full_name
stringlengths
7
104
description
stringlengths
4
725
topics
stringlengths
3
468
readme
stringlengths
13
565k
label
int64
0
1
bjmashibing/InternetArchitect
年薪百万互联网架构师课程文档及源码(公开部分)
null
null
0
a-voyager/BluetoothHelper
Bluetooth Helper Library.—-蓝牙操作库
null
# Bluetooth Helper Library [繁體中文](https://github.com/a-voyager/BluetoothHelper/blob/master/README_zh-tw.md) | [简体中文](https://github.com/a-voyager/BluetoothHelper/blob/master/README_zh.md) | [English](https://github.com/a-voyager/BluetoothHelper/blob/master/README.md) A library makes your app's bluetooth operation(for Smart Iot Hardware especially) **so easy**! ![image](https://github.com/a-voyager/BluetoothHelper/raw/master/imgs/ble_icon.png) > Don't forget give me a star :) ## Feature - Packaged common bluetooth operations, such as device discovery, connect the remote device and more. ```java btHelperClient.searchDevices(listener); ``` - Sending messages is such as Http, you send a message to the remote device(not need to connect device firstly, such as Smart Iot Hardware) then you could get a response and a status code. ```java btHelperClient.sendMessage("20:15:03:18:08:63", item, true, new OnSendMessageListener() { @Override public void onSuccess(int status, String response) { } ... }); ``` ## Dependency There are two ways: - clone this project, and use as dependency - just add following code to you build.gradle: ```groovy // Add it in your root build.gradle at the end of repositories allprojects { repositories { ... maven { url "https://jitpack.io" } } } // Add the dependency dependencies { compile 'com.github.a-voyager:BluetoothHelper:f71d40a98b' } ``` ## Usage - Get the instance use a Context object to initialize ```java btHelperClient = BtHelperClient.from(MainActivity.this); ``` - Send message to the remote device send message asynchronously, callback in main thread. parameters means: device's mac address, message object, if need to obtain response, SendMessageListener. ```java MessageItem item = new MessageItem("Hello"); btHelperClient.sendMessage("20:15:03:18:08:63", item, true, new OnSendMessageListener() { @Override public void onSuccess(int status, String response) { // Call when send a message succeed, and get a response from the remote device // status: the status describes ok or error. // 1 respect the response is valid, -1 respect the response is invalid // response: the response from the remote device, you can call response.getBytes() to get char[] } @Override public void onConnectionLost(Exception e) { e.printStackTrace(); } @Override public void onError(Exception e) { e.printStackTrace(); } }); ``` - Close connection just call close() method ```java @Override protected void onDestroy() { super.onDestroy(); btHelperClient.close(); } ``` ## More API - Search devices search devices with just calling searchDevices() method ```java btHelperClient.searchDevices(new OnSearchDeviceListener() { @Override public void onStartDiscovery() { // Call before discovery devices Log.d(TAG, "onStartDiscovery()"); } @Override public void onNewDeviceFound(BluetoothDevice device) { // Call when found a new device Log.d(TAG, "new device: " + device.getName() + " " + device.getAddress()); } @Override public void onSearchCompleted(List<BluetoothDevice> bondedList, List<BluetoothDevice> newList) { // Call when the discovery process completed Log.d(TAG, "SearchCompleted: bondedList" + bondedList.toString()); Log.d(TAG, "SearchCompleted: newList" + newList.toString()); } @Override public void onError(Exception e) { e.printStackTrace(); } }); ``` - Set filter use a filter to check if a given response is an expect data. ```java btHelperClient.setFilter(new Filter() { @Override public boolean isCorrect(String response) { return response.trim().length() >= 5; } }); ``` ## To-Do List - Listening data mode - BtHelperServer ## License The MIT License (MIT) Copyright (c) 2015 WuHaojie 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
DataLinkDC/dinky
Dinky is a real-time data development platform based on Apache Flink, enabling agile data development, deployment and operation.
datalake datawarehouse flink flinkcdc flinksql olap real-time-computing-platform sql
# Dinky [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=socialflat-square&)](https://www.apache.org/licenses/LICENSE-2.0.html) [![Stars](https://img.shields.io/github/stars/DataLinkDC/dinky?style=socialflat-square&label=stars)](https://github.com/DataLinkDC/dinky/stargazers) [![Downloads](https://img.shields.io/github/downloads/DataLinkDC/dinky/total.svg)](https://github.com/DataLinkDC/dinky/releases) [![CN doc](https://img.shields.io/badge/文档-中文版-blue.svg?style=socialflat-square&)](README_zh_CN.md) [![EN doc](https://img.shields.io/badge/document-English-blue.svg?style=socialflat-square&)](README.md) [![Stargazers over time](https://starchart.cc/DataLinkDC/dinky.svg)](https://starchart.cc/DataLinkDC/dinky) ## Introduction Dinky is a real-time data development platform based on Apache Flink, enabling agile data development, deployment and operation. ## Feature Its main features are as follows: - Immersive Flink SQL Data Development: Dinky provides prompt completion, statement beautification, online debugging, syntax verification, logic plan, catalog, lineage, version comparison, and more. - Support FlinkSQL multi-version development and execution modes: Dinky supports multiple development and execution modes for FlinkSQL, including Local, Standalone, Yarn/Kubernetes Session, Yarn Per-Job, and Yarn/Kubernetes Application. - Support Flink ecosystem: Connector, FlinkCEP, FlinkCDC, Paimon, PyFlink - Support FlinkSQL syntax enhancement: Dinky enhances FlinkSQL with features like database synchronization, execution environments, global variables, table-valued aggregate functions, load dependency, row-level permissions, and execute jar. - Support real-time warehousing and lake entry of the entire FlinkCDC database and FlinkCDC Pipeline task. - Support real-time online debugging: Preview Table, ChangeLog and UDF. - Support Flink Catalog, data source metadata online query and management. - Support real-time task operation and maintenance: Online and offline, job information, job log, version info, job snapshot, monitor, sql lineage, alarm record, etc. - Support real-time job alarm and alarm group: DingTalk, WeChat, Feishu, E-mail, SMS, Http etc. - Support automatically managed SavePoint/CheckPoint recovery and triggering mechanisms: latest, earliest, specified, etc. - Support resource management: Cluster instance, cluster configuration, data source, alarm, document, global variable, git project, UDF, resource, system configuration, etc. - Support enterprise-level management: multi-tenant, user, role, token. - More hidden features await exploration by our users. ## Principle ![dinky_principle](https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/main/dinky_principle.png) ## Run the Screenshot > FlinkSQL Studio ![datastudio](https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/v1/datastudio.png) > Grammar Check ![checksql](https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/v1/checksql.png) > Version Management ![versiondiff](https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/v1/versiondiff.png) > lineage ![lineage](https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/v1/lineage.png) > Task Monitoring ![monitor](https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/v1/monitor.png) ## Participate in Contributions [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/DataLinkDC/dinky/pulls) Welcome to join the community, build a win-win situation, please refer to the contribution process: [How to contribute](https://github.com/DataLinkDC/dinky/blob/dev/docs/docs/developer_guide/contribution/how_contribute.md). Thank you to all the people who already contributed to Dinky! [![contrib graph](https://contrib.rocks/image?repo=DataLinkDC/dinky)](https://github.com/DataLinkDC/dinky/graphs/contributors) ## How to Deploy See [source code compilation](https://github.com/DataLinkDC/dinky/blob/dev/docs/docs/deploy_guide/compile.mdx) and [installation and deployment](https://github.com/DataLinkDC/dinky/blob/dev/docs/docs/deploy_guide/deploy.mdx) for details. ## Thanks Standing on the shoulders of giants, Dinky was born. For this we express our heartfelt thanks to all the open source software used and its communities! We also hope that we are not only beneficiaries of open source, but also contributors to open source. We also hope that partners who share our enthusiasm and belief in open source will join us in contributing to the open-source community. Below is a partial list of acknowledgements: [Apache Flink](https://github.com/apache/flink) [FlinkCDC](https://github.com/ververica/flink-cdc-connectors) [Apache Paimon](https://github.com/apache/incubator-paimon) [Apache Dolphinscheduler](https://github.com/apache/dolphinscheduler) [Apache Doris](https://github.com/apache/doris) [Druid](https://github.com/alibaba/druid) [Ant-Design-Pro](https://github.com/ant-design/ant-design-pro) [Mybatis Plus](https://github.com/baomidou/mybatis-plus) [Monaco Editor](https://github.com/Microsoft/monaco-editor) [Sa Token](https://github.com/dromara/Sa-Token) [SpringBoot]() Thanks to [JetBrains](https://www.jetbrains.com/?from=dlink) for providing a free open-source license. [![JetBrains](https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/main/jetbrains.svg)](https://www.jetbrains.com/?from=dlink) ## Get Help 1.Create an issue and provide a clear description. 2.Visit the [official website](http://www.dinky.org.cn/#/) website to read the latest documentation manual. 3.It is recommended to scan the code to enter the DingTalk group. <img src="https://raw.githubusercontent.com/DataLinkDC/dinky/dev/images/main/dinkydingding.jpg" alt="dinkydingding" style="zoom:30%;" /> 4.Enter the WeChat user community group (recommended, add WeChat `wenmo_ai` to invite into the group) and QQ user community group (**543709668**) to communicate, and apply for the remarks "Dinky + company name + position". 5.Follow the WeChat public account to get the latest official articles: [Dinky Open Source](https://mmbiz.qpic.cn/mmbiz_jpg/dyicwnSlTFTp6w4PuJruFaLV6uShCJDkzqwtnbQJrQ90yKDuuIC8tyMU5DK69XZibibx7EPPBRQ3ic81se5UQYs21g/0?wx_fmt=jpeg). ## Copyright Please refer to the [LICENSE](https://github.com/DataLinkDC/dinky/blob/dev/LICENSE) document.
0
TheThirdOne/rars
RARS -- RISC-V Assembler and Runtime Simulator
assembler education ide mars risc-v riscv simulator
RARS -- RISC-V Assembler and Runtime Simulator ---------------------------------------------- RARS, the RISC-V Assembler, Simulator, and Runtime, will assemble and simulate the execution of RISC-V assembly language programs. Its primary goal is to be an effective development environment for people getting started with RISC-V. ## Features - RISC-V IMFDN Base (riscv32 and riscv64) - Several system calls that match behaviour from MARS or SPIKE. - Support for debugging using breakpoints and/or `ebreak` - Side by side comparison from pseudo-instruction to machine code with intermediate steps - Multifile assembly using either files open or a directory ## Documentation Documentation for supported [instructions](https://github.com/TheThirdOne/rars/wiki/Supported-Instructions), [system calls](https://github.com/TheThirdOne/rars/wiki/Environment-Calls), [assembler directives](https://github.com/TheThirdOne/rars/wiki/Assembler-Directives) and more can be found on the [wiki](https://github.com/TheThirdOne/rars/wiki). Documentation included in the download can be accessed via the help menu. ## Download RARS is distributed as an executable jar. You will need at least Java 8 to run it. The latest stable release can be found [here](https://github.com/TheThirdOne/rars/releases/latest), a release with the latest developments can be found on the [continuous release](https://github.com/TheThirdOne/rars/releases/tag/continuous), and the [releases page](https://github.com/TheThirdOne/rars/releases) contains all previous stable releases with patch notes. Alternatively, if you wish to make your own jar and/or modify the code, you should clone the repo with `git clone https://github.com/TheThirdOne/rars --recursive`. Running the script `./build-jar.sh` on a Unix system will build `rars.jar`. ## Screenshot ![Screenshot of sample program](screenshot.png) ## Changes from MARS 4.5 RARS was built on MARS 4.5 and owes a lot to the development of MARS; its important to note what are new developments and what come straight from MARS. Besides moving from supporting MIPS to RISC-V and the associated small changes, there are several general changes worth noting. - Instructions can now be hot-loaded like Tools. If you want to support an additional extension to the RISC-V instruction set. the .class files just need to be added to the right folder - ScreenMagnifier, MARS Bot, Intro to Tools, Scavenger Hunt, and MARS Xray were removed from the included tools. ScreenMagnifier, MARS Bot, Intro to Tools, and Scavenger Hunt were removed because they provide little benefit. And MARS Xray was removed because it is not set up to work with RISC-V, however if someone ports it, it could be merged in. - Removed delayed branching - Removed the print feature - Added a testing framework to verify compatibility with the RISC-V specification - Significant internal restructuring and refactoring.
0
internetarchive/heritrix3
Heritrix is the Internet Archive's open-source, extensible, web-scale, archival-quality web crawler project.
heritrix java warc webcrawling
# Heritrix [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.archive/heritrix/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.archive/heritrix) [![Docker](https://img.shields.io/docker/v/iipc/heritrix/latest?label=docker)](https://hub.docker.com/r/iipc/heritrix) [![Javadoc](https://javadoc.io/badge2/org.archive/heritrix/javadoc.svg)](https://www.javadoc.io/doc/org.archive.heritrix/heritrix-engine) [![LICENSE](https://img.shields.io/badge/license-Apache-blue.svg?style=flat-square)](./LICENSE) ## Introduction Heritrix is the Internet Archive's open-source, extensible, web-scale, archival-quality web crawler project. Heritrix (sometimes spelled heretrix, or misspelled or missaid as heratrix/heritix/heretix/heratix) is an archaic word for heiress (woman who inherits). Since our crawler seeks to collect and preserve the digital artifacts of our culture for the benefit of future researchers and generations, this name seemed apt. ## Crawl Operators! Heritrix is designed to respect the [`robots.txt`](http://www.robotstxt.org/robotstxt.html) exclusion directives<sup>†</sup> and [META nofollow tags](http://www.robotstxt.org/meta.html). Please consider the load your crawl will place on seed sites and set politeness policies accordingly. Also, always identify your crawl with contact information in the `User-Agent` so sites that may be adversely affected by your crawl can contact you or adapt their server behavior accordingly. <sup>†</sup> The newer wildcard extension to robots.txt is [not yet](https://github.com/internetarchive/heritrix3/issues/250) supported. ## Documentation - [Getting Started](https://heritrix.readthedocs.io/en/latest/getting-started.html) - [Operating Heritrix](https://heritrix.readthedocs.io/en/latest/operating.html) - [Configuring Crawl Jobs](https://heritrix.readthedocs.io/en/latest/configuring-jobs.html) - [Bean Reference](https://heritrix.readthedocs.io/en/latest/bean-reference.html) - [Wiki](https://github.com/internetarchive/heritrix3/wiki) ## Developer Documentation - [Developer Manual](http://crawler.archive.org/articles/developer_manual/index.html) - [REST API documentation](https://heritrix.readthedocs.io/en/latest/api.html) - JavaDoc: [engine](https://www.javadoc.io/doc/org.archive.heritrix/heritrix-engine), [modules](https://www.javadoc.io/doc/org.archive.heritrix/heritrix-modules), [commons](https://www.javadoc.io/doc/org.archive.heritrix/heritrix-commons), [contrib](https://www.javadoc.io/doc/org.archive.heritrix/heritrix-contrib) ## Latest Releases Information about releases can be found [here](https://github.com/internetarchive/heritrix3/wiki#latest-releases). ## License Heritrix is free software; you can redistribute it and/or modify it under the terms of the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) Some individual source code files are subject to or offered under other licenses. See the included [`LICENSE.txt`](./LICENSE) file for more information. Heritrix is distributed with the libraries it depends upon. The libraries can be found under the `lib` directory in the release distribution, and are used under the terms of their respective licenses, which are included alongside the libraries in the `lib` directory.
0
linkedin/ambry
Distributed object store
null
# Ambry [![Github Actions CI](https://github.com/linkedin/ambry/actions/workflows/github-actions.yml/badge.svg)](https://github.com/linkedin/ambry/actions/workflows/github-actions.yml) [![codecov.io](https://codecov.io/github/linkedin/ambry/branch/master/graph/badge.svg)](https://codecov.io/github/linkedin/ambry) [![license](https://img.shields.io/github/license/linkedin/ambry.svg)](LICENSE) Ambry is a distributed object store that supports storage of trillions of small immutable objects (50K -100K) as well as billions of large objects. It was specifically designed to store and serve media objects in web companies. However, it can be used as a general purpose storage system to store DB backups, search indexes or business reports. The system has the following characterisitics: 1. Highly available and horizontally scalable 2. Low latency and high throughput 3. Optimized for both small and large objects 4. Cost effective 5. Easy to use Requires at least JDK 1.8. ## Documentation Detailed documentation is available at https://github.com/linkedin/ambry/wiki ## Research Paper introducing Ambry at [SIGMOD 2016](http://sigmod2016.org/) -> http://dprg.cs.uiuc.edu/data/files/2016/ambry.pdf Reach out to us at ambrydev@googlegroups.com if you would like us to list a paper that is based off of research on Ambry. ## Getting Started ##### Step 1: Download the code, build it and prepare for deployment. To get the latest code and build it, do $ git clone https://github.com/linkedin/ambry.git $ cd ambry $ ./gradlew allJar $ cd target $ mkdir logs Ambry uses files that provide information about the cluster to route requests from the frontend to servers and for replication between servers. We will use a simple clustermap that contains a single server with one partition. The partition will use `/tmp` as the mount point. ##### Step 2: Deploy a server. $ nohup java -Dlog4j2.configurationFile=file:../config/log4j2.xml -jar ambry.jar --serverPropsFilePath ../config/server.properties --hardwareLayoutFilePath ../config/HardwareLayout.json --partitionLayoutFilePath ../config/PartitionLayout.json > logs/server.log & Through this command, we configure the log4j properties, provide the server with configuration options and cluster definitions and redirect output to a log. Note down the process ID returned (`serverProcessID`) because it will be needed for shutdown. The log will be available at `logs/server.log`. Alternately, you can change the log4j properties to write the log messages to a file instead of standard output. ##### Step 3: Deploy a frontend. $ nohup java -Dlog4j2.configurationFile=file:../config/log4j2.xml -cp "*" com.github.ambry.frontend.AmbryFrontendMain --serverPropsFilePath ../config/frontend.properties --hardwareLayoutFilePath ../config/HardwareLayout.json --partitionLayoutFilePath ../config/PartitionLayout.json > logs/frontend.log & Note down the process ID returned (`frontendProcessID`) because it will be needed for shutdown. Make sure that the frontend is ready to receive requests. $ curl http://localhost:1174/healthCheck GOOD The log will be available at `logs/frontend.log`. Alternately, you can change the log4j properties to write the log messages to a file instead of standard output. ##### Step 4: Interact with Ambry ! We are now ready to store and retrieve data from Ambry. Let us start by storing a simple image. For demonstration purposes, we will use an image `demo.gif` that has been copied into the `target` folder. ###### POST $ curl -i -H "x-ambry-service-id:CUrlUpload" -H "x-ambry-owner-id:`whoami`" -H "x-ambry-content-type:image/gif" -H "x-ambry-um-description:Demonstration Image" http://localhost:1174/ --data-binary @demo.gif HTTP/1.1 201 Created Location: AmbryID Content-Length: 0 The CUrl command creates a `POST` request that contains the binary data in demo.gif. Along with the file data, we provide headers that act as blob properties. These include the size of the blob, the service ID, the owner ID and the content type. In addition to these properties, Ambry also has a provision for arbitrary user defined metadata. We provide `x-ambry-um-description` as user metadata. Ambry does not interpret this data and it is purely for user annotation. The `Location` header in the response is the blob ID of the blob we just uploaded. ###### GET - Blob Info Now that we stored a blob, let us verify some properties of the blob we uploaded. $ curl -i http://localhost:1174/AmbryID/BlobInfo HTTP/1.1 200 OK x-ambry-blob-size: {Blob size} x-ambry-service-id: CUrlUpload x-ambry-creation-time: {Creation time} x-ambry-private: false x-ambry-content-type: image/gif x-ambry-owner-id: {username} x-ambry-um-desc: Demonstration Image Content-Length: 0 ###### GET - Blob Now that we have verified that Ambry returns properties correctly, let us obtain the actual blob. $ curl http://localhost:1174/AmbryID > demo-downloaded.gif $ diff demo.gif demo-downloaded.gif $ This confirms that the data that was sent in the `POST` request matches what we received in the `GET`. If you would like to see the image, simply point your browser to `http://localhost:1174/AmbryID` and you should see the image that was uploaded ! ###### DELETE Ambry is an immutable store and blobs cannot be updated but they can be deleted in order to make them irretrievable. Let us go ahead and delete the blob we just created. $ curl -i -X DELETE http://localhost:1174/AmbryID HTTP/1.1 202 Accepted Content-Length: 0 You will no longer be able to retrieve the blob properties or data. $ curl -i http://localhost:1174/AmbryID/BlobInfo HTTP/1.1 410 Gone Content-Type: text/plain; charset=UTF-8 Content-Length: 17 Connection: close Failure: 410 Gone ##### Step 5: Stop the frontend and server. $ kill -15 frontendProcessID $ kill -15 serverProcessID You can confirm that the services have been shut down by looking at the logs. ##### Additional information: In addition to the simple APIs demonstrated above, Ambry provides support for `GET` of only user metadata and `HEAD`. In addition to the `POST` of binary data that was demonstrated, Ambry also supports `POST` of `multipart/form-data` via CUrl or web forms. Other features of interest include: * **Time To Live (TTL)**: During `POST`, a TTL in seconds can be provided through the addition of a header named `x-ambry-ttl`. This means that Ambry will stop serving the blob after the TTL has expired. On `GET`, expired blobs behave the same way as deleted blobs. * **Private**: During `POST`, providing a header named `x-ambry-private` with the value `true` will mark the blob as private. API behavior can be configured based on whether a blob is public or private.
0
FXMisc/RichTextFX
Rich-text area for JavaFX
java javafx rich-text-editor
RichTextFX ========== RichTextFX provides a memory-efficient text area for JavaFX that allows the developer to style ranges of text, display custom objects in-line (no more `HTMLEditor`), and override specific default behaviors only where necessary. The library does not follow the model-view-controller paradigm, which prevents access to view-specific APIs (e.g., obtaining caret/selection/character bounds, programmic scrolling, and such). Use the library as a foundation for building rich text editors and code editors that offer syntax highlighting. Being a foundation, many features will not be implemented in this project (such as language-specific syntax highlighters, search-and-replace, hyperlink support, and similar). Rather, developers may implement these features then submit the work as a PR to the `richtextfx-demos` package. For further details about RichTextFX, its design principles, how it works, and applying CSS styling, [see the wiki](https://github.com/FXMisc/RichTextFX/wiki). [![JFXCentral](https://img.shields.io/badge/Find_me_on-JFXCentral-blue?logo=googlechrome&logoColor=white)](https://www.jfx-central.com/libraries/richtextfx) Demos ----- Standalone applications that demonstrate RichTextFX features may be found in the [RichTextFX demos](./richtextfx-demos/) directory. Table of Contents ----------------- * [Who uses RichTextFX?](#who-uses-richtextfx) * [Features](#features) * [Flavors](#flavors) * [GenericStyledArea (Base area class requiring customization)](#genericstyledarea) * [StyledTextArea (Areas ready out-of-box)](#styledtextarea) * [InlineCssTextArea](#inlinecsstextarea) * [StyleClassedTextArea](#styleclassedtextarea) * [CodeArea (Base for code editors)](#codearea) * [Requirements](#requirements) * [Download](#download) * [Stable](#stable-release) * [Snapshot](#snapshot-releases) * API Documentation (Javadoc) * [0.11.1](http://fxmisc.github.io/richtext/javadoc/0.11.1/index.html?org/fxmisc/richtext/package-summary.html) * [License](#license) * [Contributing](./CONTRIBUTING.md) Who uses RichTextFX? -------------------- - [Arduino Harp](https://www.youtube.com/watch?v=rv5raLcsPNs) - [Astro IDE](https://github.com/AmrDeveloper/Astro) - [BasicCAT](https://github.com/xulihang/BasicCAT/) - [BlueJ](https://www.bluej.org/) - [Boomega](https://github.com/Dansoftowner/Boomega) - [Chorus](https://github.com/iAmGio/chorus) - [Chronos IDE](https://github.com/giancosta86/Chronos-IDE) - [George](http://www.george.andante.no) - [Greenfoot](https://www.greenfoot.org/) - [EpubFx](https://gitlab.com/finanzer/epubfx/) - [Everest REST client](https://github.com/RohitAwate/Everest) - [JabRef](http://www.jabref.org/) - [JfxIDE](https://github.com/Zev-G/JfxIDE) - [JFXDevTools](https://github.com/Zev-G/JFXDevTools) - [JDialogue](https://github.com/SkyAphid/JDialogue) - [JuliarFuture](https://juliar.org) - [JVM Explorer](https://github.com/Naton1/jvm-explorer) - [Kappa IDE](https://bitbucket.org/TomasMikula/kappaide/) - [KeenWrite](https://github.com/DaveJarvis/keenwrite) - [Markdown Writer FX](https://github.com/JFormDesigner/markdown-writer-fx) - [mqtt-spy](http://kamilfb.github.io/mqtt-spy/) - [Nearde IDE](https://github.com/VenityStudio/Nearde-IDE) - [OmniEditor](https://github.com/giancosta86/OmniEditor) - [Recaf](https://github.com/Col-E/Recaf) - [SqlBrowserFx](https://github.com/pariskol/sqlbrowserfx/) - [Squirrel SQL client](http://www.squirrelsql.org/) - [Xanthic](https://github.com/jrguenther/Xanthic) - [XR3Player](https://github.com/goxr3plus/XR3Player) Let us know if you use RichTextFX in your project! Features -------- * Assign arbitrary styles to arbitrary ranges of text. A style can be an object, a CSS string, or a style class string. * Display line numbers or, more generally, any graphic in front of each paragraph. Can be used to show breakpoint toggles on each line of code. * Support for displaying other `Node`s in-line. * Positioning a popup window relative to the caret or selection. Useful e.g. to position an autocompletion box. * Getting the character index under the mouse when the mouse stays still over the text for a specified period of time. Useful for displaying tooltips depending on the word under the mouse. * Overriding the default behavior only where necessary without overriding any other part. Flavors ------- The following explains the different rich text area classes. The first one is the base class from which all others extend: it needs further customization before it can be used but provides all aspects of the project's features. The later ones extend this base class in various ways to provide out-of-box functionality for specific use cases. **Most will use one of these subclasses.** ### GenericStyledArea `GenericStyledArea` allows one to inline custom objects into the area alongside of text. As such, it uses generics and functional programming to accomplish this task in a completely type-safe way. It has the following parameter types: - `PS`, the paragraph style. This can be used for text alignment or setting the background color for the entire paragraph. A paragraph is either one line when text wrap is off or a long text displayed over multiple lines in a narrow viewport when text wrap is on. - `SEG`, the segment object. This specifies what immutable object to store in the model part of the area: text, hyperlinks, images, emojis, or any combination thereof. - `S`, the segment style. This can be used for text and object styling. Usually, this will be a CSS style or CSS style class. Functional programming via lambdas specify how to apply styles, how to create a `Node` for a given segment, and how to operate on a given segment (e.g., getting its length, combining it with another segment, etc.). `GenericStyledArea` is used in the [Rich-text demo](richtextfx-demos/README.md#rich-text-editor). See the wiki for a basic pattern that one must follow to implement custom objects correctly. ### StyledTextArea `StyledTextArea<PS, S>`, or one of its subclasses below, is the area you will most likely use if you don't need to display custom objects in your area. It extends `GenericStyledArea<PS, StyledText<S>, S>>`. `StyledText` is simply a text (`String`) and a style object (`S`). A slightly-enhanced [JavaFX `Text`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/text/Text.html) node is used to display the `StyledText<S>`, so you can style it using [its CSS properties](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html#text) and additional RichTextFX-specific CSS (see the wiki for more details). It properly handles the aforementioned functional programming to properly display and operate on `StyledText<S>` objects. The style object (`S`) can either be a CSS String (`-fx-fill: red;`), a CSS styleclass (`.red { -fx-fill: red; }`), or an object that handles this in a different way. Since most will use either the CSS String or CSS style class approach, there are two subclasses that already handle this correctly. ### InlineCssTextArea `InlineCssTextArea` uses the `Node#setStyle(String cssStyle)` method to style `Text` objects: ```java area.setStyle(from, to, "-fx-font-weight: bold;"); ``` ### StyleClassedTextArea `StyleClassedTextArea` uses the `Node#setStyleClass(String styleClass)` method to style `Text` objects. You can define the style classes in your stylesheet. example.css: ```css .red { -fx-fill: red; } ``` Example.java: ```java area.setStyleClass(from, to, "red"); ``` This renders the text in the range `(from, to)` in red. #### CodeArea `CodeArea` is a variant of `StyleClassedTextArea` that uses a fixed width font by default, making it a convenient base for source code editors. `CodeArea` is used in the [Java Keywords demo](richtextfx-demos/README.md#automatic-highlighting-of-java-keywords). Requirements ------------ **JDK11** or higher is required. (Can still be compiled with JDK9 if needed) Download -------- ### Stable release Current stable release is 0.11.2 which is ONLY compatible with Java 11 and UP. #### Maven coordinates | Group ID | Artifact ID | Version | | :-----------------: | :---------: | :-----: | | org.fxmisc.richtext | richtextfx | 0.11.2 | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.fxmisc.richtext/richtextfx/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.fxmisc.richtext/richtextfx) #### Gradle example ```groovy dependencies { compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.11.2' } ``` #### Sbt example ```scala libraryDependencies += "org.fxmisc.richtext" % "richtextfx" % "0.11.2" ``` #### Manual download Download [the JAR file](https://github.com/FXMisc/RichTextFX/releases/download/v0.11.2/richtextfx-0.11.2.jar) or [the fat JAR file (including dependencies)](https://github.com/FXMisc/RichTextFX/releases/download/v0.11.2/richtextfx-fat-0.11.2.jar) and place it on your classpath. ### Snapshot releases Snapshot releases are deployed to Sonatype snapshot repository. #### Maven coordinates | Group ID | Artifact ID | Version | | :-----------------: | :---------: | :------------: | | org.fxmisc.richtext | richtextfx | 1.0.0-SNAPSHOT | #### Gradle example ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } dependencies { compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '1.0.0-SNAPSHOT' } ``` #### Sbt example ```scala resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" libraryDependencies += "org.fxmisc.richtext" % "richtextfx" % "1.0.0-SNAPSHOT" ``` License ------- Dual-licensed under [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause) and [GPLv2 with the Classpath Exception](http://openjdk.java.net/legal/gplv2+ce.html).
0
mybatis/spring
Spring integration for MyBatis 3
java mybatis spring
MyBatis Spring Adapter ====================== [![Java CI](https://github.com/mybatis/spring/actions/workflows/ci.yaml/badge.svg)](https://github.com/mybatis/spring/actions/workflows/ci.yaml) [![Coverage Status](https://coveralls.io/repos/mybatis/spring/badge.svg?branch=master&service=github)](https://coveralls.io/github/mybatis/spring?branch=master) [![Maven central](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis-spring/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis-spring) [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.mybatis/mybatis-spring.svg)](https://oss.sonatype.org/content/repositories/snapshots/org/mybatis/mybatis-spring/) [![License](https://img.shields.io/:license-apache-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) ![mybatis-spring](https://mybatis.org/images/mybatis-logo.png) MyBatis-Spring adapter is an easy-to-use [Spring Framework](https://github.com/spring-projects/spring-framework) bridge for [MyBatis](https://github.com/mybatis/mybatis-3) sql mapping framework. Supported Versions ------------------ - master - Support for Spring 6 and Spring Batch 5 - 2.1.x - Maintenance for Spring 5 and Spring Batch 4 Essentials ---------- * [See the published docs](https://mybatis.org/spring/) * [See the snapshot docs](src/site/markdown) (Note: may contain explanation of unreleased features)
0
springfox/springfox
Automated JSON API documentation for API's built with Spring
java oai openapi spring spring-boot spring-data-rest springfox swagger
# Springfox [![Join the chat at https://gitter.im/springfox/springfox](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/springfox/springfox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fspringfox%2Fspringfox.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fspringfox%2Fspringfox?ref=badge_shield) [ ![Download](https://api.bintray.com/packages/springfox/maven-repo/springfox/images/download.svg) ](https://bintray.com/springfox/maven-repo/springfox/_latestVersion) [![Project Stats](https://www.openhub.net/p/springfox/widgets/project_thin_badge.gif)](https://www.openhub.net/p/springfox) | Build Status | Coverage | Code Analysis | |---|---|---| |[![Circle CI](https://circleci.com/gh/springfox/springfox/tree/master.svg?style=svg)](https://circleci.com/gh/springfox/springfox/tree/master)|[![codecov](https://codecov.io/gh/springfox/springfox/branch/master/graph/badge.svg)](https://codecov.io/gh/springfox/springfox) |[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=springfox_springfox&metric=alert_status)](https://sonarcloud.io/dashboard?id=springfox_springfox)| | Sonar Cloud | |------------ | |[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=springfox_springfox&metric=security_rating)](https://sonarcloud.io/dashboard?id=springfox_springfox)| |[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=springfox_springfox&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=springfox_springfox)| |[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=springfox_springfox&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=springfox_springfox)| |[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=springfox_springfox&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=springfox_springfox)| |[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=springfox_springfox&metric=sqale_index)](https://sonarcloud.io/dashboard?id=springfox_springfox)| |[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=springfox_springfox&metric=coverage)](https://sonarcloud.io/dashboard?id=springfox_springfox)| ### About For more information on this project visit the [Springfox Website](http://springfox.io) or [http://springfox.github.io/springfox/](http://springfox.github.io/springfox/) ### Useful links - [Reference Documentation](http://springfox.io) - [Examples repository](https://github.com/springfox/springfox-demos) - [Contribution Guidelines](https://github.com/springfox/springfox/wiki/Contribution-guidelines) - [Core contributors](http://springfox.github.io/springfox/contributors.html) - [Development and contribution guidelines](https://github.com/martypitt/swagger-springmvc/wiki/Development) - [Change log](docs/release-notes.md) - [Development Environment](http://springfox.github.io/springfox/docs/current/#development-environment) - [Release Instructions](http://springfox.github.io/springfox/docs/current/#releasing) ### Getting Started #### For new projects For Maven ```xml <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> ``` For Gradle ```gradle implementation "io.springfox:springfox-boot-starter:<version>" ``` #### Migrating from earlier snapshot #### Spring Boot Applications NOTE: Would love feedback to make this better 1. Remove explicit dependencies on `springfox-swagger2` 2. Remove any `@EnableSwagger2...` annotations 3. Add the `springfox-boot-starter` dependency 4. Springfox 3.x removes dependencies on guava and other 3rd party libraries (not zero dep yet! depends on spring plugin and open api libraries for annotations and models) so if you used guava predicates/functions those will need to transition to java 8 function interfaces. #### Migrating from existing 2.x version #### Spring Boot Applications NOTE: Would love feedback to make this better 1. Remove explicit dependencies on `springfox-swagger2` 2. Remove the `@EnableSwagger2` annotations 3. Add the `springfox-boot-starter` dependency 4. Springfox 3.x removes dependencies on guava and other 3rd party libraries (not zero dep yet! depends on spring plugin and open api libraries for annotations and models) so if you used guava predicates/functions those will need to transition to java 8 function interfaces 5. If you are using WebMvc but you don't use the [`@EnableWebMvc`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/EnableWebMvc.html) annotation yet, add this annotation. #### Regular spring mvc NOTE: Would love feedback to make this experience better 1. Remove explicit dependencies on `springfox-swagger2` 2. Add `@EnableOpenApi` for open API (and `@EnableSwagger2WebMvc` or `@EnableSwagger2WebFlux` for older versions) 3. Added the `springfox-oas` library 4. Springfox 3.x removes dependencies on guava and other 3rd party libraries (not zero dep yet! depends on spring plugin and open api libraries for annotations and models) so if you used guava predicates/functions those will need to transition to java 8 function interfaces License ------- Copyright 2015 Marty Pitt - [@martypitt](https://github.com/martypitt), Dilip Krishnan - [@dilipkrish](https://github.com/dilipkrish), Adrian Kelly - [@adrianbk](https://github.com/adrianbk), 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 [apache.org/licenses/LICENSE-2.0](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. ## License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fspringfox%2Fspringfox.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fspringfox%2Fspringfox?ref=badge_large)
0
openjdk/jmh
https://openjdk.org/projects/code-tools/jmh
null
# Java Microbenchmark Harness (JMH) JMH is a Java harness for building, running, and analysing nano/micro/milli/macro benchmarks written in Java and other languages targeting the JVM. ## Usage ### Basic Considerations The recommended way to run a JMH benchmark is to use Maven to setup a standalone project that depends on the jar files of your application. This approach is preferred to ensure that the benchmarks are correctly initialized and produce reliable results. It is possible to run benchmarks from within an existing project, and even from within an IDE, however setup is more complex and the results are less reliable. In all cases, the key to using JMH is enabling the annotation- or bytecode-processors to generate the synthetic benchmark code. Maven archetypes are the primary mechanism used to bootstrap the project that has the proper build configuration. We strongly recommend new users make use of the archetype to setup the correct environment. ### Samples In order to understand JMH tests and maybe write your own, it might be useful to work through the [JMH Samples](https://github.com/openjdk/jmh/tree/master/jmh-samples/src/main/java/org/openjdk/jmh/samples). See the test comments for run instructions. ### Preferred Usage: Command Line **Step 1. Setting up the benchmarking project.** The following command will generate the new JMH-driven project in new `test` folder. Note that current and target folder should not already contain any Maven project for this to work reliably. $ mvn archetype:generate \ -DinteractiveMode=false \ -DarchetypeGroupId=org.openjdk.jmh \ -DarchetypeArtifactId=jmh-java-benchmark-archetype \ -DgroupId=org.sample \ -DartifactId=test \ -Dversion=1.0 If you want to benchmark an alternative JVM language, use another archetype artifact ID from the [list of existing ones](https://repo.maven.apache.org/maven2/org/openjdk/jmh/), it usually amounts to replacing `java` to another language in the artifact ID given above. Using alternative archetypes may require additional changes in the build configuration, see the `pom.xml` in the generated project. **Step 2. Building the benchmarks.** After the project is generated, you can build it with the following Maven command: $ cd test/ $ mvn clean verify **Step 3. Running the benchmarks.** After the build is done, you will get the self-contained executable JAR, which holds your benchmark, and all essential JMH infrastructure code: $ java -jar target/benchmarks.jar Run with `-h` to see the command line options available. When dealing with large projects, it is customary to keep the benchmarks in a separate sub-project, which then depends on the tested modules via the usual build dependencies. ### IDE Support While the command line approach is the suggested one, some people prefer to use IDEs. The user experience varies between different IDEs, but we will outline the general things here. Running benchmarks from the IDE is generally not recommended due to generally uncontrolled environment in which the benchmarks run. **Step 1. Setting up the benchmarking project.** Some IDEs provide the GUI to create the Maven project from the given archetype. Make sure your IDE knows about Central archetype catalog, and look for `org.openjdk.jmh:jmh-${lang}-benchmark-archetype` there. Alternatively, you can use the command line to generate the benchmark project, see above. _NOTE: JMH is not intended to be used in the same way as a typical testing library such as JUnit. Simply adding the `jmh-core` jar file to your build is not enough to be able to run benchmarks._ **Step 2. Building the benchmarks.** Most IDEs are able to open/import Maven projects, and infer the build configuration from Maven project configuration. IDEA and NetBeans are able to build JMH benchmark projects with little to no effort. Eclipse build configuration may need to set up JMH annotation processors to run. **Step 3. Running the benchmarks.** There is no direct support for JMH benchmarks in the IDE, but one can use JMH Java API to invoke the benchmark. It usually amounts to having the `main` method, which will then call into JMH. See [JMH Samples](https://github.com/openjdk/jmh/tree/master/jmh-samples/src/main/java/org/openjdk/jmh/samples) for the examples of this approach. Before you run any benchmark, the project build is required. Most IDEs do this automatically, but some do require explicit build action to be added before the run: adding Maven target `verify` should help there. ### Other Build Systems JMH project does not ship the build scripts for build systems other that Maven. But there are community-supported bindings: - [Gradle JMH Plugin](https://github.com/melix/jmh-gradle-plugin) - [Scala SBT JMH Plugin](https://github.com/ktoso/sbt-jmh) If you want to build with an alternative build system, you may want to see the [Ant sample](https://github.com/openjdk/jmh/tree/master/jmh-ant-sample) which describes the steps to build JMH benchmark projects. ## Support and Development ### Pre-Requisite Steps Make sure you did this before publishing the benchmark, and/or requesting the JMH feature: - **JMH annotations Javadocs and Samples are essential reading.** Follow the [JMH Samples](https://github.com/openjdk/jmh/tree/master/jmh-samples/src/main/java/org/openjdk/jmh/samples) to get familiar with the API, use cases, culprits, and pitfalls in building the benchmarks and using JMH. - **Your benchmarks should be peer-reviewed.** Do not assume that a nice harness will magically free you from considering benchmarking pitfalls. We only promise to make avoiding them easier, not avoiding them completely. Make sure you tried these things before getting support: - **Archetypes provide the golden build configuration.** Try to generate the clean JMH benchmark project and transplant the benchmark there. This is important to try when upgrading to the newer JMH versions, since the minute differences in the build configurations may attribute to the failures you are seeing. - **Current development code is usually leaner, meaner, and better.** Make sure you are running the latest JMH version, and/or try to run with bleeding edge JMH to see if the issue is already fixed. - **See if your question/issue was discussed already.** Look around mailing list archives to see if there is already an answer. If all these did not help, you are welcome to report the issue. ### Reporting Harness and Test Bugs If you have the access to [OpenJDK Bug System](https://bugs.openjdk.org/browse/CODETOOLS-7902762?jql=project%20%3D%20CODETOOLS%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20tools%20AND%20Subcomponent%20%3D%20jmh), please submit the bug there: * Project: CODETOOLS * Component: tools * Sub-component: jmh Alternatively, you can join the [JMH Mailing List](https://mail.openjdk.org/mailman/listinfo/jmh-dev) and report the bugs there. ## Development JMH project accepts pull requests, like other OpenJDK projects. If you have never contributed to OpenJDK before, then bots would require you to [sign OCA first](http://openjdk.org/contribute). Normally, you don't need to post patches anywhere else, or post to mailing lists, etc. If you do want to have a wider discussion about JMH, please refer to [jmh-dev](https://mail.openjdk.org/mailman/listinfo/jmh-dev). Short instructions to build, test bleeding-edge JMH, and install its JAR to local Maven repo: $ mvn clean install If you already have the benchmark project, then it is enough to change JMH dependencies version to the latest `SNAPSHOT` version (look up the actual latest version in [root `pom.xml`](https://github.com/openjdk/jmh/blob/master/pom.xml)). If not, create the JMH benchmark project and change the version there. GitHub workflow "JMH Pre-Integration Tests" should pass on the changes. It would be triggered for PRs. You can also trigger it manually for your branch. ## Related projects These projects are supported by community, not by OpenJDK/JMH developers. - [IntelliJ IDEA JMH Plugin](https://github.com/artyushov/idea-jmh-plugin) - [Jenkins JMH Plugin](https://github.com/brianfromoregon/jmh-plugin) - [Teamcity JMH Plugin](https://github.com/presidentio/teamcity-plugin-jmh) - [Visualize JMH Benchmarks](https://github.com/jzillmann/jmh-visualizer)
0
apache/sedona
A cluster computing framework for processing large-scale geospatial data
cluster-computing geospatial java python scala spatial-analysis spatial-query spatial-sql
<a href="https://sedona.apache.org/"> <img alt="Apache Sedona" src="docs/image/sedona_logo.png" width="500"> </a> [![Scala and Java build](https://github.com/apache/sedona/actions/workflows/java.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/java.yml) [![Python build](https://github.com/apache/sedona/actions/workflows/python.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/python.yml) [![R build](https://github.com/apache/sedona/actions/workflows/r.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/r.yml) [![Docker image build](https://github.com/apache/sedona/actions/workflows/docker-build.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/docker-build.yml) [![Example project build](https://github.com/apache/sedona/actions/workflows/example.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/example.yml) [![Docs build](https://github.com/apache/sedona/actions/workflows/docs.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/docs.yml) | Download statistics | **Maven** | **PyPI** | Conda-forge | **CRAN** | **DockerHub** | |----------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------| | Apache Sedona | 225k/month | [![PyPI - Downloads](https://img.shields.io/pypi/dm/apache-sedona)](https://pepy.tech/project/apache-sedona) [![Downloads](https://static.pepy.tech/personalized-badge/apache-sedona?period=total&units=international_system&left_color=black&right_color=brightgreen&left_text=total%20downloads)](https://pepy.tech/project/apache-sedona) | [![Anaconda-Server Badge](https://anaconda.org/conda-forge/apache-sedona/badges/downloads.svg)](https://anaconda.org/conda-forge/apache-sedona) | [![](https://cranlogs.r-pkg.org/badges/apache.sedona?color=brightgreen)](https://cran.r-project.org/package=apache.sedona) [![](https://cranlogs.r-pkg.org/badges/grand-total/apache.sedona?color=brightgreen)](https://cran.r-project.org/package=apache.sedona) | [![Docker pulls](https://img.shields.io/docker/pulls/apache/sedona?color=brightgreen)](https://hub.docker.com/r/apache/sedona) | | Archived GeoSpark releases | 10k/month | [![PyPI - Downloads](https://img.shields.io/pypi/dm/geospark)](https://pepy.tech/project/geospark)[![Downloads](https://static.pepy.tech/personalized-badge/geospark?period=total&units=international_system&left_color=black&right_color=brightgreen&left_text=total%20downloads)](https://pepy.tech/project/geospark) | | | | * [Join the community](#join-the-community) * [What is Apache Sedona?](#what-is-apache-sedona) * [Features](#features) * [When to use Sedona?](#when-to-use-sedona) * [Use Cases](#use-cases) * [Code Example](#code-example) * [Docker image](#docker-image) * [Building Sedona](#building-sedona) * [Documentation](#documentation) * [Powered by](#powered-by) ## Join the community Follow Sedona on Twitter for fresh news: [Sedona@Twitter](https://twitter.com/ApacheSedona) Join the Sedona Discord community: [![](https://dcbadge.vercel.app/api/server/9A3k5dEBsY)](https://share.hsforms.com/1Ndql_ZigTdmLlVQc_d1o4gqga4q) Join the Sedona monthly community office hour: [Google Calendar](https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=NjI0cWgwcTZndnI1anAzYnFrNHY5Y2wyaTRfMjAyNDA0MDlUMTUwMDAwWiBjX2VmN2Q1NGY1MzA4YTRiN2YyNWFjMzNkMGY3ZWViNTRhM2E3ZjExNWI2ODlmYWY0ZDgyNDI1ZjNjYjVlZGU5MzVAZw&tmsrc=c_ef7d54f5308a4b7f25ac33d0f7eeb54a3a7f115b689faf4d82425f3cb5ede935%40group.calendar.google.com&scp=ALL), Tuesdays from 8 AM to 9 AM Pacific Time, every 4 weeks [Sedona JIRA](https://issues.apache.org/jira/projects/SEDONA): Bugs, Pull Requests, and other similar issues [Sedona Mailing Lists](https://lists.apache.org/list.html?sedona.apache.org): [dev@sedona.apache.org](https://lists.apache.org/list.html?dev@sedona.apache.org): project development, general questions or tutorials. * Please first subscribe and then post emails. To subscribe, please send an email (leave the subject and content blank) to dev-subscribe@sedona.apache.org ## What is Apache Sedona? Apache Sedona™ is a spatial computing engine that enables developers to easily process spatial data at any scale within modern cluster computing systems such as Apache Spark and Apache Flink. Sedona developers can express their spatial data processing tasks in Spatial SQL, Spatial Python or Spatial R. Internally, Sedona provides spatial data loading, indexing, partitioning, and query processing/optimization functionality that enable users to efficiently analyze spatial data at any scale. <img alt="Sedona Ecosystem" src="docs/image/sedona-ecosystem.png" width="800" class="center"> ### Features Some of the key features of Apache Sedona include: * Support for a wide range of geospatial data formats, including GeoJSON, WKT, and ESRI Shapefile. * Scalable distributed processing of large vector and raster datasets. * Tools for spatial indexing, spatial querying, and spatial join operations. * Integration with popular geospatial python tools such as GeoPandas. * Integration with popular big data tools, such as Spark, Hadoop, Hive, and Flink for data storage and querying. * A user-friendly API for working with geospatial data in the SQL, Python, Scala and Java languages. * Flexible deployment options, including standalone, local, and cluster modes. These are some of the key features of Apache Sedona, but it may offer additional capabilities depending on the specific version and configuration. Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=docs/usecases) and play the interactive Sedona Python Jupyter Notebook immediately! ## When to use Sedona? ### Use Cases: Apache Sedona is a widely used framework for working with spatial data, and it has many different use cases and applications. Some of the main use cases for Apache Sedona include: * Automotive data analytics: Apache Sedona is widely used in geospatial analytics applications, where it is used to perform spatial analysis and data mining on large and complex datasets collected from fleets. * Urban planning and development: Apache Sedona is commonly used in urban planning and development applications to analyze and visualize spatial data sets related to urban environments, such as land use, transportation networks, and population density. * Location-based services: Apache Sedona is often used in location-based services, such as mapping and navigation applications, where it is used to process and analyze spatial data to provide location-based information and services to users. * Environmental modeling and analysis: Apache Sedona is used in many different environmental modeling and analysis applications, where it is used to process and analyze spatial data related to environmental factors, such as air quality, water quality, and weather patterns. * Disaster response and management: Apache Sedona is used in disaster response and management applications to process and analyze spatial data related to disasters, such as floods, earthquakes, and other natural disasters, in order to support emergency response and recovery efforts. ### Code Example: This example loads NYC taxi trip records and taxi zone information stored as .CSV files on AWS S3 into Sedona spatial dataframes. It then performs spatial SQL query on the taxi trip datasets to filter out all records except those within the Manhattan area of New York. The example also shows a spatial join operation that matches taxi trip records to zones based on whether the taxi trip lies within the geographical extents of the zone. Finally, the last code snippet integrates the output of Sedona with GeoPandas and plots the spatial distribution of both datasets. #### Load NYC taxi trips and taxi zones data from CSV Files Stored on AWS S3 ```python taxidf = sedona.read.format('csv').option("header","true").option("delimiter", ",").load("s3a://your-directory/data/nyc-taxi-data.csv") taxidf = taxidf.selectExpr('ST_Point(CAST(Start_Lon AS Decimal(24,20)), CAST(Start_Lat AS Decimal(24,20))) AS pickup', 'Trip_Pickup_DateTime', 'Payment_Type', 'Fare_Amt') ``` ```python zoneDf = sedona.read.format('csv').option("delimiter", ",").load("s3a://your-directory/data/TIGER2018_ZCTA5.csv") zoneDf = zoneDf.selectExpr('ST_GeomFromWKT(_c0) as zone', '_c1 as zipcode') ``` #### Spatial SQL query to only return Taxi trips in Manhattan ```python taxidf_mhtn = taxidf.where('ST_Contains(ST_PolygonFromEnvelope(-74.01,40.73,-73.93,40.79), pickup)') ``` #### Spatial Join between Taxi Dataframe and Zone Dataframe to Find taxis in each zone ```python taxiVsZone = sedona.sql('SELECT zone, zipcode, pickup, Fare_Amt FROM zoneDf, taxiDf WHERE ST_Contains(zone, pickup)') ``` #### Show a map of the loaded Spatial Dataframes using GeoPandas ```python zoneGpd = gpd.GeoDataFrame(zoneDf.toPandas(), geometry="zone") taxiGpd = gpd.GeoDataFrame(taxidf.toPandas(), geometry="pickup") zone = zoneGpd.plot(color='yellow', edgecolor='black', zorder=1) zone.set_xlabel('Longitude (degrees)') zone.set_ylabel('Latitude (degrees)') zone.set_xlim(-74.1, -73.8) zone.set_ylim(40.65, 40.9) taxi = taxiGpd.plot(ax=zone, alpha=0.01, color='red', zorder=3) ``` ## Docker image We provide a Docker image for Apache Sedona with Python JupyterLab and a single-node cluster. The images are available on [DockerHub](https://hub.docker.com/r/apache/sedona) ## Building Sedona * To install the Python package: ``` pip install apache-sedona ``` * To compile the source code, please refer to [Sedona website](https://sedona.apache.org/latest-snapshot/setup/compile/) * Modules in the source code | Name | API | Introduction | |------------------|------------------------------------------|--------------------------------------------------------| | common | Java | Core geometric operation logics, serialization, index | | spark | Spark RDD/DataFrame Scala/Java/SQL | Distributed geospatial data processing on Apache Spark | | flink | Flink DataStream/Table in Scala/Java/SQL | Distributed geospatial data processing on Apache Flink | | snowflake | Snowflake SQL | Distributed geospatial data processing on Snowflake | | spark-shaded | No source code | shaded jar for Sedona Spark | | flink-shaded | No source code | shaded jar for Sedona Flink | | snowflake-tester | Java | tester program for Sedona Snowflake | | python | Spark RDD/DataFrame Python | Distributed geospatial data processing on Apache Spark | | R | Spark RDD/DataFrame in R | R wrapper for Sedona | | Zeppelin | Apache Zeppelin | Plugin for Apache Zeppelin 0.8.1+ | ## Documentation * [Spatial SQL in Sedona](https://sedona.apache.org/latest-snapshot/tutorial/sql/) * [Integrate with GeoPandas and Shapely](https://sedona.apache.org/latest-snapshot/tutorial/geopandas-shapely/) * [Working with Spatial R in Sedona](https://sedona.apache.org/latest-snapshot/api/rdocs/) Please visit [Apache Sedona website](http://sedona.apache.org/) for detailed information ## Powered by <a href="https://www.apache.org/"> <img alt="The Apache Software Foundation" src="https://www.apache.org/foundation/press/kit/asf_logo_wide.png" width="500" class="center"> </a>
0
linyiqun/DataMiningAlgorithm
数据挖掘18大算法实现以及其他相关经典DM算法
null
# 数据挖掘算法 ## 算法目录 #### 18大DM算法 包名 | 目录名 | 算法名 | -----| ------ |--------| AssociationAnalysis | DataMining_Apriori | Apriori-关联规则挖掘算法 AssociationAnalysis | DataMining_FPTree | FPTree-频繁模式树算法 BaggingAndBoosting | DataMining_AdaBoost | AdaBoost-装袋提升算法 Classification | DataMining_CART | CART-分类回归树算法 Classification | DataMining_ID3 | ID3-决策树分类算法 Classification | DataMining_KNN | KNN-k最近邻算法工具类 Classification | DataMining_NaiveBayes | NaiveBayes-朴素贝叶斯算法 Clustering | DataMining_BIRCH | BIRCH-层次聚类算法 Clustering | DataMining_KMeans | KMeans-K均值算法 GraphMining | DataMining_GSpan | GSpan-频繁子图挖掘算法 IntegratedMining | DataMining_CBA | CBA-基于关联规则的分类算法 LinkMining | DataMining_HITS | HITS-链接分析算法 LinkMining | DataMining_PageRank | PageRank-网页重要性/排名算法 RoughSets | DataMining_RoughSets | RoughSets-粗糙集属性约简算法 SequentialPatterns | DataMining_GSP | GSP-序列模式分析算法 SequentialPatterns | DataMining_PrefixSpan | PrefixSpan-序列模式分析算法 StatisticalLearning | DataMining_EM | EM-期望最大化算法 StatisticalLearning | DataMining_SVM | SVM-支持向量机算法 #### 其他经典DM算法 包名 | 目录名 | 算法名 | -----| ------ |--------| Others | DataMining_ACO | ACO-蚁群算法 Others | DataMining_BayesNetwork | BayesNetwork-贝叶斯网络算法 Others | DataMining_CABDDCC | CABDDCC-基于连通图的分裂聚类算法 Others | DataMining_Chameleon | Chameleon-两阶段合并聚类算法 Others | DataMining_DBSCAN | DBSCAN-基于密度的聚类算法 Others | DataMining_GA | GA-遗传算法 Others | DataMining_GA_Maze | GA_Maze-遗传算法在走迷宫游戏中的应用算法 Others | DataMining_KDTree | KDTree-k维空间关键数据检索算法工具类 Others | DataMining_MSApriori | MSApriori-基于多支持度的Apriori算法 Others | DataMining_RandomForest | RandomForest-随机森林算法 Others | DataMining_TAN | TAN-树型朴素贝叶斯算法 Others | DataMining_Viterbi | Viterbi-维特比算法 ## 18大经典DM算法 18大数据挖掘的经典算法以及代码实现,涉及到了决策分类,聚类,链接挖掘,关联挖掘,模式挖掘等等方面,后面都是相应算法的博文链接,希望能够帮助大家学。 目前追加了其他的一些经典的DM算法,在others的包中涉及聚类,分类,图算法,搜索算等等,没有具体分类。 * ### C4.5 C4.5算法与ID3算法一样,都是数学分类算法,C4.5算法是ID3算法的一个改进。ID3算法采用信息增益进行决策判断,而C4.5采用的是增益率。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/42395865) * ### CART CART算法的全称是分类回归树算法,他是一个二元分类,采用的是类似于熵的基尼指数作为分类决策,形成决策树后之后还要进行剪枝,我自己在实现整个算法的时候采用的是代价复杂度算法,[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/42558235) * ### KNN K最近邻算法。给定一些已经训练好的数据,输入一个新的测试数据点,计算包含于此测试数据点的最近的点的分类情况,哪个分类的类型占多数,则此测试点的分类与此相同,所以在这里,有的时候可以复制不同的分类点不同的权重。近的点的权重大点,远的点自然就小点。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/42613011) * ### Naive Bayes 朴素贝叶斯算法。朴素贝叶斯算法是贝叶斯算法里面一种比较简单的分类算法,用到了一个比较重要的贝叶斯定理,用一句简单的话概括就是条件概率的相互转换推导。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/42680161) * ### SVM 支持向量机算法。支持向量机算法是一种对线性和非线性数据进行分类的方法,非线性数据进行分类的时候可以通过核函数转为线性的情况再处理。其中的一个关键的步骤是搜索最大边缘超平面。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/42780439) * ### EM 期望最大化算法。期望最大化算法,可以拆分为2个算法,1个E-Step期望化步骤,和1个M-Step最大化步骤。他是一种算法框架,在每次计算结果之后,逼近统计模型参数的最大似然或最大后验估计。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/42921789) * ### Apriori Apriori算法是关联规则挖掘算法,通过连接和剪枝运算挖掘出频繁项集,然后根据频繁项集得到关联规则,关联规则的导出需要满足最小置信度的要求。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43059211) * ### FP-Tree 频繁模式树算法。这个算法也有被称为FP-growth算法,这个算法克服了Apriori算法的产生过多侯选集的缺点,通过递归的产生频度模式树,然后对树进行挖掘,后面的过程与Apriori算法一致。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43234309) * ### PageRank 网页重要性/排名算法。PageRank算法最早产生于Google,核心思想是通过网页的入链数作为一个网页好快的判定标准,如果1个网页内部包含了多个指向外部的链接,则PR值将会被均分,PageRank算法也会遭到LinkSpan攻击。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43311943) * ### HITS HITS算法是另外一个链接算法,部分原理与PageRank算法是比较相似的,HITS算法引入了权威值和中心值的概念,HITS算法是受用户查询条件影响的,他一般用于小规模的数据链接分析,也更容易遭受到攻击。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43311943) * ### K-Means K-Means算法是聚类算法,k在在这里指的是分类的类型数,所以在开始设定的时候非常关键,算法的原理是首先假定k个分类点,然后根据欧式距离计算分类,然后去同分类的均值作为新的聚簇中心,循环操作直到收敛。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43373159) * ### BIRCH BIRCH算法利用构建CF聚类特征树作为算法的核心,通过树的形式,BIRCH算法扫描数据库,在内存中建立一棵初始的CF-树,可以看做数据的多层压缩。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43532111) * ### AdaBoost AdaBoost算法是一种提升算法,通过对数据的多次训练得到多个互补的分类器,然后组合多个分类器,构成一个更加准确的分类器。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43635115) * ### GSP GSP算法是序列模式挖掘算法。GSP算法也是Apriori类算法,在算法的过程中也会进行连接和剪枝操作,不过在剪枝判断的时候还加上了一些时间上的约束等条件。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43699083) * ### PreFixSpan PreFixSpan算法是另一个序列模式挖掘算法,在算法的过程中不会产生候选集,给定初始前缀模式,不断的通过后缀模式中的元素转到前缀模式中,而不断的递归挖掘下去。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43766253) * ### CBA 基于关联规则分类算法。CBA算法是一种集成挖掘算法,因为他是建立在关联规则挖掘算法之上的,在已有的关联规则理论前提下,做分类判断,只是在算法的开始时对数据做处理,变成类似于事务的形式。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43818787) * ### RoughSets 粗糙集算法。粗糙集理论是一个比较新颖的数据挖掘思想。这里使用的是用粗糙集进行属性约简的算法,通过上下近似集的判断删除无效的属性,进行规制的输出。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43876001) * ### GSpan gSpan算法属于图挖掘算法领域。,主要用于频繁子图的挖掘,相较于其他的图算法,子图挖掘算法是他们的一个前提或基础算法。gSpan算法用到了DFS编码,和Edge五元组,最右路径子图扩展等概念,算法比较的抽象和复杂。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/43924273) ##Others目录下的算法: * ### GA 遗传算法。遗传算法运用了生物进化理论的知识来寻找问题最优解的算法,算法的遗传进化过程分选择,交叉和变异操作,其中选择操是非常关键的步骤,把更适应的基于组遗传给下一代。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/44041499) * ### DbScan 基于空间密度聚类算法。dbScan作为一种特殊聚类算法,弥补了其他算法的一些不足,基于空间密,实现聚类效果,可以发现任意形状的聚簇。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/44311309) * ### GA_Maze 遗传算法在走迷宫游戏中的应用。将走迷宫中的搜索出口路径的问题转化为遗传算法中的问题通过构造针对此特定问题的适值函数,基因移动方向的定位,巧的进行问题的求解。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/44656809) * ### CABDDCC 基于连通图的分裂聚类算法。也是属于层次聚类算法主要分为2个阶段,第一阶段构造连通图。第二个阶段是分裂连通图,最终形成聚类结果。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/44463997) * ### Chameleon 两阶段聚类算法。与CABDDCC算法相反,最后是通过对小簇集合的合并,形成最终的结果,在第一阶段主要是通过K近邻的思想形成小规模的连通图,第二阶段通过RI(相对互连性)和RC(相对近似性)来选一个最佳的簇进行合并。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/44569077) * ### RandomForest 随机森林算法。算法思想是决策树+boosting.决策树采用的是CART分类回归数,通过组合各个决策树的弱分类器,构成一个最终的强分类器,在构造决策树的时候采取随机数量的样本数和随机的部分属性进行子决策树的构建,避免了过分拟合的现象发生。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/44756943) * ### KDTree K-Dimension Tree。多维空间划分树,数据在多维空间进行划分与查找。主要用于关键信息的搜索,类似于在空间中的二分搜索,大大提高了搜索效率,在寻找目标元素时,使用了DFS深度优先的方式和回溯进行最近点的寻找。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/44985259) * ### MS-Apriori 基于多支持度的Apriori算法。是Apriori算法的升级算法,弥补了原先Apriori算法的不足,还增加了支持度差别限制以及支持度计数统计方面的优化,无须再次重新扫描整个数据集,产生关联规则的时候可以根据子集的关系避免一些置信度的计算。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/45082337) * ### ACO 蚁群算法。蚁群算法又称为蚂蚁算法。同GA遗传算法类似,也是运用了大自然规律的算法,用于在图中寻找最优路径的概率型算法。灵感来源于蚂蚁在寻找食物时会散播信息素的发现路径行为。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/45395491) * ### BayesNetwork 贝叶斯网络算法。弥补了朴素贝叶斯算法中必须要事件独立性的缺点,利用了贝叶斯网络的DAG有向无环图,允许各个事件保留一定的依赖关系,网络结构中的每个节点代表一种属性,边代表相应的条件概率值,通过计算从而能得到精准的分类效果。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/46683729) * ### TAN 树型朴素贝叶斯算法。此算法又被称为加强版朴素贝叶斯算法。在满足原有朴素贝叶斯条件的基础上,他允许部条件属性直接的关联性。形成树型的结构。[详细介绍链接](http://blog.csdn.net/androidlushangderen/article/details/46763427) * ### Viterbi 维特比算法。给定一个隐马尔科夫模型以及一个观察序列,求出潜在的状态序列信息,每个潜在状态信息又会受到前一个状态信息的影响。 ## 算法使用方法 在每个算法中给出了3大类型,主算法程序,调用程序,输入数据,调用方法如下: * 将需要数据的测试数据转化成与给定的输入格式相同 * 然后以Client类的测试程序调用方式进行使用。 * 也可以自行修改算法程序,来适用于自己的使用场景
0
neo4j/neo4j
Graphs for Everyone
cypher database graph graph-database graphdb neo4j nosql
null
0
MyCATApache/Mycat-Server
null
null
# Mycat1 官网: http://mycatone.top [gitee](https://gitee.com/MycatOne/Mycat-Server) [github](https://github.com/MyCATApache/Mycat-Server) 提交代码,可以开issue,写清楚代码改动或者联系qq:1019100252 mycat1.6权威指南 [yuque](https://www.yuque.com/books/share/0576de75-ffc4-4c34-8586-952ae4636944) [pdf](http://mycat.org.cn/document/mycat-definitive-guide.pdf) 客户端连接配置 [gitee](https://gitee.com/MycatOne/Mycat-Server/wiki/%E5%BC%80%E5%8F%91%E7%AF%87%EF%BC%9A1.0-%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%BF%9E%E6%8E%A5%E9%85%8D%E7%BD%AE) [github](https://github.com/MyCATApache/Mycat-Server/wiki/%E5%BC%80%E5%8F%91%E7%AF%87%EF%BC%9A1.0-%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%BF%9E%E6%8E%A5%E9%85%8D%E7%BD%AE) [![Stargazers over time](https://starchart.cc/MyCATApache/Mycat-Server.svg)](https://starchart.cc/MyCATApache/Mycat-Server) Mycat志愿者开发群:332702697,106088787 [![GitHub issues](https://img.shields.io/github/issues/MyCATApache/Mycat-Server.svg)](https://github.com/MyCATApache/Mycat-Server/issues) [![GitHub forks](https://img.shields.io/github/forks/MyCATApache/Mycat-Server.svg)](https://github.com/MyCATApache/Mycat-Server/network) [![GitHub stars](https://img.shields.io/github/stars/MyCATApache/Mycat-Server.svg)](https://github.com/MyCATApache/Mycat-Server/stargazers) [![MyCAT](https://img.shields.io/badge/MyCAT-%E2%9D%A4%EF%B8%8F-%23ff69b4.svg)](http://mycat.io/) MyCAT is an Open-Source software, “a large database cluster” oriented to enterprises. MyCAT is an enforced database which is a replacement for MySQL and supports transaction and ACID. Regarded as MySQL cluster of enterprise database, MyCAT can take the place of expensive Oracle cluster. MyCAT is also a new type of database, which seems like a SQL Server integrated with the memory cache technology, NoSQL technology and HDFS big data. And as a new modern enterprise database product, MyCAT is combined with the traditional database and new distributed data warehouse. In a word, MyCAT is a fresh new middleware of database. Mycat’s target is to smoothly migrate the current stand-alone database and applications to cloud side with low cost and to solve the bottleneck problem caused by the rapid growth of data storage and business scale. 2020年1月1日合拼了一个PR,优化PartionByLong的分片算法,数据不均衡的问题,所以该分片算法与此前的PartionByLong的数据分布不一致,即1.675之后与之前的版本不兼容 MyCAT1.6不支持一个SQL包含多个语句 旧Mycat升级fastjson,把pom.xml中fastjson的版本更改即可 1.6的bug: 批处理插入,多语句,堆外合拼,请大家要避开这些功能 全局序列号语法 ```sql INSERT INTO `travelrecord` (`id`,user_id) VALUES ('next value for MYCATSEQ_GLOBAL',"xxx"); ``` 更新Druid 1.1.10版本的分支独立维护在 [gitee](https://gitee.com/MycatOne/Mycat-Server/tree/1.6.6-druid) [github](https://github.com/MyCATApache/Mycat-Server/tree/1.6.6-druid) * Getting Started * [gitee](https://gitee.com/mirrors_MyCATApache/Mycat-doc/tree/master/en) * [github](https://github.com/MyCATApache/Mycat-doc/tree/master/en) * 尝试 MyCAT * [gitee](https://gitee.com/mirrors_MyCATApache/Mycat-doc/tree/master/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97) * [github](https://github.com/MyCATApache/Mycat-doc/tree/master/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97) ## Features * Supports SQL 92 standard * Supports MySQL cluster, used as a Proxy * Supports JDBC connection with ORACLE, DB2, SQL Server, simulated as normal MySQL Server connection * Supports MySQL cluster, percona cluster or mariadb cluster, providing high availability of data fragmentation clusters * Supports automatic failover and high availability * Supports separation of read and write, dual-master with multi-slave, single-master with multi-master of MySQL model * Supports global table, automatically fragment data into multiple nodes for efficient relational query * Supports the unique fragmentation strategy based on ER-relation for efficient relational query * Supports multiple platforms, easy deployment and implementation ## Advantage * Based on Alibaba's open-source project Cobar [github](https://github.com/alibaba/cobar),[gitee](https://gitee.com/mirrors_alibaba/cobar), whose stability, reliability, excellent architecture and performance, as well as many mature use-cases make MyCAT have a good starting. Standing on the shoulders of giants, MyCAT feels confident enough to go farther. * Extensively drawing on the best open-source projects and innovative ideas, which are integrated into the Mycat’s gene, make MyCAT be ahead of the other current similar open-source projects, even beyond some commercial products. * MyCAT behind a strong technical team whose participants are experienced more than five years including some senior software engineer, architect, DBA, etc. Excellent technical team to ensure the product quality of Mycat. * MyCAT does not rely on any commercial company. It’s unlike some open-source projects whose important features is enclosed in its commercial products and making open-source projects like a decoration. ## Roadmap * On the basis of MySQL’s support, MyCAT add more support of commercial open-source database, including native support of PostgreSQL, FireBird and other open-source databases, as well as indirect support via JDBC of other non-open-source databases such as Oracle, DB2, SQL Server etc. * More intelligent self-regulating properties, such as automatic statistical analysis of SQL, automatic creating and adjusting indexes. Based on the frequency of read and write, MyCAT automatically optimizes caching and backup strategies * Achieve a more comprehensive monitoring and management * Integrated with HDFS, provide SQL commands, load databases into HDFS for rapid analysis * Integrated excellent open-source reporting tools to make MyCAT have data analysis capability ## Download There are some compiled binary installation packages in Mycat-download project on github at [Mycat-download](http://dl.mycat.org.cn/1.6.7.6/). ## Document There are some documents in Mycat-doc project on github at [Mycat-doc] [gitee](https://gitee.com/mirrors_MyCATApache/Mycat-doc) [github](https://github.com/MyCATApache/Mycat-doc) Mycat 简单demo,具体参考Mycat权威指南 # Mycat前世今生 2013年阿里的Cobar在社区使用过程中发现存在一些比较严重的问题,及其使用限制,经过Mycat发起人第一次改良,第一代改良版——Mycat诞生。 Mycat开源以后,一些Cobar的用户参与了Mycat的开发,最终Mycat发展成为一个由众多软件公司的实力派架构师和资深开发人员维护的社区型开源软件。 2014年Mycat首次在上海的《中华架构师》大会上对外宣讲,更多的人参与进来,随后越来越多的项目采用了Mycat。 2015年5月,由核心参与者们一起编写的第一本官方权威指南《Mycat权威指南》电子版发布,累计超过500本,成为开源项目中的首创。 2015年10月为止,Mycat项目总共有16个Committer。 截至2015年11月,超过300个项目采用Mycat,涵盖银行、电信、电子商务、物流、移动应用、O2O的众多领域和公司。 截至2015年12月,超过4000名用户加群或研究讨论或测试或使用Mycat。 Mycat是基于开源cobar演变而来,我们对cobar的代码进行了彻底的重构,使用NIO重构了网络模块,并且优化了Buffer内核,增强了聚合,Join等基本特性,同时兼容绝大多数数据库成为通用的数据库中间件。1.4 版本以后 完全的脱离基本cobar内核,结合Mycat集群管理、自动扩容、智能优化,成为高性能的中间件。我们致力于开发高性能数据库中间而努力。永不收费,永不闭源,持续推动开源社区的发展。 Mycat吸引和聚集了一大批业内大数据和云计算方面的资深工程师,Mycat的发展壮大基于开源社区志愿者的持续努力,感谢社区志愿者的努力让Mycat更加强大,同时我们也欢迎社区更多的志愿者,特别是公司能够参与进来,参与Mycat的开发,一起推动社区的发展,为社区提供更好的开源中间件。 Mycat还不够强大,Mycat还有很多不足,欢迎社区志愿者的持续优化改进。 # 关键特性 支持SQL92标准 遵守Mysql原生协议,跨语言,跨平台,跨数据库的通用中间件代理。 基于心跳的自动故障切换,支持读写分离,支持MySQL主从,以及galera cluster集群。 支持Galera for MySQL集群,Percona Cluster或者MariaDB cluster 基于Nio实现,有效管理线程,高并发问题。 支持数据的多片自动路由与聚合,支持sum,count,max等常用的聚合函数。 支持单库内部任意join,支持跨库2表join,甚至基于caltlet的多表join。 支持通过全局表,ER关系的分片策略,实现了高效的多表join查询。 支持多租户方案。 支持分布式事务(弱xa)。 支持全局序列号,解决分布式下的主键生成问题。 分片规则丰富,插件化开发,易于扩展。 强大的web,命令行监控。 支持前端作为mysq通用代理,后端JDBC方式支持Oracle、DB2、SQL Server 、 mongodb 、巨杉。 支持密码加密 支持服务降级 支持IP白名单 支持SQL黑名单、sql注入攻击拦截 支持分表(1.6) 集群基于ZooKeeper管理,在线升级,扩容,智能优化,大数据处理(2.0开发版)。 # Mycat安装与使用 ## 下载: 具体下载哪个版本以发布为准,推荐1.67. ## 安装: 下载的文件直接解压即可。 ## 运行: ### linux: ./mycat start 启动 ./mycat stop 停止 ./mycat console 前台运行 ./mycat install 添加到系统自动启动(暂未实现) ./mycat remove 取消随系统自动启动(暂未实现) ./mycat restart 重启服务 ./mycat pause 暂停 ./mycat status 查看启动状态 ### win: 直接运行startup_nowrap.bat,如果出现闪退,在cmd 命令行运行,查看出错原因。 ## 内存配置: 启动前,一般需要修改JVM配置参数,打开conf/wrapper.conf文件,如下行的内容为2G和2048,可根据本机配置情况修改为512M或其它值。 以下配置跟jvm参数完全一致,可以根据自己的jvm参数调整。 Java Additional Parameters wrapper.java.additional.1= wrapper.java.additional.1=-DMYCAT_HOME=. wrapper.java.additional.2=-server #wrapper.java.additional.3=-XX:MaxPermSize=64M wrapper.java.additional.4=-XX:+AggressiveOpts wrapper.java.additional.5=-XX:MaxDirectMemorySize=100m wrapper.java.additional.6=-Dcom.sun.management.jmxremote wrapper.java.additional.7=-Dcom.sun.management.jmxremote.port=1984 wrapper.java.additional.8=-Dcom.sun.management.jmxremote.authenticate=false wrapper.java.additional.9=-Dcom.sun.management.jmxremote.ssl=false wrapper.java.additional.10=-Xmx100m wrapper.java.additional.11=-Xms100m wrapper.java.additional.12=-XX:+UseParNewGC wrapper.java.additional.13=-XX:+UseConcMarkSweepGC wrapper.java.additional.14=-XX:+UseCMSCompactAtFullCollection wrapper.java.additional.15=-XX:CMSFullGCsBeforeCompaction=0 wrapper.java.additional.16=-XX:CMSInitiatingOccupancyFraction=70 以下配置作废: wrapper.java.initmemory=3 wrapper.java.maxmemory=64 ### Mycat连接测试: 测试mycat与测试mysql完全一致,mysql怎么连接,mycat就怎么连接。 推荐先采用命令行测试: mysql -uroot -proot -P8066 -h127.0.0.1 如果采用工具连接,1.4,1.3目前部分工具无法连接,会提示database not selected,建议采用高版本,navicat测试。1.5已经修复了部分工具连接。 # Mycat配置入门 ## 配置: --bin 启动目录 --conf 配置目录存放配置文件: --server.xml:是Mycat服务器参数调整和用户授权的配置文件。 --schema.xml:是逻辑库定义和表以及分片定义的配置文件。 --rule.xml: 是分片规则的配置文件,分片规则的具体一些参数信息单独存放为文件,也在这个目录下,配置文件修改需要重启MyCAT。 --log4j.xml: 日志存放在logs/log中,每天一个文件,日志的配置是在conf/log4j.xml中,根据自己的需要可以调整输出级别为debug debug级别下,会输出更多的信息,方便排查问题。 --autopartition-long.txt,partition-hash-int.txt,sequence_conf.properties, sequence_db_conf.properties 分片相关的id分片规则配置文件 --lib MyCAT自身的jar包或依赖的jar包的存放目录。 --logs MyCAT日志的存放目录。日志存放在logs/log中,每天一个文件 下面图片描述了Mycat最重要的3大配置文件: <p> <img src="http://songwie.com/attached/image/20160205/20160205164558_154.png" alt=""> </p> ## 逻辑库配置: ### 配置server.xml 添加两个mycat逻辑库:user,pay system 参数是所有的mycat参数配置,比如添加解析器:defaultSqlParser,其他类推 user 是用户参数。 <system> <property name="defaultSqlParser">druidparser</property> </system> <user name="mycat"> <property name="password">mycat</property> <property name="schemas">user,pay</property> </user> ### 编辑schema.xml 修改dataHost和schema对应的连接信息,user,pay 垂直切分后的配置如下所示: schema 是实际逻辑库的配置,user,pay分别对应两个逻辑库,多个schema代表多个逻辑库。 dataNode是逻辑库对应的分片,如果配置多个分片只需要多个dataNode即可。 dataHost是实际的物理库配置地址,可以配置多主主从等其他配置,多个dataHost代表分片对应的物理库地址,下面的writeHost、readHost代表该分片是否配置多写,主从,读写分离等高级特性。 以下例子配置了两个writeHost为主从。 <schema name="user" checkSQLschema="false" sqlMaxLimit="100" dataNode="user" /> <schema name="pay" checkSQLschema="false" sqlMaxLimit="100" dataNode="pay" > <table name="order" dataNode="pay1,pay2" rule="rule1"/> </schema> <dataNode name="user" dataHost="host" database="user" /> <dataNode name="pay1" dataHost="host" database="pay1" /> <dataNode name="pay2" dataHost="host" database="pay2" /> <dataHost name="host" maxCon="1000" minCon="10" balance="0" writeType="0" dbType="mysql" dbDriver="native"> <heartbeat>select 1</heartbeat> <!-- can have multi write hosts --> <writeHost host="hostM1" url="192.168.0.2:3306" user="root" password="root" /> <writeHost host="hostM2" url="192.168.0.3:3306" user="root" password="root" /> </dataHost> ​ # Mycat逻辑库、系统参数配置 ## 配置Mycat环境参数 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE mycat:server SYSTEM "server.dtd"> <mycat:server xmlns:mycat="http://org.opencloudb/"> <system> <property name="defaultSqlParser">druidparser</property> </system> </mycat:server> 如例子中配置的所有的Mycat参数变量都是配置在server.xml 文件中,system标签下配置所有的参数,如果需要配置某个变量添加相应的配置即可,例如添加启动端口8066,默认为8066: <property name="serverPort">8066</property> 其他所有变量类似。 ## 配置Mycat逻辑库与用户 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE mycat:server SYSTEM "server.dtd"> <mycat:server xmlns:mycat="http://org.opencloudb/"> <user name="mycat"> <property name="password">mycat</property> <property name="schemas">TESTDB</property> </user> </mycat:server> 如例子中配置的所有的Mycat连接的用户与逻辑库映射都是配置在server.xml 文件中,user标签下配置所有的参数,例如例子中配置了一个mycat用户供应用连接到mycat,同时mycat 在schema.xml中配置后了一个逻辑库TESTDB,配置好逻辑库与用户的映射关系。 # 逻辑库、表分片配置 ## 配置逻辑库(schema) Mycat作为一个中间件,实现mysql协议,那么对前端应用连接来说就是一个数据库,也就有数据库的配置,mycat的数据库配置是在schema.xml中配置,配置好后映射到server.xml里面的用户就可以了。 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mycat:schema SYSTEM "schema.dtd"> <mycat:schema xmlns:mycat="http://org.opencloudb/"> <schema name="TESTDB" checkSQLschema="true" sqlMaxLimit="100" dataNode="dn1"> <table name="t_user" dataNode="dn1,dn2" rule="sharding-by-mod2"/> <table name="ht_jy_login_log" primaryKey="ID" dataNode="dn1,dn2" rule="sharding-by-date_jylog"/> </schema> <dataNode name="dn1" dataHost="localhost1" database="mycat_node1"/> <dataNode name="dn2" dataHost="localhost1" database="mycat_node2"/> <dataHost name="localhost1" writeType="0" switchType="1" slaveThreshold="100" balance="1" dbType="mysql" maxCon="10" minCon="1" dbDriver="native"> <heartbeat>show status like 'wsrep%'</heartbeat> <writeHost host="hostM1" url="127.0.0.1:3306" user="root" password="root" > </writeHost> </dataHost> </mycat:schema > 上面例子配置了一个逻辑库TESTDB,同时配置了t_user,ht_jy_login_log两个分片表。 ### 逻辑表配置 <table name="t_user" dataNode="dn1,dn2" rule="sharding-by-mod2"/> table 标签 是逻辑表的配置 其中 name代表表名, dataNode代表表对应的分片, Mycat默认采用分库方式,也就是一个表映射到不同的库上, rule代表表要采用的数据切分方式,名称对应到rule.xml中的对应配置,如果要分片必须配置。 ## 配置分片(dataNode) <dataNode name="dn1" dataHost="localhost1" database="mycat_node1"/> <dataNode name="dn2" dataHost="localhost1" database="mycat_node2"/> 表切分后需要配置映射到哪几个数据库中,Mycat的分片实际上就是库的别名,例如上面例子配置了两个分片dn1,dn2 分别对应到物理机映射dataHost localhost1 的两个库上。 ## 配置物理库分片映射(dataHost) <dataHost name="localhost1" writeType="0" switchType="1" slaveThreshold="100" balance="1" dbType="mysql" maxCon="10" minCon="1" dbDriver="native"> <heartbeat>show status like 'wsrep%'</heartbeat> <writeHost host="hostM1" url="127.0.0.1:3306" user="root" password="root" > </writeHost> </dataHost> Mycat作为数据库代理需要逻辑库,逻辑用户,表切分后需要配置分片,分片也就需要映射到真实的物理主机上,至于是映射到一台还是一台的多个实例上,Mycat并不关心,只需要配置好映射即可,例如例子中: 配置了一个名为localhost1的物理主机(dataHost)映射。 heartbeat 标签代表Mycat需要对物理库心跳检测的语句,正常情况下生产案例可能配置主从,或者多写 或者单库,无论哪种情况Mycat都需要维持到数据库的数据源连接,因此需要定时检查后端连接可以性,心跳语句就是来作为心跳检测。 writeHost 此标签代表 一个逻辑主机(dataHost)对应的后端的物理主机映射,例如例子中写库hostM1 映射到127.0.0.1:3306。如果后端需要做读写分离或者多写 或者主从则通过配置 多个writeHost 或者readHost即可。 dataHost 标签中的 writeType balance 等标签则是不同的策略,具体参考指南。 # Mycat 表切分规则配置 ## 表切分规则 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mycat:rule SYSTEM "rule.dtd"> <mycat:rule xmlns:mycat="http://org.opencloudb/"> <tableRule name="sharding-by-hour"> <rule> <columns>createTime</columns> <algorithm>sharding-by-hour</algorithm> </rule> </tableRule> <function name="sharding-by-hour" class="org.opencloudb.route.function.LatestMonthPartion"> <property name="splitOneDay">24</property> </function> </mycat:rule > 数据切分中作为表切分规则中最重要的配置,表的切分方式决定了数据切分后的性能好坏,因此也是最重要的配置。 如上面例子配置了一个切分规则,名为sharding-by-hour 对应的切分方式(function )是按日期切分,该配置中: ### tableRule name 为schema.xml 中table 标签中对应的 rule="sharding-by-hour" ,也就是配置表的分片规则, columns 是表的切分字段: createTime 创建日期。 algorithm 是规则对应的切分规则:映射到function 的name。 ### function function 配置是分片规则的配置。 name 为切分规则的名称,名字任意取,但是需要与tableRule 中匹配。 class 是切分规则对应的切分类,写死,需要哪种规则则配置哪种,例如本例子是按小时分片:org.opencloudb.route.function.LatestMonthPartion property 标签是切分规则对应的不同属性,不同的切分规则配置不同。
0
jindrapetrik/jpexs-decompiler
JPEXS Free Flash Decompiler
decompiler editor flash swf
# JPEXS Free Flash Decompiler ![Build passing badge](https://github.com/jindrapetrik/jpexs-decompiler/actions/workflows/main.yml/badge.svg?branch=dev) Open Source Flash SWF decompiler and editor. Extract resources, convert SWF to FLA, edit ActionScript, replace images, sounds, texts and fonts. Various output formats available. Works with Java on Windows, Linux and macOS. ## Application description and features For information about using the software, list of features, etc., visit [FFDec Wiki](https://github.com/jindrapetrik/jpexs-decompiler/wiki). ## Free-Decompiler.com website In the past (before 2018), we were using *free-decompiler.com* domain as homepage and GitHub for the source code, We've now moved all information (except the issue tracker) to GitHub. ## Download application For downloading the app, see [latest release](https://github.com/jindrapetrik/jpexs-decompiler/releases/latest). Older versions and nightly builds are availabe at the [releases section](https://github.com/jindrapetrik/jpexs-decompiler/releases) ### How to install See [installation section of the wiki](https://github.com/jindrapetrik/jpexs-decompiler/wiki/Installation) ## Source code ### How to get the source You can make a local copy of the sources with the following command: ``` git clone https://github.com/jindrapetrik/jpexs-decompiler.git ``` This assumes you have git installed on your system. ### Branches Git source control manager supports multiple code branches. We use two main branches. * `master` - for released "stable" versions * `dev` - for newest changes from developers - "nightly" version is released from this branch You can switch to `dev` branch with following git command: ``` git checkout dev ``` ### GIT recommended It is recommended to have [GIT] commandline executables installed. Building script uses GIT to include revision number in to the binary. (For Windows, you must enable Git in windows command line during installation.) ### Netbeans project Source code contains Netbeans Project so you can open it in [Netbeans IDE]. Then you can use standard actions like Run, Build, Debug, Clean and Build in the IDE. Other specific tasks can be executed via menu on build.xml (see Ant part) ### Ant If you do not have Netbeans, you can build source code also with Apache Ant. After installing Ant it is good to put it into your PATH variable. Open up commandline and navigate to sources directory. To run application, execute task "run" by entering this command: ``` ant run ``` To only build, execute build task: ``` ant build ``` For creating EXE, Installer and ZIP version, there exist Ant tasks "exe","installer","release". These tasks require additional software installed: * [launch4j] (3.5 or newer) - creates windows executable * [NSIS] (Nullsoft Scriptable Install System) (3.0b3 or newer) - creates installer You must configure installation path of these tools in tools.properties file, which could look like this for windows: ``` nsis.path = c:\\program files (x86)\\NSIS launch4j.path = c:\\program files (x86)\\launch4j ``` ### Building libraries There are few libraries which need to be built too. These libraries are placed in "libsrc" directory. * **FFDec_lib** - core of decompilation, SWF parsing, exporting **This library is built automatically with main project, but can be build also separately with its own Ant script.** * **jpacker** - used for compression of JavaScript Canvas scripts (Netbeans/Ant project) * **jpproxy** - proxy part of FFDec (Netbeans/Ant project) * **jsyntaxpane** - code editor (Netbeans/Apache Maven project) * **LZMA** - used for SWF compression (Netbeans/Ant project) * **nellymoser** - used for Nelly Moser sounds decoding (Netbeans/Ant project) * **Swf2Exe** - Stub for "Save to EXE" feature (Delphi 7 Project) * **ttf** - used for TTF font export (Netbeans/Ant project) * **gnujpdf** - used for PDF export (Netbeans/Ant project) ## Change log All notable changes are listed in the file [CHANGELOG.md](CHANGELOG.md) ## Deployment ### Nightly builds When a commit is pushed/merged into `dev` branch, a new prerelease version is created automatically by Github actions CI. These prerelease versions are called nightly builds. On releasing a new nightly build, the previous nightly build is removed. ### Stable versions A new stable version is created automatically by the Github Actions CI when marking a revision in `master` branch with a tag in format `versionx.y.z`. ## Contributing Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. ## Versioning Versions are in format `x.y.z`, for example `9.1.2`. For the versions available, see the [tags on this repository](https://github.com/jindrapetrik/jpexs-decompiler/tags). Nightly builds have additional suffix `_nightlyN` where `N` is number which increments with every (automatic) nightly release and does not depend on the `x.y.z` numbers. (This means nightly number is *NOT* reseted to 0 when releasing stable) Older nightly builds are *NOT* available through git tags. ## Authors The decompiler was originally written by **Jindra Petřík** also known as **JPEXS**. The application was made in Czech Republic. ### Developers * **JPEXS** - leader, development of the decompiler, website main admin, github account admin, organization * **honfika** - development of the decompiler * **Paolo Cancedda** - former developer * ...other pushers on GitHub or Google Code ### Translators * **Jaume Badiella Aguilera** - catalan translation * **Capasha** - swedish translation * **王晨旭** (Chenxu Wang), **晓之车**, **安安** - chinese translation * **focus** - russian translation * **honfika** - hungarian translation * **kalip** - italian translation * **Krock** - german translation * **Laurent LOUVET** - french translation * **MaGiC** - portuguese translation * **martinkoza** - polish translation * **Osman ÖZ** - turkish translation * **pepka** - ukrainian and dutch translation * **poxyran** - spanish translation * **realmaster42**, **alimsoftware** - portuguese-brasil translation * **Rtsjx** - chinese translation * **koiru** - japanese translation ## Contact If you want to report a problem or request new feature, use our issue tracker at [https://www.free-decompiler.com/flash/issues](https://www.free-decompiler.com/flash/issues) You should see [Frequently Asked Questions (FAQ) in wiki](https://github.com/jindrapetrik/jpexs-decompiler/wiki/FAQ) before. Also see [Known problems list in wiki](https://github.com/jindrapetrik/jpexs-decompiler/wiki/Known-problems) ### Email contact Emergency contact to JPEXS developer is `jindra.petrik@gmail.com`. But we prefer Issue tracker contact. ## Licenses + Acknowledgments ### Application FFDec Application is licensed under the GNU GPL v3 (GPL-3.0-or-later) licence, see the [license.txt](license.txt). It uses modified code of these libraries: * [JSyntaxPane] (Code editor) - Apache License 2.0 * [Muffin] (Proxy) - GPL And links also these libraries: * [Java Native Access - JNA] (Registry association, Process memory reading) - LGPL * [Insubstantial] (Substance Look and Feel, Flamingo Ribbon component) - Revised BSD * [javactivex] (Flash Player ActiveX embedding) - LGPLv3 * [flashdebugger library] (Debugging ActionScript) - LGPLv3 * FFDec Library (LGPLv3) - see below Application uses also some icons of the [Silk icons pack], [Silk companion 1], [FatCow icons pack] and [Aha-Soft icons pack]. ## Library See [library README](libsrc/ffdec_lib/README.md) for more info about FFDec library. [GIT]: http://git-scm.com/downloads [Netbeans IDE]: http://www.netbeans.org/ [Apache Ant]: http://ant.apache.org/ [launch4j]: http://launch4j.sourceforge.net/ [NSIS]: http://nsis.sourceforge.net/ [JSyntaxPane]: https://code.google.com/p/jsyntaxpane/ [Muffin]: https://web.archive.org/web/20171025082558/http://muffin.doit.org/ (original: http://muffin.doit.org/) [Java Native Access - JNA]: https://github.com/twall/jna [Insubstantial]: http://shemnon.com/speling/2011/04/insubstantial-62-release.html [javactivex]:https://github.com/jindrapetrik/javactivex [flashdebugger library]: https://github.com/jindrapetrik/flashdebugger [Silk icons pack]: http://www.famfamfam.com/lab/icons/silk/ [Silk companion 1]: http://damieng.com/creative/icons/silk-companion-1-icons [FatCow icons pack]: http://www.fatcow.com/free-icons [Aha-Soft icons pack]: http://www.aha-soft.com
0
OpenVidu/openvidu
OpenVidu Platform main repository
chat kurento openvidu room sfu typescript video video-conferencing webrtc
[![Backers on Open Collective](https://opencollective.com/openvidu/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/openvidu/sponsors/badge.svg)](#sponsors) [![License badge](https://img.shields.io/badge/license-Apache2-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![OpenVidu Tests](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml/badge.svg)](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml) [![Npm version](https://img.shields.io/npm/v/openvidu-browser?label=npm-version)](https://npmjs.org/package/openvidu-browser) [![Npm downloads](https://img.shields.io/npm/dw/openvidu-browser?label=npm2-downloads)](https://npmjs.org/package/openvidu-browser) [![Documentation Status](https://readthedocs.org/projects/openvidu/badge/?version=stable)](https://docs.openvidu.io/en/stable/?badge=stable) [![Docker badge](https://img.shields.io/docker/pulls/openvidu/openvidu-server-kms.svg)](https://hub.docker.com/r/openvidu/openvidu-server-kms) [![Support badge](https://img.shields.io/badge/support-sof-yellowgreen.svg)](https://openvidu.discourse.group/) [![Twitter Follow](https://img.shields.io/twitter/follow/openvidu.svg?style=social)](https://twitter.com/openvidu) [![][OpenViduLogo]](https://openvidu.io) openvidu === Visit [openvidu.io](https://openvidu.io) ## Community Forum Visit [OpenVidu Community Forum](https://openvidu.discourse.group/) [OpenViduLogo]: https://secure.gravatar.com/avatar/5daba1d43042f2e4e85849733c8e5702?s=120 ## Contributors This project exists thanks to all the people who contribute. <a href="https://github.com/OpenVidu/openvidu/contributors"><img src="https://opencollective.com/openvidu/contributors.svg?width=890&button=false" /></a> ## Backers Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/openvidu#backer)] <a href="https://opencollective.com/openvidu#backers" target="_blank"><img src="https://opencollective.com/openvidu/backers.svg?width=890"></a> ## Acknowledgments OpenVidu has been supported under project "CPP2021-008720 NewGenVidu: An elastic, user-friendly and privacy-friendly videoconferencing platform", funded by MCIN/AEI/10.13039/501100011033 and by the European Union-NextGenerationEU/PRTR. <img height="75px" src="https://openvidu.io/img/logos/support.jpg"> ## Sponsors Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/openvidu#sponsor)] <a href="https://opencollective.com/openvidu/sponsor/0/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/1/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/2/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/3/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/4/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/5/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/6/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/7/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/8/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/openvidu/sponsor/9/website" target="_blank"><img src="https://opencollective.com/openvidu/sponsor/9/avatar.svg"></a>
0
donglua/PhotoPicker
[DEPRECATED] Image Picker like Wechat
imagepicker photopicker
# PhotoPicker [![CircleCI](https://circleci.com/gh/donglua/PhotoPicker/tree/master.svg?style=svg)](https://circleci.com/gh/donglua/PhotoPicker/tree/master) [![Build Status](https://travis-ci.org/donglua/PhotoPicker.svg?branch=master)](https://travis-ci.org/donglua/PhotoPicker) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-PhotoPicker-green.svg?style=flat)](https://android-arsenal.com/details/1/2091) [ ![Download](https://api.bintray.com/packages/donglua/maven/PhotoPicker/images/download.svg) ](https://bintray.com/donglua/maven/PhotoPicker/_latestVersion) [![API](https://img.shields.io/badge/API-10%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14) --- # DEPRECATED PhotoPicker is deprecated. > * 本项目已废弃,仍可使用,但不推荐;推荐使用 [zhihu/Matisse](https://github.com/zhihu/Matisse)。 > * 本项目建于2015年初,是最早的图片选择库之一。由于目前同类开源项目很多,也做得更完善,加上迁移成本低,本项目没有继续维护的必要,感谢大家支持。 # Example ![](http://ww2.sinaimg.cn/large/5e9a81dbgw1etra61rnr9j206z0ce3yu.jpg) ![](http://ww3.sinaimg.cn/large/5e9a81dbgw1etra6q2edzj206z0cedgg.jpg) ![](http://ogkb67oc8.bkt.clouddn.com/F028B942CF5978D900B15033941478B7.jpg?imageView2/2/w/250/) <p style="float:left;"> <a href="https://play.google.com/store/apps/details?id=me.iwf.PhotoPickerDemo&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-AC-global-none-all-co-pr-py-PartBadges-Oct1515-1"> <img HEIGHT="80" WIDTH="270" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" /> </a> </p> --- # Usage ### Gradle ```groovy dependencies { compile 'me.iwf.photopicker:PhotoPicker:0.9.12@aar' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:recyclerview-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.github.bumptech.glide:glide:4.1.1' } ``` * ```appcompat-v7```version >= 23.0.0 ### eclipse [![GO HOME](http://ww4.sinaimg.cn/large/5e9a81dbgw1eu90m08v86j20dw09a3yu.jpg) ### Pick Photo ```java PhotoPicker.builder() .setPhotoCount(9) .setShowCamera(true) .setShowGif(true) .setPreviewEnabled(false) .start(this, PhotoPicker.REQUEST_CODE); ``` ### Preview Photo ```java ArrayList<String> photoPaths = ...; PhotoPreview.builder() .setPhotos(selectedPhotos) .setCurrentItem(position) .setShowDeleteButton(false) .start(MainActivity.this); ``` ### onActivityResult ```java @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK && requestCode == PhotoPicker.REQUEST_CODE) { if (data != null) { ArrayList<String> photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS); } } } ``` ### manifest ```xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" > <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.CAMERA" /> <application ... > ... <activity android:name="me.iwf.photopicker.PhotoPickerActivity" android:theme="@style/Theme.AppCompat.NoActionBar" /> <activity android:name="me.iwf.photopicker.PhotoPagerActivity" android:theme="@style/Theme.AppCompat.NoActionBar"/> </application> </manifest> ``` ### Custom style ```xml <style name="actionBarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> <item name="android:textColorPrimary">@android:color/primary_text_light</item> <item name="actionBarSize">@dimen/actionBarSize</item> </style> <style name="customTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="actionBarTheme">@style/actionBarTheme</item> <item name="colorPrimary">#FFA500</item> <item name="actionBarSize">@dimen/actionBarSize</item> <item name="colorPrimaryDark">#CCa500</item> </style> ``` ### Proguard ``` # Glide -keep public class * implements com.bumptech.glide.module.GlideModule -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { **[] $VALUES; public *; } # support-v7-appcompat -keep public class android.support.v7.widget.** { *; } -keep public class android.support.v7.internal.widget.** { *; } -keep public class android.support.v7.internal.view.menu.** { *; } -keep public class * extends android.support.v4.view.ActionProvider { public <init>(android.content.Context); } # support-design -dontwarn android.support.design.** -keep class android.support.design.** { *; } -keep interface android.support.design.** { *; } -keep public class android.support.design.R$* { *; } ``` --- # License Copyright 2015 Huang Donglu 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
Netflix/Hystrix
Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
null
<img src="https://netflix.github.io/Hystrix/images/hystrix-logo-tagline-850.png"> # Hystrix: Latency and Fault Tolerance for Distributed Systems [![NetflixOSS Lifecycle](https://img.shields.io/osslifecycle/Netflix/hystrix.svg)]() [![][travis img]][travis] [![][maven img]][maven] [![][license img]][license] # Hystrix Status Hystrix is no longer in active development, and is currently in maintenance mode. Hystrix (at version 1.5.18) is stable enough to meet the needs of Netflix for our existing applications. Meanwhile, our focus has shifted towards more adaptive implementations that react to an application’s real time performance rather than pre-configured settings (for example, through [adaptive concurrency limits](https://medium.com/@NetflixTechBlog/performance-under-load-3e6fa9a60581)). For the cases where something like Hystrix makes sense, we intend to continue using Hystrix for existing applications, and to leverage open and active projects like [resilience4j](https://github.com/resilience4j/resilience4j) for new internal projects. We are beginning to recommend others do the same. Netflix Hystrix is now officially in maintenance mode, with the following expectations to the greater community: Netflix will no longer actively review issues, merge pull-requests, and release new versions of Hystrix. We have made a final release of Hystrix (1.5.18) per [issue 1891](https://github.com/Netflix/Hystrix/issues/1891) so that the latest version in Maven Central is aligned with the last known stable version used internally at Netflix (1.5.11). If members of the community are interested in taking ownership of Hystrix and moving it back into active mode, please reach out to hystrixoss@googlegroups.com. Hystrix has served Netflix and the community well over the years, and the transition to maintenance mode is in no way an indication that the concepts and ideas from Hystrix are no longer valuable. On the contrary, Hystrix has inspired many great ideas and projects. We thank everyone at Netflix, and in the greater community, for all the contributions made to Hystrix over the years. ## Introduction Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable. ## Full Documentation See the [Wiki](https://github.com/Netflix/Hystrix/wiki/) for full documentation, examples, operational details and other information. See the [Javadoc](http://netflix.github.com/Hystrix/javadoc) for the API. ## Communication - Google Group: [HystrixOSS](http://groups.google.com/d/forum/hystrixoss) - Twitter: [@HystrixOSS](http://twitter.com/HystrixOSS) - [GitHub Issues](https://github.com/Netflix/Hystrix/issues) ## What does it do? #### 1) Latency and Fault Tolerance Stop cascading failures. Fallbacks and graceful degradation. Fail fast and rapid recovery. Thread and semaphore isolation with circuit breakers. #### 2) Realtime Operations Realtime monitoring and configuration changes. Watch service and property changes take effect immediately as they spread across a fleet. Be alerted, make decisions, affect change and see results in seconds. #### 3) Concurrency Parallel execution. Concurrency aware request caching. Automated batching through request collapsing. ## Hello World! Code to be isolated is wrapped inside the run() method of a HystrixCommand similar to the following: ```java public class CommandHelloWorld extends HystrixCommand<String> { private final String name; public CommandHelloWorld(String name) { super(HystrixCommandGroupKey.Factory.asKey("ExampleGroup")); this.name = name; } @Override protected String run() { return "Hello " + name + "!"; } } ``` This command could be used like this: ```java String s = new CommandHelloWorld("Bob").execute(); Future<String> s = new CommandHelloWorld("Bob").queue(); Observable<String> s = new CommandHelloWorld("Bob").observe(); ``` More examples and information can be found in the [How To Use](https://github.com/Netflix/Hystrix/wiki/How-To-Use) section. Example source code can be found in the [hystrix-examples](https://github.com/Netflix/Hystrix/tree/master/hystrix-examples/src/main/java/com/netflix/hystrix/examples) module. ## 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%7Cg%3A%22com.netflix.hystrix%22%20AND%20a%3A%22hystrix-core%22). Change history and version numbers => [CHANGELOG.md](https://github.com/Netflix/Hystrix/blob/master/CHANGELOG.md) Example for Maven: ```xml <dependency> <groupId>com.netflix.hystrix</groupId> <artifactId>hystrix-core</artifactId> <version>x.y.z</version> </dependency> ``` and for Ivy: ```xml <dependency org="com.netflix.hystrix" name="hystrix-core" rev="x.y.z" /> ``` If you need to download the jars instead of using a build system, create a Maven pom file like this with the desired version: ```xml <?xml version="1.0"?> <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"> <modelVersion>4.0.0</modelVersion> <groupId>com.netflix.hystrix.download</groupId> <artifactId>hystrix-download</artifactId> <version>1.0-SNAPSHOT</version> <name>Simple POM to download hystrix-core and dependencies</name> <url>http://github.com/Netflix/Hystrix</url> <dependencies> <dependency> <groupId>com.netflix.hystrix</groupId> <artifactId>hystrix-core</artifactId> <version>x.y.z</version> <scope/> </dependency> </dependencies> </project> ``` Then execute: ``` mvn -f download-hystrix-pom.xml dependency:copy-dependencies ``` It will download hystrix-core-*.jar and its dependencies into ./target/dependency/. You need Java 6 or later. ## Build To build: ``` $ git clone git@github.com:Netflix/Hystrix.git $ cd Hystrix/ $ ./gradlew build ``` Further details on building can be found on the [Getting Started](https://github.com/Netflix/Hystrix/wiki/Getting-Started) page of the wiki. ## Run Demo To run a [demo app](https://github.com/Netflix/Hystrix/tree/master/hystrix-examples/src/main/java/com/netflix/hystrix/examples/demo/HystrixCommandDemo.java) do the following: ``` $ git clone git@github.com:Netflix/Hystrix.git $ cd Hystrix/ ./gradlew runDemo ``` You will see output similar to the following: ``` Request => GetUserAccountCommand[SUCCESS][8ms], GetPaymentInformationCommand[SUCCESS][20ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][101ms], CreditCardCommand[SUCCESS][1075ms] Request => GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS][2ms], GetPaymentInformationCommand[SUCCESS][22ms], GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][130ms], CreditCardCommand[SUCCESS][1050ms] Request => GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS][4ms], GetPaymentInformationCommand[SUCCESS][19ms], GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][145ms], CreditCardCommand[SUCCESS][1301ms] Request => GetUserAccountCommand[SUCCESS][4ms], GetPaymentInformationCommand[SUCCESS][11ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][93ms], CreditCardCommand[SUCCESS][1409ms] ##################################################################################### # CreditCardCommand: Requests: 17 Errors: 0 (0%) Mean: 1171 75th: 1391 90th: 1470 99th: 1486 # GetOrderCommand: Requests: 21 Errors: 0 (0%) Mean: 100 75th: 144 90th: 207 99th: 230 # GetUserAccountCommand: Requests: 21 Errors: 4 (19%) Mean: 8 75th: 11 90th: 46 99th: 51 # GetPaymentInformationCommand: Requests: 21 Errors: 0 (0%) Mean: 18 75th: 21 90th: 24 99th: 25 ##################################################################################### Request => GetUserAccountCommand[SUCCESS][10ms], GetPaymentInformationCommand[SUCCESS][16ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][51ms], CreditCardCommand[SUCCESS][922ms] Request => GetUserAccountCommand[SUCCESS][12ms], GetPaymentInformationCommand[SUCCESS][12ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][68ms], CreditCardCommand[SUCCESS][1257ms] Request => GetUserAccountCommand[SUCCESS][10ms], GetPaymentInformationCommand[SUCCESS][11ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][78ms], CreditCardCommand[SUCCESS][1295ms] Request => GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS][6ms], GetPaymentInformationCommand[SUCCESS][11ms], GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][153ms], CreditCardCommand[SUCCESS][1321ms] ``` This demo simulates 4 different [HystrixCommand](https://github.com/Netflix/Hystrix/tree/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommand.java) implementations with failures, latency, timeouts and duplicate calls in a multi-threaded environment. It logs the results of [HystrixRequestLog](https://github.com/Netflix/Hystrix/tree/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixRequestLog.java) and metrics from [HystrixCommandMetrics](https://github.com/Netflix/Hystrix/tree/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandMetrics.java). ## Dashboard The hystrix-dashboard component of this project has been deprecated and moved to [Netflix-Skunkworks/hystrix-dashboard](https://github.com/Netflix-Skunkworks/hystrix-dashboard). Please see the README there for more details including important security considerations. ## Bugs and Feedback For bugs, questions and discussions please use the [GitHub Issues](https://github.com/Netflix/Hystrix/issues). ## LICENSE Copyright 2013 Netflix, 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. [travis]:https://travis-ci.org/Netflix/Hystrix [travis img]:https://travis-ci.org/Netflix/Hystrix.svg?branch=master [maven]:http://search.maven.org/#search|gav|1|g:"com.netflix.hystrix"%20AND%20a:"hystrix-core" [maven img]:https://maven-badges.herokuapp.com/maven-central/com.netflix.hystrix/hystrix-core/badge.svg [release]:https://github.com/netflix/hystrix/releases [release img]:https://img.shields.io/github/release/netflix/hystrix.svg [license]:LICENSE-2.0.txt [license img]:https://img.shields.io/badge/License-Apache%202-blue.svg
0
shibing624/similarity
similarity: Text similarity calculation Toolkit for Java. 文本相似度计算工具包,java编写,可用于文本相似度计算、情感分析等任务,开箱即用。
java nlp semantic sentiment sim-scores similarity
[![jitpack](https://jitpack.io/v/shibing624/similarity.svg)](https://jitpack.io/#shibing624/similarity) [![Stars](https://img.shields.io/github/stars/shibing624/similarity?style=social)](https://github.com/shibing624/similarity) [![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE) [![GitHub issues](https://img.shields.io/github/issues/shibing624/similarity.svg)](https://github.com/shibing624/similarity/issues) [![Wechat Group](https://img.shields.io/badge/wechat-group-green.svg?logo=wechat)](#Contact) # Similarity similarity, compute similarity score between text strings, Java written. similarity,相似度计算工具包,可用于文本相似度计算、情感倾向分析等,Java编写。 **similarity**是由一系列算法组成的Java版相似度计算工具包,目标是传播自然语言处理中相似度计算方法。**similarity**具备工具实用、性能高效、架构清晰、语料时新、可自定义的特点。 # Feature **similarity**提供下列功能: - 词语相似度计算 * **词林编码法相似度[推荐]** * 汉语语义法相似度 * 知网词语相似度 * 字面编辑距离法 - 短语相似度计算 * **简单短语相似度[推荐]** - 句子相似度计算 * **词性和词序结合法[推荐]** * 编辑距离算法 * Gregor编辑距离法 * 优化编辑距离法 - 段落相似度计算 * **余弦相似度[推荐]** * 编辑距离 * 欧几里得距离 * Jaccard相似性系数 * Jaro距离 * Jaro–Winkler距离 * 曼哈顿距离 * SimHash + 汉明距离 * Sørensen–Dice系数 - 知网义原 * 词语义原树 - 情感分析 * 正面倾向程度 * 负面倾向程度 * 情感倾向性 - 近似词 * word2vec 在提供丰富功能的同时,**similarity**内部模块坚持低耦合、模型坚持惰性加载、词典坚持明文发布,使用方便,帮助用户训练自己的语料。 # Usage 引入Jar包 ### Maven ```xml <repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories> ``` ```xml <dependency> <groupId>com.github.shibing624</groupId> <artifactId>similarity</artifactId> <version>1.1.6</version> </dependency> ``` ### Gradle gradle的引入:[![jitpack](https://jitpack.io/v/shibing624/similarity.svg)](https://jitpack.io/#shibing624/similarity) ### 使用示例 ```java import org.xm.Similarity; import org.xm.tendency.word.HownetWordTendency; public class demo { public static void main(String[] args) { double result = Similarity.cilinSimilarity("电动车", "自行车"); System.out.println(result); String word = "混蛋"; HownetWordTendency hownetWordTendency = new HownetWordTendency(); result = hownetWordTendency.getTendency(word); System.out.println(word + " 词语情感趋势值:" + result); } } ``` ## 功能演示 ### 1. 词语相似度计算 文本长度:词语粒度 **推荐**使用词林相似度:`org.xm.Similarity.cilinSimilarity`,是基于[同义词词林](https://blog.csdn.net/sinat_33741547/article/details/80016713)的相似度计算方法 example: [src/test/java/org.xm/WordSimilarityDemo.java](src/test/java/org/xm/WordSimilarityDemo.java) ```java package org.xm; public class WordSimilarityDemo { public static void main(String[] args) { String word1 = "教师"; String word2 = "教授"; double cilinSimilarityResult = Similarity.cilinSimilarity(word1, word2); double pinyinSimilarityResult = Similarity.pinyinSimilarity(word1, word2); double conceptSimilarityResult = Similarity.conceptSimilarity(word1, word2); double charBasedSimilarityResult = Similarity.charBasedSimilarity(word1, word2); System.out.println(word1 + " vs " + word2 + " 词林相似度值:" + cilinSimilarityResult); System.out.println(word1 + " vs " + word2 + " 拼音相似度值:" + pinyinSimilarityResult); System.out.println(word1 + " vs " + word2 + " 概念相似度值:" + conceptSimilarityResult); System.out.println(word1 + " vs " + word2 + " 字面相似度值:" + charBasedSimilarityResult); } } ``` * result: ![word_sim result](./docs/pic/word_sim.png) ### 2. 短语相似度计算 文本长度:短语粒度 **推荐**使用短语相似度:`org.xm.Similarity.phraseSimilarity`,本质是通过两个短语具有的相同字符,和相同字符的位置计算其相似度的方法 example: [src/test/java/org.xm/PhraseSimilarityDemo.java](src/test/java/org/xm/PhraseSimilarityDemo.java) ```java public static void main(String[] args) { String phrase1 = "继续努力"; String phrase2 = "持续发展"; double result = Similarity.phraseSimilarity(phrase1, phrase2); System.out.println(phrase1 + " vs " + phrase2 + " 短语相似度值:" + result); } ``` * result: ![phrase sim result](./docs/pic/phrase_sim.png) ### 3. 句子相似度计算 文本长度:句子粒度 **推荐**使用词形词序句子相似度:`org.xm.similarity.morphoSimilarity`,一种既考虑两个句子相同文本字面,也考虑相同文本出现的前后顺序的相似度方法 example: [src/test/java/org.xm/SentenceSimilarityDemo.java](src/test/java/org/xm/SentenceSimilarityDemo.java) ```java public static void main(String[] args) { String sentence1 = "中国人爱吃鱼"; String sentence2 = "湖北佬最喜吃鱼"; double morphoSimilarityResult = Similarity.morphoSimilarity(sentence1, sentence2); double editDistanceResult = Similarity.editDistanceSimilarity(sentence1, sentence2); double standEditDistanceResult = Similarity.standardEditDistanceSimilarity(sentence1,sentence2); double gregeorEditDistanceResult = Similarity.gregorEditDistanceSimilarity(sentence1,sentence2); System.out.println(sentence1 + " vs " + sentence2 + " 词形词序句子相似度值:" + morphoSimilarityResult); System.out.println(sentence1 + " vs " + sentence2 + " 优化的编辑距离句子相似度值:" + editDistanceResult); System.out.println(sentence1 + " vs " + sentence2 + " 标准编辑距离句子相似度值:" + standEditDistanceResult); System.out.println(sentence1 + " vs " + sentence2 + " gregeor编辑距离句子相似度值:" + gregeorEditDistanceResult); } ``` * result: ![sentence sim result](./docs/pic/sentence_sim.png) ### 4. 段落文本相似度计算 文本长度:段落粒度(一段话,25字符 < length(text) < 500字符) **推荐**使用词形词序句子相似度:`org.xm.similarity.text.CosineSimilarity`,一种考虑两个段落中相同的文本,经过切词,词频和词性权重加权,并用余弦计算相似度的方法 example: [src/test/java/org.xm/similarity/text/CosineSimilarityTest.java](src/test/java/org/xm/similarity/text/CosineSimilarityTest.java) ```java @Test public void getSimilarityScore() throws Exception { String text1 = "对于俄罗斯来说,最大的战果莫过于夺取乌克兰首都基辅,也就是现任总统泽连斯基和他政府的所在地。目前夺取基辅的战斗已经打响。"; String text2 = "迄今为止,俄罗斯的入侵似乎没有完全按计划成功执行——英国国防部情报部门表示,在乌克兰军队激烈抵抗下,俄罗斯军队已经损失数以百计的士兵。尽管如此,俄军在继续推进。"; TextSimilarity cosSimilarity = new CosineSimilarity(); double score1 = cosSimilarity.getSimilarity(text1, text2); System.out.println("cos相似度分值:" + score1); TextSimilarity editSimilarity = new EditDistanceSimilarity(); double score2 = editSimilarity.getSimilarity(text1, text2); System.out.println("edit相似度分值:" + score2); } ``` * result: ```shell cos相似度分值:0.399143 edit相似度分值:0.0875 ``` ### 5. 基于义原树的情感分析 example: [src/test/java/org/xm/tendency/word/HownetWordTendencyTest.java](src/test/java/org/xm/tendency/word/HownetWordTendencyTest.java) ```java @Test public void getTendency() throws Exception { HownetWordTendency hownet = new HownetWordTendency(); String word = "美好"; double sim = hownet.getTendency(word); System.out.println(word + ":" + sim); System.out.println("混蛋:" + hownet.getTendency("混蛋")); } ``` * result: ![tendency result](./docs/pic/tendency.png) 本例是基于义原树的词语粒度情感极性分析,关于文本情感分析有[pytextclassifier](https://github.com/shibing624/pytextclassifier),利用深度神经网络模型、SVM分类算法实现的效果更好。 ### 6. 近义词推荐 example: [src/test/java/org/xm/word2vec/Word2vecTest.java](src/test/java/org/xm/word2vec/Word2vecTest.java) ```java @Test public void testHomoionym() throws Exception { List<String> result = Word2vec.getHomoionym(RAW_CORPUS_SPLIT_MODEL, "武功", 10); System.out.println("武功 近似词:" + result); } @Test public void testHomoionymName() throws Exception { String model = RAW_CORPUS_SPLIT_MODEL; List<String> result = Word2vec.getHomoionym(model, "乔帮主", 10); System.out.println("乔帮主 近似词:" + result); List<String> result2 = Word2vec.getHomoionym(model, "阿朱", 10); System.out.println("阿朱 近似词:" + result2); List<String> result3 = Word2vec.getHomoionym(model, "少林寺", 10); System.out.println("少林寺 近似词:" + result3); } ``` * 训练过程: ![word2vec train](./docs/pic/word2v.png) * result: ![word2vec result](./docs/pic/word2v_ret.png) Word2vec词向量训练用的java版word2vec训练工具[Word2VEC_java](https://github.com/NLPchina/Word2VEC_java),训练语料是小说天龙八部,通过词向量实现得到近义词。 用户可以训练自定义语料,也可以用中文维基百科训练通用词向量。 ## Todo 文本相似性度量 - [x] 关键词匹配(TF-IDF、BM25) - [x] 浅层语义匹配(WordEmbed隐语义模型,用word2vec或glove词向量直接累加构造的句向量) - [x] 深度语义匹配模型(DSSM、CLSM、DeepMatch、MatchingFeatures、ARC-II、DeepMind见MatchZoo),BERT类语义匹配模型SentenceBERT、CoSENT见[text2vec](https://github.com/shibing624/text2vec) # Contact - Issue(建议):[![GitHub issues](https://img.shields.io/github/issues/shibing624/similarity.svg)](https://github.com/shibing624/similarity/issues) - 邮件我:xuming: xuming624@qq.com - 微信我: 加我*微信号:xuming624, 备注:姓名-公司-NLP* 进NLP交流群。 <img src="docs/wechat.jpeg" width="200" /> # License 授权协议为 [The Apache License 2.0](/LICENSE),可免费用做商业用途。请在产品说明中附加*similarity*的链接和授权协议。 # Contribute 项目代码还很粗糙,如果大家对代码有所改进,欢迎提交回本项目,在提交之前,注意以下两点: - 在`test`添加相应的单元测试 - 运行所有单元测试,确保所有单测都是通过的 之后即可提交PR。 # Reference * [DSSM] Po-Sen Huang, et al., 2013, Learning Deep Structured Semantic Models for Web Search using Clickthrough Data * [CLSM] Yelong Shen, et al, 2014, A Latent Semantic Model with Convolutional-Pooling Structure for Information Retrieval * [DeepMatch] Zhengdong Lu & Hang Li, 2013, A Deep Architecture for Matching Short Texts * [MatchingFeatures] Zongcheng Ji, et al., 2014, An Information Retrieval Approach to Short Text Conversation * [ARC-II] Baotian Hu, et al., 2015, Convolutional Neural Network Architectures for Matching Natural Language Sentences * [DeepMind] Aliaksei Severyn, et al., 2015, Learning to Rank Short Text Pairs with Convolutional Deep Neural Networks
0
bit4woo/Fiora
Fiora:漏洞PoC框架Nuclei的图形版。快捷搜索PoC、一键运行Nuclei。即可作为独立程序运行,也可作为burp插件使用。
burp-extensions fiora nuclei nuclei-gui poc
## Fiora 项目简介:Fiora是LoL中的无双剑姬的名字,她善于发现对手防守弱点,实现精准打击。该项目为PoC框架[nuclei](https://github.com/projectdiscovery/nuclei)提供图形界面,实现快速搜索、一键运行等功能,提升[nuclei](https://github.com/projectdiscovery/nuclei)的使用体验。 项目地址:https://github.com/bit4woo/Fiora 项目作者:[bit4woo](https://github.com/bit4woo) 视频教程:https://www.bilibili.com/video/bv1Ha411z7T1 ## 安装运行 ### 一、作为burp插件运行 1、访问https://github.com/bit4woo/Fiora/releases 2、下载最新jar包 3、如下方法安装插件 ![image-20220101172629795](README.assets/image-20220101172629795.png) ### 二、作为独立程序运行 该程序即可作为burp插件运行,也可以作为独立程序运行。命令行下通过java启动程序的命令: ``` java -jar Fiora-202100220-jar-with-dependencies.jar ``` ![image-20220101173315536](README.assets/image-20220101173315536.png) 程序截图 ![image-20220101173647192](README.assets/image-20220101173647192.png) ### 三、最新源码尝鲜 #### 自行打包 当你遇到bug或者想使用最新的功能时,可以使用如下方法自行打包。 ``` git clone https://github.com/bit4woo/Fiora cd Fiora mvn package ``` #### 关于"burp-api-common"下载失败 如果没有使用过GitHub Packages,则需要创建或修改/Users/xxxxxx/.m2/setttings.xml 文件 https://github.com/settings/tokens ``` <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <activeProfiles> <activeProfile>github</activeProfile> </activeProfiles> <profiles> <profile> <id>github</id> <repositories> <repository> <id>central</id> <url>https://repo1.maven.org/maven2</url> </repository> <repository> <id>github</id> <url>https://maven.pkg.github.com/bit4woo/*</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <servers> <server> <id>github</id> <username>你的GitHub用户名</username> <password>你的GitHub access token 通过https://github.com/settings/tokens获取</password> </server> </servers> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding> </properties> </settings> ``` `</repository>` 和`<server>` 中的内容是你需要配置的。` <repository>`中的内容你可以直接复制粘贴。 ``` <repository> <id>github</id> <url>https://maven.pkg.github.com/bit4woo/*</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> ``` 而`<server>` 中的内容就必须用自己的了。通过https://github.com/settings/tokens获取你的GitHub access token ``` <server> <id>github</id> <username>你的GitHub用户名</username> <password>你的GitHub access token 通过https://github.com/settings/tokens获取</password> </server> ``` 完成后再进行步骤一的操作即可。 ## 注意说明 1、你需要自行安装nuclei到本地环境,并且将命令加入环境变量。安装方法可以参考[官方文档](https://nuclei.projectdiscovery.io/nuclei/get-started/#running-nuclei)。 2、nuclei的模板文件存放的默认路径是当前用户路径下,即 YourUserHome/nuclei-templates。 ## 使用方法 以grafana的PoC为例。 ### 搜索PoC 程序会自动扫描nuclei-templates目录下的所有PoC文件,并加载进程序中,可以通过关键词搜索来找到想要的PoC。 ![image-20220101194244053](README.assets/image-20220101194244053.png) ### 生成PoC命令 选中想要的PoC,右键选择“generate Command Of This PoC”即可。命令会写入剪切板,直接粘贴运行即可。优点是可以对命令行进行再次编辑,但是需要自行粘贴后运行。 ![image-20220101195315472](README.assets/image-20220101195315472.png) ``` #生产的单个PoC nuclei -t C:\Users\P52\nuclei-templates\vulnerabilities\grafana\grafana-file-read.yaml -u http://example.com -proxy http://127.0.0.1 #生产workflow PoC nuclei -w C:\Users\P52\nuclei-templates\workflows\grafana-workflow.yaml -u http://example.com -proxy http://127.0.0.1 nuclei -tags grafana -u http://example.com -proxy http://127.0.0.1 ``` ### 直接执行PoC 和生成PoC命令类似,但是它会直接执行生成的命令,不需要粘贴。优点是更便捷,但是无法编辑命令行。 ![image-20220101200920749](README.assets/image-20220101200920749.png) ### 关于RobotInput RobotInput选项会影响命令执行的方式。 **当启用RobotInput时**,会尝试先开启一个命令行终端,然后以模拟键盘输入的方式进行命令的执行。优点是:效果类似人为交互,会在命令行终端留下历史记录。缺点是:这个方式受程序响应速度、剪切板读写是否成功的影响,不是很稳定,某些情况会出现混乱错误。 **当停用RobotInput时**,会将所有命令先写入bat文件,然后运行bat文件,来实现系统命令的执行。优缺点刚好相反:功能稳定,但是不会留下命令行历史记录。
0
ferredoxin/QNotified
一个旨在使QQ变得更好用的开源Xposed模块
qq xposed xposed-module
# QNotified ![QNotified logo](https://raw.githubusercontent.com/ferredoxin/QNotified/master/docs/title.png) --- [![Build Status](https://dev.azure.com/Cryolitia/QNotified/_apis/build/status/ferredoxin.QNotified?branchName=master)](https://dev.azure.com/Cryolitia/QNotified/_build/latest?definitionId=1&branchName=master) [![license](https://img.shields.io/github/license/ferredoxin/QNotified.svg)](https://www.gnu.org/licenses/agpl-3.0.html) [![GitHub release](https://img.shields.io/github/release/ferredoxin/QNotified.svg)](https://github.com/ferredoxin/QNotified/releases/latest) QNotified 是一个旨在使 QQ 变得更好用的开源 Xposed 模块 **[持续集成版本下载](https://install.appcenter.ms/orgs/qnotifieddev/apps/qnotified/distribution_groups/alpha)** ## 使用方法 激活本模块后,在 QQ/TIM 自带设置中点击 QNotified 即可开关对应功能。 ## 一切开发旨在学习,请勿用于非法用途 - 本项目保证永久开源,欢迎提交 PR,但是请不要提交用于非法用途的功能。 - 如果某功能被大量运用于非法用途或严重侵害插件使用者权益,那么该功能将会被移除。 - 本模块完全免费开源, 近期发现模块倒卖现象严重,请勿上当 - 鉴于项目的特殊性,开发团队可能在任何时间**停止更新**或**删除项目** ### 许可证 - [EULA](https://github.com/qwq233/License/blob/master/v2/LICENSE.md) ``` 版权所有©2022 gao_cai_sheng <qwq233@qwq2333.top, qwq2333.top> 允许在遵守 CC BY-NC-SA 4.0 协议的同时,复制和分发此协议文档的逐字记录副本,且允许对其进行更改,但必须保留其版权信息与原作者。如果您提出申请特殊权限,协议作者可在其口 头或书面授予任何人任何但不包括以盈利为目的的使用本协议的权利。 请务必仔细阅读和理解通用许可协议书中规定的所有权利和限制。在使用前,您需要仔细阅读并决定接受或不接受本协议的条款。除非或直至您接受本协议的条款,否则本作品及其相关副本、相关程序代码或相关资源不得在您的任何终端上下载、安装或使用。 您一旦下载、使用本作品及其相关副本、相关程序代码或相关资源,即表示您同意接受本协议各项条款的约束。如您不同意本协议中的条款,您则应当立即删除本作品、附属资源及其相关源代码。 本作品权利只许可使用,而不出售。 ``` ## 功能介绍 <details> <summary>目前已开发功能</summary> 1. 隐藏消息列表小程序入口 2. 去除回复自动 at 3. 语音消息转发 4. 强制默认气泡 5. 以图片方式打开闪照(原辅助模块) 6. 以图片方式打开表情包(原 QQ 净化) 7. Ark(json)/StructMsg(xml)卡片消息(注 1,原 BUG 复读机) 8. 复读机(+1,原 QQ 复读机) 9. 被删好友通知(可导出好友列表) 10. 防撤回 11. 签到文本化,隐藏礼物动画 12. 简洁模式圆头像(原花 Q) 13. 自定义电量 14. 转发消息点击头像查看原消息发送者和所在群 15. 下载重定向(原 QQ 净化) 16. 屏蔽 \@全体成员 或者 群红包 的通知(不影响接收消息,不影响某些插件抢红包功能) 17. 屏蔽 QQ 更新提示 18. 屏蔽 QQ 空间点赞通知 19. 禁止聊天界面输入$自动弹出 选择赠送对象 窗口 20. 直接打开不可通过 QQ 号码搜索到用户的资料卡 21. 屏蔽秀图 22. 显示进行禁言操作的管理员(查看哪个管理员禁言了你) 23. 去除夜间模式聊天界面深色遮罩 24. 直接打开指定用户资料卡(无视隐藏 QQ 号) 25. 自定义+1 图标 26. 群发文本消息(注 1) 27. 显示具体消息数量而不是 99+(原花 Q) 28. 隐藏侧滑群应用 29. 隐藏好友侧滑亲密抽屉 30. 使用系统相机 31. 使用系统相册 32. 使用系统文件 33. 聊天自动发送原图 34. 隐藏小红点 35. 隐藏群在线人数 36. 隐藏群总人数 37. 批量撤回消息 38. 隐藏移出群助手提示 39. 修改消息左滑回复 40. at 界面以管理员优先顺序排序 41. 自动续火 42. 静默指定类型通知 43. 聊天字数统计 44. 自定义钱包显示余额 45. 显示消息发送者 QQ 号与时间 46. 聊天自动发送/接收原图 注 1: 卡片消息及群发文本这两个功能因大量被用于广告引流而被加以限制 </details> ### [计划或正在开发的功能](https://github.com/ferredoxin/QNotified/projects/2) ### 不会支持的功能 - 抢红包 - 群发图片或其他类型消息 ## 发行渠道说明 <details> QNotified 将为分`Beta`、`Alpha`、`Canary`三个版本:`Beta`版本为重大功能变更或长期积累更新,发布频率由开发组决定,包含上次`Beta`版至今的所有功能更新及 Bug 修复,但可能不包括尚未稳定或正在开发中的功能,原则上更新频率将大于两周一次;`Alpha`版本为每周积累更新,在每周周末由开发组发布,包含发布时的全部更新,可能包含不稳定功能或异常问题;`Canary`版本为每 commit 自动更新,可能不包含外围文档或 CI 流程更新,不会编写任何更新文档或说明,具体更新内容可在[Github](https://github.com/ferredoxin/QNotified/commits/master)自行查看,本更新由开源的流程(包括 Azure 和开发组自研 Bot)自动编译发布,可能包含严重的功能及行为异常。 开发组不限制用户选择自己需要的版本,同时也不为任何版本产生的任何后果承担任何责任(详情请见[QNotified EULA](https://github.com/ferredoxin/QNotified/blob/master/app/src/main/assets/eula.md)),但希望各位用户各取所需,根据自己的能力范围选择适合自己的版本。 QNotified 的版本号组成为`x.y.z.w`,正常情况下`x`位将一直保持为 0,`Beta`版本更新会将`y`位+`1`并使 z 位归零,`Alpha`版本更新会将`z`位+`1`,所有版本更新的`w`位都会是触发此次更新的 Commit 的 hash 的前 7 位。 1. [@QNotified 频道](https://t.me/QNotified) 将只发布`Beta`版和`Alpha`版更新。 2. [@QNotified_CI](https://t.me/QNotified_CI) 频道将只发布`Canary`版更新。 3. [Github Release](https://github.com/ferredoxin/QNotified/releases/) 将只发布`Beta`版更新。 4. [App Center - Alpha](https://install.appcenter.ms/orgs/qnotifieddev/apps/qnotified/distribution_groups/alpha) 发布`CI`版本更新;[App Center - Weekly](https://install.appcenter.ms/orgs/qnotifieddev/apps/qnotified/distribution_groups/weekly) 发布`Alpha`版本更新。两个轨道均开放给所有人自由下载。 5. [Google Play](https://play.google.com/store/apps/details?id=nil.nadph.qnotified) 将发布`Beta`版和`Alpha`版更新。其中`Beta`版更新将在 Google Play 上以正式版轨道发布,`Alpha`版更新将在 Google Play 上以开放性测试轨道发布。任何可以登录 Google Play 的人都可自由加入或退出 Google Play 上 QNotified 的开放测试。 6. [Xposed 仓库](https://repo.xposed.info/module/nil.nadph.qnotified) 将发布`Beta`版和`Alpha`版更新。其中`Beta`版更新将被标注为 Stable,`Alpha`版更新将被标注为 Beta。 7. [LSPosed 仓库](https://github.com/Xposed-Modules-Repo/nil.nadph.qnotified/releases/) 将发布所有版本更新,其中`CI`版本更新将被标注为 Pre-release。 </details> ## 开始贡献 - [CONTRIBUTING](https://github.com/ferredoxin/QNotified/blob/master/CONTRIBUTING.md) ## 赞助 - 由于项目的特殊性,我们不接受任何形式的捐赠,但是我们希望有更多的人能够参与本项目的开发 ## [通用许可协议](https://github.com/qwq233/License/blob/master/v2/LICENSE.md)
0
ofdrw/ofdrw
OFD Reader & Writer 开源的OFD处理库,支持文档生成、数字签名、文档保护、文档合并、转换、导出等功能,文档格式遵循《GB/T 33190-2016 电子文件存储与交换格式版式文档》。
null
# OFD Reader & Writer ![-](https://img.shields.io/badge/java-%3E%3D1.8-blue) ![Maven Central](https://img.shields.io/maven-central/v/org.ofdrw/ofdrw) [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE) 在使用OFDRW前,请务必悉知 [***《OFD Reader & Writer免责声明》***](免责声明.md)! > 若clone和文档预览存在困难,请移步 [https://gitee.com/ofdrw/ofdrw](https://gitee.com/ofdrw/ofdrw) **Talk is cheap,Show me the code. ——Linus Torvalds** <p align="center"> <img width="275" height="275" src="./img/icon2.png"> </p> OFD Reader & Writer 开源的OFD处理库,支持文档生成、数字签名、文档保护、文档合并、转换、导出等功能。 本项目采用[Apache 2.0许可](./LICENSE),请尊重开源项目作者,在软件中附带OFDRW开源软件许可,**在遵守开源协议前提下可免费商业化使用**。 根据[《GB/T 33190-2016 电子文件存储与交换格式版式文档》](./GBT_33190-2016_电子文件存储与交换格式版式文档.pdf)标准实现版式文档OFD库(含有书签)。 项目采用Maven模块管理,各模块如下: - [**ofdrw-core**](./ofdrw-core) OFD核心API,参考[《GB/T 33190-2016 电子文件存储与交换格式版式文档》](./GBT_33190-2016_电子文件存储与交换格式版式文档.pdf)实现的基础数据结构。 - [**ofdrw-font**](./ofdrw-font) 生成OFD字体相关。 - [**ofdrw-layout**](./ofdrw-layout) OFD布局引擎库,用于文档构建和渲染。 - [**ofdrw-pkg**](./ofdrw-pkg) OFD文件的容器,用于文档的打包。 - [**ofdrw-reader**](./ofdrw-reader) OFD文档解析器,用于OFD的反序列化以及签名签章。 - [**ofdrw-sign**](./ofdrw-sign) OFD文档数字签章。 - [**ofdrw-gm**](./ofdrw-gm) 用于支持签章模块需要的国密电子签章数据结构。 - [**ofrw-crypto**](./ofdrw-crypto) 用于实现《GM/T 0099-2020 开放版式文档密码应用技术规范》对OFD的密码相关功能。 - [**ofdrw-gv**](./ofdrw-gv) OFDRW 所有模块所共用的全局变量。 - [**ofdrw-converter**](./ofdrw-converter) OFD文档转换。 - [**ofdrw-tool**](./ofdrw-tool) OFD文档工具,文档合并、裁剪、重组。 - [**ofdrw-graphics2d**](./ofdrw-graphics2d) 实现了AWT Graphics2D接口,生成OFD文档内容。 - [**ofdrw-full**](./ofdrw-full) 上述所有模块整合包,用于简化依赖引入。 注: - 您可以根据需求裁剪模块优化程序体积。 - 您可以仅引用`ofdrw-core`中定义的数据结来构建属于您自己的OFD库,就像[ofdrw-graphics2d](./ofdrw-graphics2d)那样。 ## QuickStart Maven项目引入依赖 ```xml <dependency> <groupId>org.ofdrw</groupId> <artifactId>ofdrw-full</artifactId> <version>2.2.12</version> </dependency> ``` **OFDRW 将持续保证API的向下兼容,您可以放心的升级OFDRW库至最新版本。** > - 若您没有采用Maven管理项目,请参阅项目中`pom.xml`文件中的依赖,手动解决三方依赖包问题。 > - 若出现NoClassFound等错误,请检查相关包是否存在冲突。 如何生成一份OFD文档,如何把大象放入冰箱? ```java public class HelloWorld { public static void main(String[] args) throws IOException { Path path = Paths.get("HelloWorld.ofd"); try (OFDDoc ofdDoc = new OFDDoc(path)) { Paragraph p = new Paragraph("你好呀,OFD Reader&Writer!"); ofdDoc.add(p); } System.out.println("生成文档位置: " + path.toAbsolutePath()); } } ``` 效果如下: ![示例](./ofdrw-layout/doc/layout/示例.png) - [文档生成API示例](./ofdrw-layout/src/test/java/org/ofdrw/layout/OFDDocTest.java) - [文档布局示例](./ofdrw-layout/src/test/java/org/ofdrw/layout/LayoutTest.java) - [Canvas示例](./ofdrw-layout/src/test/java/org/ofdrw/layout/element/canvas/DrawContextTest.java) - [文字抽取示例](./ofdrw-reader/src/test/java/org/ofdrw/reader/ContentExtractorTest.java) - [水印示例](./ofdrw-layout/src/test/java/org/ofdrw/layout/cases/watermark/WatermarkTest.java) - [段落布局示例](./ofdrw-layout/src/test/java/org/ofdrw/layout/ParagraphLayoutDemo.java) - [文档编辑示例](./ofdrw-layout/src/test/java/org/ofdrw/layout/DocEditDemos.java) - [数字签名清理示例](./ofdrw-sign/src/test/java/org/ofdrw/sign/SignCleanerTest.java) 相关文档目录: - [OFD R&W 布局设计](./ofdrw-layout/doc/layout/README.md) - [OFD R&W Canvas](./ofdrw-layout/doc/canvas/README.md) - [OFD R&W 签名签章快速入门](./ofdrw-sign/doc/quickstart/README.md) - [OFD R&W 加密 完整性保护协议](./ofdrw-crypto/README.md) - [OFD R&W 转换OFD/OFD导出 ](./ofdrw-converter/README.md) - [OFD R&W 字形数据解析](./ofdrw-converter/src/main/java/org/ofdrw/converter/font/README.md) - [OFD R&W 文档合并](./ofdrw-tool/README.md) - [OFD R&W 区域占位区块(类表单效果)](./ofdrw-layout/doc/areaholderblock/README.md) - [OFD R&W 单元格元素 使用指南](./ofdrw-layout/doc/cell/README.md) - [OFD R&W 内容生成 事件处理](./ofdrw-layout/doc/onpage/README.md) - [OFD R&W 附件操作](./ofdrw-layout/doc/attachment/README.md) ### 相关解决方案 #### HTML5 HTML5前端预览解决方案: [DLTech21/ofd.js . https://github.com/DLTech21/ofd.js](https://github.com/DLTech21/ofd.js) - `jszip`解压。 - `fast-xml-parser`解析xml为json数据。 - `svg`及`canvas`渲染实现。 - 完全浏览器OFD页面渲染。 #### 开源阅读器 **XilouReader**:[chingliu/XilouReader . https://gitee.com/chingliu/XilouReader](https://gitee.com/chingliu/XilouReader) - 基于pdfium的ofd/pdf双引擎版式阅读器。 **OfdiumEx**:[roy19831015/OfdiumEx . https://github.com/roy19831015/OfdiumEx](https://github.com/roy19831015/OfdiumEx) - 基于cairo库渲染OFD。 - Windows客户端阅读器 #### 图片转换 > 目前已经被合并到`ofdrw-converter` 模块 推荐开源OFD图片转换解决方案: [QAQtutu/ofdbox . https://github.com/QAQtutu/ofdbox](https://github.com/QAQtutu/ofdbox) - 支持OFD解析。 - 基于java.awt解析OFD实现图片绘制。 #### 阅读器 阅读器方面,您也可以尝试: - [数科网维公司 . 数科OFD阅读器 . www.ofd.cn](https://www.ofd.cn/) - [Foxit . 福昕OFD . www.foxitsoftware.cn/ofd/](https://www.foxitsoftware.cn/ofd/) ## 源码安装 > 支持 ***JDK 1.8*** 及以上版本构建。 在项目根目录下运行: ```bash mvn install ``` 就可以完成项目的构建打包,安装到本地Maven仓库中。 ## 社区交流 ***Share and Communicate*** <p align="center"> <img width="150" height="150" src="./img/comm.png"> </p> 为方便社区建设与交流,提供社区QQ群: - 05群号: **762837395** - 04群号: **690642037**(满) - 03群号: **717320255**(满) - 02群号: **745517934**(满) - 01群号: **577682453**(满) <p align="center"> <img width="375" height="672" src="./img/QQLink.jpg"> </p> > - 若您遇到与OFD相关的技术问题,欢迎进群交流! > - 若您对项目有建设性意见或方案欢迎提交**Issue**与**Pull Request**。 ## 参与贡献 参与贡献代码尽量遵守下面代码规约: 1. **原则上禁止`public`方法、类、接口进行删除**:为了保留向下兼容性,如果是更新升级请标注过去已经暴露方法、接口、类为过时标记`@Deprecated`,并注释置新的实现位置`@deprecated {@link SomethingNew}`。 2. **请为每个`public`方法、类、接口添加注释**:为了保留开发者的便利性,注释一般为多行注释,注释内容需要包含参数以及方法或类的作用、参数意义、返还值以及意义、异常抛出、以及参数意义。 [>> GitHub 第一次参与开源(多语言)](https://github.com/firstcontributions/first-contributions) > - [贡献指南](CONTRIBUTING.md)。 ## 项目情况 ### 进展 [>> 项目进展](releasenotes.md) > 在OFDRW 2.0.0之后,项目进展以发布说明的方式在项目托管仓库中描述。 ### 项目关注度 > 项目获得 Star曲线 [![Stargazers over time](https://starchart.cc/ofdrw/ofdrw.svg)](https://starchart.cc/ofdrw/ofdrw)
0
bytedance/CodeLocator
null
null
**[English](README_en.md)** | 简体中文 # CodeLocator [![GitHub license](https://img.shields.io/github/license/bytedance/scene)](https://github.com/bytedance/scene/blob/master/LICENSE) [![API](https://img.shields.io/badge/api-16%2B-green)](https://developer.android.com/about/dashboards) 一张图带你了解CodeLocator <img src="misc/CodeLocator.gif" alt="CodeLocator"/> CodeLocator是一个包含Android SDK 与 Android Studio插件的Android工具集, 包含如下的功能(目前仅支持Mac, Windows): 1. 展示当前的View视图 2. 展示当前的Activity信息 3. 展示当前所有Fragment的信息 4. 展示自定义的App运行时信息 5. 展示当前应用的文件信息 6. 实时编辑View的状态, 如可见性, 文本内容等 7. 定位当前响应触摸事件的View 8. 获取当前View绑定的数据 9. 获取当前View对应的绘制内容 10. 跳转View的点击事件代码, findViewById, ViewHolder的代码位置 11. 跳转View的xml布局文件 12. 跳转Toast, Dialog的显示代码位置 13. 跳转启动当前Activity的代码位置 14. 展示应用支持的所有Schema信息 15. 向应用发送指定Schema 16. 定位项目内最新的Apk文件 17. apk文件支持右键安装 18. 快速打开显示布局边界, 过渡绘制, 点按操作等 19. 快速连接Charles代理 ## 这些App正在使用 CodeLocator | <img src="misc/douyin.png" alt="douyin" width="100"/> | <img src="misc/douyin.png" alt="tiktok" width="100"/> | <img src="misc/duoshan.png" alt="duoshan" width="100"/> | <img src="misc/resso.png" alt="resso" width="100"/> | <img src="misc/xigua.png" alt="xigua" width="100"/> | |:---------:|:-------:|:-------:|:-------:|:-------:| | 抖音 | TikTok | 多闪 | Resso | 西瓜视频 | | <img src="misc/helo.png" alt="helo" width="100"/> |<img src="misc/feishu.png" alt="feishu" width="100"/> |<img src="misc/qingbei.png" alt="qingbei" width="100"/> | <img src="misc/fanqie.png" alt="fanqie" width="100"/> |<img src="misc/qingyan.png" alt="qingyan" width="100"/> | |:---------:|:-------:|:-------:|:-------:|:-------:| | Helo | 飞书 | 清北网校 | 番茄小说 | 轻颜相机 | | <img src="misc/huoshan.png" alt="huoshan" width="100"/> | <img src="misc/guagualong.png" alt="guagualong" width="100"/> | <img src="misc/jianying.png" alt="jianying" width="100"/> | <img src="misc/fanqiefm.png" alt="fanqiefm" width="100"/> | <img src="misc/xingfuli.png" alt="xingfuli" width="100"/> | |:---------:|:-------:|:-------:|:-------:|:-------:| | 抖音火山版 | 瓜瓜龙 | 剪映 | 番茄畅听 | 幸福里 | ## 集成说明 按照如下操作即可使用CodeLocator: 1. 在Android Studio中安装CodeLocator插件([点此下载最新版插件](https://github.com/bytedance/CodeLocator/releases)), 也可直接在插件商店搜索 CodeLocator 2. App中集成CodeLocator ```gradle allprojects { repositories { mavenCentral() maven { url "https://jitpack.io" } } } // 集成基础能力, 只需要添加一行依赖即可 dependencies { // 依赖androidx, 已升级AndroidX的项目集成下面的依赖 implementation "com.bytedance.tools.codelocator:codelocator-core:2.0.4" // 未升级AndroidX的项目集成下面的依赖 support版本不再维护 请升级androidx implementation "com.bytedance.tools.codelocator:codelocator-core-support:2.0.0" } ``` 如果需要集成代码跳转能力, <mark>需要先集成 [Lancet](https://github.com/eleme/lancet)</mark>, 同时添加如下依赖 ```gradle apply plugin: 'me.ele.lancet' dependencies { // 两种依赖方式 // 依赖lancet-all, 则包含所有lancet能力 debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-all:2.0.4" // 分别依赖对应的lancet模块, 包含相对应的跳转能力 debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-xml:2.0.4" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-activity:2.0.4" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-view:2.0.4" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-toast:2.0.4" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-dialog:2.0.4" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-popup:2.0.4" // 如果未升级AndroidX, 可使用下方的依赖 support版本不再维护 请升级androidx debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-all-support:2.0.0" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-xml-support:2.0.0" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-activity-support:2.0.0" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-view-support:2.0.0" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-toast-support:2.0.0" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-dialog-support:2.0.0" debugImplementation "com.bytedance.tools.codelocator:codelocator-lancet-popup-support:2.0.0" } ``` ## 使用说明 CodeLocator插件是一个侧边栏插件, 安装后展示在Android Studio的右侧, 点击可展开 初始状态如下: <img src="misc/codelocator_init.png" alt="codelocator_init" width="680"/> 绿色按钮表示可点击, 灰色表示当前不可操作 点击抓取按钮后, 可获得当前应用的状态信息, 左边的图片面板可点击选择对应的View, 按钮状态会根据当前选中的View做出相对应的变化 <img src="misc/codelocator_grab.png" alt="codelocator_grab" width="680"/> 更多操作可查看文档 [CodeLocator使用说明](how_to_use_codelocator_zh.md) ## 联系我们 如果你有任何关于CodeLocator的问题或建议,可以加入到微信群与我们沟通交流。 <img src="misc/my_wechat.png" alt="WeChat" /> 除此之外,你也可以发邮件到邮箱:liujian.android@bytedance.com, 在邮件中详细描述你的问题。 也欢迎投递简历~ ## License ~~~ Copyright (c) 2024 ByteDance 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. ~~~ *** The following components are provided under an Apache 2.0 license. 1. lancet - For details, https://github.com/eleme/lancet 2. okhttp - For details, https://github.com/square/okhttp 3. gson - For details, https://github.com/google/gson
0
mgarin/weblaf
WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
components cross-platform java look-and-feel skin swing swing-components ui weblaf
About ---------- [![Latest Version](https://img.shields.io/github/release/mgarin/weblaf.svg)](https://github.com/mgarin/weblaf/releases) [![Latest Version](https://img.shields.io/maven-central/v/com.weblookandfeel/weblaf-parent)](https://search.maven.org/search?q=g:com.weblookandfeel) [![Languages](https://img.shields.io/github/languages/top/mgarin/weblaf)](https://github.com/mgarin/weblaf) [![License](https://img.shields.io/github/license/mgarin/weblaf)](https://github.com/mgarin/weblaf/blob/master/LICENSE.txt) [![Last Commit](https://img.shields.io/github/last-commit/mgarin/weblaf)](https://github.com/mgarin/weblaf/commits/master) [![Chat on Gitter](https://img.shields.io/gitter/room/mgarin/weblaf?color=%2342ac8c)](https://gitter.im/mgarin/weblaf) **WebLaf** is a fully open-source Look and Feel and component library written in pure Java for cross-platform desktop Swing applications. But it is also more than just that - it was made with intention of covering pretty much all aspects of UI development and at this point WebLaF includes an extensive set of features that goes beyond just Look and Feel or Swing component library. To look at some features provided by WebLaF I recommend checking out the demo - [![DemoApplication](./screenshots/demo.png)](https://github.com/mgarin/weblaf/releases/download/v1.2.13/weblaf-demo-1.2.13-jar-with-dependencies.jar) [![DemoApplication](./screenshots/demo-dark.png)](https://github.com/mgarin/weblaf/releases/download/v1.2.13/weblaf-demo-1.2.13-jar-with-dependencies.jar) It is an [executable JAR](https://github.com/mgarin/weblaf/releases/download/v1.2.13/weblaf-demo-1.2.13-jar-with-dependencies.jar) which you can run if you have JRE 6 or higher installed. **Features** - Fully reskinnable UI with a few predefined skins available out-of-the-box - Wide range of popular custom components and features - Advanced versions of all basic Swing components - RTL orientation support for basic Swing and custom components - Multi-language support for all UI elements - Advanced API for providing UI element tooltips - Advanced API for saving and restoring UI element states - Advanced API for assigning hotkeys to UI elements and actions - Countless utilities for convenient work with Swing APIs - Application plugin support - And more... **WebLaF project** - [Fully open-source without any hidden proprietary code](https://github.com/mgarin/weblaf) - [Have been developed for 10+ years](https://github.com/mgarin/weblaf/releases) - [Constantly growing and being improved](https://github.com/mgarin/weblaf/projects) - [Open for any suggestions and improvements](https://github.com/mgarin/weblaf/blob/master/CONTRIBUTING.md) Quick start ---------- **Including WebLaF in your project (Maven)** If you are working with a Maven project you can simply add dependency for `weblaf-ui` module: ```xml <dependency> <groupId>com.weblookandfeel</groupId> <artifactId>weblaf-ui</artifactId> <version>1.2.14</version> </dependency> ``` You can also use `RELEASE` or `LATEST` version instead of specific one. **Including WebLaF in your project (binaries)** You can always find latest WebLaF binaries in [releases section](https://github.com/mgarin/weblaf/releases). These are the very same binaries that are available through Maven, simply copied over to release section for convenience. Don't forget to download all dependencies in this case as well, they are always linked at the end of release notes. If you aren't sure which binaries to use or which dependencies you might be missing - I recommend reading [How to use WebLaF](https://github.com/mgarin/weblaf/wiki/How-to-use-WebLaF) wiki article - it gives a short explanation on what each module does and requires. **Installing L&F** You can install WebLaF by simply calling `WebLookAndFeel.install ()` or using one of standard Swing `UIManager` methods: ```java public class QuickStart { public static void main ( final String[] args ) { // You should always work with UI inside Event Dispatch Thread (EDT) // That includes installing L&F, creating any Swing components etc. SwingUtilities.invokeLater ( new Runnable () { @Override public void run () { // Install WebLaF as application LaF WebLookAndFeel.install (); // You can also specify preferred skin right-away // WebLookAndFeel.install ( WebDarkSkin.class ); // You can also do that in one of the old-fashioned ways // UIManager.setLookAndFeel ( new WebLookAndFeel () ); // UIManager.setLookAndFeel ( "com.alee.laf.WebLookAndFeel" ); // UIManager.setLookAndFeel ( WebLookAndFeel.class.getCanonicalName () ); // You can also configure other WebLaF managers as you like now // StyleManager // SettingsManager // LanguageManager // ... // Initialize your application once you're done setting everything up // JFrame frame = ... // You can also use Web* components to get access to some extended WebLaF features // WebFrame frame = ... } } ); } } ``` That's it, now your application is using WebLaF. **Helpful articles** If you are new to Swing I recommend reading official Oracle articles about it first: - [Creating a GUI with JFC/Swing](https://docs.oracle.com/javase/tutorial/uiswing/index.html) It is also important to understand how threading should be approached when working with Swing: - [Event Dispatch Thread](https://github.com/mgarin/weblaf/wiki/Event-Dispatch-Thread) And if are new to WebLaF - I recommend checkin out these wiki articles first: - [How to use WebLaF](https://github.com/mgarin/weblaf/wiki/How-to-use-WebLaF) - [Styling introduction](https://github.com/mgarin/weblaf/wiki/Styling-introduction) You can also check [other wiki articles](https://github.com/mgarin/weblaf/wiki) - there are quite a few available for different WebLaF components and features and they might save you a lot of time. **Sources** One last thing - I higly recommend having WebLaF sources attached to your IDE project. I'm doing my best to keep it clean and well-documented, so if you are wondering what some method does or how a feature works - peeking into the source code might be the easiest and fastest way to find out. All of WebLaF source code is fully disclosed and available here on GitHub. Source code for releases is available in [releases](https://github.com/mgarin/weblaf/releases) section and on [Maven](https://search.maven.org/search?q=g:com.weblookandfeel). Dependencies ---------- Even though I'm trying to keep the minimal amount of dependencies on 3rd-party libraries - WebLaF has quite a few at this point, so it is worth explaining which dependencies are used for what. First, here are direct library dependencies you may find across different WebLaF modules: - [**Slf4j**](http://www.slf4j.org/) is one of the most commonly used logging tools and also offers nice options for bridging logging over to other popular tools, so this was the obvious choice. Originally I used older [log4j](https://logging.apache.org/log4j/) verson, but moved on from it due to some restrictions and nuances. - [**XStream**](https://x-stream.github.io/) is used for serializing and deserializing objects to and from XML. `LanguageManager` uses it to read translation files. `SetingsManager` uses it to store and read various settings. `StyleManager` uses it to read skins and skin extensions. `IconManager` uses it to read icon sets. `PluginManager` uses it to read plugin descriptors found in plugin JAR file. It is also used for variety of smaller features across WebLaF library. - [**SVG Salamander**](https://svgsalamander.java.net/) is a standalone library providing loading, modification and rendering capabilities for SVG icons. Unlike [Apache Batik](https://xmlgraphics.apache.org/batik/) it is way more lightweight and often able to render SVG icons slightly faster. It does have a few issues and I plan to make an abstract API for SVG icons support to allow choice between SVG Salamander and Apache Batkin in the future as explained in [#337](https://github.com/mgarin/weblaf/issues/337). It is also important to note that currently I'm using my own release of [SVG Salamander fork](https://github.com/mgarin/svgSalamander) that contains latest changes from original project and some minor non-API-breaking improvements added on top of it. - [**Java Image Scaling**](https://github.com/mortennobel/java-image-scaling/) is a lightweight library used in `ImageUtils` exclusively for better downscaling of raster images in runtime. - [**Jericho HTML parser**](http://jericho.htmlparser.net/) is used in `HtmlUtils` for rendering HTML into plain text. It is also used for quick tag lookup in `StyleEditor`. Potentially I might move this dependency as well as `StyleEditor` into a separate module(s) as described in [#336](https://github.com/mgarin/weblaf/issues/336). - [**RSyntaxTextArea**](http://bobbylight.github.io/RSyntaxTextArea/) is used for providing a styleable text area supporting syntax highlighting for multple programming languages. It is also used in `DemoApplication` for styles and code preview and in `StyleEditor` for style preview and editing. There are also a few code pieces borrowed from other open-source projects: - `TableLayout` implementation is based on [Clearthought](http://www.clearthought.info/) source code, but has some minor modifications and fixes added on top of it. - Various image filters and utilities found in `com.alee.graphics.filters` as well as strokes found in `com.alee.graphics.strokes` packages are based on [JH Labs](http://www.jhlabs.com/) examples, but slightly cleaned up and with a few minor improvements added. - `Easing` interface implementations are based on [jQuery Easing Plugin](http://gsgd.co.uk/sandbox/jquery/easing/) source code, but ported to Java and adjusted to better fit into custom animation system implemeted in WebLaF. - `IOUtils` implementation is based on [Apache Commons IO](https://commons.apache.org/proper/commons-io/) source code, but since it only uses a fraction of it's functionality I didn't want to include it as dependency. - Classes backing `GifIcon` implementation were originally made available by Kevin Weiner at http://www.fmsware.com/stuff/gif.html, which states that the code "may be freely used for any purpose. Unisys patent restrictions may apply to the LZW portions". [Unisys and LZW patent enforcement](https://en.wikipedia.org/wiki/GIF#Unisys_and_LZW_patent_enforcement) for reference. Code logic was mostly untouched, but I did a refactoring pass and fixed a few possible minor issues. Other non-code mentions: - Raster icons are mostly coming from [Fugue](https://p.yusukekamiyamane.com/) icon set. - SVG icons are mostly coming from [IconMoon](https://icomoon.io/) icon set. It is also important to mention that all dependencies and borrowed code pieces are properly attributed within the library source code itself and within available binary distributions. Java 9+ ---------- Starting from Java 9 once you run an application with WebLaF you will most probably see next warning: ``` WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.alee.utils.ReflectUtils (file:weblaf-core-x.x.x.jar) to method {method.name} WARNING: Please consider reporting this to the maintainers of com.alee.utils.ReflectUtils WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release ``` Or a similar one pointing at a different JAR or method. This warning appears because WebLaF uses Reflection API a lot to access various private/proprietary Java features as it is nearly impossible to have a robust Look and Feel otherwise due to Swing limitations and some bad Sun/Oracle design decisions. Starting from Java 9 - such "unauthorized" access displays a warning like the one shown above. Also starting from Java 12 some of Reflection API features were made unavailable, but I already added a workaround for that which is available (and enabled by default) within release artifacts on both GitHub and Maven. This workaround uses new backward-compatible multi-release JAR feature to provide a separate code implementation for Java 12+ runtime. Problem is - it is still impossible to fully "fix" these warnings from the library side. To avoid seeing them - your application must specify at launch which modules specifically should be accessible to other modules through Reflection API. If suchs permissions are not given or given incorrectly - you will keep encountering warnings (or even errors) from above pointing at "illegal" reflective access point. Here is a list of JVM options that can be used with Java 9 and higher to avoid the warnings: ``` --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/jdk.internal.loader=ALL-UNNAMED --add-opens java.desktop/javax.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.desktop/java.awt.geom=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.beans=ALL-UNNAMED --add-opens java.desktop/javax.swing.table=ALL-UNNAMED --add-opens java.desktop/com.sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/sun.font=ALL-UNNAMED --add-opens java.desktop/javax.swing.plaf.basic=ALL-UNNAMED --add-opens java.desktop/javax.swing.plaf.synth=ALL-UNNAMED --add-opens java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED --add-opens java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED --add-opens java.desktop/com.apple.laf=ALL-UNNAMED ``` This should hide the "illegal reflective access" warnings, but you most probably will see new ones instead: ``` WARNING: package com.sun.java.swing.plaf.gtk not in java.desktop WARNING: package com.apple.laf not in java.desktop ``` This happens because the list above is made for cross-platform use and includes all different modules accessed by WebLaF which you most probably won't ever have all at once. And JVM simply warns you in that case that some modules you're granting access to do not exist in your application. These are the modules that are platform-related: ``` java.desktop/com.sun.java.swing.plaf.windows java.desktop/com.sun.java.swing.plaf.gtk java.desktop/com.apple.laf ``` If you want to completely avoid any warnings - you will need to use a platform-related list of JVM options for your application, basically excluding some of these three. Also note that some new warnings might appear at some point if you would be accessing your custom components through the styling system because it uses Reflection API to access fields and methods in various classes it uses, including any custom ones. You can block any illegal reflection access to make those cases visible faster by adding next JVM option: ``` --illegal-access=deny ``` This will force JVM to throw an exception whenever Reflection API is used illegally anywhere with a full stack trace that can be used to track down the source and add aother JVM option for the module access. If you would find any JVM modules that I've missed in the list above - I would appreciate if you can post an issue here or contact me directly so I could update the information for other WebLaF users. Licensing ---------- WebLaF is available under GPLv3 license for any non-commercial open-source projects. Commercial license is available as an alternative option and intended for closed-source and/or commercial projects. It removes restrictions dictated by GPLv3 license and can either be used for a single or any amounts of projects, depending on the commercial license sub-type. Here is a summary of different available WebLaF licenses: 1. **GPLv3 license [ [weblaf-gpl.txt](licenses/weblaf-gpl.txt) ]** - Unlimited amount of non-commercial open-source projects - Unlimited amount of developers working with your non-commercial open-source projects - Unlimited amount of end-user distributions of your non-commercial open-source projects - Full access to complete library [source code](https://github.com/mgarin/weblaf) - Free [updates](https://github.com/mgarin/weblaf/releases) to all newer minor and major versions - Free support via [GitHub](https://github.com/mgarin/weblaf/issues), [Gitter](https://gitter.im/mgarin/weblaf) and [e-mail](mailto:mgarin@alee.com) Limitations: - Cannot use in any commercial projects - Cannot create any commercial derivative projects 2. **[Single-application commercial license](http://weblookandfeel.com/buy/) [ [weblaf-commercial.txt](licenses/weblaf-commercial.txt) ]** - Single commercial closed-source project - Unlimited amount of developers working with your commercial project - Unlimited amount of end-user distributions of your commercial project - Full access to complete library [source code](https://github.com/mgarin/weblaf) - Free [updates](https://github.com/mgarin/weblaf/releases) to all newer minor and major versions - Prioritized support via [GitHub](https://github.com/mgarin/weblaf/issues), [Gitter](https://gitter.im/mgarin/weblaf) and [e-mail](mailto:mgarin@alee.com) Limitations: - Can only be used in one of your commercial closed-source project - Cannot create any commercial derivative L&F libraries 3. **[Multi-application commercial license](http://weblookandfeel.com/buy/) [ [weblaf-commercial.txt](licenses/weblaf-commercial.txt) ]** - Unlimited amount of commercial closed-source projects - Unlimited amount of developers working with your commercial project(s) - Unlimited amount of end-user distributions of your commercial project(s) - Full access to complete library [source code](https://github.com/mgarin/weblaf) - Free [updates](https://github.com/mgarin/weblaf/releases) to all newer minor and major versions - Prioritized support via [GitHub](https://github.com/mgarin/weblaf/issues), [Gitter](https://gitter.im/mgarin/weblaf) and [e-mail](mailto:mgarin@alee.com) Limitations: - Cannot create any commercial derivative L&F libraries Commercial license can be purchased from the [WebLaF site](http://weblookandfeel.com/buy/). You can also contact me directly [through e-mail](mailto:mgarin@alee.com) for other payment options. Development ---------- Back in 2011 I was the only one working on the project, it was quite rudimentary and wasn't really used in any real-life projects, but since then project has grown, received multiple updates, major improvements and reworks and is now used by multiple users and organizations. We are also using WebLaF as our main framework for all our desktop applications in Alee Software and are actively working on improving and adding new features to it. This might not be much, but you can take is a guarantee that project won't suddenly close or die out. One more thing I can add is that I personally plan to work on this project for as long as Oracle supports Swing in their new Java releases as I still consider it to be a superior UI framework compared to any other Java or non-Java UI frameworks, even considering all it's flaws and issues. Those who are following the project might have noticed that pacing of updates have changed dramatically over last year. There are considerably more updates now and they are coming out at a more predictable rate - roughly every 1-2 months, depending on amount of features and changes. This partially happened because I finally finished the huge styling update that I've been working on for the last 3-4 years in background and that stopped me from delivering any changes for the time. Releasing that update allowed me to finally get new stuff rolling out, fix the library versioning, get WebLaF releases to Maven and do a lot of internal improvements to the library that I've wanted to do for a long while. I'm nowhere near being done though and you can expect new features and long-awaited improvements in the future! Now, I must be honest here - WebLaF is not the only project I am working on and I do have quite busy periods from time to time where I can't get a lot of new stuff out (and it was one of the big reasons that styling update took years to release), but I am going to dedicate to consistent releases that have already been going on for a while. It's not all about new features - bugfixes and polish is just as important, and it is usually much easier and faster to do (except for you, JDK bugs) - that is something that will keep on coming even during the busy periods. If you are interested in what's coming - I recommend taking a look at the [projects page](https://github.com/mgarin/weblaf/projects). I keep it up-to-date so you can easily see what I am working on right now and what is planned for the upcoming updates. That being said - features might get delayed or even moved to later updates in case they don't fit into 1-2 months release cycle, so don't take this as granted, but I will do my best to stick to the plan. Planned release dates can be found on [milestones page](https://github.com/mgarin/weblaf/milestones), but just like the projects - dont take it as granted. They should be more accurate now that I have shorter release cycle, but I will still delay the update if it is necessary or might as well release it earlier if it is ready. Feedback ---------- If have any questions, found some bugs or want to propose some improvements, you can: - **[Open an issue](https://github.com/mgarin/weblaf/issues) here on GitHub**<br> I highly recommend this option for any bugs or feature requests - **Chat with me and other WebLaF users [on Gitter](https://gitter.im/mgarin/weblaf)**<br> This option is best for any questions you want to ask and receive answer as fast as possible - **Contact me directly at [mgarin@alee.com](mailto:mgarin@alee.com)**<br> This might be convenient if you want to discuss some issue or ask questions privately
0
proxyee-down-org/proxyee-down
http下载工具,基于http代理,支持多连接分块下载
null
## 暂停维护此项目 首先感谢大家支持和反馈才使得proxyee-down能一直迭代到现在的版本,但由于本人精力有限,宣布暂时停止此项目的维护,并且关闭**issue**模块。 其次因为`JAVA`不太适合做客户端开发,打包后体积太大且内存占用太高,本人计划在空余时间用`GO`来重写一遍,目标是打造一个`体积小`、`跨平台`、`内存低`、`可扩展`、`免费`的下载器。 新项目目前托管在[gopeed](https://github.com/monkeyWie/gopeed),现处于初始化阶段,感兴趣的可以一起参与哦~ ![](https://i.imgur.com/dUvNgmd.jpg) # [Proxyee Down](https://pdown.org) [![Author](https://img.shields.io/badge/author-monkeyWie-red.svg?style=flat-square)](https://github.com/monkeyWie) [![Contributors](https://img.shields.io/github/contributors/proxyee-down-org/proxyee-down.svg?style=flat-square)](https://github.com/proxyee-down-org/proxyee-down/graphs/contributors) [![Stargazers](https://img.shields.io/github/stars/proxyee-down-org/proxyee-down.svg?style=flat-square)](https://github.com/proxyee-down-org/proxyee-down/stargazers) [![Fork](https://img.shields.io/github/forks/proxyee-down-org/proxyee-down.svg?style=flat-square)](https://github.com/proxyee-down-org/proxyee-down/fork) [![License](https://img.shields.io/github/license/proxyee-down-org/proxyee-down.svg?style=flat-square)](https://github.com/proxyee-down-org/proxyee-down/blob/master/LICENSE) > Proxyee Down 是一款开源的免费 HTTP 高速下载器,底层使用`netty`开发,支持自定义 HTTP 请求下载且支持扩展功能,可以通过安装扩展实现特殊的下载需求。 ## 使用教程 [点击查看教程](https://github.com/proxyee-down-org/proxyee-down/wiki/%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B) ## 交流群 1 群**11352304**、2 群**20236964**、3 群**20233754**、4 群**737991056** ## 开发 本项目后端主要使用 `java` + `spring` + `boot` + `netty`,前端使用 `vue.js` + `iview` ### 环境 ![](https://img.shields.io/badge/JAVA-1.8%2B-brightgreen.svg) ![](https://img.shields.io/badge/maven-3.0%2B-brightgreen.svg) ![](https://img.shields.io/badge/node.js-8.0%2B-brightgreen.svg) oracle jdk 1.8+或 openjfx(openjdk默认不包含javafx包) ### 编译 ``` git clone https://github.com/proxyee-down-org/proxyee-down.git cd proxyee-down/front #build html npm install npm run build cd ../main mvn clean package -Pprd ``` ### 运行 ``` java -jar proxyee-down-main.jar ```
0
docker-java/docker-java
Java Docker API Client
api client-library docker docker-java java
[![Join the chat at https://gitter.im/docker-java/docker-java](https://badges.gitter.im/docker-java/docker-java.svg)](https://gitter.im/docker-java/docker-java?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Maven Central](https://img.shields.io/maven-central/v/com.github.docker-java/docker-java.svg)](https://mvnrepository.com/artifact/com.github.docker-java/docker-java) [![codecov.io](http://codecov.io/github/docker-java/docker-java/coverage.svg?branch=main)](http://codecov.io/github/docker-java/docker-java?branch=master) [![License](http://img.shields.io/:license-apache-blue.svg?style=flat)](https://github.com/docker-java/docker-java/blob/main/LICENSE) # docker-java Java API client for [Docker](http://docs.docker.io/ "Docker") # [Read the documentation here](docs/README.md)
0
chenhaoxiang/Java
Java的学习之路,学习JavaEE以及框架时候的一些项目,结合博客和源码,让你受益匪浅,适合Java初学者和刚入门开始学框架者
null
文件名与介绍: [Database-support-package]-数据库需要用到的-c3p0/dbcp/dbUtils工具支持包 [Hibernate]利用Hibernate进行一对多的级联操作-Web实例 [Java_MySQL_jar]-数据库连接支持包 [JavaMail]-收发邮件支持包 [Java_MySQL_jar]Java访问数据库需要的包 [Spring]基于Spring框架的Web应用演示(附带cglib工具进行动态代理) [Tomcat7.0]Tomcat7版本安装包 [UltraISO]制作U盘启动盘需要的 [log4j_jar]log4j的支持包 [myAutoLoginWeb]过滤器Filter学习-实现用户的自动登录与IP黑名单过滤 [myBookStore]单机版的书店管理系统 [myDbPoolUse]C3P0连接池配置/DBCP连接池配置/Apache的DBUtils框架使用 [myFilterDemoWeb]过滤器Filter学习-设置全站编码与设置页面缓存 [myGzipWeb]全站压缩 [myJavaMainDemo]Java-QQ邮箱发送邮件-以及带附件 [myLog4jTest]log4j使用实例-----记录日志 [myMailWeb]网站注册-QQ邮箱发送激活邮箱,点击注册-实例 [myOnlinesWeb]网站在线用户信息,网站访问量... [myOnlinesWeb2]网站在线用户信息,网站访问量以及管理员踢出用户实例 [myWordsFilterWeb]过滤器-敏感词过滤 [springBoot]看《Spring Boot》时的同步笔记与实例代码 [sqlTableToExcel]将数据库表格导入excel表格需要的包 [druid_spring_config] 【Druid】Druid监控SSM项目性能-配置与实例
0
vladmihalcea/hypersistence-utils
The Hypersistence Utils library (previously known as Hibernate Types) gives you Spring and Hibernate utilities that can help you get the most out of your data access layer.
array custom-types enum hibernate hibernate-types hypersistence java json performance performance-testing spring spring-boot spring-data-jpa
[![License](https://img.shields.io/github/license/vladmihalcea/hypersistence-utils.svg)](https://raw.githubusercontent.com/vladmihalcea/hypersistence-utils/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/io.hypersistence/hypersistence-utils-parent.svg)](https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-60/) [![JavaDoc](http://javadoc.io/badge/io.hypersistence/hypersistence-utils-hibernate-60.svg)](http://www.javadoc.io/doc/io.hypersistence/hypersistence-utils-hibernate-63) ### Migrating to version 3 The project name was changed from Hibernate Types to Hypersistence Utils because the scope of the project is much broader now, offering Spring utilities as well. For this reason, when migrating from the Hibernate Types 2.x to Hypersistence Utils 3.x, you will need to follow these steps: 1. First, you will need to change your Maven or Gradle dependency, as illustrated by the [Installation Guide](#installation-guide). 2. Second, you will need to change the package name from `com.vladmihalcea.hibernate` to `io.hypersistence.utils.hibernate`. 3. Third, you will need to change the package name from `com.vladmihalcea.spring` to `io.hypersistence.utils.spring`. That's it! ### Introduction The Hypersistence Utils project gives you general-purpose utilities for both Spring and Hibernate. The main advantage of this project is that it supports a broad range of Hibernate versions, spanning from **Hibernate ORM 6.4**, **6.3** to **6.2**, **6.1**, **6.0**, **5.6**, **5.5**, **5.4**, **5.3**, and Hibernate **5.2**. ### Installation Guide Depending on the Hibernate version you are using, you need to add the following dependency: #### Hibernate 6.4 and 6.3 <dependency> <groupId>io.hypersistence</groupId> <artifactId>hypersistence-utils-hibernate-63</artifactId> <version>3.7.4</version> </dependency> #### Hibernate 6.2 <dependency> <groupId>io.hypersistence</groupId> <artifactId>hypersistence-utils-hibernate-62</artifactId> <version>3.7.4</version> </dependency> #### Hibernate 6.1 and 6.0 <dependency> <groupId>io.hypersistence</groupId> <artifactId>hypersistence-utils-hibernate-60</artifactId> <version>3.7.4</version> </dependency> #### Hibernate 5.6 and 5.5 <dependency> <groupId>io.hypersistence</groupId> <artifactId>hypersistence-utils-hibernate-55</artifactId> <version>3.7.4</version> </dependency> #### Hibernate 5.4, 5.3 and 5.2 <dependency> <groupId>io.hypersistence</groupId> <artifactId>hypersistence-utils-hibernate-52</artifactId> <version>3.7.4</version> </dependency> #### Optional Maven Dependencies The Hypersistence Utils project defines a list of optional dependencies that you will have to declare explicitly in your project in order to use them. The reason why all these dependencies are optional, like Guava, Jackson, or PostgreSQL JDBC Driver, is that not all projects may need them. Moreover, the dependency version is extremely important because, from time to time, security issues may be discovered that get fixed in newer versions. > So, relying on this library to supply you with the dependency versions is a very dangerous thing to do. > > For instance, there have been [65 security issues discovered in the Jackson Data Bind library](https://www.cvedetails.com/vulnerability-list/vendor_id-15866/product_id-42991/Fasterxml-Jackson-databind.html) this project is heavily relying on. > > To avoid risking security issues, you need to take the responsibility of constantly upgrading all the dependencies that you are using along with the Hypersistence Utils library. ##### JSON Optional Maven Dependencies If you are using JSON Types, then you might be interested in setting the following dependencies based on your Hibernate version: ###### Hibernate 6 ````xml <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId> <version>${jackson-module-jakarta-xmlbind-annotation}</version> </dependency> ```` ###### Hibernate 5 ````xml <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson-databind.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jaxb-annotations</artifactId> <version>${jackson-module-jaxb-annotation}</version> </dependency> ```` ##### Guava Optional Maven Dependency If you are mapping a `Range` using Guava, then you have to provide the Guava dependency explicitly: ````xml <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>${guava.version}</version> </dependency> ```` ##### Java Money and Currency API Optional Maven Dependency If you are mapping a `MonetaryAmount`, then you have to provide the Moneta dependency explicitly: ````xml <dependency> <groupId>org.javamoney</groupId> <artifactId>moneta</artifactId> <version>${moneta.version}</version> <type>pom</type> </dependency> ```` ##### PostgreSQL Optional Maven Dependency If you are mapping a PostgreSQL-specific column type (e.g., `inet`, `hstore`, `array`, `interval`), then you have to provide the PostgreSQL dependency explicitly: ````xml <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>${postgresql.version}</version> </dependency> ```` ### Features #### JSON ##### Generic JSON Type The `JsonType` allows you to map JSON column types, no matter if you're using Oracle, SQL Server, PostgreSQL or MySQL. ###### Hibernate 6 If you're using Hibernate 6, you can map any JSON column to `Map`, `List`, POJO, `String`, or `JsonNode` entity property: ````java @Type(JsonType.class) private Map<String, String> properties = new HashMap<>(); ```` ###### Hibernate 5 If you're using Hibernate 5, you can either provide the fully-qualified name of the Hibernate Type: ```` @Type(type = "io.hypersistence.utils.hibernate.type.json.JsonType") ```` Or, you can add the following mapping to your `package-info.java` class in the same package where your JPA entities are located: ````java @TypeDef( name = "json", typeClass = JsonType.class ) package io.hypersistence.optimizer; import io.hypersistence.utils.hibernate.type.json.JsonType; import org.hibernate.annotations.TypeDef; ```` Later, you can map the `Map`, `List`, POJO, `String`, or `JsonNode` entity properties to JSON columns like this: ````java @Type(type = "json") private Map<String, String> properties = new HashMap<>(); ```` For more details, check out [this article](https://vladmihalcea.com/how-to-map-json-objects-using-generic-hibernate-types/). ##### Best Practices > When mapping a JSON column type to a `POJO`, `List<POJO>` or `Map<String, POJO>`, you need to make sure that the `POJO` type overrides the default `equals` and `hashCode` methods and implements them according to the JSON object content. > > Otherwise, the Hibernate dirty checking mechanism may trigger unexpected UPDATE statements. Check out the [#134 issue for more details](https://github.com/vladmihalcea/hypersistence-utils/issues/138). ##### Database-specific JSON types ###### Oracle When using Oracle, you have several options: - you can use the generic `JsonType` that can work with the `JSON`, `VARCHAR`, or `BLOB` column types, as long as you hint the column type using the `columnDefinition` attribute of the JPA `@Column` annotation. - you can use the `JsonStringType` to map a `VARCHAR2` column type storing JSON. - you can use the `JsonBlobType` to map a `BLOB` column type storing JSON. For more details, check out [this article](https://vladmihalcea.com/oracle-json-jpa-hibernate/). ###### SQL Server When using SQL Server, you can use the generic `JsonType` or the `JsonStringType` to map an `NVARCHAR` column type storing JSON. For more details, check out [this article](https://vladmihalcea.com/sql-server-json-hibernate/). ###### PostgreSQL When using PostgreSQL, you can use the generic `JsonType` or the `JsonBinaryType` to map both `jsonb` and `json` column types. For more details, check out [this article](https://vladmihalcea.com/how-to-map-json-objects-using-generic-hibernate-types/). ###### MySQL When using MySQL, you can use the generic `JsonType` or the `JsonStringType` to map the `json` column type. For more details, check out [this article](https://vladmihalcea.com/how-to-map-json-objects-using-generic-hibernate-types/). ##### JSON mapping examples * [How to map a POJO to a JSON column using JPA and Hibernate](https://vladmihalcea.com/how-to-map-json-objects-using-generic-hibernate-types/) * [How to map a String JPA property to a JSON column using Hibernate](https://vladmihalcea.com/map-string-jpa-property-json-column-hibernate/) * [How to map a Jackson `JsonNode` to a JSON column](https://vladmihalcea.com/how-to-store-schema-less-eav-entity-attribute-value-data-using-json-and-hibernate/) * [How to map JSON collections using JPA and Hibernate](https://vladmihalcea.com/how-to-map-json-collections-using-jpa-and-hibernate/) * [How to map a Java Map entity property as a JSON column with JPA and Hibernate](https://vladmihalcea.com/java-map-json-jpa-hibernate/) * [How to map Java Records to JSON columns using Hibernate](https://vladmihalcea.com/java-records-json-hibernate/) * [How to map polymorphic JSON objects with JPA and Hibernate](https://vladmihalcea.com/polymorphic-json-objects-hibernate/) * [How to encrypt and decrypt JSON properties with JPA and Hibernate](https://vladmihalcea.com/encrypt-decrypt-json-jpa/) * [Why you should use Hibernate Dynamic Update for JSON properties](https://vladmihalcea.com/hibernate-dynamic-update-json-properties/) * [How to map Oracle JSON columns using JPA and Hibernate](https://vladmihalcea.com/oracle-json-jpa-hibernate/) * [How to map SQL Server JSON columns using JPA and Hibernate](https://vladmihalcea.com/sql-server-json-hibernate/) * [How to customize the Jackson ObjectMapper used by Hypersistence Utils](https://vladmihalcea.com/hibernate-types-customize-jackson-objectmapper/) * [How to customize the JSON Serializer used by Hypersistence Utils](https://vladmihalcea.com/how-to-customize-the-json-serializer-used-by-hibernate-types/) * [How to fix the Hibernate `No Dialect mapping for JDBC type: 1111` issue when mixing JSON types with native SQL queries](https://vladmihalcea.com/hibernate-no-dialect-mapping-for-jdbc-type/) * [How to fix the `column is of type jsonb but expression is of type record` or `bytea` issue](https://vladmihalcea.com/jpa-query-setparameter-hibernate/) #### ARRAY * [How to map a PostgreSQL ARRAY to a Java `List` with JPA and Hibernate](https://vladmihalcea.com/postgresql-array-java-list/) * [How to map the PostgreSQL ARRAY to Java Arrays with JPA and Hibernate](https://vladmihalcea.com/how-to-map-java-and-sql-arrays-with-jpa-and-hibernate/) * [Multidimensional array mapping with JPA and Hibernate](https://vladmihalcea.com/multidimensional-array-jpa-hibernate/) * [How to map the HSQLDB ARRAY type with JPA and Hibernate](https://vladmihalcea.com/hibernate-hsqldb-array-type/) #### PostgreSQL Types (e.g. ENUM, INET, HSTORE, RANGE) * [Java Enum to PostgreSQL Enum Type](https://vladmihalcea.com/the-best-way-to-map-an-enum-type-with-jpa-and-hibernate/) * [How to map the PostgreSQL Inet type with JPA and Hibernate](https://vladmihalcea.com/postgresql-inet-type-hibernate/) * [How to map a PostgreSQL HStore entity property with JPA and Hibernate](https://vladmihalcea.com/map-postgresql-hstore-jpa-entity-property-hibernate/) * [How to map a PostgreSQL Enum ARRAY to a JPA entity property using Hibernate](https://vladmihalcea.com/map-postgresql-enum-array-jpa-entity-property-hibernate/) * [How to map a PostgreSQL Range column type with JPA and Hibernate](https://vladmihalcea.com/map-postgresql-range-column-type-jpa-hibernate/) * [How to map a PostgreSQL Interval to a Java `Duration` with Hibernate](https://vladmihalcea.com/map-postgresql-interval-java-duration-hibernate/) #### Generic Types * [The best way to map `MonetaryAmount` with JPA and Hibernate](https://vladmihalcea.com/monetaryamount-jpa-hibernate/) * [How to map `java.time.YearMonth` to DATE or INTEGER column](https://vladmihalcea.com/java-yearmonth-jpa-hibernate/) * [How to map `java.time.Year` and `java.time.Month` with JPA and Hibernate](https://vladmihalcea.com/java-time-year-month-jpa-hibernate/) * [`Character` to nullable CHAR column](https://vladmihalcea.com/how-to-implement-a-custom-basic-type-using-hibernate-usertype/) * [`ImmutableType` utility to simplify `UserType` implementations](https://vladmihalcea.com/how-to-implement-a-custom-basic-type-using-hibernate-usertype/) #### Utilities ##### Spring * [The awesome BaseJpaRepository](https://vladmihalcea.com/basejparepository-hypersistence-utils/) * [The best Spring Data JpaRepository](https://vladmihalcea.com/best-spring-data-jparepository/) * [The Spring Data `findAll` Anti-Pattern](https://vladmihalcea.com/spring-data-findall-anti-pattern/) * [The Spring `@Retry` annotation to automatically retry on failure](https://vladmihalcea.com/optimistic-locking-retry-with-jpa/) ###### BaseJpaRepository The `BaseJpaRepository` is a much better alternative to the default Spring Data `JpaRepository` because it does not provide a `findAll` method or a `save` method that makes no sense in JPA terminology. To use the `BaseJpaRepository` utility, make sure that you provide the `repositoryBaseClass` attribute in the `@EnableJpaRepositories` configuration to reference the `BaseJpaRepositoryImpl` from the Hypersistence Utils project: ````java @Configuration @EnableJpaRepositories( value = "your.repository.package", repositoryBaseClass = BaseJpaRepositoryImpl.class ) public class JpaConfiguration { ... } ```` The `your.repository.package` is the Java package of your Spring repositories. ###### HibernateRepository While the `BaseJpaRepository` is to be preferred, in case you need to use the default `JpaRepository`, then you can at least extend the `HibernateRepository` as well to deprecate the methods that may cause problems. To use the `HibernateRepository`, make sure that you include the `io.hypersistence.utils.spring.repository` package in your `@EnableJpaRepositories` configuration: ````java @Configuration @EnableJpaRepositories( value = { "io.hypersistence.utils.spring.repository", "your.repository.package", ... } ) public class JpaConfiguration { ... } ```` The `your.repository.package` is the Java package of your Spring repositories. ##### Identifier Generators * [`BatchSequenceGenerator` - Hibernate Batch Sequence Generator](https://vladmihalcea.com/hibernate-batch-sequence-generator/) ##### Naming Strategy * [`CamelCaseToSnakeCaseNamingStrategy` - How to map camelCase properties to snake_case column names with Hibernate](https://vladmihalcea.com/map-camel-case-properties-snake-case-column-names-hibernate/) ##### DTO Projection and ResultTransformer * [`ClassImportIntegrator` - How to write a compact DTO projection query with JPA](https://vladmihalcea.com/dto-projection-jpa-query/) * [`ListResultTransformer` - The best way to use a Hibernate ResultTransformer](https://vladmihalcea.com/hibernate-resulttransformer/) * [`MapResultTransformer` - How to return a Map result from a JPA or Hibernate query](https://vladmihalcea.com/jpa-query-map-result/) ##### SQL Statement Count Validator * [`SQLStatementCountValidator` - How to detect the Hibernate N+1 query problem during testing](https://vladmihalcea.com/how-to-detect-the-n-plus-one-query-problem-during-testing/) ##### Query Utilities * [`SQLExtract` - How to get the SQL query from JPQL or JPA Criteria](https://vladmihalcea.com/get-sql-from-jpql-or-criteria/) * [`QueryStackTraceLogger` - How to find the source of an SQL query generated by Hibernate](https://vladmihalcea.com/source-sql-query-hibernate/) ### Requirements * Java version supported by the Hibernate ORM version you are using. * SLF4J * Jackson Databind ### Bug fixes and enhancements **This project is Free, as in Libre, not Gratis.** > There is no free-of-charge support. Only the source code and the binaries are available for free. > > If you need assistance with a given issue, you will need to purchase either the [Coaching Basic](https://vladmihalcea.teachable.com/p/high-performance-java-persistence-coaching-basic) or the [Coaching Pro](https://vladmihalcea.teachable.com/p/high-performance-java-persistence-coaching-pro) programs. #### Providing your own fix Besides the Paid support options, you have the option of providing your own fix. For that, here's what you need to do: 1. Provide a replicating test case using the existing test cases as a template 2. Provide a fix proposal 3. Send a Pull Request with the fix proposal and the test case However, due to lack of time, I will review the submitted Pull Requests from time to time, so you may need to wait several months until the Pull Request is reviewed and integrated. ### Are you struggling with application performance issues? <a href="https://vladmihalcea.com/hypersistence-optimizer/?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes"> <img src="https://vladmihalcea.com/wp-content/uploads/2019/03/Hypersistence-Optimizer-300x250.jpg" alt="Hypersistence Optimizer"> </a> Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. No more performance issues, no more having to spend countless hours trying to figure out why your application is barely crawling. Imagine discovering early during the development cycle that you are using suboptimal mappings and entity relationships or that you are missing performance-related settings. More, with Hypersistence Optimizer, you can detect all such issues during testing and make sure you don't deploy to production a change that will affect data access layer performance. [Hypersistence Optimizer](https://vladmihalcea.com/hypersistence-optimizer/?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes) is the tool you've been long waiting for! #### Training If you are interested in on-site training, I can offer you my [High-Performance Java Persistence training](https://vladmihalcea.com/trainings/?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes), which can be adapted to one, two or three days of sessions. For more details, check out [my website](https://vladmihalcea.com/trainings/?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes). #### Consulting If you want me to review your application and provide insight into how you can optimize it to run faster, then check out my [consulting page](https://vladmihalcea.com/consulting/?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes). #### High-Performance Java Persistence Video Courses If you want the fastest way to learn how to speed up a Java database application, then you should definitely enroll in [my High-Performance Java Persistence video courses](https://vladmihalcea.com/courses/?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes). #### High-Performance Java Persistence Book Or, if you prefer reading books, you are going to love my [High-Performance Java Persistence book](https://vladmihalcea.com/books/high-performance-java-persistence?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes) as well. <a href="https://vladmihalcea.com/books/high-performance-java-persistence?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes"> <img src="https://i0.wp.com/vladmihalcea.com/wp-content/uploads/2018/01/HPJP_h200.jpg" alt="High-Performance Java Persistence book"> </a> <a href="https://vladmihalcea.com/courses?utm_source=GitHub&utm_medium=banner&utm_campaign=hibernatetypes"> <img src="https://i0.wp.com/vladmihalcea.com/wp-content/uploads/2018/01/HPJP_Video_Vertical_h200.jpg" alt="High-Performance Java Persistence video course"> </a> #### Contributing Guide The project uses [Maven Toolchains](https://maven.apache.org/guides/mini/guide-using-toolchains.html) as different modules are compiled and tested using different Java versions. Hypersistence Utils 6 requires Java 11 while the other modules are compiled with Java 8. To see how to configure Maven Toolchains, check out [this article](https://vladmihalcea.com/maven-and-java-multi-version-modules/). The project uses various database systems for integration testing, and you can configure the JDBC connection settings using the `DatasourceProvider` instances (e.g., `PostgreSQLDataSourceProvider`), and the project uses Testcontainers to bootstrap a Docker container with the required Oracle, SQL Server, PostgreSQL, or MySQL instance on demand. > If you are a regular contributor, it's advisable to set up the required database locally or use the Docker Compose configuration provided in the `docker` folder, > as bootstrapping the containers on demand is slower, and your tests are going to take longer to run. If you want to fix an issue or add support for a new feature, please provide the associated integration test case that proves the improvement is working as expected.
0
iterate-ch/cyberduck
Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift file transfer client for Mac and Windows.
azure backblaze-b2 cloudfront cryptomator cyberduck dracoon dropbox ftp google-drive google-storage hubic irods onedrive onedrive-for-business onedrive-storage openstack-swift s3 sftp sharepoint webdav
# Cyberduck [![GitHub commit](https://img.shields.io/github/last-commit/iterate-ch/cyberduck)](https://github.com/iterate-ch/cyberduck/commits/master) [![GitHub license](https://img.shields.io/badge/license-GPL-blue.svg)](https://raw.githubusercontent.com/iterate-ch/cyberduck/master/LICENSE) [![Build Status](https://github.com/iterate-ch/cyberduck/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/iterate-ch/cyberduck/actions) [![Twitter](https://img.shields.io/badge/twitter-@cyberduckapp-blue.svg?style=flat)](http://twitter.com/cyberduckapp) This is the development home for Cyberduck, a libre file transfer client for macOS and Windows. Command line interface (CLI) for Linux, macOS and Windows. The core libraries are used in [Mountain Duck](https://mountainduck.io/). <img src="https://cdn.cyberduck.io/img/cyberduck-icon-rect-512.png" alt="Cyberduck Icon" width="400px"/> ## Mailing Lists There is a [Google Groups Cyberduck](http://groups.google.com/group/cyberduck/) discussion mailing list. The following additional [mailing lists](http://lists.cyberduck.io/) are hosted: * [News](http://lists.cyberduck.io/mailman/listinfo/cyberduck-news) Announcements of new releases * [Localization](http://lists.cyberduck.io/mailman/listinfo/cyberduck-localization) Notifications about changes to the translations needed ## Source Source code is available licensed under the [GNU General Public License Version 3](https://www.gnu.org/licenses/gpl-3.0.en.html). Pull requests welcome! ## Localizations Translations to new languages are welcome. We use [Transifex](https://www.transifex.com/cyberduck/cyberduck/dashboard/) to localize resources. Current available localizations are _English_, _Czech_, _Dutch_, _Finnish_, _French_, _German_, _Italian_, _Japanese_, _Korean_, _Norwegian_, _Portuguese_, _Slovak_, _Spanish_, _Chinese (Traditional & Simplified Han)_, _Russian_, _Swedish_, _Hungarian_, _Danish_, _Polish_, _Indonesian_, _Catalan_, _Welsh_, _Thai_, _Turkish_, _Hebrew_, _Latvian_, _Greek_, _Serbian_, _Georgian_ and _Slovenian_. Make sure to subscribe to the [localization mailing list](http://lists.cyberduck.ch/mailman/listinfo/cyberduck-localization). ## Documentation For general help about using Cyberduck, please refer to the [documentation](https://docs.cyberduck.io). The documentation is maintained in its own [repository](https://github.com/iterate-ch/docs). ## Additional Connection Profiles Additional connection profiles not bundled by default but available in _Preferences → Profiles_ are maintained in its own [repository](https://github.com/iterate-ch/profiles). ## Snapshot and Beta builds These are nightly snapshot builds from the current development trunk featuring the latest bug fixes and enhancements. Be warned, though, these builds are potentially unstable and experimental. You can also switch to beta or snapshot builds in _Preferences → Update_. ## Prerequisites - Java 11 SDK or later - Apache Ant 1.10.1 or later - Apache Maven 3.5 or later ### macOS - [Xcode 12](https://developer.apple.com/xcode/download/) or later ### Windows #### Installation **Manually** - Visual Studio 2022, following workloads are required: - `.NET desktop development` - `Universal Windows Platform development` - `Desktop development with C++` - [Bonjour SDK for Windows](https://support.apple.com/kb/dl999) - [Wix v3](https://wixtoolset.org/docs/wix3/) (Optional) **Chocolatey** _Without Visual Studio (IDE)_ ```sh choco install visualstudio2022buildtools -y choco install visualstudio2022-workload-manageddesktopbuildtools -y choco install visualstudio2022-workload-vctools -y choco install visualstudio2022-workload-universalbuildtools -y ``` _With Visual Studio IDE_ ```sh choco install visualstudio2022(edition) -y choco install visualstudio2022-workload-manageddesktop -y choco install visualstudio2022-workload-nativedesktop -y choco install visualstudio2022-workload-universal -y ``` Replace `(edition)` with your licensed IDE SKU: community, professional, enterprise Install required dependencies, after installing Visual Studio IDE or build tools: ```sh choco install microsoft-openjdk17 ant maven -y choco install bonjour -y; choco install bonjour -y --force ``` Optional, see Remarks: ```sh choco install wixtoolset -y ``` _Remarks_: Installing with Chocolatey may or may not fail spectacularly.<br> Following issues have been observed on a clean installation: - Bonjour package fails with `file not found` - though the Bonjour64.msi is extracted from BonjourPSSetup.exe. - wixtoolset depends on .NET 3.5-package, which never completes<br> On Windows 11 installation doesn't work - `visualstudio*-workload-*` may halt with "Operation canceled",<br> Abort Chocolatey-command (Ctrl-C), then open up Visual Studio Installer and Resume installation there Restart your machine after installing these components. #### System Configuration Make sure that `MSBuild`, `mvn`, `ant` and `java` are on your `PATH`-environment variable. * Open `Developer Command Prompt for VS2022`, then run `where msbuild.exe`, add first directory name to path * e.g. `C:\Program Files\Microsoft Visual Studio\Community\Msbuild\Current\Bin\amd64` * Chocolatey may have added mvn and ant to your `PATH`-variable * The Microsoft OpenJDK 17 installer automatically adds itself to the system `PATH`. Additionally include the latest Windows Sdk-binary folder in your `PATH`-environment variable: * `%ProgramFiles(x86)%\Windows Kits\10\bin\10.0.<Latest>.0\x64` ## Building Run `mvn verify -DskipTests -DskipSign` to build without running any tests and skip codesign. Find build artifacts in * `osx/target/Cyberduck.app` * `windows/target/Cyberduck.exe` Run with `-Pinstaller` to build installer packages with build artifacts * `osx/target/release/*.(zip|pkg)` * `windows/target/release/*.(exe|msi)` * `cli/osx/target/release/*.(pkg|tar.gz)` * `cli/windows/target/release/*.(exe|msi)` * `cli/linux/target/release/*.(deb|rpm)` ### Windows You will run into warnings from `MSBuild`/`WiX` that are unrelated to how Cyberduck is built. You may safely ignore them. ## Debugging ### macOS Edit `setup/app/Info.plist` if you want to debug _Cyberduck.app_ or `setup/pkg/Info.plist` if you want to debug`duck` respectively. Add `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005` in `VMOptions` to allow to connect to the running application in your IDE by attaching to the remote JVM. ### Windows Due to Visual Studio not being able to handle Java projects it is required to follow these steps for debugging: - Run `mvn verify -Dconfiguration=debug` which ensures that debugging symbols are generated This prevents Visual Studio (or `MSBuild invoked from Maven`) from generating optimized assemblies which in turn may prevent debugging. - Open the solution in Visual Studio - Open a `.java` file and set a breakpoint. Visual Studio breaks either on or near the line selected. - Debugging capabilities include - Step Over - Step Into - Step Out - Continue - Local/Auto variables - Immediate Window Go To Symbol is not working due to missing Java support. ## Running Tests After packaging, run `mvn test -DskipITs` to run unit tests but skip integration tests. ### Maven Artifacts (GPL) #### Repository Configuration Maven artifacts are available in a repository hosted on Amazon S3. - Use the following Maven configuration in your project POM to reference artifacts from Cyberduck ```xml <repositories> <repository> <id>maven.cyberduck.io-release</id> <url>https://s3-eu-west-1.amazonaws.com/repo.maven.cyberduck.io/releases</url> <layout>default</layout> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> ``` - You will need to add the AWS Maven Wagon to your build using ```xml <build> <extensions> <extension> <groupId>org.springframework.build</groupId> <artifactId>aws-maven</artifactId> <version>5.0.0.RELEASE</version> </extension> </extensions> </build> ``` #### Artifacts - Protocol implementations ```xml <dependency> <groupId>ch.cyberduck</groupId> <artifactId>protocols</artifactId> <type>pom</type> <version>7.1.0</version> </dependency> ``` - Cocoa Java Bindings (macOS) ```xml <dependency> <groupId>ch.cyberduck</groupId> <artifactId>binding</artifactId> <version>7.1.0</version> </dependency> ``` - Implementations (macOS) using Launch Services, SystemConfiguration, Foundation, Keychain and other API ```xml <dependency> <groupId>ch.cyberduck</groupId> <artifactId>libcore</artifactId> <version>${project.version}</version> </dependency> ``` ## Sponsors [![YourKit](https://www.yourkit.com/images/yk_logo.svg)](https://www.yourkit.com) YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of [YourKit Java Profiler](https://www.yourkit.com/java/profiler/) and [YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/), innovative and intelligent tools for profiling Java and .NET applications.
0
spring-projects/spring-batch
Spring Batch is a framework for writing batch applications using Java and Spring
batch batch-processing java spring
<img align="right" src="spring-batch-docs/modules/ROOT/assets/images/spring-batch.png" width="200" height="200"> # Spring Batch [![build status](https://github.com/spring-projects/spring-batch/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/spring-projects/spring-batch/actions/workflows/continuous-integration.yml) Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems. Spring Batch builds upon the productivity, POJO-based development approach, and general ease of use capabilities people have come to know from the [Spring Framework](https://github.com/spring-projects/spring-framework), while making it easy for developers to access and leverage more advanced enterprise services when necessary. If you are looking for a runtime orchestration tool for your Batch applications, or need a management console to view current and historic executions, take a look at [Spring Cloud Data Flow](https://cloud.spring.io/spring-cloud-dataflow/). It is an orchestration tool for deploying and executing data integration based microservices including Spring Batch applications. # Getting Started ## Two minutes tutorial This quick tutorial shows you how to setup a minimal project to run a simple batch job with Spring Batch. In your favorite IDE, create a new Maven-based Java 17+ project and add the following dependencies: ```xml <dependencies> <dependency> <groupId>org.springframework.batch</groupId> <artifactId>spring-batch-core</artifactId> <version>${LATEST_VERSION}</version> </dependency> <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>${LATEST_VERSION}</version> <scope>runtime</scope> </dependency> </dependencies> ``` Then, create a configuration class to define the datasource and transaction manager that will be used by the job repository: ```java import javax.sql.DataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; @Configuration public class DataSourceConfiguration { @Bean public DataSource dataSource() { return new EmbeddedDatabaseBuilder() .addScript("/org/springframework/batch/core/schema-hsqldb.sql") .build(); } @Bean public JdbcTransactionManager transactionManager(DataSource dataSource) { return new JdbcTransactionManager(dataSource); } } ``` In this tutorial, an embedded [HSQLDB](http://www.hsqldb.org) database is created and initialized with Spring Batch's meta-data tables. Finally, create a class to define the batch job: ```java import org.springframework.batch.core.Job; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.job.builder.JobBuilder; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.step.builder.StepBuilder; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.jdbc.support.JdbcTransactionManager; @Configuration @EnableBatchProcessing @Import(DataSourceConfiguration.class) public class HelloWorldJobConfiguration { @Bean public Step step(JobRepository jobRepository, JdbcTransactionManager transactionManager) { return new StepBuilder("step", jobRepository).tasklet((contribution, chunkContext) -> { System.out.println("Hello world!"); return RepeatStatus.FINISHED; }, transactionManager).build(); } @Bean public Job job(JobRepository jobRepository, Step step) { return new JobBuilder("job", jobRepository).start(step).build(); } public static void main(String[] args) throws Exception { ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldJobConfiguration.class); JobLauncher jobLauncher = context.getBean(JobLauncher.class); Job job = context.getBean(Job.class); jobLauncher.run(job, new JobParameters()); } } ``` The job in this tutorial is composed of a single step that prints "Hello world!" to the standard output. You can now run the `main` method of the `HelloWorldJobConfiguration` class to launch the job. The output should be similar to the following: ``` INFO: Finished Spring Batch infrastructure beans configuration in 8 ms. INFO: Starting embedded database: url='jdbc:hsqldb:mem:testdb', username='sa' INFO: No database type set, using meta data indicating: HSQL INFO: No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP INFO: No TaskExecutor has been set, defaulting to synchronous executor. INFO: Job: [SimpleJob: [name=job]] launched with the following parameters: [{}] INFO: Executing step: [step] Hello world! INFO: Step: [step] executed in 10ms INFO: Job: [SimpleJob: [name=job]] completed with the following parameters: [{}] and the following status: [COMPLETED] in 25ms ``` ## Getting Started Guide This guide is a more realistic tutorial that shows a typical ETL batch job that reads data from a flat file, transforms it and writes it to a relational database. It is a Spring Batch project based on Spring Boot. You find the Getting Started Guide here: [Creating a Batch Service](https://spring.io/guides/gs/batch-processing/). ## Samples You can find several samples to try out here: [Spring Batch Samples](https://github.com/spring-projects/spring-batch/tree/main/spring-batch-samples). # Getting Help If you have a question or a support request, please open a new discussion on [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions) or ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch). Please do **not** create issues on the [Issue Tracker](https://github.com/spring-projects/spring-batch/issues) for questions or support requests. We would like to keep the issue tracker **exclusively** for bug reports and feature requests. # Reporting issues Spring Batch uses [GitHub Issues](https://github.com/spring-projects/spring-batch/issues) to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below: * Before you open an issue, please search the issue tracker to see if someone has already reported the problem. If the issue doesn't already exist, create a new issue. * Please provide as much information as possible in the issue report by following the [Issue Reporting Template](https://github.com/spring-projects/spring-batch/blob/main/.github/ISSUE_TEMPLATE/bug_report.md). * If you need to paste code or include a stack trace, please use Markdown escapes (```) before and after your text. For non trivial bugs, please create a test case or a project that replicates the problem and attach it to the issue, as detailed in the [Issue Reporting Guidelines](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md). # Reporting Security Vulnerabilities Please see our [Security policy](https://github.com/spring-projects/spring-batch/security/policy). # Building from Source ## Using the Command Line Clone the git repository using the URL on the Github home page: $ git clone git@github.com:spring-projects/spring-batch.git $ cd spring-batch Maven is the build tool used for Spring Batch. You can build the project with the following command: $ ./mvnw package If you want to perform a full build with all integration tests, then run: $ ./mvnw verify Please note that some integration tests are based on Docker, so please make sure to have Docker up and running before running a full build. To generate the reference documentation, run the following commands: ``` $ cd spring-batch-docs $ ../mvnw antora:antora ``` The reference documentation can be found in `spring-batch-docs/target/anotra/site`. ## Using Docker If you want to build the project in a Docker container, you can proceed as follows: ``` $> docker run -it --mount type=bind,source="$(pwd)",target=/spring-batch maven:3-openjdk-17 bash #> cd spring-batch #> ./mvnw package ``` This will mount the source code that you cloned previously on the host inside the container. If you want to work on a copy of the source code inside the container (no side effects on the host), you can proceed as follows: ``` $> docker run -it maven:3-openjdk-17 bash #> git clone https://github.com/spring-projects/spring-batch.git #> cd spring-batch #> ./mvnw package ``` # Contributing to Spring Batch We welcome contributions in any kind! Here are some ways for you to contribute to the project: * Get involved with the Spring Batch community on [Twitter](https://twitter.com/springbatch), [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions) and [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch) by responding to questions and joining the debate. * Create [issues](https://github.com/spring-projects/spring-batch/issues) for bugs and new features or comment and vote on the ones that you are interested in. * Help us reproduce issues marked with [status: need-help-to-reproduce](https://github.com/spring-projects/spring-batch/labels/status%3A%20need-help-to-reproduce) by following the [Issue Reporting Guidelines](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md). * Github is for social coding: if you want to write code, we encourage contributions through pull requests. If you want to contribute code this way, please familiarize yourself with the process outlined here: [Contributor Guidelines](https://github.com/spring-projects/spring-batch/blob/main/CONTRIBUTING.md). * Watch for Spring Batch related articles on [spring.io](https://spring.io). Before we accept pull requests, we will need you to sign the [contributor's agreement](https://support.springsource.com/spring_committer_signup). Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests. # Code of Conduct Please see our [code of conduct](https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md). # License Spring Batch is Open Source software released under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
0
projectlombok/lombok
Very spicy additions to the Java programming language.
null
# Project Lombok Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again, with one annotation your class has a fully featured builder, automate your logging variables, and much more. See [LICENSE] for the Project Lombok license. Looking for professional support of Project Lombok? Lombok is now part of a [tidelift subscription]! For a list of all authors, see the [AUTHORS] file. For complete project information, a short tutorial on what lombok does, and how to download / use / install it, see [projectlombok.org] You can review our security policy via [SECURITY.md] [LICENSE]: https://github.com/projectlombok/lombok/blob/master/LICENSE [AUTHORS]: https://github.com/projectlombok/lombok/blob/master/AUTHORS [SECURITY.md]: https://github.com/projectlombok/lombok/blob/master/SECURITY.md [projectlombok.org]: https://projectlombok.org/ [tidelift subscription]: https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=maven-org-projectlombok-lombok&utm_medium=referral&campaign=website
0
apache/solr
Apache Solr open-source search software
backend information-retrieval java lucene nosql search search-engine solr
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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. --> # Welcome to the Apache Solr project! ----------------------------------- Solr is the popular, blazing fast open source search platform for all your enterprise, e-commerce, and analytics needs, built on [Apache Lucene](https://lucene.apache.org/). For a complete description of the Solr project, team composition, source code repositories, and other details, please see the Solr web site at https://solr.apache.org/ ## Download Downloads for Apache Solr distributions are available at https://solr.apache.org/downloads.html. ## Running Solr ### Installing Solr The Reference Guide contains an entire [Deployment Guide](https://solr.apache.org/guide/solr/latest/deployment-guide/system-requirements.html) to walk you through installing Solr. ### Running Solr in Docker You can run Solr in Docker via the [official image](https://hub.docker.com/_/solr). Learn more about [Solr in Docker](https://solr.apache.org/guide/solr/latest/deployment-guide/solr-in-docker.html) ### Running Solr on Kubernetes Solr has official support for running on Kubernetes, in the official Docker image. Please refer to the [Solr Operator](https://solr.apache.org/operator) home for details, tutorials and instructions. ## How to Use Solr includes a few examples to help you get started. To run a specific example, enter: ``` bin/solr start -e <EXAMPLE> where <EXAMPLE> is one of: cloud: SolrCloud example techproducts: Comprehensive example illustrating many of Solr's core capabilities schemaless: Schema-less example (schema is inferred from data during indexing) films: Example of starting with _default configset and adding explicit fields dynamically ``` For instance, if you want to run the techproducts example, enter: ``` bin/solr start -e techproducts ``` For a more in-depth introduction, please check out the [tutorials in the Solr Reference Guide](https://solr.apache.org/guide/solr/latest/getting-started/solr-tutorial.html). ## Support - [Users Mailing List](https://solr.apache.org/community.html#mailing-lists-chat) - Slack: Solr Community Channel. Sign up at https://s.apache.org/solr-slack - IRC: `#solr` on [libera.chat](https://web.libera.chat/?channels=#solr) ## Developer Documentation Learn more about developing Solr by reading through the developer docs in [./dev-docs](./dev-docs) source tree or building Solr from source in [./dev-docs/solr-source-code.adoc](./dev-docs/solr-source-code.adoc) ### Quickstart Solr uses [Gradle](https://gradle.org/) for its build system. Here are some useful hints to build and run Solr locally: - To build a Solr dev distribution: ``` ./gradlew dev ``` - To run the Solr dev distribution locally: ``` cd ./solr/packaging/build/dev bin/solr start -c ``` - Open a web browser and go to http://localhost:8983/solr/ to access the Solr Admin interface. You can also use the `bin/solr` script to create and manage Solr collections. For example use the `bin/solr post` tool to index some sample data. ## Get Involved Please review [CONTRIBUTING.md](CONTRIBUTING.md) for information on contributing to the project. To get involved in the developer community: - [Mailing Lists](https://solr.apache.org/community.html#mailing-lists-chat) - Slack: `#solr-dev` in the `the-asf` organization. Sign up at https://the-asf.slack.com/messages/CE70MDPMF - [Issue Tracker (JIRA)](https://issues.apache.org/jira/browse/SOLR) - IRC: `#solr-dev` on [libera.chat](https://web.libera.chat/?channels=#solr-dev)
0
datahub-project/datahub
The Metadata Platform for your Data Stack
data-catalog data-discovery datahub hacktoberfest linkedin metadata
<!--HOSTED_DOCS_ONLY import useBaseUrl from '@docusaurus/useBaseUrl'; export const Logo = (props) => { return ( <div style={{ display: "flex", justifyContent: "center", padding: "20px", height: "190px" }}> <img alt="DataHub Logo" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/datahub-logo-color-mark.svg" {...props} /> </div> ); }; <Logo /> <!-- HOSTED_DOCS_ONLY--> <p align="center"> <img alt="DataHub" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/datahub-logo-color-mark.svg" height="150" /> </p> <!-- --> # DataHub: The Metadata Platform for the Modern Data Stack ## Built with ❤️ by <img src="https://datahubproject.io/img/acryl-logo-light-mark.png" width="25"/> [Acryl Data](https://acryldata.io) and <img src="https://datahubproject.io/img/LI-In-Bug.png" width="25"/> [LinkedIn](https://engineering.linkedin.com) [![Version](https://img.shields.io/github/v/release/datahub-project/datahub?include_prereleases)](https://github.com/datahub-project/datahub/releases/latest) [![PyPI version](https://badge.fury.io/py/acryl-datahub.svg)](https://badge.fury.io/py/acryl-datahub) [![build & test](https://github.com/datahub-project/datahub/workflows/build%20&%20test/badge.svg?branch=master&event=push)](https://github.com/datahub-project/datahub/actions?query=workflow%3A%22build+%26+test%22+branch%3Amaster+event%3Apush) [![Docker Pulls](https://img.shields.io/docker/pulls/acryldata/datahub-gms.svg)](https://hub.docker.com/r/acryldata/datahub-gms) [![Slack](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://slack.datahubproject.io) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/datahub-project/datahub/blob/master/docs/CONTRIBUTING.md) [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/datahub-project/datahub)](https://github.com/datahub-project/datahub/pulls?q=is%3Apr) [![License](https://img.shields.io/github/license/datahub-project/datahub)](https://github.com/datahub-project/datahub/blob/master/LICENSE) [![YouTube](https://img.shields.io/youtube/channel/subscribers/UC3qFQC5IiwR5fvWEqi_tJ5w?style=social)](https://www.youtube.com/channel/UC3qFQC5IiwR5fvWEqi_tJ5w) [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/datahub-project) [![Follow](https://img.shields.io/twitter/follow/datahubproject?label=Follow&style=social)](https://twitter.com/datahubproject) ### 🏠 Hosted DataHub Docs (Courtesy of Acryl Data): [datahubproject.io](https://datahubproject.io/docs) --- [Quickstart](https://datahubproject.io/docs/quickstart) | [Features](https://datahubproject.io/docs/) | [Roadmap](https://feature-requests.datahubproject.io/roadmap) | [Adoption](#adoption) | [Demo](https://demo.datahubproject.io/) | [Town Hall](https://datahubproject.io/docs/townhalls) --- > 📣 DataHub Town Hall is the 4th Thursday at 9am US PT of every month - [add it to your calendar!](https://rsvp.datahubproject.io/) > > - Town-hall Zoom link: [zoom.datahubproject.io](https://zoom.datahubproject.io) > - [Meeting details](docs/townhalls.md) & [past recordings](docs/townhall-history.md) > ✨ DataHub Community Highlights: > > - Read our Monthly Project Updates [here](https://blog.datahubproject.io/tagged/project-updates). > - Bringing The Power Of The DataHub Real-Time Metadata Graph To Everyone At Acryl Data: [Data Engineering Podcast](https://www.dataengineeringpodcast.com/acryl-data-datahub-metadata-graph-episode-230/) > - Check out our most-read blog post, [DataHub: Popular Metadata Architectures Explained](https://engineering.linkedin.com/blog/2020/datahub-popular-metadata-architectures-explained) @ LinkedIn Engineering Blog. > - Join us on [Slack](docs/slack.md)! Ask questions and keep up with the latest announcements. ## Introduction DataHub is an open-source metadata platform for the modern data stack. Read about the architectures of different metadata systems and why DataHub excels [here](https://engineering.linkedin.com/blog/2020/datahub-popular-metadata-architectures-explained). Also read our [LinkedIn Engineering blog post](https://engineering.linkedin.com/blog/2019/data-hub), check out our [Strata presentation](https://speakerdeck.com/shirshanka/the-evolution-of-metadata-linkedins-journey-strata-nyc-2019) and watch our [Crunch Conference Talk](https://www.youtube.com/watch?v=OB-O0Y6OYDE). You should also visit [DataHub Architecture](docs/architecture/architecture.md) to get a better understanding of how DataHub is implemented. ## Features & Roadmap Check out DataHub's [Features](docs/features.md) & [Roadmap](https://feature-requests.datahubproject.io/roadmap). ## Demo and Screenshots There's a [hosted demo environment](https://demo.datahubproject.io/) courtesy of [Acryl Data](https://acryldata.io) where you can explore DataHub without installing it locally ## Quickstart Please follow the [DataHub Quickstart Guide](https://datahubproject.io/docs/quickstart) to get a copy of DataHub up & running locally using [Docker](https://docker.com). As the guide assumes some basic knowledge of Docker, we'd recommend you to go through the "Hello World" example of [A Docker Tutorial for Beginners](https://docker-curriculum.com) if Docker is completely foreign to you. ## Development If you're looking to build & modify datahub please take a look at our [Development Guide](https://datahubproject.io/docs/developers). <p align="center"> <a href="https://demo.datahubproject.io/"> <img width="70%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/entity.png"/> </a> </p> ## Source Code and Repositories - [datahub-project/datahub](https://github.com/datahub-project/datahub): This repository contains the complete source code for DataHub's metadata model, metadata services, integration connectors and the web application. - [acryldata/datahub-actions](https://github.com/acryldata/datahub-actions): DataHub Actions is a framework for responding to changes to your DataHub Metadata Graph in real time. - [acryldata/datahub-helm](https://github.com/acryldata/datahub-helm): Repository of helm charts for deploying DataHub on a Kubernetes cluster - [acryldata/meta-world](https://github.com/acryldata/meta-world): A repository to store recipes, custom sources, transformations and other things to make your DataHub experience magical - [dbt-impact-action](https://github.com/acryldata/dbt-impact-action) : This repository contains a github action for commenting on your PRs with a summary of the impact of changes within a dbt project - [datahub-tools](https://github.com/makenotion/datahub-tools) : Additional python tools to interact with the DataHub GraphQL endpoints, built by Notion - [business-glossary-sync-action](https://github.com/acryldata/business-glossary-sync-action) : This repository contains a github action that opens PRs to update your business glossary yaml file. ## Releases See [Releases](https://github.com/datahub-project/datahub/releases) page for more details. We follow the [SemVer Specification](https://semver.org) when versioning the releases and adopt the [Keep a Changelog convention](https://keepachangelog.com/) for the changelog format. ## Contributing We welcome contributions from the community. Please refer to our [Contributing Guidelines](docs/CONTRIBUTING.md) for more details. We also have a [contrib](contrib) directory for incubating experimental features. ## Community Join our [Slack workspace](https://slack.datahubproject.io) for discussions and important announcements. You can also find out more about our upcoming [town hall meetings](docs/townhalls.md) and view past recordings. ## Adoption Here are the companies that have officially adopted DataHub. Please feel free to add yours to the list if we missed it. - [ABLY](https://ably.team/) - [Adevinta](https://www.adevinta.com/) - [Banksalad](https://www.banksalad.com) - [Cabify](https://cabify.tech/) - [ClassDojo](https://www.classdojo.com/) - [Coursera](https://www.coursera.org/) - [DefinedCrowd](http://www.definedcrowd.com) - [DFDS](https://www.dfds.com/) - [Digital Turbine](https://www.digitalturbine.com/) - [Expedia Group](http://expedia.com) - [Experius](https://www.experius.nl) - [Geotab](https://www.geotab.com) - [Grofers](https://grofers.com) - [Haibo Technology](https://www.botech.com.cn) - [hipages](https://hipages.com.au/) - [inovex](https://www.inovex.de/) - [IOMED](https://iomed.health) - [Klarna](https://www.klarna.com) - [LinkedIn](http://linkedin.com) - [Moloco](https://www.moloco.com/en) - [N26](https://n26brasil.com/) - [Optum](https://www.optum.com/) - [Peloton](https://www.onepeloton.com) - [PITS Global Data Recovery Services](https://www.pitsdatarecovery.net/) - [Razer](https://www.razer.com) - [Saxo Bank](https://www.home.saxo) - [Showroomprive](https://www.showroomprive.com/) - [SpotHero](https://spothero.com) - [Stash](https://www.stash.com) - [Shanghai HuaRui Bank](https://www.shrbank.com) - [s7 Airlines](https://www.s7.ru/) - [ThoughtWorks](https://www.thoughtworks.com) - [TypeForm](http://typeform.com) - [Udemy](https://www.udemy.com/) - [Uphold](https://uphold.com) - [Viasat](https://viasat.com) - [Wikimedia](https://www.wikimedia.org) - [Wolt](https://wolt.com) - [Zynga](https://www.zynga.com) ## Select Articles & Talks - [DataHub Blog](https://blog.datahubproject.io/) - [DataHub YouTube Channel](https://www.youtube.com/channel/UC3qFQC5IiwR5fvWEqi_tJ5w) - [Optum: Data Mesh via DataHub](https://opensource.optum.com/blog/2022/03/23/data-mesh-via-datahub) - [Saxo Bank: Enabling Data Discovery in Data Mesh](https://medium.com/datahub-project/enabling-data-discovery-in-a-data-mesh-the-saxo-journey-451b06969c8f) - [Bringing The Power Of The DataHub Real-Time Metadata Graph To Everyone At Acryl Data](https://www.dataengineeringpodcast.com/acryl-data-datahub-metadata-graph-episode-230/) - [DataHub: Popular Metadata Architectures Explained](https://engineering.linkedin.com/blog/2020/datahub-popular-metadata-architectures-explained) - [Driving DataOps Culture with LinkedIn DataHub](https://www.youtube.com/watch?v=ccsIKK9nVxk) @ [DataOps Unleashed 2021](https://dataopsunleashed.com/#shirshanka-session) - [The evolution of metadata: LinkedIn’s story](https://speakerdeck.com/shirshanka/the-evolution-of-metadata-linkedins-journey-strata-nyc-2019) @ [Strata Data Conference 2019](https://conferences.oreilly.com/strata/strata-ny-2019.html) - [Journey of metadata at LinkedIn](https://www.youtube.com/watch?v=OB-O0Y6OYDE) @ [Crunch Data Conference 2019](https://crunchconf.com/2019) - [DataHub Journey with Expedia Group](https://www.youtube.com/watch?v=ajcRdB22s5o) - [Data Discoverability at SpotHero](https://www.slideshare.net/MaggieHays/data-discoverability-at-spothero) - [Data Catalogue — Knowing your data](https://medium.com/albert-franzi/data-catalogue-knowing-your-data-15f7d0724900) - [DataHub: A Generalized Metadata Search & Discovery Tool](https://engineering.linkedin.com/blog/2019/data-hub) - [Open sourcing DataHub: LinkedIn’s metadata search and discovery platform](https://engineering.linkedin.com/blog/2020/open-sourcing-datahub--linkedins-metadata-search-and-discovery-p) - [Emerging Architectures for Modern Data Infrastructure](https://future.com/emerging-architectures-for-modern-data-infrastructure-2020/) See the full list [here](docs/links.md). ## License [Apache License 2.0](./LICENSE).
0
apolloconfig/apollo
Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
config-management configuration-management distributed-configuration microservices spring-boot spring-cloud
<img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/logo/logo-simple.png" alt="apollo-logo" width="40%"> English | [中文](https://www.apolloconfig.com/#/zh/README) # Apollo - A reliable configuration management system [![Build Status](https://github.com/apolloconfig/apollo/workflows/build/badge.svg)](https://github.com/apolloconfig/apollo/actions) [![GitHub Release](https://img.shields.io/github/release/apolloconfig/apollo.svg)](https://github.com/apolloconfig/apollo/releases) [![Maven Central Repo](https://img.shields.io/maven-central/v/com.ctrip.framework.apollo/apollo-client.svg)](https://mvnrepository.com/artifact/com.ctrip.framework.apollo/apollo-client) [![codecov.io](https://codecov.io/github/apolloconfig/apollo/coverage.svg?branch=master)](https://codecov.io/github/apolloconfig/apollo?branch=master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Apollo is a reliable configuration management system. It can centrally manage the configurations of different applications and different clusters. It is suitable for microservice configuration management scenarios. The server side is developed based on Spring Boot and Spring Cloud, which can simply run without the need to install additional application containers such as Tomcat. The Java SDK does not rely on any framework and can run in all Java runtime environments. It also has good support for Spring/Spring Boot environments. The .Net SDK does not rely on any framework and can run in all .Net runtime environments. For more details of the product introduction, please refer [Introduction to Apollo Configuration Center](https://www.apolloconfig.com/#/zh/design/apollo-introduction). For local demo purpose, please refer [Quick Start](https://www.apolloconfig.com/#/zh/deployment/quick-start). Demo Environment: - [http://81.68.181.139](http://81.68.181.139/) - User/Password: apollo/admin # Screenshots ![Screenshot](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/docs/en/images/apollo-home-screenshot.jpg) # Features * **Unified management of the configurations of different environments and different clusters** * Apollo provides a unified interface to centrally manage the configurations of different environments, different clusters, and different namespaces * The same codebase could have different configurations when deployed in different clusters * With the namespace concept, it is easy to support multiple applications to share the same configurations, while also allowing them to customize the configurations * Multiple languages is provided in user interface(currently Chinese and English) * **Configuration changes takes effect in real time (hot release)** * After the user modified the configuration and released it in Apollo, the sdk will receive the latest configurations in real time (1 second) and notify the application * **Release version management** * Every configuration releases are versioned, which is friendly to support configuration rollback * **Grayscale release** * Support grayscale configuration release, for example, after clicking release, it will only take effect for some application instances. After a period of observation, we could push the configurations to all application instances if there is no problem * **Authorization management, release approval and operation audit** * Great authorization mechanism is designed for applications and configurations management, and the management of configurations is divided into two operations: editing and publishing, therefore greatly reducing human errors * All operations have audit logs for easy tracking of problems * **Client side configuration information monitoring** * It's very easy to see which instances are using the configurations and what versions they are using * **Rich SDKs available** * Provides native sdks of Java and .Net to facilitate application integration * Support Spring Placeholder, Annotation and Spring Boot ConfigurationProperties for easy application use (requires Spring 3.1.1+) * Http APIs are provided, so non-Java and .Net applications can integrate conveniently * Rich third party sdks are also available, e.g. Golang, Python, NodeJS, PHP, C, etc * **Open platform API** * Apollo itself provides a unified configuration management interface, which supports features such as multi-environment, multi-data center configuration management, permissions, and process governance * However, for the sake of versatility, Apollo will not put too many restrictions on the modification of the configuration, as long as it conforms to the basic format, it can be saved. * In our research, we found that for some users, their configurations may have more complicated formats, such as xml, json, and the format needs to be verified * There are also some users such as DAL, which not only have a specific format, but also need to verify the entered value before saving, such as checking whether the database, username and password match * For this type of application, Apollo allows the application to modify and release configurations through open APIs, which has great authorization and permission control mechanism built in * **Simple deployment** * As an infrastructure service, the configuration center has very high availability requirements, which forces Apollo to rely on external dependencies as little as possible * Currently, the only external dependency is MySQL, so the deployment is very simple. Apollo can run as long as Java and MySQL are installed * Apollo also provides a packaging script, which can generate all required installation packages with just one click, and supports customization of runtime parameters # Usage * [Apollo User Guide](https://www.apolloconfig.com/#/zh/portal/apollo-user-guide) * [Apollo Open APIs](https://www.apolloconfig.com/#/zh/portal/apollo-open-api-platform) * [Apollo Use Cases](https://github.com/apolloconfig/apollo-use-cases) * [Apollo User Practices](https://www.apolloconfig.com/#/zh/portal/apollo-user-practices) * [Apollo Security Best Practices](https://www.apolloconfig.com/#/zh/portal/apollo-user-guide?id=_71-%e5%ae%89%e5%85%a8%e7%9b%b8%e5%85%b3) # SDK * [Java SDK User Guide](https://www.apolloconfig.com/#/zh/client/java-sdk-user-guide) * [.Net SDK user Guide](https://www.apolloconfig.com/#/zh/client/dotnet-sdk-user-guide) * [Golang SDK User Guide](https://www.apolloconfig.com/#/zh/client/golang-sdks-user-guide) * [Python SDK User Guide](https://www.apolloconfig.com/#/zh/client/python-sdks-user-guide) * [NodeJS SDK User Guide](https://www.apolloconfig.com/#/zh/client/nodejs-sdks-user-guide) * [PHP SDK User Guide](https://www.apolloconfig.com/#/zh/client/php-sdks-user-guide) * [C SDK User Guide](https://www.apolloconfig.com/#/zh/client/c-sdks-user-guide) * [Rust SDK User Guide](https://www.apolloconfig.com/#/zh/client/rust-sdks-user-guide) * [HTTP API Guide](https://www.apolloconfig.com/#/zh/client/other-language-client-user-guide) # Design * [Apollo Design](https://www.apolloconfig.com/#/zh/design/apollo-design) * [Apollo Core Concept - Namespace](https://www.apolloconfig.com/#/zh/design/apollo-core-concept-namespace) * [Apollo Architecture Analysis](https://mp.weixin.qq.com/s/-hUaQPzfsl9Lm3IqQW3VDQ) * [Apollo Source Code Explanation](http://www.iocoder.cn/categories/Apollo/) # Development * [Apollo Development Guide](https://www.apolloconfig.com/#/zh/contribution/apollo-development-guide) * Code Styles * [Eclipse Code Style](https://github.com/apolloconfig/apollo/blob/master/apollo-buildtools/style/eclipse-java-google-style.xml) * [Intellij Code Style](https://github.com/apolloconfig/apollo/blob/master/apollo-buildtools/style/intellij-java-google-style.xml) # Deployment * [Quick Start](https://www.apolloconfig.com/#/zh/deployment/quick-start) * [Distributed Deployment Guide](https://www.apolloconfig.com/#/zh/deployment/distributed-deployment-guide) # Release Notes * [Releases](https://github.com/apolloconfig/apollo/releases) # FAQ * [FAQ](https://www.apolloconfig.com/#/zh/faq/faq) * [Common Issues in Deployment & Development Phase](https://www.apolloconfig.com/#/zh/faq/common-issues-in-deployment-and-development-phase) # Presentation * [Design and Implementation Details of Apollo](http://www.itdks.com/dakalive/detail/3420) * [Slides](https://github.com/apolloconfig/apollo-community/blob/master/slides/design-and-implementation-of-apollo.pdf) * [Configuration Center Makes Microservices Smart](https://2018.qconshanghai.com/presentation/799) * [Slides](https://github.com/apolloconfig/apollo-community/blob/master/slides/configuration-center-makes-microservices-smart.pdf) # Publication * [Design and Implementation Details of Apollo](https://www.infoq.cn/article/open-source-configuration-center-apollo) * [Configuration Center Makes Microservices Smart](https://mp.weixin.qq.com/s/iDmYJre_ULEIxuliu1EbIQ) # Community * [Apollo Team](https://www.apolloconfig.com/#/en/community/team) * [Community Governance](https://github.com/apolloconfig/apollo/blob/master/GOVERNANCE.md) * [Contributing Guide](https://github.com/apolloconfig/apollo/blob/master/CONTRIBUTING.md) # License The project is licensed under the [Apache 2 license](https://github.com/apolloconfig/apollo/blob/master/LICENSE). # Known Users > Sorted by registration order,users are welcome to register in [https://github.com/apolloconfig/apollo/issues/451](https://github.com/apolloconfig/apollo/issues/451) (reference purpose only for the community) <table> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ctrip.png" alt="携程"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/bluestone.png" alt="青石证券"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/sagreen.png" alt="沙绿"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/umetrip.jpg" alt="航旅纵横"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zhuanzhuan.png" alt="58转转"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/phone580.png" alt="蜂助手"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hainan-airlines.png" alt="海南航空"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/cvte.png" alt="CVTE"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mainbo.jpg" alt="明博教育"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/madailicai.png" alt="麻袋理财"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mxnavi.jpg" alt="美行科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/fshows.jpg" alt="首展科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/feezu.png" alt="易微行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/rencaijia.png" alt="人才加"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/keking.png" alt="凯京集团"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/leoao.png" alt="乐刻运动"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/dji.png" alt="大疆"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/kkmh.png" alt="快看漫画"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/wolaidai.png" alt="我来贷"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xsrj.png" alt="虚实软件"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yanxuan.png" alt="网易严选"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/sjzg.png" alt="视觉中国"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zc360.png" alt="资产360"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ecarx.png" alt="亿咖通"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/5173.png" alt="5173"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hujiang.png" alt="沪江"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/163yun.png" alt="网易云基础服务"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/cash-bus.png" alt="现金巴士"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/smartisan.png" alt="锤子科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/toodc.png" alt="头等仓"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/juneyaoair.png" alt="吉祥航空"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/263mobile.png" alt="263移动通信"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/toutoujinrong.png" alt="投投金融"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mytijian.png" alt="每天健康"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/maiyabank.png" alt="麦芽金服"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/fengunion.png" alt="蜂向科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/geex-logo.png" alt="即科金融"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/beike.png" alt="贝壳网"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/youzan.png" alt="有赞"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yunjihuitong.png" alt="云集汇通"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/rhinotech.png" alt="犀牛瀚海科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/nxin.png" alt="农信互联"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mgzf.png" alt="蘑菇租房"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/huli-logo.png" alt="狐狸金服"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mandao.png" alt="漫道集团"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/enmonster.png" alt="怪兽充电"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/nanguazufang.png" alt="南瓜租房"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/shitoujinrong.png" alt="石投金融"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/tubatu.png" alt="土巴兔"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/payh_logo.png" alt="平安银行"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xinxindai.png" alt="新新贷"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/chrtc.png" alt="中国华戎科技集团"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/tuya_logo.png" alt="涂鸦智能"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/szlcsc.jpg" alt="立创商城"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hairongyi.png" alt="乐赚金服"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/kxqc.png" alt="开心汽车"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ppcredit.png" alt="乐赚金服"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/primeton.png" alt="普元信息"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hoskeeper.png" alt="医帮管家"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/fula.png" alt="付啦信用卡管家"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/uzai.png" alt="悠哉网"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/91wutong.png" alt="梧桐诚选"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ppdai.png" alt="拍拍贷"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xinyongfei.png" alt="信用飞"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/dxy.png" alt="丁香园"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ghtech.png" alt="国槐科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/qbb.png" alt="亲宝宝"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/huawei_logo.png" alt="华为视频直播"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/weiboyi.png" alt="微播易"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ofpay.png" alt="欧飞"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mishuo.png" alt="迷说"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yixia.png" alt="一下科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/daocloud.png" alt="DaoCloud"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/cnvex.png" alt="汽摩交易所"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/100tal.png" alt="好未来教育集团"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ainirobot.png" alt="猎户星空"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zhuojian.png" alt="卓健科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/enjoyor.png" alt="银江股份"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/tuhu.png" alt="途虎养车"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/homedo.png" alt="河姆渡"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xwbank.png" alt="新网银行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ctspcl.png" alt="中旅安信云贷"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/meiyou.png" alt="美柚"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zkh-logo.png" alt="震坤行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/wgss.png" alt="万谷盛世"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/plateno.png" alt="铂涛旅行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/lifesense.png" alt="乐心"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/reachmedia.png" alt="亿投传媒"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/guxiansheng.png" alt="股先生"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/caixuetang.png" alt="财学堂"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/4399.png" alt="4399"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/autohome.png" alt="汽车之家"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mbcaijing.png" alt="面包财经"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hoopchina.png" alt="虎扑"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/sohu-auto.png" alt="搜狐汽车"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/liangfuzhengxin.png" alt="量富征信"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/maihaoche.png" alt="卖好车"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zyiot.jpg" alt="中移物联网"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/biauto.png" alt="易车网"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/maiyaole.png" alt="一药网"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xiaoying.png" alt="小影"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/caibeike.png" alt="彩贝壳"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yeelight.png" alt="YEELIGHT"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/itsgmu.png" alt="积目"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/acmedcare.png" alt="极致医疗"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jinhui365.png" alt="金汇金融"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/900etrip.png" alt="久柏易游"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/24xiaomai.png" alt="小麦铺"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/vvic.png" alt="搜款网"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mizlicai.png" alt="米庄理财"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/bjt.png" alt="贝吉塔网络科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/weimob.png" alt="微盟"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/kada.png" alt="网易卡搭"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/kapbook.png" alt="股书"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jumore.png" alt="聚贸"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/bimface.png" alt="广联达bimface"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/globalgrow.png" alt="环球易购"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jollychic.png" alt="浙江执御"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/2dfire.jpg" alt="二维火"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/shopin.png" alt="上品"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/inspur.png" alt="浪潮集团"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ngarihealth.png" alt="纳里健康"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/oraro.png" alt="橙红科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/dragonpass.png" alt="龙腾出行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/lizhi.fm.png" alt="荔枝"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/htd.png" alt="汇通达"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yunrong.png" alt="云融金科"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/tszg360.png" alt="天生掌柜"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/rongplus.png" alt="容联光辉"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/intellif.png" alt="云天励飞"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jiayundata.png" alt="嘉云数据"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zts.png" alt="中泰证券网络金融部"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/163dun.png" alt="网易易盾"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xiangwushuo.png" alt="享物说"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/sto.png" alt="申通"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jinhe.png" alt="金和网络"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/2345.png" alt="二三四五"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/chtwm.jpg" alt="恒天财富"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/uweixin.png" alt="沐雪微信"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/wzeye.png" alt="温州医科大学附属眼视光医院"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/10010pay.png" alt="联通支付"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/shanshu.png" alt="杉数科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/fenlibao.png" alt="分利宝"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hetao101.png" alt="核桃编程"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xiaohongshu.png" alt="小红书"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/blissmall.png" alt="幸福西饼"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ky-express.png" alt="跨越速运"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/oyohotels.png" alt="OYO"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/100-me.png" alt="叮咚买菜"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zhidaohulian.jpg" alt="智道网联"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xueqiu.jpg" alt="雪球"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/autocloudpro.png" alt="车通云"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/dadaabc.png" alt="哒哒英语"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xedaojia.jpg" alt="小E微店"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/daling.png" alt="达令家"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/renliwo.png" alt="人力窝"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mocire.jpg" alt="嘉美在线"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/uepay.png" alt="极易付"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/wdom.png" alt="智慧开源"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/cheshiku.png" alt="车仕库"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/taimeitech.png" alt="太美医疗科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yilianbaihui.png" alt="亿联百汇"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zhoupu123.png" alt="舟谱数据"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/frxs.png" alt="芙蓉兴盛"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/beastshop.png" alt="野兽派"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/kaishustory.png" alt="凯叔讲故事"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/haodf.png" alt="好大夫在线"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/insyunmi.png" alt="云幂信息技术"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/duiba.png" alt="兑吧"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/9ji.png" alt="九机网"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/sui.png" alt="随手科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/aixiangdao.png" alt="万谷盛世"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yunzhangfang.png" alt="云账房"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yuantutech.png" alt="浙江远图互联"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/qk365.png" alt="青客公寓"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/eastmoney.png" alt="东方财富"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jikexiu.png" alt="极客修"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/meix.png" alt="美市科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zto.png" alt="中通快递"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/e6yun.png" alt="易流科技"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xiaoyuanzhao.png" alt="实习僧"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/dalingjia.png" alt="达令家"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/secoo.png" alt="寺库"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/lianlianpay.png" alt="连连支付"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zhongan.png" alt="众安保险"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/360jinrong.png" alt="360金融"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/caschina.png" alt="中航服商旅"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ke.png" alt="贝壳"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yeahmobi.png" alt="Yeahmobi易点天下"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/idengyun.png" alt="北京登云美业网络科技有限公司"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jinher.png" alt="金和网络"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/komect.png" alt="中移(杭州)信息技术有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/beisen.png" alt="北森"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/log56.png" alt="合肥维天运通"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/meboth.png" alt="北京蜜步科技有限公司"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/postop.png" alt="术康"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/rfchina.png" alt="富力集团"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/tfxing.png" alt="天府行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/8travelpay.png" alt="八商山"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/centaline.png" alt="中原地产"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zkyda.png" alt="智科云达"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/house730.png" alt="中原730"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/pagoda.png" alt="百果园"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/bolome.png" alt="波罗蜜"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xignite.png" alt="Xignite"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/aduer.png" alt="杭州有云科技有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jojoreading.png" alt="成都书声科技有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/sweetome.png" alt="斯维登集团"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/vipthink.png" alt="广东快乐种子科技有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/tongxuecool.png" alt="上海盈翼文化传播有限公司"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/sccfc.png" alt="上海尚诚消费金融股份有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ziroom.png" alt="自如网"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jd.png" alt="京东"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/rabbitpre.png" alt="兔展智能"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zhubei.png" alt="竹贝"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/imile.png" alt="iMile(中东)"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/helloglobal.png" alt="哈罗出行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zhaopin.png" alt="智联招聘"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/acadsoc.png" alt="阿卡索"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mojory.png" alt="妙知旅"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/chengduoduo.png" alt="程多多"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/baojunev.png" alt="上汽通用五菱"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/leyan.png" alt="乐言科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/dushu.png" alt="樊登读书"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/zyiz.png" alt="找一找教程网"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/bppc.png" alt="中油碧辟石油有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/shanglv51.png" alt="四川商旅无忧科技服务有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/waijiao365.png" alt="懿鸢网络科技(上海)有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/gaoding.jpg" alt="稿定科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ricacorp.png" alt="搵樓 - 利嘉閣"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/t3go.png" alt="南京领行科技股份有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mokahr.jpg" alt="北京希瑞亚斯科技有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/printrainbow.png" alt="印彩虹印刷公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/milliontech.png" alt="Million Tech"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/guoguokeji.jpg" alt="果果科技"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/airkunming.png" alt="昆明航空"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/5i5j.png" alt="我爱我家"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/gjzq.png" alt="国金证券"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/enjoymusic.jpg" alt="不亦乐乎"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/cnhnb.png" alt="惠农网"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/daoklab.jpg" alt="成都道壳"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ausnutria.jpg" alt="澳优乳业"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/deiyoudian.png" alt="河南有态度信息科技有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ezhiyang.png" alt="智阳第一人力"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/shie.png" alt="上海保险交易所"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/wsecar.png" alt="万顺叫车"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/shouqinba.jpg" alt="收钱吧"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/baozun.png" alt="宝尊电商"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xbnwl.png" alt="喜百年供应链"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/gwwisdom.png" alt="南京观为智慧软件科技有限公司"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ztrip.png" alt="在途商旅"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hualala.png" alt="哗啦啦"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/xin.png" alt="优信二手车"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/maycur.png" alt="每刻科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/bullyun.png" alt="杭州蛮牛"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/bestpay.png" alt="翼支付"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mockuai.png" alt="魔筷科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ct108.png" alt="畅唐网络"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jusdaglobal.jpg" alt="准时达"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/izaodao.png" alt="早道网校"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ovopark.jpg" alt="万店掌"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/funstory.jpg" alt="推文科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/lemonbox.png" alt="Lemonbox"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/polyt.png" alt="保利票务"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/chipwing.png" alt="芯翼科技"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/czbank.png" alt="浙商银行"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/czbyqy.png" alt="易企银科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/yundun.jpg" alt="上海云盾"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/gaiaworks.jpg" alt="苏州盖雅信息技术有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mengxiang.png" alt="爱库存"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/jidouauto.png" alt="极豆车联网"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ipalfish.png" alt="伴鱼少儿英语"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/iqboard.png" alt="锐达科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/koolearn.png" alt="新东方在线"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/kingcome.png" alt="金康高科"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/soulapp.png" alt="soul"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/ezrpro.png" alt="驿氪"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/hc360.png" alt="慧聪"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/21cp.png" alt="中塑在线"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/goinglink.jpg" alt="甄云科技"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/aitrace.jpg" alt="追溯科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/moqipobing.png" alt="玩吧"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/cassan.png" alt="广州卡桑信息技术有限公司"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/shuidichou.png" alt="水滴"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/kuwo.png" alt="酷我音乐"></td> </tr> <tr> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mi.png" alt="小米"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/mvmyun.png" alt="今典"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/visabao.jpg" alt="签宝科技"></td> <td><img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/known-users/inrice.png" alt="广州趣米网络科技有限公司"></td> <td><a target="_blank" href="https://github.com/apolloconfig/apollo/issues/451">More...</a></td> </tr> </table> # Awards <img src="https://cdn.jsdelivr.net/gh/apolloconfig/apollo-community@master/images/awards/oschina-2018-award.jpg" width="240px" alt="The most popular Chinese open source software in 2018"> # Stargazers over time [![Stargazers over time](https://api.star-history.com/svg?repos=apolloconfig/apollo&type=Date)](https://star-history.com/#apolloconfig/apollo&Date)
0
antlr/antlr4
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
antlr antlr4 cpp csharp dart golang grammar java javascript language-recognition parse parser-generator parsing php python swift
# ANTLR v4 [![Java 11+](https://img.shields.io/badge/java-11+-4c7e9f.svg)](http://java.oracle.com) [![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt) **ANTLR** (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface (or visitor) that makes it easy to respond to the recognition of phrases of interest. **Dev branch build status** [![MacOSX, Windows, Linux](https://github.com/antlr/antlr4/actions/workflows/hosted.yml/badge.svg)](https://github.com/antlr/antlr4/actions/workflows/hosted.yml) (github actions) <!-- * [![Windows](https://github.com/antlr/antlr4/actions/workflows/windows.yml/badge.svg?branch=dev)](https://github.com/antlr/antlr4/actions/workflows/windows.yml) (github actions) * [![Circle CI Build Status (Linux)](https://img.shields.io/circleci/build/gh/antlr/antlr4/master?label=Linux)](https://app.circleci.com/pipelines/github/antlr/antlr4) (CircleCI) [![AppVeyor CI Build Status (Windows)](https://img.shields.io/appveyor/build/parrt/antlr4?label=Windows)](https://ci.appveyor.com/project/parrt/antlr4) [![Travis-CI Build Status (Swift-Linux)](https://img.shields.io/travis/antlr/antlr4.svg?label=Linux-Swift&branch=master)](https://travis-ci.com/github/antlr/antlr4) --> ## Versioning ANTLR 4 supports 10 target languages (Cpp, CSharp, Dart, Java, JavaScript, PHP, Python3, Swift, TypeScript, Go), and ensuring consistency across these targets is a unique and highly valuable feature. To ensure proper support of this feature, each release of ANTLR is a complete release of the tool and the 10 runtimes, all with the same version. As such, ANTLR versioning does not strictly follow semver semantics: * a component may be released with the latest version number even though nothing has changed within that component since the previous release * major version is bumped only when ANTLR is rewritten for a totally new "generation", such as ANTLR3 -> ANTLR4 (LL(\*) -> ALL(\*) parsing) * minor version updates may include minor breaking changes, the policy is to regenerate parsers with every release (4.11 -> 4.12) * backwards compatibility is only guaranteed for patch version bumps (4.11.1 -> 4.11.2) If you use a semver verifier in your CI, you probably want to apply special rules for ANTLR, such as treating minor change as a major change. ## Repo branch structure The default branch for this repo is [`master`](https://github.com/antlr/antlr4/tree/master), which is the latest stable release and has tags for the various releases; e.g., see release tag [4.9.3](https://github.com/antlr/antlr4/tree/4.9.3). Branch [`dev`](https://github.com/antlr/antlr4/tree/dev) is where development occurs between releases and all pull requests should be derived from that branch. The `dev` branch is merged back into `master` to cut a release and the release state is tagged (e.g., with `4.10-rc1` or `4.10`.) Visually our process looks roughly like this: <img src="doc/images/new-antlr-branches.png" width="500"> The Go target now has its own dedicated repo: ```bash $ go get github.com/antlr4-go/antlr ``` **Note** The dedicated Go repo is for `go get` and `import` only. Go runtime development is still performed in the main `antlr/antlr4` repo. ## Authors and major contributors * [Terence Parr](http://www.cs.usfca.edu/~parrt/), parrt@cs.usfca.edu ANTLR project lead and supreme dictator for life [University of San Francisco](http://www.usfca.edu/) * [Sam Harwell](http://tunnelvisionlabs.com/) (Tool co-author, Java and original C# target) * [Eric Vergnaud](https://github.com/ericvergnaud) (Javascript, TypeScript, Python2, Python3 targets and maintenance of C# target) * [Peter Boyer](https://github.com/pboyer) (Go target) * [Mike Lischke](http://www.soft-gems.net/) (C++ completed target) * Dan McLaughlin (C++ initial target) * David Sisson (C++ initial target and test) * [Janyou](https://github.com/janyou) (Swift target) * [Ewan Mellor](https://github.com/ewanmellor), [Hanzhou Shi](https://github.com/hanjoes) (Swift target merging) * [Ben Hamilton](https://github.com/bhamiltoncx) (Full Unicode support in serialized ATN and all languages' runtimes for code points > U+FFFF) * [Marcos Passos](https://github.com/marcospassos) (PHP target) * [Lingyu Li](https://github.com/lingyv-li) (Dart target) * [Ivan Kochurkin](https://github.com/KvanTTT) has made major contributions to overall quality, error handling, and Target performance. * [Justin King](https://github.com/jcking) has done a huge amount of work across multiple targets, but especially for C++. * [Ken Domino](https://github.com/kaby76) has a knack for finding bugs/issues and analysis; also a major contributor on the [grammars-v4 repo](https://github.com/antlr/grammars-v4). * [Jim Idle](https://github.com/jimidle) has contributed to previous versions of ANTLR and recently jumped back in to solve a major problem with the Go target. ## Useful information * [Release notes](https://github.com/antlr/antlr4/releases) * [Getting started with v4](https://github.com/antlr/antlr4/blob/master/doc/getting-started.md) * [Official site](http://www.antlr.org/) * [Documentation](https://github.com/antlr/antlr4/blob/master/doc/index.md) * [FAQ](https://github.com/antlr/antlr4/blob/master/doc/faq/index.md) * [ANTLR code generation targets](https://github.com/antlr/antlr4/blob/master/doc/targets.md)<br>(Currently: Java, C#, Python3, JavaScript, TypeScript, Go, C++, Swift, Dart, PHP) * _Note: As of version 4.14, we are dropping support for Python 2. We love the Python community, but Python 2 support was officially halted in Jan 2020. More recently, GiHub also dropped support for Python 2, which has made it impossible for us to maintain a consistent level of quality across targets (we use GitHub for our CI). Long live Python 3!_ * [Java API](http://www.antlr.org/api/Java/index.html) * [ANTLR v3](http://www.antlr3.org/) * [v3 to v4 Migration, differences](https://github.com/antlr/antlr4/blob/master/doc/faq/general.md) You might also find the following pages useful, particularly if you want to mess around with the various target languages. * [How to build ANTLR itself](https://github.com/antlr/antlr4/blob/master/doc/building-antlr.md) * [How we create and deploy an ANTLR release](https://github.com/antlr/antlr4/blob/master/doc/releasing-antlr.md) ## The Definitive ANTLR 4 Reference Programmers run into parsing problems all the time. Whether it’s a data format like JSON, a network protocol like SMTP, a server configuration file for Apache, a PostScript/PDF file, or a simple spreadsheet macro language—ANTLR v4 and this book will demystify the process. ANTLR v4 has been rewritten from scratch to make it easier than ever to build parsers and the language applications built on top. This completely rewritten new edition of the bestselling Definitive ANTLR Reference shows you how to take advantage of these new features. You can buy the book [The Definitive ANTLR 4 Reference](http://amzn.com/1934356999) at amazon or an [electronic version at the publisher's site](https://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference). You will find the [Book source code](http://pragprog.com/titles/tpantlr2/source_code) useful. ## Additional grammars [This repository](https://github.com/antlr/grammars-v4) is a collection of grammars without actions where the root directory name is the all-lowercase name of the language parsed by the grammar. For example, java, cpp, csharp, c, etc...
0
Helium314/HeliBoard
Customizable and privacy-conscious open-source keyboard
null
# HeliBoard HeliBoard is a privacy-conscious and customizable open-source keyboard, based on AOSP / OpenBoard. Does not use internet permission, and thus is 100% offline. [<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">](https://f-droid.org/packages/helium314.keyboard/) [<img src="https://user-images.githubusercontent.com/663460/26973090-f8fdc986-4d14-11e7-995a-e7c5e79ed925.png" alt="Download APK from GitHub" height="80">](https://github.com/Helium314/HeliBoard/releases/latest) ## Table of Contents - [Features](#features) * [FAQ / Common Issues](#faq--common-issues) * [Hidden Functionality](#hidden-functionality) - [Contributing](#contributing-) * [Reporting Issues](#reporting-issues) * [Translation](#translation) * [Dictionary Creation](#dictionary-creation) * [Code Contribution](#code-contribution) - [To-do](#to-do) - [License](#license) - [Credits](#credits) # Features <ul> <li>Add dictionaries for suggestions and spell check</li> <ul> <li>build your own, or get them <a href="https://codeberg.org/Helium314/aosp-dictionaries#dictionaries">here</a>, or in the <a href="https://codeberg.org/Helium314/aosp-dictionaries#experimental-dictionaries">experimental</a> section (quality may vary)</li> <li>additional dictionaries for emojis or scientific symbols can be used to provide suggestions (similar to "emoji search")</li> <li>note that for Korean layouts, suggestions only work using <a href="https://github.com/openboard-team/openboard/commit/83fca9533c03b9fecc009fc632577226bbd6301f">this dictionary</a>, the tools in the dictionary repository are not able to create working dictionaries</li> </ul> <li>Customize keyboard themes (style, colors and background image)</li> <ul> <li>can follow the system's day/night setting on Android 10+ (and on some versions of Android 9)</li> <li>can follow dynamic colors for Android 12+</li> </ul> <li>Customize keyboard <a href="https://github.com/Helium314/HeliBoard/blob/main/layouts.md">layouts</a> (only available when disabling <i>use system languages</i>)</li> <li>Multilingual typing</li> <li>Glide typing (<i>only with closed source library</i> ☹️)</li> <ul> <li>library not included in the app, as there is no compatible open source library available</li> <li>can be extracted from GApps packages ("<i>swypelibs</i>"), or downloaded <a href="https://github.com/erkserkserks/openboard/tree/46fdf2b550035ca69299ce312fa158e7ade36967/app/src/main/jniLibs">here</a></li> </ul> <li>Clipboard history</li> <li>One-handed mode</li> <li>Split keyboard (only available if the screen is large enough)</li> <li>Number pad</li> <li>Backup and restore your learned word / history data</li> </ul> ## FAQ / Common Issues * __Add a dictionary__: First download the dictionary file, e.g. from [here](https://codeberg.org/Helium314/aosp-dictionaries#dictionaries). Then go to language settings, click on the language, then on `+` next to _dictionary_ the _add_ and select the file. Alternatively you can open a `.dict` file in a file explorer with HeliBoard and then select the language. Note that the latter method does not work with all file explorers. * __Emoji search__: You can get addon dictionaries for emoji suggestions in the [dictionaries repo](https://codeberg.org/Helium314/aosp-dictionaries). An actual search function does not exist yet. * __Cannot switch choose layout__: This is only possible when _use system languages_ is disabled. You can select the layout when tapping on the language. * __How to customize layout__: Go to layout selection and use the `+` button, then you can add a custom layout, either from a file or you can copy and edit an existing layout. * __No suggestions for some language__: Check [dictionaries repo](https://codeberg.org/Helium314/aosp-dictionaries) whether a dictionary is available. If there is one, download it and add it in the language settings for this language. * __No suggestions in some app / text field__: This app respects the [no suggestions flag](https://developer.android.com/reference/android/text/InputType#TYPE_TEXT_FLAG_NO_SUGGESTIONS) set by some input fields, i.e. the developer does not want you to see suggestions here. Best do in issue report for that app if you think this behavior is wrong. Alternatively you can enable the _always show suggestions_ setting that overrides the _no suggestions_ flag. * __Multilingual typing__: Enable in _Languages & Layouts_, select the main language and tap the `+` button next to _multilingual typing_ to add a language. Note that the selection is limited to languages with the same script as the main language, and to languages that have a dictionary (see above for how to add). * __How to enable glide typing__: There is no glide typing built into this app, but you can load compatible libraries: Go to advanced settings -> _load gesture typing library_ and point to a file (setting not available in _nouserlib_ version). You can extract the file from GApps packages ("_swypelibs_"), or download one [here](https://github.com/erkserkserks/openboard/tree/master/app/src/main/jniLibs). Make sure to use the correct version (app will tell you in the dialog to load the library). * __Glide typing is not working after loading a library__: Possibly the download was corrupted, or you downloaded the wrong file. If you get a "_unknown file_" confirmation popup, it is likely you are not using the correct file (or you might be using a different version of the library). In rare cases, there might be crashes when the file is not in internal storage, or some [Samsung-specific problems](https://stackoverflow.com/a/75286899). * __German layout with / without umlauts__: _German (Germany)_ layout has umlauts, _German_ layout doesn't * __Spell checker is not checking all languages in multilingual typing__: Make sure you actually enabled HeliBoard spell checker. Usually it can be found in System Settings -> System -> Languages -> Advanced -> Spell Checker, but this may depend on Android version. * __Words added to Gboard dictionary are not suggested__: Gboard uses its own dictionary instead of the system's personal dictionary. See [here](https://github.com/Helium314/HeliBoard/issues/500#issuecomment-2032292161) for how to export the words. * __What is the _nouserlib_ version?__: The normal version (_release_) allows the user to provide a library for glide typing, while the _nouserlib_ version does not. Running code that isn't supplied with the app is _dynamic code loading_, which is a security risk. Android Studio warns about this: > Dynamically loading code from locations other than the application's library directory or the Android platform's built-in library directories is dangerous, as there is an increased risk that the code could have been tampered with. Applications should use loadLibrary when possible, which provides increased assurance that libraries are loaded from one of these safer locations. Application developers should use the features of their development environment to place application native libraries into the lib directory of their compiled APKs. The app checks the SHA256 checksum of the library and warns the user if it doesn't match with known library versions. A mismatch indicates the library was modified, but may also occur if the user intentionally provides a different library than expected (e.g. a self-built variant). Note that if the the app is installed as a system app, both versions have access to the system glide typing library (if it is installed). * __App crashing when using as system app__: This happens if you do not install the app, but just copy the APK. Then the app's own library is not extracted from the APK, and not accessible to the app. You will need tp either install the app over itself, or provide a library. * (_to be expanded_...) ## Hidden Functionality Features that may go unnoticed, and further potentially useful information * Long-pressing the Clipboard Key (the optional one in the suggestion strip) pastes system clipboard contents. * Long-pressing keys in the suggestion strip toolbar pins them to the suggestion strip. * Long-press the Comma-key to access Clipboard View, Emoji View, One-handed Mode, Settings, or Switch Language: * Emoji View and Language Switch will disappear if you have the corresponding key enabled; * For some layouts it\'s not the Comma-key, but the key at the same position (e.g. it\'s `q` for Dvorak layout). * When incognito mode is enabled, no words will be learned, and no emojis will be added to recents. * Sliding key input: Swipe from shift or symbol key to another key. This will enter a single uppercase key or symbol and return to the previous keyboard. * Hold shift or symbol key, press one or more keys, and then release shift or symbol key to return to the previous keyboard. * Long-press a suggestion in the suggestion strip to show more suggestions, and a delete button to remove this suggestion. * Swipe up from a suggestion to open more suggestions, and release on the suggestion to select it. * Long-press an entry in the clipboard history to pin it (keep it in clipboard until you unpin). * Swipe left in clipboard view to remove an entry (except when it's pinned) * Select text and press shift to switch between uppercase, lowercase and capitalize words * You can add dictionaries by opening the file * This only works with _content-uris_ and not with _file-uris_, meaning that it may not work with some file explorers. * _Debug mode / debug APK_ * Long-press a suggestion in the suggestion strip twice to show the source dictionary. * When using debug APK, you can find _Debug Settings_ within the _Advanced Preferences_, though the usefulness is limited except for dumping dictionaries into the log. * For a release APK, you need to tap the version in _About_ several times, then you can find debug settings in _Advanced Preferences_. * When enabling _Show suggestion infos_, suggestions will have some tiny numbers on top showing some internal score and source dictionary. * In the event of an application crash, you will be prompted whether you want the crash logs when you open the Settings. * When using multilingual typing, space bar will show an confidence value used for determining the currently used language. * For users doing manual backups with root access: Starting at Android 7, some files and the main shared preferences file are not in the default location, because the app is using [device protected storage](https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()). This is necessary so the settings and layout files can be read before the device is unlocked, e.g. at boot. The files are usually located in `/data/user_de/0/<package_id>/`, though the location may depend on the device and Android version. # Contributing ❤ ## Reporting Issues Whether you encountered a bug, or want to see a new feature in HeliBoard, you can contribute to the project by opening a new issue [here](https://github.com/Helium314/HeliBoard/issues). Your help is always welcome! Before opening a new issue, be sure to check the following: - **Does the issue already exist?** Make sure a similar issue has not been reported by browsing [existing issues](https://github.com/Helium314/HeliBoard/issues). Please search open and closed issues. - **Is the issue still relevant?** Make sure your issue is not already fixed in the latest version of HeliBoard. - **Did you use the issue template?** It is important to make life of our kind contributors easier by avoiding issues that miss key information to their resolution. Note that issues that that ignore part of the issue template will likely get treated with very low priority, as often they are needlessly hard to read or understand (e.g. huge screenshots, not providing a proper description, or addressing multiple topics). ## Translation Translations can be added using [Weblate](https://translate.codeberg.org/projects/heliboard/). You will need an account to update translations and add languages. Add the language you want to translate to in Languages -> Manage translated languages in the top menu bar. Updating translations in a PR will not be accepted, as it may cause conflicts with Weblate translations. ## Dictionary Creation There will not be any further dictionaries bundled in this app. However, you can add dictionaries to the [dictionaries repository](https://codeberg.org/Helium314/aosp-dictionaries). To create or update a dictionary for your language, you can use [this tool](https://github.com/remi0s/aosp-dictionary-tools). You will need a wordlist, as described [here](https://codeberg.org/Helium314/aosp-dictionaries/src/branch/main/wordlists/sample.combined) and in the repository readme. ## Code Contribution ### Getting Started HeliBoard project is based on Gradle and Android Gradle Plugin. To get started, you can install [Android Studio](https://developer.android.com/studio), and import project 'from Version Control / Git / Github' by providing this git repository [URL](https://github.com/Helium314/HeliBoard) (or git SSH [URL](git@github.com:Helium314/heliboard.git)). Of course you can also use any other compatible IDE, or work with text editor and command line. Once everything is up correctly, you're ready to go! ### Guidelines HeliBoard is a complex application, when contributing, you must take a step back and make sure your contribution: - **Is actually wanted**. Best check related open issues before you start working on a PR. Issues with "PR" and "contributor needed" labels are accepted, but still it would be good if you announced that you are working on it. If there is no issue related to your intended contribution, it's a good idea to open a new one to avoid disappointment of the contribution not being accepted. For small changes or fixing obvious bugs this step is not necessary. - **Is only about a single thing**. Mixing unrelated contributions into a single PR is hard to review and can get messy. - **Has a proper description**. What your contribution does is usually less obvious to reviewers than for yourself. A good description helps a lot for understanding what is going on, and for separating wanted from unintended changes in behavior. - **Uses already in-place mechanism and take advantage of them**. In other terms, does not reinvent the wheel or uses shortcuts that could alter the consistency of the existing code. - **Has a low footprint**. Some parts of the code are executed very frequently, and the keyboard should stay responsive even on older devices. - **Does not bring any non-free code or proprietary binary blobs**. This also applies to code/binaries with unknown licenses. Make sure you do not introduce any closed-source library from Google. If your contribution contains code that is not your own, provide a link to the source. - **Complies with the user privacy principle HeliBoard follows**. In addition to previous elements, HeliBoard must stick to [F-Droid inclusion guidelines](https://f-droid.org/docs/Inclusion_Policy/). ### Adding Layouts See [layouts.md](layouts.md#adding-new-layouts--languages) for how to add new layouts to the app. ### Update Emojis See make-emoji-keys tool [README](tools/make-emoji-keys/README.md). ### Update List of Existing Dictionaries See make-dict-list tool [README](tools/make-dict-list/README.md). # To-do __Planned features and improvements:__ * Customizable functional key layout * Will likely result in having the same functional key layout for alphabet and symbols layouts * Support for _alt_, _ctrl_, _meta_ and _fn_ (#479) * Less complicated addition of new keyboard languages (e.g. #519) * Additional and customizable key swipe functionality * Some functionality will not be possible when using glide typing * Ability to enter all emojis independent of Android version (optional, #297) * (limited) support for customizing _all_ internally used colors * Add and enable emoji dictionaries by default (if available for language) * Clearer / more intuitive arrangement of settings * Maybe hide some less used settings by default (similar to color customization) * Customizable currency keys * Customizable clipboard toolbar keys (#513, #403) * Ability to export/import (share) custom colors * Make use of the `.com` key in URL fields (currently only available for tablets) * With language-dependent TLDs * Internal cleanup (a lot of over-complicated and convoluted code) * (optionally?) move toolbar key pinning to a setting, so long press actions on unpinned toolbar keys are available * [Bug fixes](https://github.com/Helium314/HeliBoard/issues?q=is%3Aissue+is%3Aopen+label%3Abug) __What will _not_ be added:__ * Material 3 (not worth adding 1.5 MB to app size) * Dictionaries for more languages (you can still download them) * Anything that requires additional permissions # License HeliBoard (as a fork of OpenBoard) is licensed under GNU General Public License v3.0. > Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. See repo's [LICENSE](/LICENSE-GPL-3) file. Since the app is based on Apache 2.0 licensed AOSP Keyboard, an [Apache 2.0](LICENSE-Apache-2.0) license file is provided. The icon is licensed under [Creative Commons BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). A [license file](LICENSE-CC-BY-SA-4.0) is also included. # Credits - Icon by [Fabian OvrWrt](https://github.com/FabianOvrWrt) with contributions from [The Eclectic Dyslexic](https://github.com/the-eclectic-dyslexic) - [OpenBoard](https://github.com/openboard-team/openboard) - [AOSP Keyboard](https://android.googlesource.com/platform/packages/inputmethods/LatinIME/) - [LineageOS](https://review.lineageos.org/admin/repos/LineageOS/android_packages_inputmethods_LatinIME) - [Simple Keyboard](https://github.com/rkkr/simple-keyboard) - [Indic Keyboard](https://gitlab.com/indicproject/indic-keyboard) - [FlorisBoard](https://github.com/florisboard/florisboard/) - Our [contributors](https://github.com/Helium314/HeliBoard/graphs/contributors)
0
ReactiveX/RxJava
RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
flow java reactive-streams rxjava
# RxJava: Reactive Extensions for the JVM <a href='https://github.com/ReactiveX/RxJava/actions?query=workflow%3ASnapshot'><img src='https://github.com/ReactiveX/RxJava/workflows/Snapshot/badge.svg'></a> [![codecov.io](http://codecov.io/github/ReactiveX/RxJava/coverage.svg?branch=3.x)](https://codecov.io/gh/ReactiveX/RxJava/branch/3.x) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.reactivex.rxjava3/rxjava/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.reactivex.rxjava3/rxjava) [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/ReactiveX/RxJava) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/ReactiveX/RxJava/badge)](https://securityscorecards.dev/viewer/?uri=github.com/ReactiveX/RxJava) RxJava is a Java VM implementation of [Reactive Extensions](http://reactivex.io): a library for composing asynchronous and event-based programs by using observable sequences. It extends the [observer pattern](http://en.wikipedia.org/wiki/Observer_pattern) to support sequences of data/events and adds operators that allow you to compose sequences together declaratively while abstracting away concerns about things like low-level threading, synchronization, thread-safety and concurrent data structures. #### Version 3.x ([Javadoc](http://reactivex.io/RxJava/3.x/javadoc/)) - Single dependency: [Reactive-Streams](https://github.com/reactive-streams/reactive-streams-jvm). - Java 8+ or Android API 21+ required. - Java 8 lambda-friendly API. - [Android](https://github.com/ReactiveX/RxAndroid) desugar friendly. - Fixed API mistakes and many limits of RxJava 2. - Intended to be a replacement for RxJava 2 with relatively few binary incompatible changes. - Non-opinionated about the source of concurrency (threads, pools, event loops, fibers, actors, etc.). - Async or synchronous execution. - Virtual time and schedulers for parameterized concurrency. - Test and diagnostic support via test schedulers, test consumers and plugin hooks. - Interop with newer JDK versions via 3rd party libraries, such as - [Java 9 Flow API](https://github.com/akarnokd/RxJavaJdk9Interop#rxjavajdk9interop) - [Java 21 Virtual Threads](https://github.com/akarnokd/RxJavaFiberInterop#rxjavafiberinterop) Learn more about RxJava in general on the <a href="https://github.com/ReactiveX/RxJava/wiki">Wiki Home</a>. :information_source: Please read the [What's different in 3.0](https://github.com/ReactiveX/RxJava/wiki/What's-different-in-3.0) for details on the changes and migration information when upgrading from 2.x. #### Version 2.x The [2.x version](https://github.com/ReactiveX/RxJava/tree/2.x) is end-of-life as of **February 28, 2021**. No further development, support, maintenance, PRs and updates will happen. The [Javadoc]([Javadoc](http://reactivex.io/RxJava/2.x/javadoc/)) of the very last version, **2.2.21**, will remain accessible. #### Version 1.x The [1.x version](https://github.com/ReactiveX/RxJava/tree/1.x) is end-of-life as of **March 31, 2018**. No further development, support, maintenance, PRs and updates will happen. The [Javadoc]([Javadoc](http://reactivex.io/RxJava/1.x/javadoc/)) of the very last version, **1.3.8**, will remain accessible. ## Getting started ### Setting up the dependency The first step is to include RxJava 3 into your project, for example, as a Gradle compile dependency: ```groovy implementation "io.reactivex.rxjava3:rxjava:3.x.y" ``` (Please replace `x` and `y` with the latest version numbers: [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.reactivex.rxjava3/rxjava/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.reactivex.rxjava3/rxjava) ) ### Hello World The second is to write the **Hello World** program: ```java package rxjava.examples; import io.reactivex.rxjava3.core.*; public class HelloWorld { public static void main(String[] args) { Flowable.just("Hello world").subscribe(System.out::println); } } ``` Note that RxJava 3 components now live under `io.reactivex.rxjava3` and the base classes and interfaces live under `io.reactivex.rxjava3.core`. ### Base classes RxJava 3 features several base classes you can discover operators on: - [`io.reactivex.rxjava3.core.Flowable`](http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html): 0..N flows, supporting Reactive-Streams and backpressure - [`io.reactivex.rxjava3.core.Observable`](http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html): 0..N flows, no backpressure, - [`io.reactivex.rxjava3.core.Single`](http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Single.html): a flow of exactly 1 item or an error, - [`io.reactivex.rxjava3.core.Completable`](http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Completable.html): a flow without items but only a completion or error signal, - [`io.reactivex.rxjava3.core.Maybe`](http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Maybe.html): a flow with no items, exactly one item or an error. ### Some terminology #### Upstream, downstream The dataflows in RxJava consist of a source, zero or more intermediate steps followed by a data consumer or combinator step (where the step is responsible to consume the dataflow by some means): ```java source.operator1().operator2().operator3().subscribe(consumer); source.flatMap(value -> source.operator1().operator2().operator3()); ``` Here, if we imagine ourselves on `operator2`, looking to the left towards the source is called the **upstream**. Looking to the right towards the subscriber/consumer is called the **downstream**. This is often more apparent when each element is written on a separate line: ```java source .operator1() .operator2() .operator3() .subscribe(consumer) ``` #### Objects in motion In RxJava's documentation, **emission**, **emits**, **item**, **event**, **signal**, **data** and **message** are considered synonyms and represent the object traveling along the dataflow. #### Backpressure When the dataflow runs through asynchronous steps, each step may perform different things with different speed. To avoid overwhelming such steps, which usually would manifest itself as increased memory usage due to temporary buffering or the need for skipping/dropping data, so-called backpressure is applied, which is a form of flow control where the steps can express how many items are they ready to process. This allows constraining the memory usage of the dataflows in situations where there is generally no way for a step to know how many items the upstream will send to it. In RxJava, the dedicated `Flowable` class is designated to support backpressure and `Observable` is dedicated to the non-backpressured operations (short sequences, GUI interactions, etc.). The other types, `Single`, `Maybe` and `Completable` don't support backpressure nor should they; there is always room to store one item temporarily. #### Assembly time The preparation of dataflows by applying various intermediate operators happens in the so-called **assembly time**: ```java Flowable<Integer> flow = Flowable.range(1, 5) .map(v -> v * v) .filter(v -> v % 3 == 0) ; ``` At this point, the data is not flowing yet and no side-effects are happening. #### Subscription time This is a temporary state when `subscribe()` is called on a flow that establishes the chain of processing steps internally: ```java flow.subscribe(System.out::println) ```` This is when the **subscription side-effects** are triggered (see `doOnSubscribe`). Some sources block or start emitting items right away in this state. #### Runtime This is the state when the flows are actively emitting items, errors or completion signals: ```java Observable.create(emitter -> { while (!emitter.isDisposed()) { long time = System.currentTimeMillis(); emitter.onNext(time); if (time % 2 != 0) { emitter.onError(new IllegalStateException("Odd millisecond!")); break; } } }) .subscribe(System.out::println, Throwable::printStackTrace); ``` Practically, this is when the body of the given example above executes. ### Simple background computation One of the common use cases for RxJava is to run some computation, network request on a background thread and show the results (or error) on the UI thread: ```java import io.reactivex.rxjava3.schedulers.Schedulers; Flowable.fromCallable(() -> { Thread.sleep(1000); // imitate expensive computation return "Done"; }) .subscribeOn(Schedulers.io()) .observeOn(Schedulers.single()) .subscribe(System.out::println, Throwable::printStackTrace); Thread.sleep(2000); // <--- wait for the flow to finish ``` This style of chaining methods is called a **fluent API** which resembles the **builder pattern**. However, RxJava's reactive types are immutable; each of the method calls returns a new `Flowable` with added behavior. To illustrate, the example can be rewritten as follows: ```java Flowable<String> source = Flowable.fromCallable(() -> { Thread.sleep(1000); // imitate expensive computation return "Done"; }); Flowable<String> runBackground = source.subscribeOn(Schedulers.io()); Flowable<String> showForeground = runBackground.observeOn(Schedulers.single()); showForeground.subscribe(System.out::println, Throwable::printStackTrace); Thread.sleep(2000); ``` Typically, you can move computations or blocking IO to some other thread via `subscribeOn`. Once the data is ready, you can make sure they get processed on the foreground or GUI thread via `observeOn`. ### Schedulers RxJava operators don't work with `Thread`s or `ExecutorService`s directly but with so-called `Scheduler`s that abstract away sources of concurrency behind a uniform API. RxJava 3 features several standard schedulers accessible via `Schedulers` utility class. - `Schedulers.computation()`: Run computation intensive work on a fixed number of dedicated threads in the background. Most asynchronous operators use this as their default `Scheduler`. - `Schedulers.io()`: Run I/O-like or blocking operations on a dynamically changing set of threads. - `Schedulers.single()`: Run work on a single thread in a sequential and FIFO manner. - `Schedulers.trampoline()`: Run work in a sequential and FIFO manner in one of the participating threads, usually for testing purposes. These are available on all JVM platforms but some specific platforms, such as Android, have their own typical `Scheduler`s defined: `AndroidSchedulers.mainThread()`, `SwingScheduler.instance()` or `JavaFXScheduler.platform()`. In addition, there is an option to wrap an existing `Executor` (and its subtypes such as `ExecutorService`) into a `Scheduler` via `Schedulers.from(Executor)`. This can be used, for example, to have a larger but still fixed pool of threads (unlike `computation()` and `io()` respectively). The `Thread.sleep(2000);` at the end is no accident. In RxJava the default `Scheduler`s run on daemon threads, which means once the Java main thread exits, they all get stopped and background computations may never happen. Sleeping for some time in this example situations lets you see the output of the flow on the console with time to spare. ### Concurrency within a flow Flows in RxJava are sequential in nature split into processing stages that may run **concurrently** with each other: ```java Flowable.range(1, 10) .observeOn(Schedulers.computation()) .map(v -> v * v) .blockingSubscribe(System.out::println); ``` This example flow squares the numbers from 1 to 10 on the **computation** `Scheduler` and consumes the results on the "main" thread (more precisely, the caller thread of `blockingSubscribe`). However, the lambda `v -> v * v` doesn't run in parallel for this flow; it receives the values 1 to 10 on the same computation thread one after the other. ### Parallel processing Processing the numbers 1 to 10 in parallel is a bit more involved: ```java Flowable.range(1, 10) .flatMap(v -> Flowable.just(v) .subscribeOn(Schedulers.computation()) .map(w -> w * w) ) .blockingSubscribe(System.out::println); ``` Practically, parallelism in RxJava means running independent flows and merging their results back into a single flow. The operator `flatMap` does this by first mapping each number from 1 to 10 into its own individual `Flowable`, runs them and merges the computed squares. Note, however, that `flatMap` doesn't guarantee any order and the items from the inner flows may end up interleaved. There are alternative operators: - `concatMap` that maps and runs one inner flow at a time and - `concatMapEager` which runs all inner flows "at once" but the output flow will be in the order those inner flows were created. Alternatively, the `Flowable.parallel()` operator and the `ParallelFlowable` type help achieve the same parallel processing pattern: ```java Flowable.range(1, 10) .parallel() .runOn(Schedulers.computation()) .map(v -> v * v) .sequential() .blockingSubscribe(System.out::println); ``` ### Dependent sub-flows `flatMap` is a powerful operator and helps in a lot of situations. For example, given a service that returns a `Flowable`, we'd like to call another service with values emitted by the first service: ```java Flowable<Inventory> inventorySource = warehouse.getInventoryAsync(); inventorySource .flatMap(inventoryItem -> erp.getDemandAsync(inventoryItem.getId()) .map(demand -> "Item " + inventoryItem.getName() + " has demand " + demand)) .subscribe(System.out::println); ``` ### Continuations Sometimes, when an item has become available, one would like to perform some dependent computations on it. This is sometimes called **continuations** and, depending on what should happen and what types are involved, may involve various operators to accomplish. #### Dependent The most typical scenario is to given a value, invoke another service, await and continue with its result: ```java service.apiCall() .flatMap(value -> service.anotherApiCall(value)) .flatMap(next -> service.finalCall(next)) ``` It is often the case also that later sequences would require values from earlier mappings. This can be achieved by moving the outer `flatMap` into the inner parts of the previous `flatMap` for example: ```java service.apiCall() .flatMap(value -> service.anotherApiCall(value) .flatMap(next -> service.finalCallBoth(value, next)) ) ``` Here, the original `value` will be available inside the inner `flatMap`, courtesy of lambda variable capture. #### Non-dependent In other scenarios, the result(s) of the first source/dataflow is irrelevant and one would like to continue with a quasi independent another source. Here, `flatMap` works as well: ```java Observable continued = sourceObservable.flatMapSingle(ignored -> someSingleSource) continued.map(v -> v.toString()) .subscribe(System.out::println, Throwable::printStackTrace); ``` however, the continuation in this case stays `Observable` instead of the likely more appropriate `Single`. (This is understandable because from the perspective of `flatMapSingle`, `sourceObservable` is a multi-valued source and thus the mapping may result in multiple values as well). Often though there is a way that is somewhat more expressive (and also lower overhead) by using `Completable` as the mediator and its operator `andThen` to resume with something else: ```java sourceObservable .ignoreElements() // returns Completable .andThen(someSingleSource) .map(v -> v.toString()) ``` The only dependency between the `sourceObservable` and the `someSingleSource` is that the former should complete normally in order for the latter to be consumed. #### Deferred-dependent Sometimes, there is an implicit data dependency between the previous sequence and the new sequence that, for some reason, was not flowing through the "regular channels". One would be inclined to write such continuations as follows: ```java AtomicInteger count = new AtomicInteger(); Observable.range(1, 10) .doOnNext(ignored -> count.incrementAndGet()) .ignoreElements() .andThen(Single.just(count.get())) .subscribe(System.out::println); ``` Unfortunately, this prints `0` because `Single.just(count.get())` is evaluated at **assembly time** when the dataflow hasn't even run yet. We need something that defers the evaluation of this `Single` source until **runtime** when the main source completes: ```java AtomicInteger count = new AtomicInteger(); Observable.range(1, 10) .doOnNext(ignored -> count.incrementAndGet()) .ignoreElements() .andThen(Single.defer(() -> Single.just(count.get()))) .subscribe(System.out::println); ``` or ```java AtomicInteger count = new AtomicInteger(); Observable.range(1, 10) .doOnNext(ignored -> count.incrementAndGet()) .ignoreElements() .andThen(Single.fromCallable(() -> count.get())) .subscribe(System.out::println); ``` ### Type conversions Sometimes, a source or service returns a different type than the flow that is supposed to work with it. For example, in the inventory example above, `getDemandAsync` could return a `Single<DemandRecord>`. If the code example is left unchanged, this will result in a compile-time error (however, often with a misleading error message about lack of overload). In such situations, there are usually two options to fix the transformation: 1) convert to the desired type or 2) find and use an overload of the specific operator supporting the different type. #### Converting to the desired type Each reactive base class features operators that can perform such conversions, including the protocol conversions, to match some other type. The following matrix shows the available conversion options: | | Flowable | Observable | Single | Maybe | Completable | |----------|----------|------------|--------|-------|-------------| |**Flowable** | | `toObservable` | `first`, `firstOrError`, `single`, `singleOrError`, `last`, `lastOrError`<sup>1</sup> | `firstElement`, `singleElement`, `lastElement` | `ignoreElements` | |**Observable**| `toFlowable`<sup>2</sup> | | `first`, `firstOrError`, `single`, `singleOrError`, `last`, `lastOrError`<sup>1</sup> | `firstElement`, `singleElement`, `lastElement` | `ignoreElements` | |**Single** | `toFlowable`<sup>3</sup> | `toObservable` | | `toMaybe` | `ignoreElement` | |**Maybe** | `toFlowable`<sup>3</sup> | `toObservable` | `toSingle` | | `ignoreElement` | |**Completable** | `toFlowable` | `toObservable` | `toSingle` | `toMaybe` | | <sup>1</sup>: When turning a multi-valued source into a single-valued source, one should decide which of the many source values should be considered as the result. <sup>2</sup>: Turning an `Observable` into `Flowable` requires an additional decision: what to do with the potential unconstrained flow of the source `Observable`? There are several strategies available (such as buffering, dropping, keeping the latest) via the `BackpressureStrategy` parameter or via standard `Flowable` operators such as `onBackpressureBuffer`, `onBackpressureDrop`, `onBackpressureLatest` which also allow further customization of the backpressure behavior. <sup>3</sup>: When there is only (at most) one source item, there is no problem with backpressure as it can be always stored until the downstream is ready to consume. #### Using an overload with the desired type Many frequently used operator has overloads that can deal with the other types. These are usually named with the suffix of the target type: | Operator | Overloads | |----------|-----------| | `flatMap` | `flatMapSingle`, `flatMapMaybe`, `flatMapCompletable`, `flatMapIterable` | | `concatMap` | `concatMapSingle`, `concatMapMaybe`, `concatMapCompletable`, `concatMapIterable` | | `switchMap` | `switchMapSingle`, `switchMapMaybe`, `switchMapCompletable` | The reason these operators have a suffix instead of simply having the same name with different signature is type erasure. Java doesn't consider signatures such as `operator(Function<T, Single<R>>)` and `operator(Function<T, Maybe<R>>)` different (unlike C#) and due to erasure, the two `operator`s would end up as duplicate methods with the same signature. ### Operator naming conventions Naming in programming is one of the hardest things as names are expected to be not long, expressive, capturing and easily memorable. Unfortunately, the target language (and pre-existing conventions) may not give too much help in this regard (unusable keywords, type erasure, type ambiguities, etc.). #### Unusable keywords In the original Rx.NET, the operator that emits a single item and then completes is called `Return(T)`. Since the Java convention is to have a lowercase letter start a method name, this would have been `return(T)` which is a keyword in Java and thus not available. Therefore, RxJava chose to name this operator `just(T)`. The same limitation exists for the operator `Switch`, which had to be named `switchOnNext`. Yet another example is `Catch` which was named `onErrorResumeNext`. #### Type erasure Many operators that expect the user to provide some function returning a reactive type can't be overloaded because the type erasure around a `Function<T, X>` turns such method signatures into duplicates. RxJava chose to name such operators by appending the type as suffix as well: ```java Flowable<R> flatMap(Function<? super T, ? extends Publisher<? extends R>> mapper) Flowable<R> flatMapMaybe(Function<? super T, ? extends MaybeSource<? extends R>> mapper) ``` #### Type ambiguities Even though certain operators have no problems from type erasure, their signature may turn up being ambiguous, especially if one uses Java 8 and lambdas. For example, there are several overloads of `concatWith` taking the various other reactive base types as arguments (for providing convenience and performance benefits in the underlying implementation): ```java Flowable<T> concatWith(Publisher<? extends T> other); Flowable<T> concatWith(SingleSource<? extends T> other); ``` Both `Publisher` and `SingleSource` appear as functional interfaces (types with one abstract method) and may encourage users to try to provide a lambda expression: ```java someSource.concatWith(s -> Single.just(2)) .subscribe(System.out::println, Throwable::printStackTrace); ``` Unfortunately, this approach doesn't work and the example does not print `2` at all. In fact, since version 2.1.10, it doesn't even compile because at least 4 `concatWith` overloads exist and the compiler finds the code above ambiguous. The user in such situations probably wanted to defer some computation until the `someSource` has completed, thus the correct unambiguous operator should have been `defer`: ```java someSource.concatWith(Single.defer(() -> Single.just(2))) .subscribe(System.out::println, Throwable::printStackTrace); ``` Sometimes, a suffix is added to avoid logical ambiguities that may compile but produce the wrong type in a flow: ```java Flowable<T> merge(Publisher<? extends Publisher<? extends T>> sources); Flowable<T> mergeArray(Publisher<? extends T>... sources); ``` This can get also ambiguous when functional interface types get involved as the type argument `T`. #### Error handling Dataflows can fail, at which point the error is emitted to the consumer(s). Sometimes though, multiple sources may fail at which point there is a choice whether or not wait for all of them to complete or fail. To indicate this opportunity, many operator names are suffixed with the `DelayError` words (while others feature a `delayError` or `delayErrors` boolean flag in one of their overloads): ```java Flowable<T> concat(Publisher<? extends Publisher<? extends T>> sources); Flowable<T> concatDelayError(Publisher<? extends Publisher<? extends T>> sources); ``` Of course, suffixes of various kinds may appear together: ```java Flowable<T> concatArrayEagerDelayError(Publisher<? extends T>... sources); ``` #### Base class vs base type The base classes can be considered heavy due to the sheer number of static and instance methods on them. RxJava 3's design was heavily influenced by the [Reactive Streams](https://github.com/reactive-streams/reactive-streams-jvm#reactive-streams) specification, therefore, the library features a class and an interface per each reactive type: | Type | Class | Interface | Consumer | |------|-------|-----------|----------| | 0..N backpressured | `Flowable` | `Publisher`<sup>1</sup> | `Subscriber` | | 0..N unbounded | `Observable` | `ObservableSource`<sup>2</sup> | `Observer` | | 1 element or error | `Single` | `SingleSource` | `SingleObserver` | | 0..1 element or error | `Maybe` | `MaybeSource` | `MaybeObserver` | | 0 element or error | `Completable` | `CompletableSource` | `CompletableObserver` | <sup>1</sup>The `org.reactivestreams.Publisher` is part of the external Reactive Streams library. It is the main type to interact with other reactive libraries through a standardized mechanism governed by the [Reactive Streams specification](https://github.com/reactive-streams/reactive-streams-jvm#specification). <sup>2</sup>The naming convention of the interface was to append `Source` to the semi-traditional class name. There is no `FlowableSource` since `Publisher` is provided by the Reactive Streams library (and subtyping it wouldn't have helped with interoperation either). These interfaces are, however, not standard in the sense of the Reactive Streams specification and are currently RxJava specific only. ### R8 and ProGuard settings By default, RxJava itself doesn't require any ProGuard/R8 settings and should work without problems. Unfortunately, the Reactive Streams dependency since version 1.0.3 has embedded Java 9 class files in its JAR that can cause warnings with the plain ProGuard: ``` Warning: org.reactivestreams.FlowAdapters$FlowPublisherFromReactive: can't find superclass or interface java.util.concurrent.Flow$Publisher Warning: org.reactivestreams.FlowAdapters$FlowToReactiveProcessor: can't find superclass or interface java.util.concurrent.Flow$Processor Warning: org.reactivestreams.FlowAdapters$FlowToReactiveSubscriber: can't find superclass or interface java.util.concurrent.Flow$Subscriber Warning: org.reactivestreams.FlowAdapters$FlowToReactiveSubscription: can't find superclass or interface java.util.concurrent.Flow$Subscription Warning: org.reactivestreams.FlowAdapters: can't find referenced class java.util.concurrent.Flow$Publisher ``` It is recommended one sets up the following `-dontwarn` entry in the application's `proguard-ruleset` file: ``` -dontwarn java.util.concurrent.Flow* ``` For R8, the RxJava jar includes the `META-INF/proguard/rxjava3.pro` with the same no-warning clause and should apply automatically. ### Further reading For further details, consult the [wiki](https://github.com/ReactiveX/RxJava/wiki). ## Communication - Google Group: [RxJava](http://groups.google.com/d/forum/rxjava) - Twitter: [@RxJava](http://twitter.com/RxJava) - [GitHub Issues](https://github.com/ReactiveX/RxJava/issues) - StackOverflow: [rx-java](http://stackoverflow.com/questions/tagged/rx-java) and [rx-java2](http://stackoverflow.com/questions/tagged/rx-java2) - [Gitter.im](https://gitter.im/ReactiveX/RxJava) ## Versioning Version 3.x is in development. Bugfixes will be applied to both 2.x and 3.x branches, but new features will only be added to 3.x. Minor 3.x increments (such as 3.1, 3.2, etc) will occur when non-trivial new functionality is added or significant enhancements or bug fixes occur that may have behavioral changes that may affect some edge cases (such as dependence on behavior resulting from a bug). An example of an enhancement that would classify as this is adding reactive pull backpressure support to an operator that previously did not support it. This should be backwards compatible but does behave differently. Patch 3.x.y increments (such as 3.0.0 -> 3.0.1, 3.3.1 -> 3.3.2, etc) will occur for bug fixes and trivial functionality (like adding a method overload). New functionality marked with an [`@Beta`][beta source link] or [`@Experimental`][experimental source link] annotation can also be added in the patch releases to allow rapid exploration and iteration of unstable new functionality. #### @Beta APIs marked with the [`@Beta`][beta source link] annotation at the class or method level are subject to change. They can be modified in any way, or even removed, at any time. If your code is a library itself (i.e. it is used on the CLASSPATH of users outside your control), you should not use beta APIs, unless you repackage them (e.g. using ProGuard, shading, etc). #### @Experimental APIs marked with the [`@Experimental`][experimental source link] annotation at the class or method level will almost certainly change. They can be modified in any way, or even removed, at any time. You should not use or rely on them in any production code. They are purely to allow broad testing and feedback. #### @Deprecated APIs marked with the `@Deprecated` annotation at the class or method level will remain supported until the next major release, but it is recommended to stop using them. #### io.reactivex.rxjava3.internal.* All code inside the `io.reactivex.rxjava3.internal.*` packages are considered private API and should not be relied upon at all. It can change at any time. ## Full Documentation - [Wiki](https://github.com/ReactiveX/RxJava/wiki) - [Javadoc](http://reactivex.io/RxJava/3.x/javadoc/) - [Latest snaphot Javadoc](http://reactivex.io/RxJava/3.x/javadoc/snapshot/) - Javadoc of a specific [release version](https://github.com/ReactiveX/RxJava/tags): `http://reactivex.io/RxJava/3.x/javadoc/3.x.y/` ## 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%7Cio.reactivex.rxjava3). Example for Gradle: ```groovy implementation 'io.reactivex.rxjava3:rxjava:x.y.z' ``` and for Maven: ```xml <dependency> <groupId>io.reactivex.rxjava3</groupId> <artifactId>rxjava</artifactId> <version>x.y.z</version> </dependency> ``` and for Ivy: ```xml <dependency org="io.reactivex.rxjava3" name="rxjava" rev="x.y.z" /> ``` ### Snapshots Snapshots after May 1st, 2021 are available via https://oss.sonatype.org/content/repositories/snapshots/io/reactivex/rxjava3/rxjava/ ```groovy repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } } dependencies { implementation 'io.reactivex.rxjava3:rxjava:3.0.0-SNAPSHOT' } ``` JavaDoc snapshots are available at http://reactivex.io/RxJava/3.x/javadoc/snapshot ## Build To build: ``` $ git clone git@github.com:ReactiveX/RxJava.git $ cd RxJava/ $ ./gradlew build ``` Further details on building can be found on the [Getting Started](https://github.com/ReactiveX/RxJava/wiki/Getting-Started) page of the wiki. ## Bugs and Feedback For bugs, questions and discussions please use the [Github Issues](https://github.com/ReactiveX/RxJava/issues). ## LICENSE Copyright (c) 2016-present, RxJava Contributors. 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. [beta source link]: https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java/io/reactivex/rxjava3/annotations/Beta.java [experimental source link]: https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java/io/reactivex/rxjava3/annotations/Experimental.java
0
ReactiveX/RxNetty
Reactive Extension (Rx) Adaptor for Netty
null
Project Status ======= **2018-02-014** * `1.0.x` will be the RxNetty-2 update. It is currently pending an RFC for API changes. * `0.5.x` is the current release branch. This is no longer under active development but will have major patches applied and will accept pull requests. * `0.4.x` is now considered legancy and will only have critical patches applied. Branch Status ======= This is the current branch for RxNetty and is now API stable. Motivations ====== Motivations and detailed status of the breaking changes in 0.5.x can be found [here](https://github.com/ReactiveX/RxNetty/wiki/0.5.x-FAQs) RxNetty ======= [ ![Download](https://api.bintray.com/packages/reactivex/RxJava/RxNetty/images/download.svg) ](https://bintray.com/reactivex/RxJava/RxNetty/_latestVersion) <a href='https://travis-ci.org/ReactiveX/RxNetty/builds'><img src='https://travis-ci.org/ReactiveX/RxNetty.svg?branch=0.5.x'></a> [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/Netflix/Hystrix.svg)](http://isitmaintained.com/project/Reactivex/RxNetty "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/Netflix/Hystrix.svg)](http://isitmaintained.com/project/Reactivex/RxNetty "Percentage of issues still open") Reactive Extension (Rx) Adaptor for Netty Getting Started ========== The best place to start exploring this library is to look at the [examples](rxnetty-examples) for some common usecases addressed by RxNetty. A very simple HTTP server example can be found [here](rxnetty-examples/src/main/java/io/reactivex/netty/examples/http/helloworld/HelloWorldServer.java) and the corresponding HTTP client is [here](rxnetty-examples/src/main/java/io/reactivex/netty/examples/http/helloworld/HelloWorldClient.java) ## Binaries Binaries and dependency information for Maven, Ivy, Gradle and others can be found at [http://search.maven.org](http://search.maven.org/#search|ga|1|io.reactivex.rxnetty). Example for Maven: ```xml <dependency> <groupId>io.reactivex</groupId> <artifactId>rxnetty-http</artifactId> <version>x.y.z</version> </dependency> ``` and for Ivy: ```xml <dependency org="io.reactivex" name="rxnetty-http" rev="x.y.z" /> ``` and for Gradle: ```groovy implementation 'io.reactivex:rxnetty-http:x.y.z' ``` ###### Unintentional release artifacts There are two artifacts in maven central 0.5.0 and 0.5.1 which were unintentionally released from 0.4.x branch. Do not use them. [More details here](https://github.com/ReactiveX/RxNetty/issues/439) ## Build To build: ``` $ git clone https://github.com/ReactiveX/RxNetty.git -b 0.5.x $ cd RxNetty/ $ ./gradlew build ``` ## Bugs and Feedback For bugs, questions and discussions please use the [Github Issues](https://github.com/ReactiveX/RxNetty/issues). ## LICENSE Copyright 2014 Netflix, 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.
0
failsafe-lib/failsafe
Fault tolerance and resilience patterns for the JVM
bulkhead circuit-breaker fallback java rate-limiter resilience resiliency-patterns retry timeout
# Failsafe [![Build Status](https://github.com/failsafe-lib/failsafe/workflows/build/badge.svg)](https://github.com/failsafe-lib/failsafe/actions) [![Maven Central](https://img.shields.io/maven-central/v/dev.failsafe/failsafe.svg?maxAge=60&colorB=53C92E)](https://maven-badges.herokuapp.com/maven-central/dev.failsafe/failsafe) [![License](http://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) [![Slack](https://img.shields.io/badge/slack-failsafe-brightgreen.svg?logo=slack)](https://failsafe-lib.slack.com) [![JavaDoc](https://img.shields.io/maven-central/v/dev.failsafe/failsafe.svg?maxAge=60&label=javadoc)](https://failsafe.dev/javadoc/core) Failsafe is a lightweight, zero-dependency library for handling failures in Java 8+, with a concise API for handling everyday use cases and the flexibility to handle everything else. It works by wrapping executable logic with one or more resilience policies, which can be combined and composed as needed. Policies include [Retry](https://failsafe.dev/retry/), [CircuitBreaker](https://failsafe.dev/circuit-breaker/), [RateLimiter](https://failsafe.dev/rate-limiter/), [Timeout](https://failsafe.dev/timeout/), [Bulkhead](https://failsafe.dev/bulkhead/), and [Fallback](https://failsafe.dev/fallback/). Additional modules include [OkHttp](https://failsafe.dev/okhttp/) and [Retrofit](https://failsafe.dev/retrofit/). ## Usage Visit [failsafe.dev](https://failsafe.dev) for usage info, docs, and additional resources. ## Contributing Check out the [contributing guidelines](https://github.com/failsafe-lib/failsafe/blob/master/CONTRIBUTING.md). ## License Copyright Jonathan Halterman and friends. Released under the [Apache 2.0 license](https://github.com/failsafe-lib/failsafe/blob/master/LICENSE).
0
hekailiang/squirrel
squirrel-foundation is a State Machine library, which provided a lightweight, easy use, type safe and programmable state machine implementation for Java.
event-handlers fsm java state-machine statemachine
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/hekailiang/squirrel) squirrel-foundation ======== [![Join the chat at https://gitter.im/hekailiang/squirrel](https://badges.gitter.im/hekailiang/squirrel.svg)](https://gitter.im/hekailiang/squirrel?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## What is it? Just like the squirrel, a **small**, **agile**, **smart**, **alert** and **cute** animal, squirrel-foundation is aimed to provide a **lightweight**, highly **flexible** and **extensible**, **diagnosable**, **easy use** and **type safe** Java state machine implementation for enterprise usage. Here is the state machine diagram which describes the state change of an ATM: ![ATMStateMachine](http://hekailiang.github.io/squirrel/images/ATMStateMachine.png) The sample code could be found in package *"org.squirrelframework.foundation.fsm.atm"*. ## Maven squirrel-foundation has been deployed to maven central repository, so you only need to add following dependency to the pom.xml. Latest Released Version: ```maven <dependency> <groupId>org.squirrelframework</groupId> <artifactId>squirrel-foundation</artifactId> <version>0.3.10</version> </dependency> ``` Latest Snapshot Version: ```maven <dependency> <groupId>org.squirrelframework</groupId> <artifactId>squirrel-foundation</artifactId> <version>0.3.11-SNAPSHOT</version> </dependency> ``` ## Quick Start To quickly try squirrel state machine functions, please create a maven project and include squirrel-foundation dependency properly. Then just run following sample code. ```java public class QuickStartSample { // 1. Define State Machine Event enum FSMEvent { ToA, ToB, ToC, ToD } // 2. Define State Machine Class @StateMachineParameters(stateType=String.class, eventType=FSMEvent.class, contextType=Integer.class) static class StateMachineSample extends AbstractUntypedStateMachine { protected void fromAToB(String from, String to, FSMEvent event, Integer context) { System.out.println("Transition from '"+from+"' to '"+to+"' on event '"+event+ "' with context '"+context+"'."); } protected void ontoB(String from, String to, FSMEvent event, Integer context) { System.out.println("Entry State \'"+to+"\'."); } } public static void main(String[] args) { // 3. Build State Transitions UntypedStateMachineBuilder builder = StateMachineBuilderFactory.create(StateMachineSample.class); builder.externalTransition().from("A").to("B").on(FSMEvent.ToB).callMethod("fromAToB"); builder.onEntry("B").callMethod("ontoB"); // 4. Use State Machine UntypedStateMachine fsm = builder.newStateMachine("A"); fsm.fire(FSMEvent.ToB, 10); System.out.println("Current state is "+fsm.getCurrentState()); } } ``` At now you may have many questions about the sample code, please be patient. The following user guide will answer most of your questions. But before getting into the details, it requires you have basic understanding on state machine concepts. These materials are good for understanding state machine concepts. [[state-machine-diagrams]][9] [[qt-state-machine]][10] ## User Guide ### Get Starting **squirrel-foundation** supports both fluent API and declarative manner to declare a state machine, and also enable user to define the action methods in a straightforward manner. * **StateMachine** interface takes four generic type parameters. * **T** stands for the type of implemented state machine. * **S** stands for the type of implemented state. * **E** stands for the type of implemented event. * **C** stands for the type of implemented external context. * **State Machine Builder** - State machine builder is used to generate state machine definition. StateMachineBuilder can be created by StateMachineBuilderFactory. - The StateMachineBuilder is composed of *TransitionBuilder (InternalTransitionBuilder / LocalTransitionBuilder / ExternalTransitionBuilder) which is used to build transition between states, and EntryExitActionBuilder which is used to build the actions during entry or exit state. - The internal state is implicitly built during transition creation or state action creation. - All the state machine instances created by the same state machine builder share the same definition data for memory usage optimize. - State machine builder generate state machine definition in a lazy manner. When builder create first state machine instance, the state machine definition will be generated which is time consumed. But after state machine definition generated, the following state machine instance creation will be much faster. Generally, state machine builder should be reused as much as possible. In order to create a state machine, user need to create state machine builder first. For example: ```java StateMachineBuilder<MyStateMachine, MyState, MyEvent, MyContext> builder = StateMachineBuilderFactory.create(MyStateMachine.class, MyState.class, MyEvent.class, MyContext.class); ``` The state machine builder takes for parameters which are type of state machine(T), state(S), event(E) and context(C). * **Fluent API** After state machine builder was created, we can use fluent API to define state/transition/action of the state machine. ```java builder.externalTransition().from(MyState.A).to(MyState.B).on(MyEvent.GoToB); ``` An **external transition** is built between state 'A' to state 'B' and triggered on received event 'GoToB'. ```java builder.internalTransition(TransitionPriority.HIGH).within(MyState.A).on(MyEvent.WithinA).perform(myAction); ``` An **internal transition** with priority set to high is build inside state 'A' on event 'WithinA' perform 'myAction'. The internal transition means after transition complete, no state is exited or entered. The transition priority is used to override original transition when state machine extended. ```java builder.externalTransition().from(MyState.C).to(MyState.D).on(MyEvent.GoToD).when( new Condition<MyContext>() { @Override public boolean isSatisfied(MyContext context) { return context!=null && context.getValue()>80; } @Override public String name() { return "MyCondition"; } }).callMethod("myInternalTransitionCall"); ``` An **conditional transition** is built from state 'C' to state 'D' on event 'GoToD' when external context satisfied the condition restriction, then call action method "myInternalTransitionCall". User can also use [MVEL][7](a powerful expression language) to describe condition in the following way. ```java builder.externalTransition().from(MyState.C).to(MyState.D).on(MyEvent.GoToD).whenMvel( "MyCondition:::(context!=null && context.getValue()>80)").callMethod("myInternalTransitionCall"); ``` **Note:** Characters ':::' use to separate condition name and condition expression. The 'context' is the predefined variable point to current Context object. ```java builder.onEntry(MyState.A).perform(Lists.newArrayList(action1, action2)) ``` A list of state entry actions is defined in above sample code. * **Method Call Action** User can define anonymous actions during define transitions or state entry/exit. However, the action code will be scattered over many places which may make code hard to maintain. Moreover, other user cannot override the actions. So squirrel-foundation also support to define state machine method call action which comes along with state machine class itself. ```java StateMachineBuilder<...> builder = StateMachineBuilderFactory.create( MyStateMachine.class, MyState.class, MyEvent.class, MyContext.class); builder.externalTransition().from(A).to(B).on(toB).callMethod("fromAToB"); // All transition action method stays with state machine class public class MyStateMachine<...> extends AbstractStateMachine<...> { protected void fromAToB(MyState from, MyState to, MyEvent event, MyContext context) { // this method will be called during transition from "A" to "B" on event "toB" // the action method parameters types and order should match ... } } ``` Moreover, squirrel-foundation also support define method call actions in a **Convention Over Configuration** manner. Basically, this means that if the method declared in state machine satisfied naming and parameters convention, it will be added into the transition action list and also be invoked at certain phase. e.g. ```java protected void transitFromAToBOnGoToB(MyState from, MyState to, MyEvent event, MyContext context) ``` The method named as **transitFrom\[SourceStateName\]To\[TargetStateName\]On\[EventName\]**, and parameterized as \[MyState, MyState, MyEvent, MyContext\] will be added into transition "A-(GoToB)->B" action list. When transiting from state 'A' to state 'B' on event 'GoToB', this method will be invoked. ```java protected void transitFromAnyToBOnGoToB(MyState from, MyState to, MyEvent event, MyContext context) ``` **transitFromAnyTo[TargetStateName]On[EventName]** The method will be invoked when transit from any state to state 'B' on event 'GoToB'. ```java protected void exitA(MyState from, MyState to, MyEvent event, MyContext context) ``` **exit[StateName]** The method will be invoked when exit state 'A'. So as the **entry[StateName]** , **beforeExitAny**/**afterExitAny** and **beforeEntryAny**/**afterEntryAny**. ***Other Supported Naming Patterns:*** ``` transitFrom[fromStateName]To[toStateName]On[eventName]When[conditionName] transitFrom[fromStateName]To[toStateName]On[eventName] transitFromAnyTo[toStateName]On[eventName] transitFrom[fromStateName]ToAnyOn[eventName] transitFrom[fromStateName]To[toStateName] on[eventName] ``` Those method conventions listed above also provided **AOP-like** functionalities, which provided build-in flexible extension capability for squirrel state machine at any granularity. For more information, please refer to test case "*org.squirrelframework.foundation.fsm.ExtensionMethodCallTest*". Since 0.3.1, there is another way to define these AOP-like extension methods which is through fluent API (thanks suggestion from [vittali](https://github.com/vittali)), e.g. ```java // since 0.3.1 // the same effect as add method transitFromAnyToCOnToC in your state machine builder.transit().fromAny().to("C").on("ToC").callMethod("fromAnyToC"); // the same effect as add method transitFromBToAnyOnToC in your state machine builder.transit().from("B").toAny().on("ToC").callMethod("fromBToAny"); // the same effect as add method transitFromBToAny in your state machine builder.transit().from("B").toAny().onAny().callMethod("fromBToAny"); ``` Or through declarative annotation, e.g. ```java // since 0.3.1 @Transitions({ @Transit(from="B", to="E", on="*", callMethod="fromBToEOnAny"), @Transit(from="*", to="E", on="ToE", callMethod="fromAnyToEOnToE") }) ``` **Note**: These action methods will be attached to *matched and already existed transitions* but not to create any new transitions. Since 0.3.4, multiple transitions can also be defined once at a time using following API, e.g. ```java // transitions(A->B@A2B=>a2b, A->C@A2C=>a2c, A->D@A2D) will be defined at once builder.transitions().from(State._A).toAmong(State.B, State.C, State.D). onEach(Event.A2B, Event.A2C, Event.A2D).callMethod("a2b|a2c|_"); // transitions(A->_A@A2ANY=>DecisionMaker, _A->A@ANY2A) will be defined at once builder.localTransitions().between(State.A).and(State._A). onMutual(Event.A2ANY, Event.ANY2A). perform( Lists.newArrayList(new DecisionMaker("SomeLocalState"), null) ); ``` More information can be found in *org.squirrelframework.foundation.fsm.samples.DecisionStateSampleTest*; * **Declarative Annotation** A declarative way is also provided to define and also to extend the state machine. Here is an example. ```java @States({ @State(name="A", entryCallMethod="entryStateA", exitCallMethod="exitStateA"), @State(name="B", entryCallMethod="entryStateB", exitCallMethod="exitStateB") }) @Transitions({ @Transit(from="A", to="B", on="GoToB", callMethod="stateAToStateBOnGotoB"), @Transit(from="A", to="A", on="WithinA", callMethod="stateAToStateAOnWithinA", type=TransitionType.INTERNAL) }) interface MyStateMachine extends StateMachine<MyStateMachine, MyState, MyEvent, MyContext> { void entryStateA(MyState from, MyState to, MyEvent event, MyContext context); void stateAToStateBOnGotoB(MyState from, MyState to, MyEvent event, MyContext context) void stateAToStateAOnWithinA(MyState from, MyState to, MyEvent event, MyContext context) void exitStateA(MyState from, MyState to, MyEvent event, MyContext context); ... } ``` The annotation can be defined in both implementation class of state machine or any interface that state machine will be implemented. It also can be used mixed with fluent API, which means the state machine defined in fluent API can also be extended by these annotations. (One thing you may need to be noticed, the method defined within interface must be public, which means also the method call action implementation will be public to caller.) * **Converters** In order to declare state and event within *@State* and *@Transit*, user need to implement corresponding converters for their state(S) and event(E) type. The convert must implement Converter\<T\> interface, which convert the state/event to/from String. ```java public interface Converter<T> extends SquirrelComponent { /** * Convert object to string. * @param obj converted object * @return string description of object */ String convertToString(T obj); /** * Convert string to object. * @param name name of the object * @return converted object */ T convertFromString(String name); } ``` Then register these converters to *ConverterProvider*. e.g. ```java ConverterProvider.INSTANCE.register(MyEvent.class, new MyEventConverter()); ConverterProvider.INSTANCE.register(MyState.class, new MyStateConverter()); ``` *Note: If you only use fluent API to define state machine, there is no need to implement corresponding converters. And also if the Event or State class is type of String or Enumeration, you don't need to implement or register a converter explicitly at most of cases.* * **New State Machine Instance** After user defined state machine behaviour, user could create a new state machine instance through builder. Note, once the state machine instance is created from the builder, the builder cannot be used to define any new element of state machine anymore. ```java T newStateMachine(S initialStateId, Object... extraParams); ``` To create a new state machine instance from state machine builder, you need to pass following parameters. 1. ```initialStateId```: When started, the initial state of the state machine. 2. ```extraParams```: Extra parameters that needed for create new state machine instance. Set to *"new Object[0]"* for no extra parameters needed. a. If user passed extra parameters while creating a new state machine instance, please be sure that StateMachineBuilderFactory also had defined type of extra parameters when creating the state machine builder. Otherwise, extra parameter will be ignored. b. Extra parameters can be passed into state machine instance in two ways. One is through state machine constructor which means user need to define a constructor with the same parameters' type and order for the state machine instance. Another way is define a method named ```postConstruct``` and also with the same parameters' type and order. If no extra parameters need to passed to state machine, user can simply call ```T newStateMachine(S initialStateId)``` to create a new state machine instance. New state machine from state machine builder. (In this case, no extra parameters need to be passed.) ```java MyStateMachine stateMachine = builder.newStateMachine(MyState.Initial); ``` * **Trigger Transitions** After state machine was created, user can fire events along with context to trigger transition inside state machine. e.g. ```java stateMachine.fire(MyEvent.Prepare, new MyContext("Testing")); ``` * **Untyped State Machine** In order to simplify state machine usage, and avoid too many generic types (e.g. StateMachine\<T, S, E, C\>) which may make code hard to read in some case, but still keep important part of type safety feature on transition action execution, UntypedStateMachine was implemented for this purpose. ```java enum TestEvent { toA, toB, toC, toD } @Transitions({ @Transit(from="A", to="B", on="toB", callMethod="fromAToB"), @Transit(from="B", to="C", on="toC"), @Transit(from="C", to="D", on="toD") }) @StateMachineParameters(stateType=String.class, eventType=TestEvent.class, contextType=Integer.class) class UntypedStateMachineSample extends AbstractUntypedStateMachine { // No need to specify constructor anymore since 0.2.9 // protected UntypedStateMachineSample(ImmutableUntypedState initialState, // Map<Object, ImmutableUntypedState> states) { // super(initialState, states); // } protected void fromAToB(String from, String to, TestEvent event, Integer context) { // transition action still type safe ... } protected void transitFromDToAOntoA(String from, String to, TestEvent event, Integer context) { // transition action still type safe ... } } UntypedStateMachineBuilder builder = StateMachineBuilderFactory.create( UntypedStateMachineSample.class); // state machine builder not type safe anymore builder.externalTransition().from("D").to("A").on(TestEvent.toA); UntypedStateMachine fsm = builder.newStateMachine("A"); ``` To build an UntypedStateMachine, user need to create an UntypedStateMachineBuilder through StateMachineBuilderFactory first. StateMachineBuilderFactory takes only one parameter which is type of state machine class to create UntypedStateMachineBuilder. *@StateMachineParameters* is used to declare state machine generic parameter types. *AbstractUntypedStateMachine* is the base class of any untyped state machine. * **Context Insensitive State Machine** Sometimes state transition does not care about context, which means transition mostly only determined by event. For this case user can use context insensitive state machine to simplify method call parameters. To declare context insensitive state machine is quite simple. User only need to add annotation *@ContextInsensitive* on state machine implementation class. After that, context parameter can be ignored on the transition method parameter list. e.g. ```java @ContextInsensitive public class ATMStateMachine extends AbstractStateMachine<ATMStateMachine, ATMState, String, Void> { // no need to add context parameter here anymore public void transitFromIdleToLoadingOnConnected(ATMState from, ATMState to, String event) { ... } public void entryLoading(ATMState from, ATMState to, String event) { ... } } ``` * **Transition Exception Handling** When exception happened during state transition, the executed action list will be aborted and state machine will be enter error status, which means the state machine instance cannot process event anymore. If user continue to fire event to the state machine instance, a IllegalStateException will be thrown out. All the exception happened during transition phase including action execution and external listener invocation will be wrapped into TransitionException(unchecked exception). Currently, the default exception handling strategy is simple and rude by just continuing throw out the exception, see AbstractStateMachine.afterTransitionCausedException method. ```java protected void afterTransitionCausedException(...) { throw e; } ``` If state machine can be recovered from this exception, user can extend afterTransitionCausedException method, and add corresponding the recovery logic in this method. **DONOT** forget to set state machine status back to normal at the end. e.g. ```java @Override protected void afterTransitionCausedException(Object fromState, Object toState, Object event, Object context) { Throwable targeException = getLastException().getTargetException(); // recover from IllegalArgumentException thrown out from state 'A' to 'B' caused by event 'ToB' if(targeException instanceof IllegalArgumentException && fromState.equals("A") && toState.equals("B") && event.equals("ToB")) { // do some error clean up job here // ... // after recovered from this exception, reset the state machine status back to normal setStatus(StateMachineStatus.IDLE); } else if(...) { // recover from other exception ... } else { super.afterTransitionCausedException(fromState, toState, event, context); } } ``` ### Advanced Feature * **Define Hierarchical State** A hierarchical state may contain nested state. The child states may themselves have nested children and the nesting may proceed to any depth. When a hierarchical state is active, one and only one of its child states is active. The hierarchical state can be defined through API or annotation. ```java void defineSequentialStatesOn(S parentStateId, S... childStateIds); ``` *builder.defineSequentialStatesOn(State.A, State.BinA, StateCinA)* defines two child states "BinA" and "CinA" under parent state "A", the first defined child state will also be the initial state of the hierarchical state "A". The same hierarchical state can also be defined through annotation, e.g. ```java @States({ @State(name="A", entryMethodCall="entryA", exitMethodCall="exitA"), @State(parent="A", name="BinA", entryMethodCall="entryBinA", exitMethodCall="exitBinA", initialState=true), @State(parent="A", name="CinA", entryMethodCall="entryCinA", exitMethodCall="exitCinA") }) ``` * **Define Parallel State** The parallel state encapsulates a set of child states which are simultaneously active when the parent element is active. The parallel state can be defined through API or annotation both. e.g. ![ParallelStates](http://hekailiang.github.io/squirrel/images/ParallelStates.png) ```java // defines two region states "RegionState1" and "RegionState2" under parent parallel state "Root" builder.defineParallelStatesOn(MyState.Root, MyState.RegionState1, MyState.RegionState2); builder.defineSequentialStatesOn(MyState.RegionState1, MyState.State11, MyState.State12); builder.externalTransition().from(MyState.State11).to(MyState.State12).on(MyEvent.Event1); builder.defineSequentialStatesOn(MyState.RegionState2, MyState.State21, MyState.State22); builder.externalTransition().from(MyState.State21).to(MyState.State22).on(MyEvent.Event2); ``` or ```java @States({ @State(name="Root", entryCallMethod="enterRoot", exitCallMethod="exitRoot", compositeType=StateCompositeType.PARALLEL), @State(parent="Root", name="RegionState1", entryCallMethod="enterRegionState1", exitCallMethod="exitRegionState1"), @State(parent="Root", name="RegionState2", entryCallMethod="enterRegionState2", exitCallMethod="exitRegionState2") }) ``` To get current sub states of the parallel state ```java stateMachine.getSubStatesOn(MyState.Root); // return list of current sub states of parallel state ``` When all the parallel states reached final state, a **Finish** context event will be fired. * **Define Context Event** Context event means that user defined event has predefined context in the state machine. squirrel-foundation defined three type of context event for different use case. **Start/Terminate Event**: Event declared as start/terminate event will be used when state machine started/terminated. So user can differentiate the invoked action trigger, e.g. when state machine is starting and entering its initial state, user can differentiate these state entry action was invoked by start event. **Finish Event**: When all the parallel states reached final state, finish event will be automatically fired. User can define following transition based on finish event. To define the context event, user has two way, annotation or builder API. ```java @ContextEvent(finishEvent="Finish") static class ParallelStateMachine extends AbstractStateMachine<...> { } ``` or ```java StateMachineBuilder<...> builder = StateMachineBuilderFactory.create(...); ... builder.defineFinishEvent(HEvent.Start); builder.defineTerminateEvent(HEvent.Terminate); builder.defineStartEvent(HEvent.Finish); ``` * **Using History States to Save and Restore the Current State** The history pseudo-state allows a state machine to remember its state configuration. A transition taking the history state as its target will return the state machine to this recorded configuration. If the 'type' of a history is "shallow", the state machine processor must record the direct active children of its parent before taking any transition that exits the parent. If the 'type' of a history is "deep", the state machine processor must record all the active descendants of the parent before taking any transition that exits the parent. Both API and annotation are supported to define history type of state. e.g. ```java // defined history type of state "A" as "deep" builder.defineSequentialStatesOn(MyState.A, HistoryType.DEEP, MyState.A1, MyState.A2) ``` or ```java @State(parent="A", name="A1", entryCallMethod="enterA1", exitCallMethod="exitA1", historyType=HistoryType.DEEP) ``` **Note:** Before 0.3.7, user need to define "HistoryType.DEEP" for each level of historical state, which is not quite convenient.(Thanks to [Voskuijlen](https://github.com/Voskuijlen) to provide solution [Issue33](https://github.com/hekailiang/squirrel/issues/33)). Now user only define "HistoryType.DEEP" at the top level of historical state, and all its children state historical information will be remembered. * **Transition Types** According to the UML specification, a transition may be one of these three kinds: > * *Internal Transition* Implies that the Transition, if triggered, occurs without exiting or entering the source State (i.e., it does not cause a state change). This means that the entry or exit condition of the source State will not be invoked. An internal Transition can be taken even if the StateMachine is in one or more Regions nested within the associated State. > * *Local Transition* Implies that the Transition, if triggered, will not exit the composite (source) State, but it will exit and re-enter any state within the composite State that is in the current state configuration. > * *External Transition* Implies that the Transition, if triggered, will exit the composite (source) State squirrel-foundation supports both API and annotation to declare all kinds of transitions, e.g. ```java builder.externalTransition().from(MyState.A).to(MyState.B).on(MyEvent.A2B); builder.internalTransition().within(MyState.A).on(MyEvent.innerA); builder.localTransition().from(MyState.A).to(MyState.CinA).on(MyEvent.intoC) ``` or ```java @Transitions({ @Transition(from="A", to="B", on="A2B"), //default value of transition type is EXTERNAL @Transition(from="A", on="innerA", type=TransitionType.INTERNAL), @Transition(from="A", to="CinA", on="intoC", type=TransitionType.LOCAL), }) ``` * **Polymorphism Event Dispatch** During the lifecycle of the state machine, various events will be fired, e.g. ``` State Machine Lifecycle Events |--StateMachineEvent /* Base event of all state machine event */ |--StartEvent /* Fired when state machine started */ |--TerminateEvent /* Fired when state machine terminated */ |--TransitionEvent /* Base event of all transition event */ |--TransitionBeginEvent /* Fired when transition began */ |--TransitionCompleteEvent /* Fired when transition completed */ |--TransitionExceptionEvent /* Fired when transition threw exception */ |--TransitionDeclinedEvent /* Fired when transition declined */ |--TransitionEndEvent /* Fired when transition end no matter declined or complete */ ``` User can add a listener to listen StateMachineEvent, which means all events fired during state machine lifecycle will be caught by this listener, e.g., ```java stateMachine.addStateMachineListener(new StateMachineListener<...>() { @Override public void stateMachineEvent(StateMachineEvent<...> event) { // ... } }); ``` **And** User can also add a listener to listen TransitionEvent through StateMachine.addTransitionListener, which means all events fired during each state transition including TransitionBeginEvent, TransitionCompleteEvent and TransitionEndEvent will be caught by this listener. **Or** user can add specific listener e.g. TransitionDeclinedListener to listen TransitionDeclinedEvent when transition request was declined. * **Declarative Event Listener** Adding above event listener to state machine sometime annoying to user, and too many generic types also makes code ugly to read. To simplify state machine usage, more important to provide a non-invasive integration, squirrel-foundation provides a declarative way to add event listener through following annotation, e.g. ```java static class ExternalModule { @OnTransitionEnd @ListenerOrder(10) // Since 0.3.1 ListenerOrder can be used to insure listener invoked orderly public void transitionEnd() { // method annotated with TransitionEnd will be invoked when transition end... // the method must be public and return nothing } @OnTransitionBegin public void transitionBegin(TestEvent event) { // method annotated with TransitionBegin will be invoked when transition begin... } // 'event'(E), 'from'(S), 'to'(S), 'context'(C) and 'stateMachine'(T) can be used in MVEL scripts @OnTransitionBegin(when="event.name().equals(\"toB\")") public void transitionBeginConditional() { // method will be invoked when transition begin while transition caused by event "toB" } @OnTransitionComplete public void transitionComplete(String from, String to, TestEvent event, Integer context) { // method annotated with TransitionComplete will be invoked when transition complete... } @OnTransitionDecline public void transitionDeclined(String from, TestEvent event, Integer context) { // method annotated with TransitionDecline will be invoked when transition declined... } @OnBeforeActionExecuted public void onBeforeActionExecuted(Object sourceState, Object targetState, Object event, Object context, int[] mOfN, Action<?, ?, ?,?> action) { // method annotated with OnAfterActionExecuted will be invoked before action invoked } @OnAfterActionExecuted public void onAfterActionExecuted(Object sourceState, Object targetState, Object event, Object context, int[] mOfN, Action<?, ?, ?,?> action) { // method annotated with OnAfterActionExecuted will be invoked after action invoked } @OnActionExecException public void onActionExecException(Action<?, ?, ?,?> action, TransitionException e) { // method annotated with OnActionExecException will be invoked when action thrown exception } } ExternalModule externalModule = new ExternalModule(); fsm.addDeclarativeListener(externalModule); ... fsm.removeDeclarativeListener(externalModule); ``` By doing this external module code does not need to implement any state machine listener interface. Only add few annotations on methods which will be hooked during transition phase. The parameters of method is also type safe, and will automatically be inferred to match corresponding event. This is a good approach for **Separation of Concerns**. User can find sample usage in *org.squirrelframework.foundation.fsm.StateMachineLogger*. * **Transition Extension Methods** Each transition event also has corresponding extension method on AbstractStateMachine class which is allowed to be extended in customer state machine implementation class. ```java protected void afterTransitionCausedException(Exception e, S fromState, S toState, E event, C context) { } protected void beforeTransitionBegin(S fromState, E event, C context) { } protected void afterTransitionCompleted(S fromState, S toState, E event, C context) { } protected void afterTransitionEnd(S fromState, S toState, E event, C context) { } protected void afterTransitionDeclined(S fromState, E event, C context) { } protected void beforeActionInvoked(S fromState, S toState, E event, C context) { } ``` Typically, user can hook in your business processing logic in these extension methods during each state transition, while the various event listener serves as boundary of state machine based control system, which can interact with external modules (e.g. UI, Auditing, ESB and so on). For example, user can extend the method afterTransitionCausedException for environment clean up when exception happened during transition, and also notify user interface module to display error message through TransitionExceptionEvent. * **Weighted Action** User can define action weight to adjust action execution order. The actions during state entry/exit and state transition are ordered in ascending order according to their weight value. Action weight is 0 by default. User has two way to set action weight. One is append weight number to method name and separated by ':'. ```java // define state entry action 'goEntryD' weight -150 @State(name="D", entryCallMethod="goEntryD:-150") // define transition action 'goAToC1' weight +150 @Transit(from="A", to="C", on="ToC", callMethod="goAToC1:+150") ``` Another way is override weight method of Action class, e.g. ```java Action<...> newAction = new Action<...>() { ... @Override public int weight() { return 100; } } ``` squirrel-foundation also support a conventional manner to declare action weight. The weight of method call action whose name started with '*before*' will be set to 100, so as the name started with '*after*' will be set to -100. Generally it means that the action method name started with 'before' will be invoked at first, while the action method name started with 'after' will be invoked at last. "method1:ignore" means method1 will not be invoked. For more information, please refer to test case '*org.squirrelframework.foundation.fsm.WeightedActionTest*'; * **Asynchronized Execution** **@AsyncExecute** annotation can be used on method call action and declarative event listener to indicate that this action or event listener will be executed asynchronously, e.g. Define asynchronously invoked action method: ```java @ContextInsensitive @StateMachineParameters(stateType=String.class, eventType=String.class, contextType=Void.class) public class ConcurrentSimpleStateMachine extends AbstractUntypedStateMachine { // No need to specify constructor anymore since 0.2.9 // protected ConcurrentSimpleStateMachine(ImmutableUntypedState initialState, // Map<Object, ImmutableUntypedState> states) { // super(initialState, states); // } @AsyncExecute protected void fromAToB(String from, String to, String event) { // this action method will be invoked asynchronously } } ``` Define asynchronously dispatched event: ```java public class DeclarativeListener { @OnTransitionBegin @AsyncExecute public void onTransitionBegin(...) { // transition begin event will be dispatched asynchronously to this listener method } } ``` Asynchronous execution task will be submit to a *ExecutorService*. User can register your ExecutorService implementation instance through *SquirrelSingletonProvider*, e.g. ```java ExecutorService executorService = Executors.newFixedThreadPool(1); SquirrelSingletonProvider.getInstance().register(ExecutorService.class, executorService); ``` If no ExecutorService instance was registered, *SquirrelConfiguration* will provide a default one. * **State Machine PostProcessor** User can register post processor for specific type of state machine in order to adding post process logic after state machine instantiated, e.g. ```java // 1 User defined a state machine interface interface MyStateMachine extends StateMachine<MyStateMachine, MyState, MyEvent, MyContext> { . . . } // 2 Both MyStateMachineImpl and MyStateMachineImplEx are implemented MyStateMachine class MyStateMachineImpl implements MyStateMachine { . . . } class MyStateMachineImplEx implements MyStateMachine { . . . } // 3 User define a state machine post processor MyStateMachinePostProcessor implements SquirrelPostProcessor<MyStateMachine> { void postProcess(MyStateMachine component) { . . . } } // 4 User register state machine post process SquirrelPostProcessorProvider.getInstance().register(MyStateMachine.class, MyStateMachinePostProcessor.class); ``` For this case, when user created both MyStateMachineImpl and MyStateMachineImplEx instance, the registered post processor MyStateMachinePostProcessor will be called to do some work. * **State Machine Export** **SCXMLVisitor** can be used to export state machine definition in [SCXML] [2] document. ```java SCXMLVisitor visitor = SquirrelProvider.getInstance().newInstance(SCXMLVisitor.class); stateMachine.accept(visitor); visitor.convertSCXMLFile("MyStateMachine", true); ``` BTW, user can also call *StateMachine.exportXMLDefinition(true)* to export beautified XML definition. **DotVisitor** can be used to generate state diagram which can be viewed by [GraphViz] [3]. ```java DotVisitor visitor = SquirrelProvider.getInstance().newInstance(DotVisitor.class); stateMachine.accept(visitor); visitor.convertDotFile("SnakeStateMachine"); ``` * **State Machine Import** **UntypedStateMachineImporter** can be used to import state machine SCXML-similar definition which was exported by SCXMLVisitor or handwriting definition. UntypedStateMachineImporter will build a UntypedStateMachineBuilder according to the definition which can later be used to create state machine instances. ```java UntypedStateMachineBuilder builder = new UntypedStateMachineImporter().importDefinition(scxmlDef); ATMStateMachine stateMachine = builder.newAnyStateMachine(ATMState.Idle); ``` *Note: The UntypedStateMachineImporter provided an XML-style to define the state machine just like the state machine builder API or declarative annotations. The SCXML-similar definition is not equal to standard SCXML.* * **Save/Load State Machine Data** User can save data of state machine when state machine is in idle status. ```java StateMachineData.Reader<MyStateMachine, MyState, MyEvent, MyContext> savedData = stateMachine.dumpSavedData(); ``` And also user can load above *savedData* into another state machine whose status is terminated or just initialized. ```java newStateMachineInstance.loadSavedData(savedData); ``` **NOTE**: The state machine data can be serialized to/deserialized from Base64 encoded string with the help of *ObjectSerializableSupport* class. * **State Machine Configuration** When creating new state machine instance, user can configure its behavior through *StateMachineConfiguration*, e.g. ```java UntypedStateMachine fsm = builder.newUntypedStateMachine("a", StateMachineConfiguration.create().enableAutoStart(false) .setIdProvider(IdProvider.UUIDProvider.getInstance()), new Object[0]); // since 0.3.0 fsm.fire(TestEvent.toA); ``` The sample code above is used to create a state machine instance with UUID as its identifier and disable auto start function. StateMachineConfigure can also be set on state machine builder which means all the state machine instance created by ```builder.newStateMachine(S initialStateId)``` or ```builder.newStateMachine(S initialStateId, Object... extraParams)``` will use this configuration. * **State Machine Diagnose** *StateMachineLogger* is used to observe internal status of the state machine, like the execution performance, action calling sequence, transition progress and so on, e.g. ```java StateMachine<?,?,?,?> stateMachine = builder.newStateMachine(HState.A); StateMachineLogger fsmLogger = new StateMachineLogger(stateMachine); fsmLogger.startLogging(); ... stateMachine.fire(HEvent.B2A, 1); ... fsmLogger.terminateLogging(); ------------------------------------------------------------------------------------------- Console Log: HierachicalStateMachine: Transition from "B2a" on "B2A" with context "1" begin. Before execute method call action "leftB2a" (1 of 6). Before execute method call action "exitB2" (2 of 6). ... Before execute method call action "entryA1" (6 of 6). HierachicalStateMachine: Transition from "B2a" to "A1" on "B2A" complete which took 2ms. ... ``` *Since v0.3.0 state machine logger can be used more easy way by just set StateMachineConfiguration enable debug mode to ture, e.g.* ``` StateMachine<?,?,?,?> stateMachine = builder.newStateMachine(HState.A, StateMachineConfiguration.create().enableDebugMode(true), new Object[0]); ``` *StateMachinePerformanceMonitor* can be used to monitor state machine execution performance information, including total transition times count, average transition consumed time and so on, e.g. ```java final UntypedStateMachine fsm = builder.newStateMachine("D"); final StateMachinePerformanceMonitor performanceMonitor = new StateMachinePerformanceMonitor("Sample State Machine Performance Info"); fsm.addDeclarativeListener(performanceMonitor); for (int i = 0; i < 10000; i++) { fsm.fire(FSMEvent.ToA, 10); fsm.fire(FSMEvent.ToB, 10); fsm.fire(FSMEvent.ToC, 10); fsm.fire(FSMEvent.ToD, 10); } fsm.removeDeclarativeListener(performanceMonitor); System.out.println(performanceMonitor.getPerfModel()); ------------------------------------------------------------------------------------------- Console Log: ========================== Sample State Machine Performance Info ========================== Total Transition Invoked: 40000 Total Transition Failed: 0 Total Transition Declained: 0 Average Transition Comsumed: 0.0004ms Transition Key Invoked Times Average Time Max Time Min Time C--{ToD, 10}->D 10000 0.0007ms 5ms 0ms B--{ToC, 10}->C 10000 0.0001ms 1ms 0ms D--{ToA, 10}->A 10000 0.0009ms 7ms 0ms A--{ToB, 10}->B 10000 0.0000ms 1ms 0ms Total Action Invoked: 40000 Total Action Failed: 0 Average Action Execution Comsumed: 0.0000ms Action Key Invoked Times Average Time Max Time Min Time instan...Test$1 40000 0.0000ms 1ms 0ms ========================== Sample State Machine Performance Info ========================== ``` Add **@LogExecTime** on action method will log out the execution time of the method. And also add the @LogExecTime on state machine class will log out all the action method execution time. For example, the execution time of method *transitFromAToBOnGoToB* will be logged out. ```java @LogExecTime protected void transitFromAToBOnGoToB(MyState from, MyState to, MyEvent event, MyContext context) ``` * **Timed State** A **timed state** is a state that can delay or periodically trigger specified event after state entered. Timed task will be submit to a *ScheduledExecutorService*. User can register your ScheduledExecutorService implementation instance through *SquirrelSingletonProvider*, e.g. ```java ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); SquirrelSingletonProvider.getInstance().register(ScheduledExecutorService.class, scheduler); ``` If no ScheduledExecutorService instance was registered, *SquirrelConfiguration* will provide a default one. After that, a timed state can be defined by state machine builder, e.g. ```java // after 50ms delay fire event "FIRST" every 100ms with null context builder.defineTimedState("A", 50, 100, "FIRST", null); builder.internalTransition().within("A").on("FIRST"); ``` **NOTE**: Make sure timed state must be defined before describe its transitions or entry/exit actions. *timeInterval* less than or equal to 0 will be considered only execute once after *initialDelay*. * **Linked State (so called Submachine State)** A **linked state** specifies the insertion of the specification of a submachine state machine. The state machine that contains the linked state is called the containing state machine. The same state machine may be a submachine more than once in the context of a single containing state machine. A linked state is semantically equivalent to a composite state. The regions of the submachine state machine are the regions of the composite state. The entry, exit, and behavior actions and internal transitions are defined as part of the state. Submachine state is a decomposition mechanism that allows factoring of common behaviors and their reuse. The linked state can be defined by following sample code. ```java builderOfTestStateMachine.definedLinkedState(LState.A, builderOfLinkedStateMachine, LState.A1); ``` * ~~**JMX Support**~~ Since 0.3.3, user can remote monitor state machine instance(e.g. current status, name) and modify configurations(e.g. toggle loggings/toggle performance monitor/remote fire event) at runtime. All the state machine instances information will be under "org.squirrelframework" domain. The following sample code shows how to enable JMX support. ```java UntypedStateMachineBuilder builder = StateMachineBuilderFactory.create(...); builder.setStateMachineConfiguration(StateMachineConfiguration.create().enableRemoteMonitor(true)); ``` **NOTE**: JMX feature support deprecated since 0.3.9-SNAPSHOT. ## Examples See [EXAMPLES](https://github.com/hekailiang/squirrel/blob/master/EXAMPLES.md) file. ## Release Notes See [RELEASE NOTES](https://github.com/hekailiang/squirrel/blob/master/RELEASE_NOTES.md) file. ## Future Plan * Support health metrics monitoring * Support state machine definition profile(activate different profile behave differently) * [Javascript version of Squirrel State Machine](https://github.com/hekailiang/squirrel-statemachine-js) is still under development ## Sponsors ![IDEA](http://www.jetbrains.com/img/logos/logo_intellij_idea.png) ## More Information * For the **latest updates** follow my twitter [@hhe11][5] or [+HeHenry][8] * For discussions or questions please join the [squirrel state machine group][4] * For any issue or requirement, please submit an [issue][6] * **If you use Squirrel State Machine code in your application, I'll be appreciate if you inform the author about it (email: hekailiang@gmail.com) like this**: **Subject:** Squirrel State Machine Usage Notification **Text:** I use Squirrel State Machine \<lib\_version\> in \<project\_name\> - http://link\_to\_project. I [allow | don't allow] to mention my project in section "Who using Squirrel State Machine" on GitHub. [1]: http://en.wikipedia.org/wiki/UML_state_machine [2]: http://www.w3.org/TR/scxml/ [3]: http://www.graphviz.org/ [4]: http://groups.google.com/group/squirrel-state-machine [5]: https://twitter.com/hhe11 [6]: https://github.com/hekailiang/squirrel/issues?state=open [7]: http://mvel.codehaus.org/ [8]: https://google.com/+HeHenry [9]: http://www.uml-diagrams.org/state-machine-diagrams.html [10]: http://qt-project.org/doc/qt-4.8/statemachine-api.html [11]: https://github.com/hekailiang/squirrel/pull/11
0
apache/guacamole-client
Mirror of Apache Guacamole Client
c guacamole java javascript network-client network-server
null
0
pf4j/pf4j
Plugin Framework for Java (PF4J)
java modularity plugins
<img src="pf4j-logo.svg" width="250"/> Plugin Framework for Java (PF4J) ===================== [![Join the chat at https://gitter.im/decebals/pf4j](https://badges.gitter.im/decebals/pf4j.svg)](https://gitter.im/decebals/pf4j?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GitHub Actions Status](https://github.com/pf4j/pf4j/actions/workflows/build.yml/badge.svg)](https://github.com/pf4j/pf4j/actions/workflows/build.yml) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=pf4j_pf4j&metric=coverage)](https://sonarcloud.io/summary/new_code?id=pf4j_pf4j) [![Maven Central](http://img.shields.io/maven-central/v/org.pf4j/pf4j.svg)](http://search.maven.org/#search|ga|1|pf4j) A plugin is a way for a third party to extend the functionality of an application. A plugin implements extension points declared by application or other plugins. Also, a plugin can define extension points. **NOTE:** Starting with version 0.9 you can define an extension directly in the application jar (you're not obligated to put the extension in a plugin - you can see this extension as a default/system extension). See [WhazzupGreeting](https://github.com/pf4j/pf4j/blob/master/demo/app/src/main/java/org/pf4j/demo/WhazzupGreeting.java) for a real example. Features/Benefits ------------------- With PF4J you can easily transform a monolithic java application in a modular application. PF4J is an open source (Apache license) lightweight (around __100 KB__) plugin framework for java, with minimal dependencies (only slf4j-api) and very extensible (see `PluginDescriptorFinder` and `ExtensionFinder`). Practically, PF4J is a microframework that aims to keep the core simple but extensible. We also have a community-driven ecosystem of extensions. For now are available these extensions: - [pf4j-shell](https://github.com/pf4j/pf4j-shell) (interactive shell for PF4J) - [pf4j-update](https://github.com/pf4j/pf4j-update) (update mechanism for PF4J) - [pf4j-spring](https://github.com/pf4j/pf4j-spring) (PF4J - Spring Framework integration) - [pf4j-wicket](https://github.com/pf4j/pf4j-wicket) (PF4J - Wicket integration) - [pf4j-web](https://github.com/pf4j/pf4j-web) (PF4J in web applications) No XML, only Java. You can mark any interface or abstract class as an extension point (with marker interface ExtensionPoint) and you specified that an class is an extension with @Extension annotation. Components ------------------- - **Plugin** is the base class for all plugins types. Each plugin is loaded into a separate class loader to avoid conflicts. - **PluginManager** is used for all aspects of plugins management (loading, starting, stopping). You can use a built-in implementation as `JarPluginManager`, `ZipPluginManager`, `DefaultPluginManager` (it's a `JarPluginManager` + `ZipPluginManager`) or you can implement a custom plugin manager starting from `AbstractPluginManager` (implement only factory methods). - **PluginLoader** loads all information (classes) needed by a plugin. - **ExtensionPoint** is a point in the application where custom code can be invoked. It's a java interface marker. Any java interface or abstract class can be marked as an extension point (implements `ExtensionPoint` interface). - **Extension** is an implementation of an extension point. It's a java annotation on a class. **PLUGIN** = a container for **EXTENSION POINTS** and **EXTENSIONS** + lifecycle methods (start, stop, delete) A **PLUGIN** is similar with a **MODULE** from other systems. If you don't need lifecycle methods (hook methods for start, stop, delete) you are not forced to supply a plugin class (the `PluginClass` property from the plugin descriptor is optional). You only need to supply some description of plugin (id, version, author, ...) for a good tracking (your application wants to know who supplied the extensions or extensions points). How to use ------------------- It's very simple to add pf4j in your application. Define an extension point in your application/plugin using **ExtensionPoint** interface marker: ```java public interface Greeting extends ExtensionPoint { String getGreeting(); } ``` Create an extension using `@Extension` annotation: ```java @Extension public class WelcomeGreeting implements Greeting { public String getGreeting() { return "Welcome"; } } ``` Create (it's __optional__) a `Plugin` class if you are interested in plugin's lifecycle events (start, stop, ...): ```java public class WelcomePlugin extends Plugin { @Override public void start() { System.out.println("WelcomePlugin.start()"); } @Override public void stop() { System.out.println("WelcomePlugin.stop()"); } @Override public void delete() { System.out.println("WelcomePlugin.delete()"); } } ``` In above code we've created a plugin (welcome) that comes with one extension for the `Greeting` extension point. You can distribute your plugin as a jar file (the simple solution). In this case add the plugin's metadata in `MANIFEST.MF` file of jar: ``` Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: decebal Build-Jdk: 1.6.0_17 Plugin-Class: org.pf4j.demo.welcome.WelcomePlugin Plugin-Dependencies: x, y, z Plugin-Id: welcome-plugin Plugin-Provider: Decebal Suiu Plugin-Version: 0.0.1 ``` In the manifest above, we've described a plugin with the id of `welcome-plugin` (mandatory attribute). We've also defined a class `org.pf4j.demo.welcome.WelcomePlugin` (optional attribute), with version `0.0.1` (mandatory attribute) and with dependencies to plugins `x, y, z` (optional attribute). Now you can play with plugins and extensions in your code: ```java public static void main(String[] args) { ... // create the plugin manager PluginManager pluginManager = new JarPluginManager(); // or "new ZipPluginManager() / new DefaultPluginManager()" // start and load all plugins of application pluginManager.loadPlugins(); pluginManager.startPlugins(); // retrieve all extensions for "Greeting" extension point List<Greeting> greetings = pluginManager.getExtensions(Greeting.class); for (Greeting greeting : greetings) { System.out.println(">>> " + greeting.getGreeting()); } // stop and unload all plugins pluginManager.stopPlugins(); pluginManager.unloadPlugins(); ... } ``` The output is: ``` >>> Welcome ``` PF4J is very customizable and comes with a lot of goodies. Please read the documentation to discover yourself the power of this library. Documentation --------------- Documentation is available on [pf4j.org](http://pf4j.org) Demo --------------- Demo applications are available in [demo](https://github.com/pf4j/pf4j/tree/master/demo) folder Quickstart (call to action) --------------- 1. Read this file to have an overview about what this project does 2. Read [Getting started](https://pf4j.org/doc/getting-started.html) section of documentation to understand the basic concepts 3. Read [Quickstart](https://pf4j.org/dev/quickstart.html) section of documentation to create your first PF4J-based modular application
0
auth0/java-jwt
Java implementation of JSON Web Token (JWT)
dx-sdk java jwt
> **Note** > As part of our ongoing commitment to best security practices, we have rotated the signing keys used to sign previous releases of this SDK. As a result, new patch builds have been released using the new signing key. Please upgrade at your earliest convenience. > > While this change won't affect most developers, if you have implemented a dependency signature validation step in your build process, you may notice a warning that past releases can't be verified. This is expected, and a result of the key rotation process. Updating to the latest version will resolve this for you. ![A Java implementation of JSON Web Token (JWT) - RFC 7519.](https://cdn.auth0.com/website/sdks/banners/java-jwt-banner.png) ![Build Status](https://img.shields.io/github/checks-status/auth0/java-jwt/master) [![Coverage Status](https://img.shields.io/codecov/c/github/auth0/java-jwt.svg?style=flat-square)](https://codecov.io/github/auth0/java-jwt) [![License](http://img.shields.io/:license-mit-blue.svg?style=flat)](https://doge.mit-license.org/) [![Maven Central](https://img.shields.io/maven-central/v/com.auth0/java-jwt.svg?style=flat-square)](https://mvnrepository.com/artifact/com.auth0/java-jwt) [![javadoc](https://javadoc.io/badge2/com.auth0/auth0/javadoc.svg)](https://javadoc.io/doc/com.auth0/java-jwt) :books: [Documentation](#documentation) - :rocket: [Getting Started](#getting-started) - :computer: [API Reference](#api-reference) :speech_balloon: [Feedback](#feedback) ## Documentation - [Examples](./EXAMPLES.md) - code samples for common java-jwt scenarios. - [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0. ## Getting Started ### Requirements This library is supported for Java LTS versions 8, 11, and 17. For issues on non-LTS versions above 8, consideration will be given on a case-by-case basis. > `java-jwt` is intended for server-side JVM applications. Android applications should use [JWTDecode.Android](https://github.com/auth0/JWTDecode.Android). `java-jwt` supports the following algorithms for both signing and verification: | JWS | Algorithm | Description | | :-------------: | :-------------: | :----- | | HS256 | HMAC256 | HMAC with SHA-256 | | HS384 | HMAC384 | HMAC with SHA-384 | | HS512 | HMAC512 | HMAC with SHA-512 | | RS256 | RSA256 | RSASSA-PKCS1-v1_5 with SHA-256 | | RS384 | RSA384 | RSASSA-PKCS1-v1_5 with SHA-384 | | RS512 | RSA512 | RSASSA-PKCS1-v1_5 with SHA-512 | | ES256 | ECDSA256 | ECDSA with curve P-256 and SHA-256 | | ES384 | ECDSA384 | ECDSA with curve P-384 and SHA-384 | | ES512 | ECDSA512 | ECDSA with curve P-521 and SHA-512 | > Note - Support for ECDSA with curve secp256k1 and SHA-256 (ES256K) has been dropped since it has been [disabled in Java 15](https://www.oracle.com/java/technologies/javase/15-relnote-issues.html#JDK-8237219) > :warning: **Important security note:** JVM has a critical vulnerability for ECDSA Algorithms - [CVE-2022-21449](https://nvd.nist.gov/vuln/detail/CVE-2022-21449). Please review the details of the vulnerability and update your environment. ### Installation Add the dependency via Maven: ```xml <dependency> <groupId>com.auth0</groupId> <artifactId>java-jwt</artifactId> <version>4.4.0</version> </dependency> ``` or Gradle: ```gradle implementation 'com.auth0:java-jwt:4.4.0' ``` ### Create a JWT Use `JWT.create()`, configure the claims, and then call `sign(algorithm)` to sign the JWT. The example below demonstrates this using the `RS256` signing algorithm: ```java try { Algorithm algorithm = Algorithm.RSA256(rsaPublicKey, rsaPrivateKey); String token = JWT.create() .withIssuer("auth0") .sign(algorithm); } catch (JWTCreationException exception){ // Invalid Signing configuration / Couldn't convert Claims. } ``` ### Verify a JWT Create a `JWTVerifier` passing the `Algorithm`, and specify any required claim values. The following example uses `RS256` to verify the JWT. ```java String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.AbIJTDMFc7yUa5MhvcP03nJPyCPzZtQcGEp-zWfOkEE"; DecodedJWT decodedJWT; try { Algorithm algorithm = Algorithm.RSA256(rsaPublicKey, rsaPrivateKey); JWTVerifier verifier = JWT.require(algorithm) // specify any specific claim validations .withIssuer("auth0") // reusable verifier instance .build(); decodedJWT = verifier.verify(token); } catch (JWTVerificationException exception){ // Invalid signature/claims } ``` If the token has an invalid signature or the Claim requirement is not met, a `JWTVerificationException` will be thrown. See the [examples](./EXAMPLES.md) and [JavaDocs](https://javadoc.io/doc/com.auth0/java-jwt/latest) for additional documentation. ## API Reference - [java-jwt JavaDocs](https://javadoc.io/doc/com.auth0/java-jwt/latest) ## Feedback ### Contributing We appreciate feedback and contribution to this repo! Before you get started, please see the following: - [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) - [Auth0's code of conduct guidelines]((https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)) ### Raise an issue To provide feedback or report a bug, [please raise an issue on our issue tracker](https://github.com/auth0/java-jwt/issues). ### Vulnerability Reporting Please do not report security vulnerabilities on the public Github issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. --- <p align="center"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150"> <source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png" width="150"> <img alt="Auth0 Logo" src="./auth0_light_mode.png" width="150"> </picture> </p> <p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p> <p align="center"> This project is licensed under the MIT license. See the <a href="./LICENSE"> LICENSE</a> file for more info.</p>
0
vivo/MoonBox
月光宝盒:无侵入的流量录制与回放平台 A server-side traffic capture and replay platform with noninvasive
capture hacktoberfest hacktoberfest2023 recoding replay traffic
# **Moonbox:月光宝盒** Moonbox(月光宝盒)是[JVM-Sandbox](https://github.com/alibaba/jvm-sandbox-repeater)生态下的,基于[jvm-sandbox-repeater](https://github.com/alibaba/jvm-sandbox-repeater)重新开发的一款流量回放平台产品。在jvm-sandbox-repeater基础上提供了更加丰富功能,同时便于线上部署和使用,[更多对比参考](./docs/repeater-diff.md)。 ## 使用场景 > 你是否遇到过以下的问题? > > - 线上有个用户请求一直不成功,我想在测试环境Debug一下,能帮我复现一下吗? > - 压测流量不知道怎么构造,数据结构太复杂,压测模型也难以评估,有什么好的办法吗? > - 不想写接口测试脚本了,我想做一个流量录制系统,把线上用户场景做业务回归,可能会接入很多服务系统,不想让每个系统都进行改造,有好的框架选择吗? > - 我想做一个业务监控系统,对线上核心接口采样之后做一些业务校验,实时监控业务正确性 Moonbox(月光宝盒)是一个**无侵入**的线上**流量录制** 和**流量回放**平台,沿用了jvm-sandbox-repeater的SPI设计,并提供了大量的常用插件,同时也提供数据统计和存储能力。通过Moonbox可以实现自动化测试、线上问题追踪、和业务监控等能力 ![功能介绍](./docs/images/introduce.png) ### 名词解释 - **录制**:把一次请求的入参、出参、**下游RPC、DB、缓存**等序列化并存储的过程 - **回放**:把录制数据还原,重新发起一次或N次请求,对特定的下游节点进行MOCK的过程 - **入口调用**:入口调用一般是应用的**流量来源**,比如http/dubbo,在调用过程中录制调用入参,返回值。回放时作为流量发起和执行结果对比依据 - **子调用**:区别于入口调用,子调用是调用执行过程中某次方法调用。子调用在录制时会记录该方法的入参、返回值;回放时用该返回值进行MOCK - **MOCK**:在回放时,被拦截的子调用**不会发生真实调用**,利用字节码动态干预能力,将录制时的返回值直接返回 - **降噪**:在回放时,部分回放子调用入参或者回放流量响应结果和原始流量对比不一致字段,对这些非必要字段进行排除对比过程 ### 功能介绍 - 流量录制:流量录制模板管理,录制任务下发和录制流量查看 - 流量回放:流量回放任务管理,回放数据查看成功率统计 - 回放mock:流量录制和回放特殊mock(作为子调用mock) - 对比配置:流量回放字段忽略配置 更多详细功能介绍,详见 [Moonbox操作手册](./docs/user-guide.md) ## 技术原理 技术原理介绍,详见 [技术原理](./docs/project-design.md) ## 快速开始 详见 [快速开始](./docs/quick-start.md) ## Docker部署 详见 [月光宝盒Docker部署](./docs/月光宝盒Docker部署手册.md) ## 未来计划 月光宝盒项目已经在vivo运行2年,接入了上百个项目。内部有较多新特性正在开发和使用中,预计会陆续会对外开源,包括 - 丰富更多的插件 - mysql的数据存储 - 基于c++的流量录制回放 - docker化平台部署 - 用例、场景管理能力 - 定时录制、回放能力 ## (微信群)社区交流 ![微信交流](./docs/images/contact.png) 请回复:moonbox微信群交流,申请进群 欢迎优先提交Issue、PR,欢迎使用、共建。 ## 谁在使用 如果您在使用MoonBox,请让我们知道,您的使用对我们非常重要:[登记链接](https://github.com/vivo/MoonBox/issues/9) (按登记顺序排列) ![image](https://user-images.githubusercontent.com/25222084/219582563-15b50fc0-392c-46fd-8ef7-879798fd9620.png)
0
apache/bookkeeper
Apache BookKeeper - a scalable, fault tolerant and low latency storage service optimized for append-only workloads
big-data bookkeeper
<img src="https://pbs.twimg.com/profile_images/545716709311520769/piLLa1iC_400x400.png" alt="logo" style="width: 32px;"/> [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.bookkeeper/bookkeeper/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.bookkeeper/bookkeeper) # Apache BookKeeper Apache BookKeeper is a scalable, fault-tolerant and low latency storage service optimized for append-only workloads. It is suitable for being used in following scenarios: - WAL (Write-Ahead-Logging), e.g. HDFS NameNode, Pravega. - Message Store, e.g. Apache Pulsar. - Offset/Cursor Store, e.g. Apache Pulsar. - Object/Blob Store, e.g. storing state machine snapshots. ## Get Started * Checkout the project [website](https://bookkeeper.apache.org/). * *Concepts*: Start with the [basic concepts](https://bookkeeper.apache.org/docs/getting-started/concepts) of Apache BookKeeper. This will help you to fully understand the other parts of the documentation. * Follow the [Installation](https://bookkeeper.apache.org/docs/getting-started/installation) guide to set up BookKeeper. ## Documentation Please visit the [Documentation](https://bookkeeper.apache.org/docs/overview/) from the project website for more information. ## Get In Touch ### Report a Bug For filing bugs, suggesting improvements, or requesting new features, help us out by [opening a GitHub issue](https://github.com/apache/bookkeeper/issues). ### Need Help? [Subscribe](mailto:user-subscribe@bookkeeper.apache.org) or [mail](mailto:user@bookkeeper.apache.org) the [user@bookkeeper.apache.org](mailto:user@bookkeeper.apache.org) list - Ask questions, find answers, and also help other users. [Subscribe](mailto:dev-subscribe@bookkeeper.apache.org) or [mail](mailto:dev@bookkeeper.apache.org) the [dev@bookkeeper.apache.org](mailto:dev@bookkeeper.apache.org) list - Join development discussions, propose new ideas and connect with contributors. [Join us on Slack](https://communityinviter.com/apps/apachebookkeeper/apache-bookkeeper) - This is the most immediate way to connect with Apache BookKeeper committers and contributors. ## Contributing We feel that a welcoming open community is important and welcome contributions. ### Contributing Code 1. See our [installation guide](https://bookkeeper.apache.org/docs/next/getting-started/installation/) to get your local environment setup. 2. Take a look at our open issues: [GitHub Issues](https://github.com/apache/bookkeeper/issues). 3. Review our [coding style](https://bookkeeper.apache.org/community/coding-guide/) and follow our [pull requests](https://github.com/apache/bookkeeper/pulls) to learn more about our conventions. 4. Make your changes according to our [contributing guide](https://bookkeeper.apache.org/community/contributing/)
0
baomidou/dynamic-datasource
dynamic datasource for springboot 多数据源 动态数据源 主从分离 读写分离 分布式事务
datasource distributed-transaction dynamic-datasource dynamicdatasource multi-datasource multidatasource mybatis spring-boot springboot
<p align="center"> <img src="https://images.gitee.com/uploads/images/2019/0626/231046_f44892b9_709883.png" border="0" /> </p> <p align="center"> <strong>一个基于springboot的快速集成多数据源的启动器</strong> </p> <p align="center"> <a > <img src="https://github.com/baomidou/dynamic-datasource-spring-boot-starter/workflows/CodeQL/badge.svg?branch=master" > </a> <a> <img src="https://badgen.net/github/stars/baomidou/dynamic-datasource-spring-boot-starter" > </a> <a href="https://mvnrepository.com/artifact/com.baomidou/dynamic-datasource-spring-boot-starter" target="_blank"> <img src="https://img.shields.io/maven-central/v/com.baomidou/dynamic-datasource-spring-boot-starter.svg" > </a> <a href="https://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"> <img src="https://img.shields.io/:license-apache-brightgreen.svg" > </a> <a> <img src="https://img.shields.io/badge/JDK-8+-green.svg" > </a> <a> <img src="https://img.shields.io/badge/springBoot-1.5.x__2.x.x__3.x.x-green.svg" > </a> <a href="https://www.jetbrains.com"> <img src="https://img.shields.io/badge/IntelliJ%20IDEA-support-blue.svg" > </a> <a> <img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" > </a> <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=ded31006508b57d2d732c81266dd2c26e33283f84464e2c294309d90b9674992"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="dynamic-sring-boot-starter" title="dynamic-sring-boot-starter"></a> </p> # 简介 dynamic-datasource-spring-boot-starter 是一个基于springboot的快速集成多数据源的启动器。 其支持 **Jdk 1.7+, SpringBoot 1.5.x 2.x.x 3.x.x**。 ## 文档 | Documentation 详细文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611 ## 贡献 | Contributing 我们欢迎社区的贡献,请查看 [CONTRIBUTING.md](./CONTRIBUTING.md) 。 # 特性 - 支持 **数据源分组** ,适用于多种场景 纯粹多库 读写分离 一主多从 混合模式。 - 支持数据库敏感配置信息 **加密(可自定义)** ENC()。 - 支持每个数据库独立初始化表结构schema和数据库database。 - 支持无数据源启动,支持懒加载数据源(需要的时候再创建连接)。 - 支持 **自定义注解** ,需继承DS(3.2.0+)。 - 提供并简化对Druid,HikariCp,BeeCp,Dbcp2的快速集成。 - 提供对Mybatis-Plus,Quartz,ShardingJdbc,P6sy,Jndi等组件的集成方案。 - 提供 **自定义数据源来源** 方案(如全从数据库加载)。 - 提供项目启动后 **动态增加移除数据源** 方案。 - 提供Mybatis环境下的 **纯读写分离** 方案。 - 提供使用 **spel动态参数** 解析数据源方案。内置spel,session,header,支持自定义。 - 支持 **多层数据源嵌套切换** 。(ServiceA >>> ServiceB >>> ServiceC)。 - 提供 **基于seata的分布式事务方案** 。 - 提供 **本地多数据源事务方案。** # 约定 1. 本框架只做 **切换数据源** 这件核心的事情,并**不限制你的具体操作**,切换了数据源可以做任何CRUD。 2. 配置文件所有以下划线 `_` 分割的数据源 **首部** 即为组的名称,相同组名称的数据源会放在一个组下。 3. 切换数据源可以是组名,也可以是具体数据源名称。组名则切换时采用负载均衡算法切换。 4. 默认的数据源名称为 **master** ,你可以通过 `spring.datasource.dynamic.primary` 修改。 5. 方法上的注解优先于类上注解。 6. DS支持继承抽象类上的DS,暂不支持继承接口上的DS。 # 使用方法 1. 引入dynamic-datasource-spring-boot-starter。 spring-boot 1.5.x 2.x.x ```xml <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <version>${version}</version> </dependency> ``` spring-boot3及以上 ```xml <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot3-starter</artifactId> <version>${version}</version> </dependency> ``` 2. 配置数据源。 ```yaml spring: datasource: dynamic: enabled: true #启用动态数据源,默认true primary: master #设置默认的数据源或者数据源组,默认值即为master strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 grace-destroy: false #是否优雅关闭数据源,默认为false,设置为true时,关闭数据源时如果数据源中还存在活跃连接,至多等待10s后强制关闭 datasource: master: url: jdbc:mysql://xx.xx.xx.xx:3306/dynamic username: root password: 123456 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 slave_1: url: jdbc:mysql://xx.xx.xx.xx:3307/dynamic username: root password: 123456 driver-class-name: com.mysql.jdbc.Driver slave_2: url: ENC(xxxxx) # 内置加密,使用请查看详细文档 username: ENC(xxxxx) password: ENC(xxxxx) driver-class-name: com.mysql.jdbc.Driver #......省略 #以上会配置一个默认库master,一个组slave下有两个子库slave_1,slave_2 ``` **多主多从:** ```yaml spring: datasource: dynamic: datasource: master_1: master_2: slave_1: slave_2: slave_3: ``` **纯粹多库:** ```yaml spring: datasource: dynamic: datasource: mysql: oracle: sqlserver: postgresql: h2: ``` **混合配置:** ```yaml spring: datasource: dynamic: datasource: master: slave_1: slave_2: oracle_1: oracle_2: ``` 3. 使用 **@DS** 切换数据源。 **@DS** 可以注解在方法上或类上,**同时存在就近原则 方法上注解 优先于 类上注解**。 | 注解 | 结果 | |:-------------:|:-----------------------:| | 没有@DS | 默认数据源 | | @DS("dsName") | dsName可以为组名也可以为具体某个库的名称 | ```java @Service @DS("slave") public class UserServiceImpl implements UserService { @Autowired private JdbcTemplate jdbcTemplate; public List selectAll() { return jdbcTemplate.queryForList("select * from user"); } @Override @DS("slave_1") public List selectByCondition() { return jdbcTemplate.queryForList("select * from user where age >10"); } } ```
0
ndroi/easy163
安卓端一键解锁网易云音乐,无须 ROOT
android-app netease-cloud-music unblocker vip vpn
# easy163 安卓版网易云助手 **一键可用,无须 ROOT** **播放 VIP 和下架歌曲** **任意歌曲下载到本地** **下架歌曲收藏** 工作原理: 在本地搭建 VPN 服务,拦截修改重定向网易云 APP 的 HTTP 请求,从其他音乐平台获取资源 特性: <ul> <li>支持 VIP 和下架歌曲播放</li> <li>支持任意歌曲下载</li> <li>支持收藏(不支持 Like)</li> <li>高精度歌曲匹配算法 </li> </ul> 已知问题: <ol> <li>Easy163 开启时无法登录网易云音乐,请先关闭时登录,登录完毕后再打开</li> <li>用户自身个人主页不可用,暂时无解</li> <li>下载时若长时间显示正在计算文件长度然后失败,点击重试即可</li> </ol> 使用方式: 开启本软件的 VPN 服务即可使用 如无法使用请重启网易云 开启本软件后如遇到设备网络异常请关闭本软件 说明: 开启本软件后网易云 APP 所有的 HTTP 请求皆由本软件代理,如质疑其安全性欢迎审阅源码并自行编译 APK 本软件为实验性项目,使用完全免费,仅提供技术研究使用,作者不承担用户使用造成的一切责任 推荐: 网易云官方推出的 **网易云极速版** [https://mip.onlinedown.net/soft/1225624.htm] 官网推出后不久下架,此版本网易云功能简单稳定,与 easy163 兼容良好 **项目需要频繁维护,希望大家支持** **欢迎点赞项目,提交问题** 感谢 [https://github.com/nondanee/UnblockNeteaseMusic] 提供 NodeJS 版网易云助手 本项目参考其大量业务逻辑,包括 APP 图标 感谢 [https://github.com/mightofcode/android-vpnservice] 实现了轻量易用的 Android VPN 代理程序
0
supertokens/supertokens-core
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
auth0 authentication aws-cognito email-password email-password-login firebase-auth hacktoberfest java keycloak login oauth password passwordless passwordless-authentication passwordless-login session-management signin social-login supertokens
[![SuperTokens banner](https://raw.githubusercontent.com/supertokens/supertokens-logo/master/images/Artboard%20%E2%80%93%2027%402x.png)](https://supertokens.com/) # Open-Source auth provider <a href="https://supertokens.io/discord"> <img src="https://img.shields.io/discord/603466164219281420.svg?logo=discord" alt="chat on Discord"></a> <span><img src="https://img.shields.io/docker/pulls/supertokens/supertokens-postgresql.svg" alt="Docker pull stats"/></span> Add **secure login and session management** to your apps. [SDKs available](https://supertokens.com/docs/community/sdks) for popular languages and front-end frameworks e.g. Node.js, Go, Python, React.js, React Native, Vanilla JS, etc. ![Architecture Diagram](https://supertokens.com/img/architecture/self_hosted_generic.png) Supertokens architecture is optimized to add secure authentication for your users without compromising on user and developer experience **Three building blocks of SuperTokens architecture** 1. Frontend SDK: Manages session tokens and renders login UI widgets 2. Backend SDK: Provides APIs for sign-up, sign-in, signout, session refreshing, etc. Your Frontend will talk to these APIs 3. SuperTokens Core: The HTTP service for the core auth logic and database operations. This service is used by the Backend SDK ## Features [![Click here to get started](.github/click-here-to-get-started.png)](https://supertokens.com/docs/guides) * Passwordless Login * Social Login * Email Password Login * Phone Password Login * Session Management * Multi-Factor Authentication * Multi Tenancy / Organization Support (Enterprise SSO) * User Roles * Microservice Authentication ## Learn more - [🚀 What is SuperTokens?](https://github.com/supertokens/supertokens-core#-what-is-supertokens) - [Philosophy](https://github.com/supertokens/supertokens-core#philosophy) - [Features + Demo app](https://github.com/supertokens/supertokens-core#features---click-here-to-see-the-demo-app) - [Documentation](https://github.com/supertokens/supertokens-core#documentation) - [🏗️ Architecture](https://github.com/supertokens/supertokens-core#%EF%B8%8F-architecture) - [☕ Why Java?](https://github.com/supertokens/supertokens-core#-why-java) - [⌨️ User Management Dashboard](https://github.com/supertokens/supertokens-core#-user-management-dashboard) - [🔥 SuperTokens vs Others](https://github.com/supertokens/supertokens-core#-supertokens-vs-others) - [🛠️ Building from source](https://github.com/supertokens/supertokens-core#%EF%B8%8F-building-from-source) - [👥 Community](https://github.com/supertokens/supertokens-core#-community) - [Contributors](https://github.com/supertokens/supertokens-core#contributors-across-all-supertokens-repositories) - [👩‍💻 Contributing](https://github.com/supertokens/supertokens-core#-contributing) - [📝 License](https://github.com/supertokens/supertokens-core#-license) ### If you like our project, please :star2: this repository! For feedback, feel free to join our [Discord](https://supertokens.io/discord), or create an issue on this repo ## 🚀 What is SuperTokens? SuperTokens is an open-core alternative to proprietary login providers like Auth0 or AWS Cognito. We are different because we offer: - Open source: SuperTokens can be used for free, forever, with no limits on the number of users. - An on-premises deployment so that you control 100% of your user data, using your own database. - An end-to-end solution with login, sign-ups, user and session management, without all the complexities of OAuth protocols. - Ease of implementation and higher security. - Extensibility: Anyone can contribute and make SuperTokens better! ### Philosophy Authentication directly affects the UX, dev experience, and security of any app. We believe that current solutions cannot optimize for all three "pillars", leading to many applications hand-rolling their own auth. This not only leads to security issues but is also a massive time drain. We want to change that - we believe the only way is to provide a solution that has the right level of abstraction gives you maximum control, is secure, and is simple to use - just like if you build it yourself, from scratch (minus the time to learn, build, and maintain). We also believe in the principle of least vendor lock-in. Your having full control of your user's data means that you can switch away from SuperTokens without forcing your existing users to logout, reset their passwords, or in the worst case, sign up again. ### [Click here](https://thirdpartyemailpassword.demo.supertokens.io/) to see the demo app. - Please visit [our website](https://supertokens.io/pricing) to see the list of features. - We want to make features as decoupled as possible. This means you can use SuperTokens for just login, or just session management, or both. In fact, we also offer session management integrations with other login providers like Auth0. ### Documentation The docs can be seen [on our website](https://supertokens.io/docs/community/introduction). There is more information about SuperTokens on the [GitHub wiki section](https://github.com/supertokens/supertokens-core/wiki). ## 🏗️ Architecture Please find an [architecture diagram here](https://supertokens.io/docs/community/architecture) **For more information, please visit our [GitHub wiki section](https://github.com/supertokens/supertokens-core/wiki/SuperTokens-Architecture).** ## ☕ Why Java? - ✅ Whilst running Java can seem difficult, we provide the JDK along with the binary/docker image when distributing it. This makes running SuperTokens just like running any other HTTP microservice. - ✅ Java has a very mature ecosystem. This implies that third-party libraries have been battle-tested. - ✅ Java's strong type system ensures fewer bugs and easier maintainability. This is especially important when many people are expected to work on the same project. - ✅ Our team is most comfortable with Java and hiring great Java developers is relatively easy as well. - ✅ One of the biggest criticisms of Java is memory usage. We have three solutions to this: - The most frequent auth-related operation is session verification - this happens within the backend SDK (node, python, Go) without contacting the Java core. Therefore, a single instance of the core can handle several 10s of thousands of users fairly easily. - We have carefully chosen our dependencies. For eg: we use an embedded tomcat server instead of a higher-level web framework. - We also plan on using [GraalVM](https://www.graalvm.org/) in the future and this can reduce memory usage by 95%! - ✅ If you require any modifications to the auth APIs, those would need to be done on the backend SDK level (for example Node, Golang, Python..). So you’d rarely need to directly modify/work with the Java code in this repo. ## ⌨️ User Management Dashboard Oversee your users with the [SuperTokens User Management Dashboard](https://supertokens.com/docs/userdashboard/about) ### List users List all the users who have signed up to your application. ![List SuperTokens users](.github/list-user.png) ### Manage users Manage users by modifying or deleting their sessions, metadata, roles and account info. ![Manage users](.github/user-info.png) ## 🔥 SuperTokens vs others Please find a detailed comparison chart [on our website](https://supertokens.io/pricing#comparison-chart) ## 🛠️ Building from source Please see our [wiki](https://github.com/supertokens/supertokens-core/wiki/Building-from-source) for instructions. ## 👥 Community - [Discord](https://supertokens.io/discord) - [Email](mailto:team@supertokens.io) If you think this is a project you could use in the future, please :star2: this repository! ### Contributors (across all SuperTokens repositories) <table> <tr> <td align="center"><a href="https://github.com/rishabhpoddar"><img src="https://avatars1.githubusercontent.com/u/2976287?s=460&u=d0cf2463df96fbdf1138cf74f88d7cf41415b238&v=4" width="100px;" alt=""/><br /><sub><b>Rishabh Poddar</b></sub></a></td> <td align="center"><a href="https://twitter.com/Advait_Ruia"><img src="https://pbs.twimg.com/profile_images/1261970454685900800/ALVzsBQJ_400x400.jpg" width="100px;" alt=""/><br /><sub><b>Advait Ruia</b></sub></a></td> <td align="center"><a href="https://github.com/bhumilsarvaiya"><img src="https://avatars2.githubusercontent.com/u/21988812?s=460&u=c0bcde60a8bf1a99baafced55dd1a8d901fa7e4a&v=4" width="100px;" alt=""/><br /><sub><b>Bhumil Sarvaiya</b></sub></a></td> <td align="center"><a href="https://github.com/jscyo"><img src="https://i.stack.imgur.com/frlIf.png" width="100px;" alt=""/><br /><sub><b>Joel Coutinho</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/RakeshUP"><img src="https://avatars1.githubusercontent.com/u/20946466?s=400&u=01d7d6d701eedd8345e491172e3af04578d18113&v=4" width="100px;" alt=""/><br /><sub><b>Rakesh UP</b></sub></a></td> <td align="center"><a href="https://twitter.com/mufassirkazi"><img src="https://i.stack.imgur.com/frlIf.png" width="100px;" alt=""/><br /><sub><b>Mufassir Kazi</b></sub></a></td> <td align="center"><a href="https://github.com/nkshah2"><img src="https://avatars2.githubusercontent.com/u/18233774?s=400&u=5befa41674cfcd6c6060103360ab323cdfa24dcb&v=4" width="100px;" alt=""/><br /><sub><b>Nemi Shah</b></sub></a></td> <td align="center"><a href="https://github.com/irohitb"><img src="https://avatars3.githubusercontent.com/u/32276134?s=400&u=0b72f6c4e6cfa749229a8e69ed86acb720a384e7&v=4" width="100px;" alt=""/><br /><sub><b>Rohit Bhatia</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/mmaha"><img src="https://avatars3.githubusercontent.com/u/297517?s=400&u=8c41caf46c511ed2054c3d14c23193eda0d996af&v=4" width="100px;" alt=""/><br /><sub><b>Madhu Mahadevan</b></sub></a></td> <td align="center"><a href="https://github.com/nugmanoff"><img src="https://avatars3.githubusercontent.com/u/20473743?s=460&u=2d33e10df1e8c3f38328e6e92d753363026f660f&v=4" width="100px;" alt=""/><br /><sub><b>Aidar Nugmanoff</b></sub></a></td> <td align="center"><a href="https://github.com/arnxv0"><img src="https://avatars2.githubusercontent.com/u/57629464?s=460&u=5f0cca1aed9fabb38bea74df73ed99dfcfec2f26&v=4" width="100px;" alt=""/><br /><sub><b>Arnav Dewan</b></sub></a></td> <td align="center"><a href="https://github.com/NkxxkN"><img src="https://avatars1.githubusercontent.com/u/5072452?s=460&u=eda6b25b674d20e3389bf19a0619d6e4c1e46670&v=4" width="100px;" alt=""/><br /><sub><b>NkxxkN</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/UbadahJ"><img src="https://avatars1.githubusercontent.com/u/26687928?s=460&u=ae1d3ae5fad6e4cfa71809f8ce4a99429321dcaf&v=4" width="100px;" alt=""/><br /><sub><b>LordChadiwala</b></sub></a></td> <td align="center"><a href="https://github.com/LuizDoPc"><img src="https://avatars0.githubusercontent.com/u/20651653?s=460&u=d673e5357da83e446311831efe107e695d3ef875&v=4" width="100px;" alt=""/><br /><sub><b>Luiz Soares</b></sub></a></td> <td align="center"><a href="https://github.com/sudiptog81"><img src="https://avatars0.githubusercontent.com/u/11232940?s=460&u=07b4989ae4c43e43f35730d7f8d59631f5ed933c&v=4" width="100px;" alt=""/><br /><sub><b>Sudipto Ghosh</b></sub></a></td> <td align="center"><a href="https://github.com/Fabricio20"><img src="https://avatars1.githubusercontent.com/u/7545720?s=400&v=4" width="100px;" alt=""/><br /><sub><b>Fabricio20</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/metallicmonkey"><img src="https://avatars0.githubusercontent.com/u/10272154?s=460&u=b6f5daefe3f3ce49e9ed094043674a2c2718af73&v=4" width="100px;" alt=""/><br /><sub><b>metallicmonkey</b></sub></a></td> <td align="center"><a href="https://github.com/vidu171"><img src="https://avatars1.githubusercontent.com/u/25363324?s=460&u=8d3ccde95f49579e893c8c12db22cdcd0fea36cb&v=4" width="100px;" alt=""/><br /><sub><b>Vidhyanshu Jain</b></sub></a></td> <td align="center"><a href="https://github.com/dlion"><img src="https://avatars3.githubusercontent.com/u/2125236?s=460&u=801df23e89718386a099ba60e15b61a562fdf334&v=4" width="100px;" alt=""/><br /><sub><b>Domenico Luciani</b></sub></a></td> <td align="center"><a href="https://github.com/EnzoBtv"><img src="https://avatars1.githubusercontent.com/u/40310156?s=460&u=f7c0e017293b0d57b8340dbfae36c078f0176e1a&v=4" width="100px;" alt=""/><br /><sub><b>Enzo Batrov</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/IsautierEloise"><img src="https://avatars2.githubusercontent.com/u/44578188?s=400&u=2bda597af317d871d6b1017193956b40a6fe0412&v=4" width="100px;" alt=""/><br /><sub><b>Eloïse Isautier</b></sub></a></td> <td align="center"><a href="https://github.com/ocReaper"><img src="https://avatars2.githubusercontent.com/u/4038188?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Ákos Resch</b></sub></a></td> <td align="center"><a href="https://github.com/chotuchaudhary"><img src="https://avatars0.githubusercontent.com/u/14938108?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Chotu Chaudhary</b></sub></a></td> <td align="center"><a href="https://github.com/heracek"><img src="https://avatars.githubusercontent.com/u/7502?s=460&v=4" width="100px;" alt=""/><br /><sub><b>Tomáš Horáček</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/sbauch"><img src="https://avatars.githubusercontent.com/u/923033?s=460&u=db9bb41f9b279750c74afc1be0ab51db05539593&v=4" width="100px;" alt=""/><br /><sub><b>Sam Bauch</b></sub></a></td> <td align="center"><a href="https://github.com/mirrorrim"><img src="https://avatars.githubusercontent.com/u/9555251?v=4" width="100px;" alt=""/><br /><sub><b>Alexey Tylindus</b></sub></a></td> <td align="center"><a href="https://github.com/gusfune"><img src="https://avatars.githubusercontent.com/u/1147240?v=4" width="100px;" alt=""/><br /><sub><b>Gus Fune</b></sub></a></td> <td align="center"><a href="https://github.com/chenkaiC4"><img src="https://avatars.githubusercontent.com/u/7543145?v=4" width="100px;" alt=""/><br /><sub><b>chenkaiC4</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/dulowski-marek"><img src="https://avatars.githubusercontent.com/u/17051704?v=4" width="100px;" alt=""/><br /><sub><b>Marek Dulowski</b></sub></a></td> <td align="center"><a href="https://github.com/Piyushhbhutoria"><img src="https://avatars.githubusercontent.com/u/20777594?v=4" width="100px;" alt=""/><br /><sub><b>Piyushh Bhutoria</b></sub></a></td> <td align="center"><a href="https://github.com/aldeed"><img src="https://avatars.githubusercontent.com/u/3012067?v=4" width="100px;" alt=""/><br /><sub><b>Eric Dobbertin</b></sub></a></td> <td align="center"><a href="https://github.com/seniorquico"><img src="https://avatars.githubusercontent.com/u/415806?v=4" width="100px;" alt=""/><br /><sub><b>Kyle Dodson</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/taijuten"><img src="https://avatars.githubusercontent.com/u/4288526?v=4" width="100px;" alt=""/><br /><sub><b>Ralph Lawrence</b></sub></a></td> <td align="center"><a href="https://github.com/christopher-kapic"><img src="https://avatars.githubusercontent.com/u/59740769?v=4" width="100px;" alt=""/><br /><sub><b>Christopher Kapic</b></sub></a></td> <td align="center"><a href="https://github.com/Hanzyusuf"><img src="https://avatars.githubusercontent.com/u/22171112?v=4" width="100px;" alt=""/><br /><sub><b>Hanzyusuf</b></sub></a></td> <td align="center"><a href="https://github.com/porcellus"><img src="https://avatars.githubusercontent.com/u/1129990?v=4" width="100px;" alt=""/><br /><sub><b> Mihály Lengyel</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/cerino-ligutom"><img src="https://avatars.githubusercontent.com/u/6721822?v=4" width="100px;" alt=""/><br /><sub><b>Cerino O. Ligutom III</b></sub></a></td> <td align="center"><a href="https://github.com/nadilas"><img src="https://avatars.githubusercontent.com/u/5324856?v=4" width="100px;" alt=""/><br /><sub><b>nadilas</b></sub></a></td> <td align="center"><a href="https://github.com/vasica38"><img src="https://avatars.githubusercontent.com/u/26538079?v=4" width="100px;" alt=""/><br /><sub><b>Vasile Catana</b></sub></a></td> <td align="center"><a href="https://github.com/rossoskull"><img src="https://avatars.githubusercontent.com/u/27884543?v=4" width="100px;" alt=""/><br /><sub><b>Jay Mistry</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/jacobhq"><img src="https://avatars.githubusercontent.com/u/29145479?v=4" width="100px;" alt=""/><br /><sub><b>Jacob Marshall</b></sub></a></td> <td align="center"><a href="https://github.com/miketromba"><img src="https://avatars.githubusercontent.com/u/25141252?v=4" width="100px;" alt=""/><br /><sub><b>miketromba</b></sub></a></td> <td align="center"><a href="https://github.com/olhapi"><img src="https://avatars.githubusercontent.com/u/4780263?v=4" width="100px;" alt=""/><br /><sub><b>Oleg Vdovenko</b></sub></a></td> <td align="center"><a href="https://github.com/siddharthmudgal"><img src="https://avatars.githubusercontent.com/u/9314217?v=4" width="100px;" alt=""/><br /><sub><b>Siddharth</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/xuatz"><img src="https://avatars.githubusercontent.com/u/9292261?v=4" width="100px;" alt=""/><br /><sub><b>xuatz</b></sub></a></td> <td align="center"><a href="https://github.com/yowayb"><img src="https://avatars.githubusercontent.com/u/603829?v=4" width="100px;" alt=""/><br /><sub><b>Yoway Buorn</b></sub></a></td> <td align="center"><a href="https://github.com/rtpa25"><img src="https://avatars.githubusercontent.com/u/72537293?v=4" width="100px;" alt=""/><br /><sub><b>Ronit Panda</b></sub></a></td> <td align="center"><a href="https://github.com/anugrahsinghal"><img src="https://avatars.githubusercontent.com/u/18058884?v=4" width="100px;" alt=""/><br /><sub><b>Anugrah Singhal</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/JeremyEastham"><img src="https://avatars.githubusercontent.com/u/34139712?v=4" width="100px;" alt=""/><br /><sub><b>Jeremy Eastham</b></sub></a></td> <td align="center"><a href="https://github.com/assafushy"><img src="https://avatars.githubusercontent.com/u/7502687?v=4" width="100px;" alt=""/><br /><sub><b>Assaf Yacobi</b></sub></a></td> <td align="center"><a href="https://github.com/sattvikc"><img src="https://avatars.githubusercontent.com/u/650429?v=4" width="100px;" alt=""/><br /><sub><b>Sattvik Chakravarthy</b></sub></a></td> <td align="center"><a href="https://github.com/opichon"><img src="https://avatars.githubusercontent.com/u/203745?v=4" width="100px;" alt=""/><br /><sub><b>Olivier Pichon</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/FuzzySid"><img src="https://avatars.githubusercontent.com/u/40206571?v=4" width="100px;" alt=""/><br /><sub><b>Siddhant Varma</b></sub></a></td> <td align="center"><a href="https://github.com/renyijiu"><img src="https://avatars.githubusercontent.com/u/8318266?v=4" width="100px;" alt=""/><br /><sub><b>renyijiu</b></sub></a></td> <td align="center"><a href="https://github.com/ITenthusiasm"><img src="https://avatars.githubusercontent.com/u/47364027?v=4" width="100px;" alt=""/><br /><sub><b>Isaiah Thomason</b></sub></a></td> <td align="center"><a href="https://github.com/utsavdotpro"><img src="https://avatars.githubusercontent.com/u/38961422?v=4" width="100px;" alt=""/><br /><sub><b>Utsav Barnwal</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/saurabhghatnekar"><img src="https://avatars.githubusercontent.com/u/20884782?v=4" width="100px;" alt=""/><br /><sub><b>Saurabh Ghatnekar</b></sub></a></td> <td align="center"><a href="https://github.com/alisher-aituarov"><img src="https://avatars.githubusercontent.com/u/63276190?v=4" width="100px;" alt=""/><br /><sub><b>Alisher Aituarov</b></sub></a></td> <td align="center"><a href="https://github.com/wallstromsimon"><img src="https://avatars.githubusercontent.com/u/3397398?v=4" width="100px;" alt=""/><br /><sub><b>Simon Kihlberg Wallstrom</b></sub></a></td> <td align="center"><a href="https://github.com/AreebKhan619"><img src="https://avatars.githubusercontent.com/u/39133435?v=4" width="100px;" alt=""/><br /><sub><b>Areeb Khan</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/sublimator"><img src="https://avatars.githubusercontent.com/u/525211?v=4" width="100px;" alt=""/><br /><sub><b>Nicholas Dudfield</b></sub></a></td> <td align="center"><a href="https://github.com/Qdea"><img src="https://avatars.githubusercontent.com/u/58660439?v=4" width="100px;" alt=""/><br /><sub><b>Qdea</b></sub></a></td> <td align="center"><a href="https://github.com/LukasKnuth"><img src="https://avatars.githubusercontent.com/u/692211?v=4" width="100px;" alt=""/><br /><sub><b>Lukas Knuth</b></sub></a></td> <td align="center"><a href="https://github.com/melvynhills"><img src="https://avatars.githubusercontent.com/u/417315?v=4" width="100px;" alt=""/><br /><sub><b> Melvyn Hills</b></sub></a></td> <tr> <td align="center"><a href="https://github.com/mattanimation"><img src="https://avatars.githubusercontent.com/u/1426997?v=4" width="100px;" alt=""/><br /><sub><b>Matt Murray</b></sub></a></td> Melvyn Hills</b></sub></a></td> <td align="center"><a href="https://github.com/constantoine"><img src="https://avatars.githubusercontent.com/u/13930958?v=4" width="100px;" alt=""/><br /><sub><b>Cléo Rebert</b></sub></a></td> <td align="center"><a href="https://github.com/daniil-borovoy"><img src="https://avatars.githubusercontent.com/u/74528634?v=4" width="100px;" alt=""/><br /><sub><b>Daniil Borovoy</b></sub></a></td> <td align="center"><a href="https://github.com/kriskw1999"><img src="https://avatars.githubusercontent.com/u/71312948?v=4" width="100px;" alt=""/><br /><sub><b>Krzysztof Witkowski</b></sub></a></td> </tr> <tr> <td align="center"><a href="https://github.com/Lehoczky"><img src="https://avatars.githubusercontent.com/u/31937175?v=4" width="100px;" alt=""/><br /><sub><b>Lehoczky Zoltán</b></sub></a></td> Melvyn Hills</b></sub></a></td> </tr> </table> ## 👩‍💻 Contributing Please see the [CONTRIBUTING.md](https://github.com/supertokens/supertokens-core/blob/master/CONTRIBUTING.md) file for instructions. ## 📝 License &copy; 2020-2023 SuperTokens Inc and its contributors. All rights reserved. Portions of this software are licensed as follows: * All content that resides under the "ee/" directory of this repository, if that directory exists, is licensed under the license defined in "ee/LICENSE.md". * All third-party components incorporated into the SuperTokens Software are licensed under the original license provided by the owner of the applicable component. * Content outside of the above-mentioned directories or restrictions above is available under the "Apache 2.0" license as defined in the level "LICENSE.md" file
0
GoogleContainerTools/jib
🏗 Build container images for your Java applications.
containers docker docker-registry gradle gradle-plugin java jib kubernetes maven maven-plugin microservices oci
![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg) [![Maven Central](https://img.shields.io/maven-central/v/com.google.cloud.tools/jib-maven-plugin)](https://maven-badges.herokuapp.com/maven-central/com.google.cloud.tools/jib-maven-plugin) [![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/com/google/cloud/tools/jib/com.google.cloud.tools.jib.gradle.plugin/maven-metadata.xml.svg?colorB=007ec6&label=gradle)](https://plugins.gradle.org/plugin/com.google.cloud.tools.jib) ![Build Status](https://storage.googleapis.com/cloud-tools-for-java-kokoro-build-badges/jib-ubuntu-master-orb.svg) ![Build Status](https://storage.googleapis.com/cloud-tools-for-java-kokoro-build-badges/jib-windows-master-orb.svg) ![Build Status](https://storage.googleapis.com/cloud-tools-for-java-kokoro-build-badges/jib-macos-master-orb.svg) [![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev) [![Gitter version](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/google/jib) # Jib <image src="https://github.com/GoogleContainerTools/jib/raw/master/logo/jib-build-docker-java-container-image.png" alt="Jib - Containerize your Java applications." width="650px" /> | ☑️ Jib User Survey | | :----- | | What do you like best about Jib? What needs to be improved? Please tell us by taking a [one-minute survey](https://forms.gle/YRFeamGj51xmgnx28). Your responses will help us understand Jib usage and allow us to serve our customers (you!) better. | ## What is Jib? Jib builds optimized Docker and [OCI](https://github.com/opencontainers/image-spec) images for your Java applications without a Docker daemon - and without deep mastery of Docker best-practices. It is available as plugins for [Maven](jib-maven-plugin) and [Gradle](jib-gradle-plugin) and as a Java library. - [Maven](https://maven.apache.org/): See documentation for [jib-maven-plugin](jib-maven-plugin). - [Gradle](https://gradle.org/): See documentation for [jib-gradle-plugin](jib-gradle-plugin). - [Jib Core](jib-core): A general-purpose container-building library for Java. - [Jib CLI](jib-cli): A command-line interface for building images that uses Jib Core. Jib works well with Google Cloud Build. For details, see [how to use Jib on Google Cloud Build](docs/google-cloud-build.md). For more information, check out the [official blog post](https://cloudplatform.googleblog.com/2018/07/introducing-jib-build-java-docker-images-better.html) or watch [this talk](https://www.youtube.com/watch?v=H6gR_Cv4yWI) ([slides](https://speakerdeck.com/coollog/build-containers-faster-with-jib-a-google-image-build-tool-for-java-applications)). ## Goals * **Fast** - Deploy your changes fast. Jib separates your application into multiple layers, splitting dependencies from classes. Now you don’t have to wait for Docker to rebuild your entire Java application - just deploy the layers that changed. * **Reproducible** - Rebuilding your container image with the same contents always generates the same image. Never trigger an unnecessary update again. * **Daemonless** - Reduce your CLI dependencies. Build your Docker image from within Maven or Gradle and push to any registry of your choice. *No more writing Dockerfiles and calling docker build/push.* ## Quickstart * **Maven** - See the jib-maven-plugin [Quickstart](jib-maven-plugin#quickstart). * **Gradle** - See the jib-gradle-plugin [Quickstart](jib-gradle-plugin#quickstart). * **Jib Core** - See the Jib Core [Quickstart](jib-core#adding-jib-core-to-your-build). * **Jib CLI** - See the Jib CLI [doc](jib-cli). ## Examples The [examples](examples) directory includes the following examples (and more). * [helloworld](examples/helloworld) * [Spring Boot](examples/spring-boot) * [Micronaut](examples/micronaut) * [Multi-module project](examples/multi-module) * [Spark Java using Java Agent](examples/java-agent) ## How Jib Works Whereas traditionally a Java application is built as a single image layer with the application JAR, Jib's build strategy separates the Java application into multiple layers for more granular incremental builds. When you change your code, only your changes are rebuilt, not your entire application. These layers, by default, are layered on top of an [OpenJDK base image](docs/default_base_image.md), but you can also configure a custom base image. For more information, check out the [official blog post](https://cloudplatform.googleblog.com/2018/07/introducing-jib-build-java-docker-images-better.html) or watch [this talk](https://www.youtube.com/watch?v=H6gR_Cv4yWI) ([slides](https://speakerdeck.com/coollog/build-containers-faster-with-jib-a-google-image-build-tool-for-java-applications)). See also [rules_docker](https://github.com/bazelbuild/rules_docker) for a similar existing container image build tool for the [Bazel build system](https://github.com/bazelbuild/bazel). ## Need Help? A lot of questions are already answered! * [Frequently Asked Questions (FAQ)](docs/faq.md) * [Stack Overflow](https://stackoverflow.com/questions/tagged/jib) * [GitHub issues](https://stackoverflow.com/questions/tagged/jib) _For usage questions, please ask them on Stack Overflow._ ## Privacy See the [Privacy page](docs/privacy.md). ## Get involved with the community We welcome contributions! Here's how you can contribute: * [Browse issues](https://github.com/GoogleContainerTools/jib/issues) or [file an issue](https://github.com/GoogleContainerTools/jib/issues/new) * Chat with us on [gitter](https://gitter.im/google/jib) * Join the [jib-users mailing list](https://groups.google.com/forum/#!forum/jib-users) * Contribute: * *Read the [contributing guide](https://github.com/GoogleContainerTools/jib/blob/master/CONTRIBUTING.md) before starting work on an issue* * Try to fix [good first issues](https://github.com/GoogleContainerTools/jib/labels/good%20first%20issue) * Help out on [issues that need help](https://github.com/GoogleContainerTools/jib/labels/kind%2Fquestion) * Join in on [discussion issues](https://github.com/GoogleContainerTools/jib/labels/discuss) <!-- * Read the [style guide] --> *Make sure to follow the [Code of Conduct](https://github.com/GoogleContainerTools/jib/blob/master/CODE_OF_CONDUCT.md) when contributing so we can foster an open and welcoming community.* ## Disclaimer This is not an officially supported Google product.
0
classgraph/classgraph
An uber-fast parallelized Java classpath scanner and module scanner.
null
# ClassGraph <img alt="ClassGraph Logo" height="320" width = "320" src="https://github.com/classgraph/classgraph/wiki/ClassGraphLogo.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img alt="Duke Award logo" height="320" src="https://github.com/classgraph/classgraph/wiki/Duke-noborder.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://github.com/classgraph/classgraph/wiki/OSPB-award-letter.pdf"><img alt="Google Open Source Peer Bonus logo" height="320" src="https://github.com/classgraph/classgraph/wiki/OSPB-logo.png"></a> ClassGraph is an uber-fast parallelized classpath scanner and module scanner for Java, Scala, Kotlin and other JVM languages. | _ClassGraph won a Duke's Choice Award (a recognition of the most useful and/or innovative software in the Java ecosystem) at Oracle Code One 2018, and a Google Open Source Peer Bonus award in 2022._ Thanks to all the users who have reported bugs, requested features, offered suggestions, and submitted pull requests to help get ClassGraph to where it is today. | |-----------------------------| [![Platforms: Windows, Mac OS X, Linux, Android (build-time)](https://img.shields.io/badge/platforms-Windows,_Mac_OS_X,_Linux,_Android_(build--time)-blue.svg)](#) [![Languages: Java, Scala, Kotlin, etc.](https://img.shields.io/badge/languages-Java,_Scala,_Kotlin,_etc.-blue.svg)](#) [![JDK compatibility: 7, 8, 9+ (JPMS)](https://img.shields.io/badge/JDK_compatibility-7,_8,_9+_(JPMS)-blue.svg)](#) <br> [![Build Status](https://travis-ci.org/classgraph/classgraph.png?branch=master)](https://travis-ci.org/classgraph/classgraph) [![GitHub issues](https://img.shields.io/github/issues/classgraph/classgraph.svg)](https://github.com/classgraph/classgraph/issues/) [![lgtm alerts](https://img.shields.io/lgtm/alerts/g/classgraph/classgraph.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/classgraph/classgraph/alerts/) [![lgtm code quality](https://img.shields.io/lgtm/grade/java/g/classgraph/classgraph.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/classgraph/classgraph/context:java) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/ebc65f685d504cfcb379533d28d6353c)](https://www.codacy.com/gh/classgraph/classgraph/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=classgraph/classgraph&amp;utm_campaign=Badge_Grade) <br> [![Dependencies: none](https://img.shields.io/badge/dependencies-none-blue.svg)](#) [![Dependents](https://badgen.net/github/dependents-repo/classgraph/classgraph)](https://github.com/classgraph/classgraph/network/dependents?package_id=UGFja2FnZS0xODcxNTE4NTM%3D) [![GitHub stars chart](https://img.shields.io/badge/github%20stars-chart-blue.svg)](https://seladb.github.io/StarTrack-js/#/preload?r=classgraph,classgraph) <br> [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.classgraph/classgraph/badge.svg)](https://mvnrepository.com/artifact/io.github.classgraph/classgraph) [![Javadocs](http://www.javadoc.io/badge/io.github.classgraph/classgraph.svg)](https://javadoc.io/doc/io.github.classgraph/classgraph) <br> [![Gitter chat](https://img.shields.io/badge/gitter-join%20chat-blue.svg)](https://gitter.im/classgraph/Lobby) <br> [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/classgraph/classgraph/blob/master/LICENSE) | ClassGraph is stable and mature, and has a low bug report rate, despite being used by hundreds of projects. | |-----------------------------| ### ClassGraph vs. Java Introspection ClassGraph has the ability to "invert" the Java class and/or reflection API, or has the ability to index classes and resources. For example, the Java class and reflection API can tell you the superclass of a given class, or the interfaces implemented by a given class, or can give you the list of annotations on a class; ClassGraph can find **all classes that extend a given class** (all subclasses of a given class), or **all classes that implement a given interface**, or **all classes that are annotated with a given annotation**. The Java API can load the content of a resource file with a specific path in a specific ClassLoader, but ClassGraph can find and load **all resources in all classloaders with paths matching a given pattern**. ### Examples The following code prints the name of all classes in the package `com.xyz` or its subpackages, anywhere on the classpath or module path, that are annotated with an annotation of the form `@com.xyz.Route("/pages/home.html")`, along with the annotation parameter value. This is accomplished without loading or initializing any of the scanned classes. ```java String pkg = "com.xyz"; String routeAnnotation = pkg + ".Route"; try (ScanResult scanResult = new ClassGraph() .verbose() // Log to stderr .enableAllInfo() // Scan classes, methods, fields, annotations .acceptPackages(pkg) // Scan com.xyz and subpackages (omit to scan all packages) .scan()) { // Start the scan for (ClassInfo routeClassInfo : scanResult.getClassesWithAnnotation(routeAnnotation)) { AnnotationInfo routeAnnotationInfo = routeClassInfo.getAnnotationInfo(routeAnnotation); List<AnnotationParameterValue> routeParamVals = routeAnnotationInfo.getParameterValues(); // @com.xyz.Route has one required parameter String route = (String) routeParamVals.get(0).getValue(); System.out.println(routeClassInfo.getName() + " is annotated with route " + route); } } ``` The following code finds all JSON files in `META-INF/config` in all ClassLoaders or modules, and calls the method `readJson(String path, String content)` with the path and content of each file. ```java try (ScanResult scanResult = new ClassGraph().acceptPathsNonRecursive("META-INF/config").scan()) { scanResult.getResourcesWithExtension("json") .forEachByteArray((Resource res, byte[] content) -> { readJson(res.getPath(), new String(content, StandardCharsets.UTF_8)); }); } ``` See the [code examples](https://github.com/classgraph/classgraph/wiki/Code-examples) page for more examples of how to use the ClassGraph API. ### Capabilities ClassGraph provides a number of important capabilities to the JVM ecosystem: * ClassGraph has the ability to build a model in memory of the entire relatedness graph of all classes, annotations, interfaces, methods and fields that are visible to the JVM, and can even read [type annotations](https://docs.oracle.com/javase/tutorial/java/annotations/type_annotations.html). This graph of class metadata can be [queried in a wide range of ways](https://github.com/classgraph/classgraph/wiki/Code-examples), enabling some degree of *metaprogramming* in JVM languages -- the ability to write code that analyzes or responds to the properties of other code. * ClassGraph reads the classfile bytecode format directly, so it can read all information about classes without loading or initializing them. * ClassGraph is fully compatible with the new JPMS module system (Project Jigsaw / JDK 9+), i.e. it can scan both the traditional classpath and the module path. However, the code is also fully backwards compatible with JDK 7 and JDK 8 (i.e. the code is compiled in Java 7 compatibility mode, and all interaction with the module system is implemented via reflection for backwards compatibility). * ClassGraph scans the classpath or module path using [carefully optimized multithreaded code](https://github.com/classgraph/classgraph/wiki/How-fast-is-ClassGraph) for the shortest possible scan times, and it runs as close as possible to I/O bandwidth limits, even on a fast SSD. * ClassGraph handles more [classpath specification mechanisms](https://github.com/classgraph/classgraph/wiki/Classpath-specification-mechanisms) found in the wild than any other classpath scanner, making code that depends upon ClassGraph maximally portable. * ClassGraph can scan the classpath and module path either at runtime or [at build time](https://github.com/classgraph/classgraph/wiki/Build-Time-Scanning) (e.g. to implement annotation processing for Android). * ClassGraph can [find classes that are duplicated or defined more than once in the classpath or module path](https://github.com/classgraph/classgraph/wiki/Code-examples#find-all-duplicate-class-definitions-in-the-classpath-or-module-path), which can help find the cause of strange class resolution behaviors. * ClassGraph can [create GraphViz visualizations of the class graph structure](https://github.com/classgraph/classgraph/wiki/ClassInfo-API#generating-a-graphviz-dot-file-for-class-graph-visualization), which can help with code understanding: (click to enlarge; [see graph legend here](https://github.com/classgraph/classgraph/blob/master/src/test/java/com/xyz/classgraph-fig-legend.png)) <p align="center"> <a href="https://raw.githubusercontent.com/classgraph/classgraph/master/src/test/java/com/xyz/classgraph-fig.png"><img src="https://raw.githubusercontent.com/classgraph/classgraph/master/src/test/java/com/xyz/classgraph-fig.png" width="898" height="685" alt="Class graph visualization"/></a> </p> ## Downloading ### Maven dependency Replace `X.Y.Z` below with the latest [release number](https://github.com/classgraph/classgraph/releases). (Alternatively, you could use `LATEST` in place of `X.Y.Z` instead if you just want to grab the latest version -- although be aware that that may lead to non-reproducible builds, since the ClassGraph version number could increase at any time. You could use [dependency locking](https://docs.gradle.org/current/userguide/dependency_locking.html) to address this.) ```xml <dependency> <groupId>io.github.classgraph</groupId> <artifactId>classgraph</artifactId> <version>X.Y.Z</version> </dependency> ``` See instructions for [use as a module](https://github.com/classgraph/classgraph/wiki#use-as-a-module). ### Running on JDK 16+ The JDK team decided to start enforcing strong encapsulation in JDK 16+. That will means that by default, ClassGraph will not be able to find the classpath of your project, if all of the following are true: * You are running on JDK 16+ * You are using a legacy classloader (rather than the module system) * Your classloader does not expose its classpath via a public field or method (i.e. the full classpath can only be determined by reflection of private fields or methods). If your ClassGraph code works in JDK versions less than 16 but breaks in JDK 16+ (meaning that ClassGraph can no longer find your classes), you have probably run into this problem. ClassGraph can use either of the following libraries to silently circumvent all of Java's security mechanisms (visibility/access checks, security manager restrictions, and strong encapsulation), in order to read the classpath from private fields and methods of classloaders. * Narcissus by Luke Hutchison (@lukehutch), author of ClassGraph * JVM-Driver by Roberto Gentili (@burningwave), author of [Burningwave Core](https://github.com/burningwave/core). **To clarify, you do *only* need to use Narcissus or JVM-driver if ClassGraph cannot find the classpath elements from your classloader, due to the enforcement of strong encapsulation, or if it is problematic that you are getting reflection access warnings on the console.** To use one of these libraries: * Upgrade ClassGraph to the latest version * Either: 1. Add the [Narcissus](https://github.com/toolfactory/narcissus) library to your project as an extra dependency (this includes a native library, and only Linux x86/x64, Windows x86/x64, and Mac OS X x64 are currently supported -- feel free to contribute native code builds for other platforms or architectures). 2. Set `ClassGraph.CIRCUMVENT_ENCAPSULATION = CircumventEncapsulationMethod.NARCISSUS;` before interacting with ClassGraph in any other way (this will load the Narcissus library as ClassGraph's reflection driver). * Or: 1. Add the [JVM-Driver](https://github.com/toolfactory/jvm-driver) library to your project as an extra dependency (this uses only Java code and works to bypass encapsulation without native code for all JDK versions between 8 and 18). 2. Set `ClassGraph.CIRCUMVENT_ENCAPSULATION = CircumventEncapsulationMethod.JVM_DRIVER;` before interacting with ClassGraph in any other way (this will load the JVM-Driver library as ClassGraph's reflection driver). JDK 16's strong encapsulation is just the first step of trying to lock down Java's internals, so further restrictions are possible (e.g. it is likely that `setAccessible(true)` will fail in future JDK releases, even within a module, and probably the JNI API will be locked down soon, making Narcissus require a commandline flag to work). Therefore, **please convince your upstream runtime environment maintainers to expose the full classpath from their classloader using a public method or field, otherwise ClassGraph may stop working for your runtime environment in the future.** ### Pre-built JARs You can get pre-built JARs (usable on JRE 7 or newer) from [Sonatype](https://oss.sonatype.org/#nexus-search;quick~io.github.classgraph). ### Building from source ClassGraph must be built on JDK 8 or newer (due to the presence of `@FunctionalInterface` annotations on some interfaces), but is built using `-target 1.7` for backwards compatibility with JRE 7. The following commands will build the most recent version of ClassGraph from git master. The compiled package will then be in the "classgraph/target" directory. ```bash git clone https://github.com/classgraph/classgraph.git cd classgraph export JAVA_HOME=/usr/java/default # Or similar -- Maven needs JAVA_HOME ./mvnw -Dmaven.test.skip=true package ``` This will allow you to build a local SNAPSHOT jar in `target/`. Alternatively, use `./mvnw -Dmaven.test.skip=true install` to build a SNAPSHOT jar and then copy it into your local repository, so that you can use it in your Maven projects. Note that may need to do `./mvnw dependency:resolve` in your project if you overwrite an older snapshot with a newer one. `./mvnw -U` updates from remote repositories an may overwrite your local artifact. But you can always change the `artifactId` or the `groupId` of your local ClassGraph build to place your local build artifact in another location within your local repository. ## Documentation [See the wiki for complete documentation and usage information.](https://github.com/classgraph/classgraph/wiki) **ClassGraph was known as FastClasspathScanner prior to version 4**. See the [porting notes](https://github.com/classgraph/classgraph/wiki/Porting-FastClasspathScanner-code-to-ClassGraph) for information on porting from the older FastClasspathScanner API. ## Mailing List * Feel free to subscribe to the [ClassGraph-Users](https://groups.google.com/d/forum/classgraph-users) email list for updates, or to ask questions. * There is also a [Gitter room](https://gitter.im/classgraph/Lobby) for discussion of ClassGraph. ## Sponsorship ClassGraph was written by Luke Hutchison ([@LH](http://twitter.com/LH) on Twitter). If ClassGraph is critical to your work, you can help fund further development through the [GitHub Sponsors Program](https://github.com/sponsors/lukehutch). <a href="https://github.com/sponsors/lukehutch"><img src="https://github.blog/wp-content/uploads/2019/05/mona-heart-featured.png" height="140"></a> ## Acknowledgments ClassGraph would not be possible without contributions from numerous users, including in the form of bug reports, feature requests, code contributions, and assistance with testing. ## Alternatives Some other classpath scanning mechanisms include: * [Reflections](https://github.com/ronmamo/reflections) * [Corn Classpath Scanner](https://sites.google.com/site/javacornproject/corn-cps) * [annotation-detector](https://github.com/rmuller/infomas-asl/tree/master/annotation-detector) * [Scannotation](http://scannotation.sourceforge.net/) * [Sclasner](https://github.com/xitrum-framework/sclasner) * [Annovention](https://github.com/ngocdaothanh/annovention) * [ClassIndex](https://github.com/atteo/classindex) (compiletime annotation scanner/processor) * [Jandex](https://github.com/wildfly/Jandex) (Java annotation indexer, part of Wildfly) * [Spring](http://spring.io/) has built-in classpath scanning * [Hibernate](http://hibernate.org/) has the class [`org.hibernate.ejb.packaging.Scanner`](https://www.programcreek.com/java-api-examples/index.php?api=org.hibernate.ejb.packaging.Scanner). * [extcos -- the Extended Component Scanner](https://sourceforge.net/projects/extcos/) * [Javassist](http://jboss-javassist.github.io/javassist/) * [ObjectWeb ASM](http://asm.ow2.org/) * [QDox](https://github.com/paul-hammant/qdox), a fast Java source parser and indexer * [bndtools](https://github.com/bndtools/bnd), which is able to ["crawl"/parse the bytecode of class files](https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/bnd/osgi/Clazz.java) to find all imports/dependencies, among other things. * [coffea](https://github.com/sbilinski/coffea), a command line tool and Python library for analyzing static dependences in Java bytecode * [org.clapper.classutil.ClassFinder](https://github.com/bmc/classutil/blob/master/src/main/scala/org/clapper/classutil/ClassFinder.scala) * [com.google.common.reflect.ClassPath](https://github.com/google/guava/blob/master/guava/src/com/google/common/reflect/ClassPath.java) * [jdependency](https://github.com/tcurdt/jdependency) * [Burningwave Core](https://github.com/burningwave/core#burningwave-core-) ## License **The MIT License (MIT)** **Copyright (c) 2022 Luke Hutchison** 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
lenve/VBlog
V部落,Vue+SpringBoot实现的多用户博客管理平台!
null
扫码加微信(微信ID:**a_java_boy2**),备注V部落,进群讨论。 ![](https://user-images.githubusercontent.com/6023444/75459026-ba70d500-59b9-11ea-8cbd-3d5889f356c4.png) V 部落姊妹篇:[https://github.com/lenve/vhr](https://github.com/lenve/vhr) V部落是一个多用户博客管理平台,采用Vue+SpringBoot开发。 项目演示地址: [http://45.77.146.32:8081/index.html](http://45.77.146.32:8081/index.html) ## 英雄帖 >项目还有许多待改进的地方,欢迎小伙伴提交pr,我会将大家完成的工作展示在README中! # 项目效果图 ## 登陆页面 ![登录](https://raw.githubusercontent.com/lenve/VBlog/master/doc/login.png) ## 文章列表 ![文章列表](https://raw.githubusercontent.com/lenve/VBlog/master/doc/article.png) ## 发表文章 ![发表文章](https://raw.githubusercontent.com/lenve/VBlog/master/doc/post.png) ## 用户管理 ![用户管理](https://raw.githubusercontent.com/lenve/VBlog/master/doc/usermana.png) ## 栏目管理 ![栏目管理](https://raw.githubusercontent.com/lenve/VBlog/master/doc/category.png) ## 数据统计 ![数据统计](https://raw.githubusercontent.com/lenve/VBlog/master/doc/datastatistics.png) # 技术栈 ## 后端技术栈 后端主要采用了: 1.SpringBoot 2.SpringSecurity 3.MyBatis 4.部分接口遵循Restful风格 5.MySQL ## 前端技术栈 前端主要采用了: 1.Vue 2.axios 3.ElementUI 4.vue-echarts 5.mavon-editor 6.vue-router 还有其他一些琐碎的技术我就不在这里一一列举了。 # 快速运行 1.克隆本项目到本地 ``` git@github.com:lenve/VBlog.git ``` 2.找到blogserver项目中resources目录下的vueblog.sql文件,在MySQL数据库中执行 3.根据自己本地情况修改数据库配置,数据库配置在SpringBoot项目的application.properties中 4.在IntelliJ IDEA中运行blogserver项目 **OK,至此,服务端就启动成功了,此时我们直接在地址栏输入```http://localhost:8081/index.html```即可访问我们的项目,如果要做二次开发,请继续看第五、六步。** 5.进入到vueblog目录中,在命令行依次输入如下命令: ``` # 安装依赖 npm install # 在 localhost:8080 启动项目 npm run dev ``` 由于我在vueblog项目中已经配置了端口转发,将数据转发到SpringBoot上,因此项目启动之后,在浏览器中输入```http://localhost:8080```就可以访问我们的前端项目了,所有的请求通过端口转发将数据传到SpringBoot中(注意此时不要关闭SpringBoot项目)。 6.最后可以用WebStorm等工具打开vueblog项目,继续开发,开发完成后,当项目要上线时,依然进入到vueblog目录,然后执行如下命令: ``` npm run build ``` 该命令执行成功之后,vueblog目录下生成一个dist文件夹,将该文件夹中的两个文件static和index.html拷贝到SpringBoot项目中resources/static/目录下,然后就可以像第4步那样直接访问了。 **步骤5中需要大家对NodeJS、NPM等有一定的使用经验,不熟悉的小伙伴可以先自行搜索学习下,推荐[Vue官方教程](https://cn.vuejs.org/v2/guide/)。** # 项目依赖 1.[vue-echarts](https://github.com/Justineo/vue-echarts) 2.[mavonEditor](https://github.com/hinesboy/mavonEditor) # License MIT **欢迎小伙伴们star、fork。** ## 其他 关注公众号**江南一点雨**,专注于 Spring Boot+微服务,定期视频教程分享,关注后回复 Java ,领取松哥为你精心准备的 Java 干货! ![公众号二维码](http://www.javaboy.org/images/sb/javaboy.jpg)
0
metersphere/metersphere
MeterSphere 一站式开源持续测试平台,为软件质量保驾护航。搞测试,就选 MeterSphere!
api-testing continuous-testing jmeter metersphere performance-testing postman selenium swagger test-automation testcase testing testlink testlink-alternative ui-testing
<p align="center"><a href="https://metersphere.io"><img src="https://metersphere.oss-cn-hangzhou.aliyuncs.com/img/MeterSphere-%E7%B4%AB%E8%89%B2.png" alt="MeterSphere" width="300" /></a></p> <h3 align="center">一站式开源持续测试平台</h3> <p align="center"> <a href="https://www.gnu.org/licenses/gpl-3.0.html"><img src="https://shields.io/github/license/metersphere/metersphere" alt="License: GPL v3"></a> <a href="https://www.codacy.com/gh/metersphere/metersphere/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=metersphere/metersphere&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/da67574fd82b473992781d1386b937ef" alt="Codacy"></a> <a href="https://codecov.io/github/metersphere/metersphere"><img src="https://codecov.io/github/metersphere/metersphere/graph/badge.svg?token=5AB5V8ZGXQ"/></a> <a href="https://github.com/metersphere/metersphere/releases"><img src="https://img.shields.io/github/v/release/metersphere/metersphere" alt="GitHub release"></a> <a href="https://github.com/metersphere/metersphere"><img src="https://img.shields.io/github/stars/metersphere/metersphere?color=%231890FF&style=flat-square" alt="Stars"></a> </p> <hr /> MeterSphere 是一站式开源持续测试平台, 涵盖测试跟踪、接口测试、UI 测试和性能测试等功能,全面兼容 JMeter、Selenium 等主流开源标准,有效助力开发和测试团队充分利用云弹性进行高度可扩展的自动化测试,加速高质量的软件交付,推动中国测试行业整体效率的提升。 ![产品定位](https://metersphere.oss-cn-hangzhou.aliyuncs.com/img/ms-architecture.png) ## MeterSphere 的功能 - **测试跟踪**: 对接主流项目管理平台,测试过程全链路跟踪管理;列表脑图模式自由切换,用例编写更简单、测试报告更清晰; - **接口测试**: 比 JMeter 易用,比 Postman 强大; API 管理、Mock 服务、场景编排、多协议支持,你想要的全都有; - **UI 测试**: 基于 Selenium 浏览器自动化,高度可复用的测试脚本; 无需复杂的代码编写,人人都可开展的低代码自动化测试; - **性能测试**: 兼容 JMeter 的同时补足其分布式、监控与报告以及管理短板; 轻松帮助团队实现高并发、分布式的性能压测,完成压测任务的统一调度与管理。 ## MeterSphere 的优势 - **开源**:基于开源、兼容开源;按月发布新版本、日均下载安装超过100次、被大量客户验证; - **一站式**:一个产品全面涵盖测试跟踪、接口测试、UI测试、性能测试等功能并形成联动; - **全生命周期**:一个产品全满足从测试计划、测试执行到测试报告分析的全生命周期需求; - **持续测试**:无缝对接 Bug 管理工具和持续集成工具等,能将测试融入持续交付和 DevOps 体系; - **团队协作**:支持团队协作和资产沉淀,无论团队规模如何,总有适合的落地方式。 ## UI 展示 ![UI展示](https://www.fit2cloud.com/metersphere/images/ms-dashboard.jpeg) ## 快速开始 **一键安装** 仅需两步快速安装 MeterSphere: 1. 准备一台不小于 8 G内存的 64位 Linux 主机; 2. 以 root 用户执行如下命令一键安装 MeterSphere。 ```sh curl -sSL https://resource.fit2cloud.com/metersphere/metersphere/releases/latest/download/quick_start.sh | bash ``` **学习资料** - [在线文档](https://metersphere.io/docs/) - [社区论坛](https://space.bilibili.com/510493147/channel/collectiondetail?sid=397323) - [在线体验](https://metersphere.com/?utm_source=github) **加入微信交流群** <img src="https://metersphere.oss-cn-hangzhou.aliyuncs.com/img/wechat-group.png" alt="微信群二维码" width="200"/> ## 版本说明 MeterSphere 版本号命名规则为:v大版本.功能版本.Bug修复版本。比如: ```text v1.0.1 是 v1.0.0 之后的Bug修复版本; v1.1.0 是 v1.0.0 之后的功能版本。 ``` MeterSphere 按年发布 LTS(Long Term Support)版本。 - v1.10-lts:发布时间为 2021 年 5 月 27 日,目前已经停止维护; - v1.20-lts:发布时间为 2022 年 4 月 27 日,目前仅进行必要的安全类 Bug 修复和严重 Bug 修复; - v2.10-lts:发布时间为 2023 年 5 月 25 日,每两周发布小版本,持续进行 Bug 修复和部分功能的有限优化。 ## 技术栈 - 后端: [Spring Boot](https://www.tutorialspoint.com/spring_boot/spring_boot_introduction.htm) - 前端: [Vue.js](https://vuejs.org/) - 中间件: [MySQL](https://www.mysql.com/), [Kafka](https://kafka.apache.org/), [MinIO](https://min.io/), [Redis](https://redis.com/) - 基础设施: [Docker](https://www.docker.com/), [Kubernetes](https://kubernetes.io/) - 测试引擎: [JMeter](https://jmeter.apache.org/) ## 安全说明 如果您在使用过程中发现任何安全问题,请通过以下方式直接联系我们: - 邮箱:support@fit2cloud.com - 电话:400-052-0755 ## 致谢 - [JMeter](https://jmeter.apache.org/):MeterSphere 使用了 JMeter 作为测试引擎 - [Arco Design](https://arco.design/vue):感谢 Arco Design 提供的优秀组件库 ## FOSSA Status [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmetersphere%2Fmetersphere.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmetersphere%2Fmetersphere?ref=badge_large) ## License & Copyright Copyright (c) 2014-2024 飞致云 FIT2CLOUD, All rights reserved. Licensed under The GNU General Public License version 3 (GPLv3) (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.gnu.org/licenses/gpl-3.0.html 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
apache/jmeter
Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
java performance test
<h1 align="center"><img src="https://jmeter.apache.org/images/logo.svg" alt="Apache JMeter logo" /></h1> An Open Source Java application designed to measure performance and load test applications. By The Apache Software Foundation [![Build Status](https://api.travis-ci.com/apache/jmeter.svg?branch=master)](https://travis-ci.com/apache/jmeter/) [![codecov](https://codecov.io/gh/apache/jmeter/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/jmeter) [![License](https://img.shields.io/:license-apache-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) [![Stack Overflow](https://img.shields.io/:stack%20overflow-jmeter-brightgreen.svg)](https://stackoverflow.com/questions/tagged/jmeter) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.jmeter/ApacheJMeter/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.jmeter/ApacheJMeter) [![Javadocs](https://www.javadoc.io/badge/org.apache.jmeter/ApacheJMeter_core.svg)](https://www.javadoc.io/doc/org.apache.jmeter/ApacheJMeter_core) [![Twitter](https://img.shields.io/twitter/url/https/github.com/apache/jmeter.svg?style=social)](https://twitter.com/intent/tweet?text=Powerful%20load%20testing%20with%20Apache%20JMeter:&url=https://jmeter.apache.org) ## What Is It? Apache JMeter can measure performance and load test static and dynamic web applications. It can be used to simulate a heavy load on a server, group of servers, network or object to test its strength or to analyze overall performance under different load types. ![JMeter screen](https://raw.githubusercontent.com/apache/jmeter/master/xdocs/images/screenshots/jmeter_screen.png) ## Features Complete portability and 100% Java. Multi-threading allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups. ### Protocols Ability to load and performance test many applications/server/protocol types: - Web - HTTP, HTTPS (Java, NodeJS, PHP, ASP.NET,...) - SOAP / REST Webservices - FTP - Database via JDBC - LDAP - Message-oriented Middleware (MOM) via JMS - Mail - SMTP(S), POP3(S) and IMAP(S) - Native commands or shell scripts - TCP - Java Objects ### IDE Fully featured Test IDE that allows fast Test Plan **recording** (from Browsers or native applications), **building** and **debugging**. ### Command Line [Command-line mode (Non GUI / headless mode)](https://jmeter.apache.org/usermanual/get-started.html#non_gui) to load test from any Java compatible OS (Linux, Windows, Mac OSX, ...) ### Reporting A complete and ready to present [dynamic HTML report](https://jmeter.apache.org/usermanual/generating-dashboard.html) ![Dashboard screenshot](https://raw.githubusercontent.com/apache/jmeter/master/xdocs/images/screenshots/dashboard/response_time_percentiles_over_time.png) [Live reporting](https://jmeter.apache.org/usermanual/realtime-results.html) into 3rd party databases like InfluxDB or Graphite ![Live report](https://raw.githubusercontent.com/apache/jmeter/master/xdocs/images/screenshots/grafana_dashboard.png) ### Correlation Easy correlation through ability to extract data from most popular response formats, [HTML](https://jmeter.apache.org/usermanual/component_reference.html#CSS/JQuery_Extractor), [JSON](https://jmeter.apache.org/usermanual/component_reference.html#JSON_Extractor), [XML](https://jmeter.apache.org/usermanual/component_reference.html#XPath_Extractor) or [any textual format](https://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor) ### Highly Extensible Core - Pluggable Samplers allow unlimited testing capabilities. - **Scriptable Samplers** (JSR223-compatible languages like Groovy). - Several load statistics can be chosen with **pluggable tiers**. - Data analysis and **visualization plugins** allow great extensibility and personalization. - Functions can be used to provide dynamic input to a test or provide data manipulation. - Easy Continuous Integration via 3rd party Open Source libraries for Maven, Gradle and Jenkins. ## The Latest Version Details of the latest version can be found on the [JMeter Apache Project web site](https://jmeter.apache.org/) ## Requirements The following requirements exist for running Apache JMeter: - Java Interpreter: A fully compliant Java 17 Runtime Environment is required for Apache JMeter to execute. A JDK with `keytool` utility is better suited for Recording HTTPS websites. - Optional jars: Some jars are not included with JMeter. If required, these should be downloaded and placed in the lib directory - JDBC - available from the database supplier - JMS - available from the JMS provider - [Bouncy Castle](https://www.bouncycastle.org/) - only needed for SMIME Assertion - Java Compiler (*OPTIONAL*): A Java compiler is not needed since the distribution includes a precompiled Java binary archive. > **Note** that a compiler is required to build plugins for Apache JMeter. ## Installation Instructions > **Note** that spaces in directory names can cause problems. - Release builds Unpack the binary archive into a suitable directory structure. ## Running JMeter 1. Change to the `bin` directory 2. Run the `jmeter` (Un\*x) or `jmeter.bat` (Windows) file. ### Windows For Windows, there are also some other scripts which you can drag-and-drop a JMX file onto: - `jmeter-n.cmd` - runs the file as a non-GUI test - `jmeter-n-r.cmd` - runs the file as a non-GUI remote (client-server) test - `jmeter-t.cmd` - loads the file ready to run it as a GUI test ## Documentation The documentation available as of the date of this release is also included, in HTML format, in the [printable_docs](printable_docs) directory, and it may be browsed starting from the file called [index.html](printable_docs/index.html). ## Reporting a bug/enhancement See [Issue Tracking](https://jmeter.apache.org/issues.html). ## Build instructions ### Release builds Unpack the source archive into a suitable directory structure. Most of the 3rd party library files can be extracted from the binary archive by unpacking it into the same directory structure. Any optional jars (see above) should be placed in `lib/opt` and/or `lib`. Jars in `lib/opt` will be used for building JMeter and running the unit tests, but won't be used at run-time. _This is useful for testing what happens if the optional jars are not downloaded by other JMeter users._ If you are behind a proxy, you can set a few build properties in `~/.gradle/gradle.properties` for Gradle to use the proxy: ```properties systemProp.http.proxyHost=proxy.example.invalid systemProp.http.proxyPort=8080 systemProp.http.proxyUser=your_user_name systemProp.http.proxyPassword=your_password systemProp.https.proxyHost=proxy.example.invalid systemProp.https.proxyPort=8080 systemProp.https.proxyUser=your_user_name systemProp.https.proxyPassword=your_password ``` ### Test builds JMeter is built using Gradle, and it uses [Gradle's Toolchains for JVM projects](https://docs.gradle.org/current/userguide/toolchains.html) for provisioning JDKs. It means the code would search for the needed JDKs locally, or download them if they are not found. By default, the code would use JDK 17 for build purposes, however it would set the target release to 8, so the resulting artifacts would be compatible with Java 8. The following command builds and tests JMeter: ```sh ./gradlew build ``` If you want to use a custom JDK for building you can set `-PjdkBuildVersion=11`, and you can select `-PjdkTestVersion=21` if you want to use a different JDK for testing. You can list the available build parameters by executing ```sh ./gradlew parameters ``` If the system does not have a GUI display then: ```sh ./gradlew build -Djava.awt.headless=true ``` The output artifacts (jars, reports) are placed in the `build` folder. For instance, binary artifacts can be found under `src/dist/build/distributions`. The following command would compile the application and enable you to run `jmeter` from the `bin` directory. > **Note** that it completely refreshes `lib/` contents, so it would remove custom plugins should you have them installed to `lib/`. However, it would keep `lib/ext/` plugins intact. ```sh ./gradlew createDist ``` Alternatively, you could get Gradle to start the GUI: ```sh ./gradlew runGui ``` ## Developer Information Building and contributing is explained in details at [building JMeter](https://jmeter.apache.org/building.html) and [CONTRIBUTING.md](CONTRIBUTING.md). More information on the tasks available for building JMeter with Gradle is available in [gradle.md](gradle.md). The code can be obtained from: - https://github.com/apache/jmeter - https://gitbox.apache.org/repos/asf/jmeter.git ## Licensing and Legal Information For legal and licensing information, please see the following files: - [LICENSE](LICENSE) - [NOTICE](NOTICE) ## Cryptographic Software Notice This distribution may include software that has been designed for use with cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See <https://www.wassenaar.org/> for more information. The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code. The following provides more details on the included software that may be subject to export controls on cryptographic software: Apache JMeter interfaces with the Java Secure Socket Extension (JSSE) API to provide - HTTPS support Apache JMeter interfaces (via Apache HttpClient4) with the Java Cryptography Extension (JCE) API to provide - NTLM authentication Apache JMeter does not include any implementation of JSSE or JCE. ## Thanks **Thank you for using Apache JMeter.** ### Third party notices * Notice for mxparser: > This product includes software developed by the Indiana > University Extreme! Lab. For further information please visit > http://www.extreme.indiana.edu/
0
TechEmpower/FrameworkBenchmarks
Source for the TechEmpower Framework Benchmarks project
benchmark framework frameworkbenchmarks performance suite
# Welcome to [TechEmpower Framework Benchmarks (TFB)](http://www.techempower.com/benchmarks/) [![Build Status](https://github.com/TechEmpower/FrameworkBenchmarks/workflows/build/badge.svg?branch=master&event=push)](https://github.com/TechEmpower/FrameworkBenchmarks/actions?query=workflow%3Abuild+branch%3Amaster) If you're new to the project, welcome! Please feel free to ask questions [here](https://github.com/TechEmpower/FrameworkBenchmarks/issues/2978). We encourage new frameworks and contributors to ask questions. We're here to help! This project provides representative performance measures across a wide field of web application frameworks. With much help from the community, coverage is quite broad and we are happy to broaden it further with contributions. The project presently includes frameworks on many languages including `Go`, `Python`, `Java`, `Ruby`, `PHP`, `C#`, `F#`,`Clojure`, `Groovy`, `Dart`, `JavaScript`, `Erlang`, `Haskell`, `Scala`, `Perl`, `Lua`, `C`, and others. The current tests exercise plaintext responses, JSON serialization, database reads and writes via the object-relational mapper (ORM), collections, sorting, server-side templates, and XSS counter-measures. Future tests will exercise other components and greater computation. [Read more and see the results of our tests on cloud and physical hardware](http://www.techempower.com/benchmarks/). For descriptions of the test types that we run, see the [test requirements section](https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview). If you find yourself in a directory or file that you're not sure what the purpose is, checkout our [file structure](https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Codebase-File-Structure) in our documentation, which will briefly explain the use of relevant directories and files. ## Quick Start Guide To get started developing you'll need to install [docker](https://docs.docker.com/install/) or see our [Quick Start Guide using vagrant](#quick-start-guide-vagrant) 1. Clone TFB. $ git clone https://github.com/TechEmpower/FrameworkBenchmarks.git 2. Change directories $ cd FrameworkBenchmarks 3. Run a test. $ ./tfb --mode verify --test gemini ### Explanation of the `./tfb` script The run script is pretty wordy, but each and every flag is required. If you are using windows, either adapt the docker command at the end of the `./tfb` shell script (replacing `${SCRIPT_ROOT}` with `/c/path/to/FrameworkBenchmarks`), or use vagrant. The command looks like this: `docker run -it --rm --network tfb -v /var/run/docker.sock:/var/run/docker.sock -v [FWROOT]:/FrameworkBenchmarks techempower/tfb [ARGS]` - `-it` tells docker to run this in 'interactive' mode and simulate a TTY, so that `ctrl+c` is propagated. - `--rm` tells docker to remove the container as soon as the toolset finishes running, meaning there aren't hundreds of stopped containers lying around. - `--network=tfb` tells the container to join the 'tfb' Docker virtual network - The first `-v` specifies which Docker socket path to mount as a volume in the running container. This allows docker commands run inside this container to use the host container's docker to create/run/stop/remove containers. - The second `-v` mounts the FrameworkBenchmarks source directory as a volume to share with the container so that rebuilding the toolset image is unnecessary and any changes you make on the host system are available in the running toolset container. - `techempower/tfb` is the name of toolset container to run #### A note on Windows - Docker expects Linux-style paths. If you cloned on your `C:\` drive, then `[ABS PATH TO THIS DIR]` would be `/c/FrameworkBenchmarks`. - [Docker for Windows](https://www.docker.com/docker-windows) understands `/var/run/docker.sock` even though that is not a valid path on Windows, but only when using Linux containers (it doesn't work with Windows containers and LCOW). [Docker Toolbox](https://docs.docker.com/toolbox/toolbox_install_windows/) **may** not understand `/var/run/docker.sock`, even when using Linux containers - use at your own risk. ## Quick Start Guide (Vagrant) Get started developing quickly by utilizing vagrant with TFB. [Git](https://git-scm.com), [Virtualbox](https://www.virtualbox.org/) and [vagrant](https://www.vagrantup.com/) are required. 1. Clone TFB. $ git clone https://github.com/TechEmpower/FrameworkBenchmarks.git 2. Change directories $ cd FrameworkBenchmarks/deployment/vagrant 3. Build the vagrant virtual machine $ vagrant up 4. Run a test $ vagrant ssh $ tfb --mode verify --test gemini ## Add a New Test Either on your computer, or once you open an SSH connection to your vagrant box, start the new test initialization wizard. vagrant@TFB-all:~/FrameworkBenchmarks$ ./tfb --new This will walk you through the entire process of creating a new test to include in the suite. ## Resources ### Official Documentation Our official documentation can be found in the [wiki](https://github.com/TechEmpower/FrameworkBenchmarks/wiki). If you find any errors or areas for improvement within the docs, feel free to open an issue in this repo. ### Live Results Results of continuous benchmarking runs are available in real time [here](https://tfb-status.techempower.com/). ### Data Visualization If you have a `results.json` file that you would like to visualize, you can [do that here](https://tfb-status.techempower.com/share). You can also attach a `runid` parameter to that url where `runid` is a run listed on [tfb-status](https://tfb-status.techempower.com) like so: https://www.techempower.com/benchmarks/#section=test&runid=fd07b64e-47ce-411e-8b9b-b13368e988c6. If you want to visualize them or compare different results files on bash, here is an unofficial [plaintext results parser](https://github.com/joeyleeeeeee97/PlainTextResultsParser) ## Contributing The community has consistently helped in making these tests better, and we welcome any and all changes. Reviewing our contribution practices and guidelines will help to keep us all on the same page. The [contribution guide](https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Development-Contributing-Guide) can be found in the [TFB documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki). Join in the conversation in the [Discussions tab](https://github.com/TechEmpower/FrameworkBenchmarks/discussions), on [Twitter](https://twitter.com/tfbenchmarks), or chat with us on [Freenode](https://webchat.freenode.net/) at `#techempower-fwbm`.
0
BiglySoftware/BiglyBT
Feature-filled Bittorrent client based on the Azureus open source project
bittorrent bittorrent-client i2p p2p torrent torrent-client torrent-downloader torrent-management
# BiglyBT Source for BiglyBT, a feature filled, open source, ad-free, bittorrent client. BiglyBT is forked from the original project and is being maintained by two of the original developers as well as members of the community. With over 15 years of development, there's a good chance we have the features you are looking for, as well as the decade old bugs you aren't looking for :) * [Official BiglyBT site](https://www.biglybt.com) * [Ways to Contribute](CONTRIBUTING.md) * [Translation Information](TRANSLATE.md) * [Feature Voting Page](https://vote.biglybt.com) * [Coding Guidelines](CODING_GUIDELINES.md) * [Beta Program Changelog](https://biglybt.tumblr.com/) ## Donations | Method | Address | |:--|:--| | PayPal | [BiglyBT's Donation Page](https://www.biglybt.com/donation/donate.php) | | BCH/BTC/BSG/BSV | 1BiGLYBT38ttJhvZkjGc5mCw5uKoRHcUmr | | DASH | XjDwmSrDPQBaLzCkuRHZaFzHf7mTVxkW9K | | DOGE | DMXWdEtPUJc5p2sbHGo77SvqFXKTR8Vff1 | | ETH/ETC | 0x4e609B5EF88C8aA8Ab73945fD1ba68c9E27faC75 | | LTC | LKGc2utCrGfojpYsX3naT9n1AxjLiZ5MMG | | TRX/BTT | TAbsb7pjEEWNpXFvPf49rfVhFSB2e3dAM7 | | XRP | rPFKfbx2tuzMMaz7Zy99M6CquHKgp9srSb | ## Setting up Dev Environment Getting the basics to compile from source is pretty straightforward: 1. Clone the repo into your favorite IDE 1. Mark `core/src` and `uis/src` as project roots (source modules) 1. To the uis module, add `core/lib/*` and one of the swt.jars at `/uis/lib/`:<br> `swt-win64.jar` on Windows<br> `swt-cocoa-64.jar` on OSX<br> `swt-linux-64.jar` on Linux (GTK) 1. To the core module, add `core/lib/*` 1. Make `uis` module depend on `core`. `Core` should not depend on `uis` IntelliJ IDEA will do all these steps for you with its wizard. ### External Annotations If you wish IntelliJ IDEA to show MessageBundle strings instead of keys, as well as reduce the number of NPE warnings, you can attach the external annotations either by: * Project Settings->Modules->Paths->External Annotations * in `<module>/<module>.iml` add to component: ``` <annotation-paths> <root url="file://$MODULE_DIR$/../external-annotations" /> </annotation-paths> ``` External Annotations definitions are a WIP and not complete list of definitions. ## Running in Dev Environment Running is only few more steps: * Main class is `com.biglybt.ui.Main` in module `uis` * Working Directory should be a new folder, since the app will write things to it. Put the [`aereg.dll`](core/lib/libWIN32Access/README.md) or `libOSXAccess.jnilib` in there. When a normal user is running the app, the working directory is where the jar, executable, and libraries (dll, so, jnilib) are. * If you want a separate config dir from the default one, use VM Option `-Dazureus.config.path=<some config path>` * Run it ## Release Installer Notes We build our installers using [Install4j, multi-platform installer builder](https://www.ej-technologies.com/products/install4j/overview.html) ![Install4j Logo](https://www.ej-technologies.com/images/product_banners/install4j_large.png) Our binaries and installers up to and including v3.4 are signed with a digital signature of "Bigly Software". Releases after v3.4 will use an individual signing certificate and will bear the name "Arron Mogge (Open Source Developer)" denoting the identity of our team member responsible for signing.
0
xuxueli/xxl-job
A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
cron distributed glue java job quartz restful schedule scheduler task xxl-job
<p align="center" > <img src="https://www.xuxueli.com/doc/static/xxl-job/images/xxl-logo.jpg" width="150"> <h3 align="center">XXL-JOB</h3> <p align="center"> XXL-JOB, a distributed task scheduling framework. <br> <a href="https://www.xuxueli.com/xxl-job/"><strong>-- Home Page --</strong></a> <br> <br> <a href="https://github.com/xuxueli/xxl-job/actions"> <img src="https://github.com/xuxueli/xxl-job/workflows/Java%20CI/badge.svg" > </a> <a href="https://maven-badges.herokuapp.com/maven-central/com.xuxueli/xxl-job/"> <img src="https://maven-badges.herokuapp.com/maven-central/com.xuxueli/xxl-job/badge.svg" > </a> <a href="https://github.com/xuxueli/xxl-job/releases"> <img src="https://img.shields.io/github/release/xuxueli/xxl-job.svg" > </a> <a href="https://github.com/xuxueli/xxl-job/"> <img src="https://img.shields.io/github/stars/xuxueli/xxl-job" > </a> <a href="https://hub.docker.com/r/xuxueli/xxl-job-admin/"> <img src="https://img.shields.io/docker/pulls/xuxueli/xxl-job-admin" > </a> <a href="http://www.gnu.org/licenses/gpl-3.0.html"> <img src="https://img.shields.io/badge/license-GPLv3-blue.svg" > </a> <a href="https://www.xuxueli.com/page/donate.html"> <img src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat" > </a> </p> </p> ## Introduction XXL-JOB is a distributed task scheduling framework. It's core design goal is to develop quickly and learn simple, lightweight, and easy to expand. Now, it's already open source, and many companies use it in production environments, real "out-of-the-box". XXL-JOB是一个分布式任务调度平台,其核心设计目标是开发迅速、学习简单、轻量级、易扩展。现已开放源代码并接入多家公司线上产品线,开箱即用。 ## Documentation - [中文文档](https://www.xuxueli.com/xxl-job/) - [English Documentation](https://www.xuxueli.com/xxl-job/en/) ## Communication - [社区交流](https://www.xuxueli.com/page/community.html) ## Features - 1、简单:支持通过Web页面对任务进行CRUD操作,操作简单,一分钟上手; - 2、动态:支持动态修改任务状态、启动/停止任务,以及终止运行中任务,即时生效; - 3、调度中心HA(中心式):调度采用中心式设计,“调度中心”自研调度组件并支持集群部署,可保证调度中心HA; - 4、执行器HA(分布式):任务分布式执行,任务"执行器"支持集群部署,可保证任务执行HA; - 5、注册中心: 执行器会周期性自动注册任务, 调度中心将会自动发现注册的任务并触发执行。同时,也支持手动录入执行器地址; - 6、弹性扩容缩容:一旦有新执行器机器上线或者下线,下次调度时将会重新分配任务; - 7、触发策略:提供丰富的任务触发策略,包括:Cron触发、固定间隔触发、固定延时触发、API(事件)触发、人工触发、父子任务触发; - 8、调度过期策略:调度中心错过调度时间的补偿处理策略,包括:忽略、立即补偿触发一次等; - 9、阻塞处理策略:调度过于密集执行器来不及处理时的处理策略,策略包括:单机串行(默认)、丢弃后续调度、覆盖之前调度; - 10、任务超时控制:支持自定义任务超时时间,任务运行超时将会主动中断任务; - 11、任务失败重试:支持自定义任务失败重试次数,当任务失败时将会按照预设的失败重试次数主动进行重试;其中分片任务支持分片粒度的失败重试; - 12、任务失败告警;默认提供邮件方式失败告警,同时预留扩展接口,可方便的扩展短信、钉钉等告警方式; - 13、路由策略:执行器集群部署时提供丰富的路由策略,包括:第一个、最后一个、轮询、随机、一致性HASH、最不经常使用、最近最久未使用、故障转移、忙碌转移等; - 14、分片广播任务:执行器集群部署时,任务路由策略选择"分片广播"情况下,一次任务调度将会广播触发集群中所有执行器执行一次任务,可根据分片参数开发分片任务; - 15、动态分片:分片广播任务以执行器为维度进行分片,支持动态扩容执行器集群从而动态增加分片数量,协同进行业务处理;在进行大数据量业务操作时可显著提升任务处理能力和速度。 - 16、故障转移:任务路由策略选择"故障转移"情况下,如果执行器集群中某一台机器故障,将会自动Failover切换到一台正常的执行器发送调度请求。 - 17、任务进度监控:支持实时监控任务进度; - 18、Rolling实时日志:支持在线查看调度结果,并且支持以Rolling方式实时查看执行器输出的完整的执行日志; - 19、GLUE:提供Web IDE,支持在线开发任务逻辑代码,动态发布,实时编译生效,省略部署上线的过程。支持30个版本的历史版本回溯。 - 20、脚本任务:支持以GLUE模式开发和运行脚本任务,包括Shell、Python、NodeJS、PHP、PowerShell等类型脚本; - 21、命令行任务:原生提供通用命令行任务Handler(Bean任务,"CommandJobHandler");业务方只需要提供命令行即可; - 22、任务依赖:支持配置子任务依赖,当父任务执行结束且执行成功后将会主动触发一次子任务的执行, 多个子任务用逗号分隔; - 23、一致性:“调度中心”通过DB锁保证集群分布式调度的一致性, 一次任务调度只会触发一次执行; - 24、自定义任务参数:支持在线配置调度任务入参,即时生效; - 25、调度线程池:调度系统多线程触发调度运行,确保调度精确执行,不被堵塞; - 26、数据加密:调度中心和执行器之间的通讯进行数据加密,提升调度信息安全性; - 27、邮件报警:任务失败时支持邮件报警,支持配置多邮件地址群发报警邮件; - 28、推送maven中央仓库: 将会把最新稳定版推送到maven中央仓库, 方便用户接入和使用; - 29、运行报表:支持实时查看运行数据,如任务数量、调度次数、执行器数量等;以及调度报表,如调度日期分布图,调度成功分布图等; - 30、全异步:任务调度流程全异步化设计实现,如异步调度、异步运行、异步回调等,有效对密集调度进行流量削峰,理论上支持任意时长任务的运行; - 31、跨语言:调度中心与执行器提供语言无关的 RESTful API 服务,第三方任意语言可据此对接调度中心或者实现执行器。除此之外,还提供了 “多任务模式”和“httpJobHandler”等其他跨语言方案; - 32、国际化:调度中心支持国际化设置,提供中文、英文两种可选语言,默认为中文; - 33、容器化:提供官方docker镜像,并实时更新推送dockerhub,进一步实现产品开箱即用; - 34、线程池隔离:调度线程池进行隔离拆分,慢任务自动降级进入"Slow"线程池,避免耗尽调度线程,提高系统稳定性; - 35、用户管理:支持在线管理系统用户,存在管理员、普通用户两种角色; - 36、权限控制:执行器维度进行权限控制,管理员拥有全量权限,普通用户需要分配执行器权限后才允许相关操作; ## Development 于2015年中,我在github上创建XXL-JOB项目仓库并提交第一个commit,随之进行系统结构设计,UI选型,交互设计…… 于2015-11月,XXL-JOB终于RELEASE了第一个大版本V1.0, 随后我将之发布到OSCHINA,XXL-JOB在OSCHINA上获得了@红薯的热门推荐,同期分别达到了OSCHINA的“热门动弹”排行第一和git.oschina的开源软件月热度排行第一,在此特别感谢红薯,感谢大家的关注和支持。 于2015-12月,我将XXL-JOB发表到我司内部知识库,并且得到内部同事认可。 于2016-01月,我司展开XXL-JOB的内部接入和定制工作,在此感谢袁某和尹某两位同事的贡献,同时也感谢内部其他给与关注与支持的同事。 于2017-05-13,在上海举办的 "[第62期开源中国源创会](https://www.oschina.net/event/2236961)" 的 "放码过来" 环节,我登台对XXL-JOB做了演讲,台下五百位在场观众反响热烈([图文回顾](https://www.oschina.net/question/2686220_2242120) )。 于2017-10-22,又拍云 Open Talk 联合 Spring Cloud 中国社区举办的 "[进击的微服务实战派上海站](https://opentalk.upyun.com/303.html)",我登台对XXL-JOB做了演讲,现场观众反响热烈并在会后与XXL-JOB用户热烈讨论交流。 于2017-12-11,XXL-JOB有幸参会《[InfoQ ArchSummit全球架构师峰会](http://bj2017.archsummit.com/)》,并被拍拍贷架构总监"杨波老师"在专题 "[微服务原理、基础架构和开源实践](http://bj2017.archsummit.com/training/2)" 中现场介绍。 于2017-12-18,XXL-JOB参与"[2017年度最受欢迎中国开源软件](http://www.oschina.net/project/top_cn_2017?sort=1)"评比,在当时已录入的约九千个国产开源项目中角逐,最终进入了前30强。 于2018-01-15,XXL-JOB参与"[2017码云最火开源项目](https://www.oschina.net/news/92438/2017-mayun-top-50)"评比,在当时已录入的约六千五百个码云项目中角逐,最终进去了前20强。 于2018-04-14,iTechPlus在上海举办的 "[2018互联网开发者大会](http://www.itdks.com/eventlist/detail/2065)",我登台对XXL-JOB做了演讲,现场观众反响热烈并在会后与XXL-JOB用户热烈讨论交流。 于2018-05-27,在上海举办的 "[第75期开源中国源创会](https://www.oschina.net/event/2278742)" 的 "架构" 主题专场,我登台进行“基础架构与中间件图谱”主题演讲,台下上千位在场观众反响热烈([图文回顾](https://www.oschina.net/question/3802184_2280606) )。 于2018-12-05,XXL-JOB参与"[2018年度最受欢迎中国开源软件](https://www.oschina.net/project/top_cn_2018?sort=1)"评比,在当时已录入的一万多个开源项目中角逐,最终排名第19名。 于2019-12-10,XXL-JOB参与"[2019年度最受欢迎中国开源软件](https://www.oschina.net/project/top_cn_2019)"评比,在当时已录入的一万多个开源项目中角逐,最终排名"开发框架和基础组件类"第9名。 于2020-11-16,XXL-JOB参与"[2020年度最受欢迎中国开源软件](https://www.oschina.net/project/top_cn_2020)"评比,在当时已录入的一万多个开源项目中角逐,最终排名"开发框架和基础组件类"第8名。 于2021-12-06,XXL-JOB参与"[2021年度OSC中国开源项目评选](https://www.oschina.net/project/top_cn_2021) "评比,在当时已录入的一万多个开源项目中角逐,最终当选"最受欢迎项目"。 > 我司大众点评目前已接入XXL-JOB,内部别名《Ferrari》(Ferrari基于XXL-JOB的V1.1版本定制而成,新接入应用推荐升级最新版本)。 据最新统计, 自2016-01-21接入至2017-12-01期间,该系统已调度约100万次,表现优异。新接入应用推荐使用最新版本,因为经过数十个版本的更新,系统的任务模型、UI交互模型以及底层调度通讯模型都有了较大的优化和提升,核心功能更加稳定高效。 至今,XXL-JOB已接入多家公司的线上产品线,接入场景如电商业务,O2O业务和大数据作业等,截止最新统计时间为止,XXL-JOB已接入的公司包括不限于: - 1、大众点评【美团点评】 - 2、山东学而网络科技有限公司; - 3、安徽慧通互联科技有限公司; - 4、人人聚财金服; - 5、上海棠棣信息科技股份有限公司 - 6、运满满【运满满】 - 7、米其林 (中国区)【米其林】 - 8、妈妈联盟 - 9、九樱天下(北京)信息技术有限公司 - 10、万普拉斯科技有限公司【一加手机】 - 11、上海亿保健康管理有限公司 - 12、海尔馨厨【海尔】 - 13、河南大红包电子商务有限公司 - 14、成都顺点科技有限公司 - 15、深圳市怡亚通 - 16、深圳麦亚信科技股份有限公司 - 17、上海博莹科技信息技术有限公司 - 18、中国平安科技有限公司【中国平安】 - 19、杭州知时信息科技有限公司 - 20、博莹科技(上海)有限公司 - 21、成都依能股份有限责任公司 - 22、湖南高阳通联信息技术有限公司 - 23、深圳市邦德文化发展有限公司 - 24、福建阿思可网络教育有限公司 - 25、优信二手车【优信】 - 26、上海悠游堂投资发展股份有限公司【悠游堂】 - 27、北京粉笔蓝天科技有限公司 - 28、中秀科技(无锡)有限公司 - 29、武汉空心科技有限公司 - 30、北京蚂蚁风暴科技有限公司 - 31、四川互宜达科技有限公司 - 32、钱包行云(北京)科技有限公司 - 33、重庆欣才集团 - 34、咪咕互动娱乐有限公司【中国移动】 - 35、北京诺亦腾科技有限公司 - 36、增长引擎(北京)信息技术有限公司 - 37、北京英贝思科技有限公司 - 38、刚泰集团 - 39、深圳泰久信息系统股份有限公司 - 40、随行付支付有限公司 - 41、广州瀚农网络科技有限公司 - 42、享点科技有限公司 - 43、杭州比智科技有限公司 - 44、圳临界线网络科技有限公司 - 45、广州知识圈网络科技有限公司 - 46、国誉商业上海有限公司 - 47、海尔消费金融有限公司,嗨付、够花【海尔】 - 48、广州巴图鲁信息科技有限公司 - 49、深圳市鹏海运电子数据交换有限公司 - 50、深圳市亚飞电子商务有限公司 - 51、上海趣医网络有限公司 - 52、聚金资本 - 53、北京父母邦网络科技有限公司 - 54、中山元赫软件科技有限公司 - 55、中商惠民(北京)电子商务有限公司 - 56、凯京集团 - 57、华夏票联(北京)科技有限公司 - 58、拍拍贷【拍拍贷】 - 59、北京尚德机构在线教育有限公司 - 60、任子行股份有限公司 - 61、北京时态电子商务有限公司 - 62、深圳卷皮网络科技有限公司 - 63、北京安博通科技股份有限公司 - 64、未来无线网 - 65、厦门瓷禧网络有限公司 - 66、北京递蓝科软件股份有限公司 - 67、郑州创海软件科技公司 - 68、北京国槐信息科技有限公司 - 69、浪潮软件集团 - 70、多立恒(北京)信息技术有限公司 - 71、广州极迅客信息科技有限公司 - 72、赫基(中国)集团股份有限公司 - 73、海投汇 - 74、上海润益创业孵化器管理股份有限公司 - 75、汉纳森(厦门)数据股份有限公司 - 76、安信信托 - 77、岚儒财富 - 78、捷道软件 - 79、湖北享七网络科技有限公司 - 80、湖南创发科技责任有限公司 - 81、深圳小安时代互联网金融服务有限公司 - 82、湖北享七网络科技有限公司 - 83、钱包行云(北京)科技有限公司 - 84、360金融【360】 - 85、易企秀 - 86、摩贝(上海)生物科技有限公司 - 87、广东芯智慧科技有限公司 - 88、联想集团【联想】 - 89、怪兽充电 - 90、行圆汽车 - 91、深圳店店通科技邮箱公司 - 92、京东【京东】 - 93、米庄理财 - 94、咖啡易融 - 95、梧桐诚选 - 96、恒大地产【恒大】 - 97、昆明龙慧 - 98、上海涩瑶软件 - 99、易信【网易】 - 100、铜板街 - 101、杭州云若网络科技有限公司 - 102、特百惠(中国)有限公司 - 103、常山众卡运力供应链管理有限公司 - 104、深圳立创电子商务有限公司 - 105、杭州智诺科技股份有限公司 - 106、北京云漾信息科技有限公司 - 107、深圳市多银科技有限公司 - 108、亲宝宝 - 109、上海博卡软件科技有限公司 - 110、智慧树在线教育平台 - 111、米族金融 - 112、北京辰森世纪 - 113、云南滇医通 - 114、广州市分领网络科技有限责任公司 - 115、浙江微能科技有限公司 - 116、上海馨飞电子商务有限公司 - 117、上海宝尊电子商务有限公司 - 118、直客通科技技术有限公司 - 119、科度科技有限公司 - 120、上海数慧系统技术有限公司 - 121、我的医药网 - 122、多粉平台 - 123、铁甲二手机 - 124、上海海新得数据技术有限公司 - 125、深圳市珍爱网信息技术有限公司【珍爱网】 - 126、小蜜蜂 - 127、吉荣数科技 - 128、上海恺域信息科技有限公司 - 129、广州荔支网络有限公司【荔枝FM】 - 130、杭州闪宝科技有限公司 - 131、北京互联新网科技发展有限公司 - 132、誉道科技 - 133、山西兆盛房地产开发有限公司 - 134、北京蓝睿通达科技有限公司 - 135、月亮小屋(中国)有限公司【蓝月亮】 - 136、青岛国瑞信息技术有限公司 - 137、博雅云计算(北京)有限公司 - 138、华泰证券香港子公司 - 139、杭州东方通信软件技术有限公司 - 140、武汉博晟安全技术股份有限公司 - 141、深圳市六度人和科技有限公司 - 142、杭州趣维科技有限公司(小影) - 143、宁波单车侠之家科技有限公司【单车侠】 - 144、丁丁云康信息科技(北京)有限公司 - 145、云钱袋 - 146、南京中兴力维 - 147、上海矽昌通信技术有限公司 - 148、深圳萨科科技 - 149、中通服创立科技有限责任公司 - 150、深圳市对庄科技有限公司 - 151、上证所信息网络有限公司 - 152、杭州火烧云科技有限公司【婚礼纪】 - 153、天津青芒果科技有限公司【芒果头条】 - 154、长飞光纤光缆股份有限公司 - 155、世纪凯歌(北京)医疗科技有限公司 - 156、浙江霖梓控股有限公司 - 157、江西腾飞网络技术有限公司 - 158、安迅物流有限公司 - 159、肉联网 - 160、北京北广梯影广告传媒有限公司 - 161、上海数慧系统技术有限公司 - 162、大志天成 - 163、上海云鹊医 - 164、上海云鹊医 - 165、墨迹天气【墨迹天气】 - 166、上海逸橙信息科技有限公司 - 167、沅朋物联 - 168、杭州恒生云融网络科技有限公司 - 169、绿米联创 - 170、重庆易宠科技有限公司 - 171、安徽引航科技有限公司(乐职网) - 172、上海数联医信企业发展有限公司 - 173、良彬建材 - 174、杭州求是同创网络科技有限公司 - 175、荷马国际 - 176、点雇网 - 177、深圳市华星光电技术有限公司 - 178、厦门神州鹰软件科技有限公司 - 179、深圳市招商信诺人寿保险有限公司 - 180、上海好屋网信息技术有限公司 - 181、海信集团【海信】 - 182、信凌可信息科技(上海)有限公司 - 183、长春天成科技发展有限公司 - 184、用友金融信息技术股份有限公司【用友】 - 185、北京咖啡易融有限公司 - 186、国投瑞银基金管理有限公司 - 187、晋松(上海)网络信息技术有限公司 - 188、深圳市随手科技有限公司【随手记】 - 189、深圳水务科技有限公司 - 190、易企秀【易企秀】 - 191、北京磁云科技 - 192、南京蜂泰互联网科技有限公司 - 193、章鱼直播 - 194、奖多多科技 - 195、天津市神州商龙科技股份有限公司 - 196、岩心科技 - 197、车码科技(北京)有限公司 - 198、贵阳市投资控股集团 - 199、康旗股份 - 200、龙腾出行 - 201、杭州华量软件 - 202、合肥顶岭医疗科技有限公司 - 203、重庆表达式科技有限公司 - 204、上海米道信息科技有限公司 - 205、北京益友会科技有限公司 - 206、北京融贯电子商务有限公司 - 207、中国外汇交易中心 - 208、中国外运股份有限公司 - 209、中国上海晓圈教育科技有限公司 - 210、普联软件股份有限公司 - 211、北京科蓝软件股份有限公司 - 212、江苏斯诺物联科技有限公司 - 213、北京搜狐-狐友【搜狐】 - 214、新大陆网商金融 - 215、山东神码中税信息科技有限公司 - 216、河南汇顺网络科技有限公司 - 217、北京华夏思源科技发展有限公司 - 218、上海东普信息科技有限公司 - 219、上海鸣勃网络科技有限公司 - 220、广东学苑教育发展有限公司 - 221、深圳强时科技有限公司 - 222、上海云砺信息科技有限公司 - 223、重庆愉客行网络有限公司 - 224、数云 - 225、国家电网运检部 - 226、杭州找趣 - 227、浩鲸云计算科技股份有限公司 - 228、科大讯飞【科大讯飞】 - 229、杭州行装网络科技有限公司 - 230、即有分期金融 - 231、深圳法司德信息科技有限公司 - 232、上海博复信息科技有限公司 - 233、杭州云嘉云计算有限公司 - 234、有家民宿(有家美宿) - 235、北京赢销通软件技术有限公司 - 236、浙江聚有财金融服务外包有限公司 - 237、易族智汇(北京)科技有限公司 - 238、合肥顶岭医疗科技开发有限公司 - 239、车船宝(深圳)旭珩科技有限公司) - 240、广州富力地产有限公司 - 241、氢课(上海)教育科技有限公司 - 242、武汉氪细胞网络技术有限公司 - 243、杭州有云科技有限公司 - 244、上海仙豆智能机器人有限公司 - 245、拉卡拉支付股份有限公司【拉卡拉】 - 246、虎彩印艺股份有限公司 - 247、北京数微科技有限公司 - 248、广东智瑞科技有限公司 - 249、找钢网 - 250、九机网 - 251、杭州跑跑网络科技有限公司 - 252、深圳未来云集 - 253、杭州每日给力科技有限公司 - 254、上海齐犇信息科技有限公司 - 255、滴滴出行【滴滴】 - 256、合肥云诊信息科技有限公司 - 257、云知声智能科技股份有限公司 - 258、南京坦道科技有限公司 - 259、爱乐优(二手平台) - 260、猫眼电影(私有化部署)【猫眼电影】 - 261、美团大象(私有化部署)【美团大象】 - 262、作业帮教育科技(北京)有限公司【作业帮】 - 263、北京小年糕互联网技术有限公司 - 264、山东矩阵软件工程股份有限公司 - 265、陕西国驿软件科技有限公司 - 266、君开信息科技 - 267、村鸟网络科技有限责任公司 - 268、云南国际信托有限公司 - 269、金智教育 - 270、珠海市筑巢科技有限公司 - 271、上海百胜软件股份有限公司 - 272、深圳市科盾科技有限公司 - 273、哈啰出行【哈啰】 - 274、途虎养车【途虎】 - 275、卡思优派人力资源集团 - 276、南京观为智慧软件科技有限公司 - 277、杭州城市大脑科技有限公司 - 278、猿辅导【猿辅导】 - 279、洛阳健创网络科技有限公司 - 280、魔力耳朵 - 281、亿阳信通 - 282、上海招鲤科技有限公司 - 283、四川商旅无忧科技服务有限公司 - 284、UU跑腿 - 285、北京老虎证券【老虎证券】 - 286、悠活省吧(北京)网络科技有限公司 - 287、F5未来商店 - 288、深圳环阳通信息技术有限公司 - 289、遠傳電信 - 290、作业帮(北京)教育科技有限公司【作业帮】 - 291、成都科鸿智信科技有限公司 - 292、北京木屋时代科技有限公司 - 293、大学通(哈尔滨)科技有限责任公司 - 294、浙江华坤道威数据科技有限公司 - 295、吉祥航空【吉祥航空】 - 296、南京圆周网络科技有限公司 - 297、广州市洋葱omall电子商务 - 298、天津联物科技有限公司 - 299、跑哪儿科技(北京)有限公司 - 300、深圳市美西西餐饮有限公司(喜茶) - 301、平安不动产有限公司【平安】 - 302、江苏中海昇物联科技有限公司 - 303、湖南牙医帮科技有限公司 - 304、重庆民航凯亚信息技术有限公司(易通航) - 305、递易(上海)智能科技有限公司 - 306、亚朵 - 307、浙江新课堂教育股份有限公司 - 308、北京蜂创科技有限公司 - 309、德一智慧城市信息系统有限公司 - 310、北京翼点科技有限公司 - 311、湖南智数新维度信息科技有限公司 - 312、北京玖扬博文文化发展有限公司 - 313、上海宇珩信息科技有限公司 - 314、全景智联(武汉)科技有限公司 - 315、天津易客满国际物流有限公司 - 316、南京爱福路汽车科技有限公司 - 317、我房旅居集团 - 318、湛江亲邻科技有限公司 - 319、深圳市姜科网络有限公司 - 320、青岛日日顺物流有限公司 - 321、南京太川信息技术有限公司 - 322、美图之家科技有限公司【美图】 - 323、南京太川信息技术有限公司 - 324、众薪科技(北京)有限公司 - 325、武汉安安物联科技有限公司 - 326、北京智客朗道网络科技有限公司 - 327、深圳市超级猩猩健身管理管理有限公司 - 328、重庆达志科技有限公司 - 329、上海享评信息科技有限公司 - 330、薪得付信息科技 - 331、跟谁学 - 332、中道(苏州)旅游网络科技有限公司 - 333、广州小卫科技有限公司 - 334、上海非码网络科技有限公司 - 335、途家网网络技术(北京)有限公司【途家】 - 336、广州辉凡信息科技有限公司 - 337、天维尔信息科技股份有限公司 - 338、上海极豆科技有限公司 - 339、苏州触达信息技术有限公司 - 340、北京热云科技有限公司 - 341、中智企服(北京)科技有限公司 - 342、易联云计算(杭州)有限责任公司 - 343、青岛航空股份有限公司【青岛航空】 - 344、山西博睿通科技有限公司 - 345、网易杭州网络有限公司【网易】 - 346、北京果果乐学科技有限公司 - 347、百望股份有限公司 - 348、中保金服(深圳)科技有限公司 - 349、天津运友物流科技股份有限公司 - 350、广东创能科技股份有限公司 - 351、上海倚博信息科技有限公司 - 352、深圳百果园实业(集团)股份有限公司 - 353、广州细刻网络科技有限公司 - 354、武汉鸿业众创科技有限公司 - 355、金锡科技(广州)有限公司 - 356、易瑞国际电子商务有限公司 - 357、奇点云 - 358、中视信息科技有限公司 - 359、开源项目:datax-web - 360、云知声智能科技股份有限公司 - 361、开源项目:bboss - 362、成都深驾科技有限公司 - 363、FunPlus【趣加】 - 364、杭州创匠信科技有限公司 - 365、龙匠(北京)科技发展有限公司 - 366、广州一链通互联网科技有限公司 - 367、上海星艾网络科技有限公司 - 368、虎博网络技术(上海)有限公司 - 369、青岛优米信息技术有限公司 - 370、八维通科技有限公司 - 371、烟台合享智星数据科技有限公司 - 372、东吴证券股份有限公司 - 373、中通云仓股份有限公司【中通】 - 374、北京加菲猫科技有限公司 - 375、北京匠心演绎科技有限公司 - 376、宝贝走天下 - 377、厦门众库科技有限公司 - 378、海通证券数据中心 - 389、湖南快乐通宝小额贷款有限公司 - 380、浙江大华技术股份有限公司 - 381、杭州魔筷科技有限公司 - 382、青岛掌讯通区块链科技有限公司 - 383、新大陆金融科技 - 384、常州玺拓软件科技有限公司 - 385、北京正保网格教育科技有限公司 - 386、统一企业(中国)投资有限公司【统一】 - 387、微革网络科技有限公司 - 388、杭州融易算科技有限公司 - 399、青岛上啥班网络科技有限公司 - 390、京东酒世界 - 391、杭州爱博仕科技有限公司 - 392、五星金服控股有限公司 - 393、福建乐摩物联科技有限公司 - 394、百炼智能科技有限公司 - 395、山东能源数智云科技有限公司 - 396、招商局能源运输股份有限公司 - 397、三一集团【三一】 - 398、东巴文(深圳)健康管理有限公司 - 399、索易软件 - 400、深圳市宁远科技有限公司 - 401、熙牛医疗 - 402、南京智鹤电子科技有限公司 - 403、嘀嗒出行【嘀嗒出行】 - 404、广州虎牙信息科技有限公司【虎牙】 - 405、广州欧莱雅百库网络科技有限公司【欧莱雅】 - 406、微微科技有限公司 - 407、我爱我家房地产经纪有限公司【我爱我家】 - 408、九号发现 - 409、薪人薪事 - 410、武汉氪细胞网络技术有限公司 - 411、广州市斯凯奇商业有限公司 - 412、微淼商学院 - 413、杭州车盛科技有限公司 - 414、深兰科技(上海)有限公司 - 415、安徽中科美络信息技术有限公司 - 416、比亚迪汽车工业有限公司【比亚迪】 - 417、湖南小桔信息技术有限公司 - 418、安徽科大国创软件科技有限公司 - 419、克而瑞 - 420、陕西云基华海信息技术有限公司 - 421、安徽深宁科技有限公司 - 422、广东康爱多数字健康有限公司 - 423、嘉里电子商务 - 424、上海时代光华教育发展有限公司 - 425、CityDo - 426、上海禹知信息科技有限公司 - 427、广东智瑞科技有限公司 - 428、西安爱铭网络科技有限公司 - 429、心医国际数字医疗系统(大连)有限公司 - 430、乐其电商 - 431、锐达科技 - 432、天津长城滨银汽车金融有限公司 - 433、代码网 - 434、东莞市东城乔伦软件开发工作室 - 435、浙江百应科技有限公司 - 436、上海力爱帝信息技术有限公司(Red E) - 437、云徙科技有限公司 - 438、北京康智乐思网络科技有限公司【大姨吗APP】 - 439、安徽开元瞬视科技有限公司 - 440、立方 - 441、厦门纵行科技 - 442、乐山-菲尼克斯半导体有限公司 - 443、武汉光谷联合集团有限公司 - 444、上海金仕达软件科技有限公司 - 445、深圳易世通达科技有限公司 - 446、爱动超越人工智能科技(北京)有限责任公司 - 447、迪普信(北京)科技有限公司 - 448、掌站科技(北京)有限公司 - 449、深圳市华云中盛股份有限公司 - 450、上海原圈科技有限公司 - 451、广州赞赏信息科技有限公司 - 452、Amber Group - 453、德威国际货运代理(上海)公司 - 454、浙江杰夫兄弟智慧科技有限公司 - 455、信也科技 - 456、开思时代科技(深圳)有限公司 - 457、大连槐德科技有限公司 - 458、同程生活 - 459、松果出行 - 460、企鹅杏仁集团 - 461、宁波科云信息科技有限公司 - 462、上海格蓝威驰信息科技有限公司 - 463、杭州趣淘鲸科技有限公司 - 464、湖州市数字惠民科技有限公司 - 465、乐普(北京)医疗器械股份有限公司 - 466、广州市晴川高新技术开发有限公司 - 467、山西缇客科技有限公司 - 468、徐州卡西穆电子商务有限公司 - 469、格创东智科技有限公司 - 470、世纪龙信息网络有限责任公司 - 471、邦道科技有限公司 - 472、河南中盟新云科技股份有限公司 - 473、横琴人寿保险有限公司 - 474、上海海隆华钟信息技术有限公司 - 475、上海久湛 - 476、上海仙豆智能机器人有限公司 - 477、广州汇尚网络科技有限公司 - 478、深圳市阿卡索资讯股份有限公司 - 479、青岛佳家康健康管理有限责任公司 - 480、蓝城兄弟 - 481、成都天府通金融服务股份有限公司 - 482、深圳云镖网络科技有限公司 - 483、上海影创科技 - 484、成都艾拉物联 - 485、北京客邻尚品网络技术有限公司 - 486、IT实战联盟 - 487、杭州尤拉夫科技有限公司 - 488、中大检测(湖南)股份有限公司 - 489、江苏电老虎工业互联网股份有限公司 - 490、上海助通信息科技有限公司 - 491、北京符节科技有限公司 - 492、杭州英祐科技有限公司 - 493、江苏电老虎工业互联网股份有限公司 - 494、深圳市点猫科技有限公司 - 495、杭州天音 - 496、深圳市二十一科技互联网有限公司 - 497、海南海口翎度科技 - 498、北京小趣智品科技有限公司 - 499、广州石竹计算机软件有限公司 - 500、深圳市惟客数据科技有限公司 - 501、中国医疗器械有限公司 - 502、上海云谦科技有限公司 - 503、上海磐农信息科技有限公司 - 504、广州领航食品有限公司 - 505、青岛掌讯通区块链科技有限公司 - 506、北京新网数码信息技术有限公司 - 507、超体信息科技(深圳)有限公司 - 508、长沙店帮手信息科技有限公司 - 509、上海助弓装饰工程有限公司 - 510、杭州寻联网络科技有限公司 - 511、成都大淘客科技有限公司 - 512、松果出行 - 513、深圳市唤梦科技有限公司 - 514、上汽集团商用车技术中心 - 515、北京中航讯科技股份有限公司 - 516、北龙中网(北京)科技有限责任公司 - 517、前海超级前台(深圳)信息技术有限公司 - 518、上海中商网络股份有限公司 - 519、上海助通信息科技有限公司 - 520、宁波聚臻智能科技有限公司 - 521、上海零动数码科技股份有限公司 - 522、浙江学海教育科技有限公司 - 523、聚学云(山东)信息技术有限公司 - 524、多氟多新材料股份有限公司 - 525、智慧眼科技股份有限公司 - 526、广东智通人才连锁股份有限公司 - 527、世纪开元智印互联科技集团股份有限公司 - 528、北京理想汽车【理想汽车】 - 529、巽逸科技(重庆)有限公司 - 530、义乌购电子商务有限公司 - 531、深圳市珂莱蒂尔服饰有限公司 - 532、江西国泰利民信息科技有限公司 - 533、广西广电大数据科技有限公司 - 534、杭州艾麦科技有限公司 - 535、广州小滴科技有限公司 - 536、佳缘科技股份有限公司 - 537、上海深擎信息科技有限公司 - 538、武商网 - 539、福建民本信息科技有限公司 - 540、杭州惠合信息科技有限公司 - 541、厦门爱立得科技有限公司 - 542、成都拟合未来科技有限公司 - 543、宁波聚臻智能科技有限公司 - 544、广东百慧科技有限公司 - 545、笨马网络 - 546、深圳市信安数字科技有限公司 - 547、深圳市思乐数据技术有限公司 - 548、四川绿源集科技有限公司 - 549、湖南云医链生物科技有限公司 - 550、杭州源诚科技有限公司 - 551、北京开课吧科技有限公司 - 552、北京多来点信息技术有限公司 - 553、JEECG BOOT低代码开发平台 - 554、苏州同元软控信息技术有限公司 - 555、江苏大泰信息技术有限公司 - 556、北京大禹汇智 - 557、北京盛哲科技有限公司 - 558、广州钛动科技有限公司 - 559、北京大禹汇智科技有限公司 - 560、湖南鼎翰文化股份有限公司 - 561、苏州安软信息科技有限公司 - 562、芒果tv - 563、上海艺赛旗软件股份有限公司 - 564、中盈优创资讯科技有限公司 - 565、乐乎公寓 - 566、启明信息 - 567、苏州安软 - 568、南京富金的软件科技有限公司 - 569、深圳市新科聚合网络技术有限公司 - 570、你好现在(北京)科技股份有限公司 - 571、360考试宝典 - 572、北京一零科技有限公司 - 573、厦门星纵信息 - 574、Dalligent Solusi Indonesia - 575、深圳华普物联科技有限公司 - 576、深圳行健自动化股份有限公司 - 577、深圳市富融信息科技服务有限公司 - 578、蓝鸟云 - 579、上海澎博财经资讯有限公司 - 580、北京小鸦科技有限公司 - 581、杭州盈泉云科技有限公司 - 582、惟客数据 - 583、GOSO香蜜闺秀 - 584、普乐师(上海)数字科技有限公司 - 585、西安市雁塔区咖北堂网络科技部 - 586、宁波聚臻智能科技有限公司 - 587、普乐师数字科技有限公司 - 588、江苏蟹联网科技有限公司 - 589、杭州未智科技有限公司 - 590、安吉智行物流有限公司 - 591、华生大家居集团有限公司 - 592、美心食品(广州)有限公司 - 593、货拉拉【货拉拉APP】 - 594、杭州思韬瑞科技有限公司 - 595、杭州玖融科技有限公司 - 596、北京优海网络科技有限公司 - 597、浙江大维高新技术股份有限公司 - 598、粤港澳大湾区数字经济研究院 - 599、普康(杭州)健康科技有限公司 - 600、华西证券股份有限公司【华西证券】 - 601、杭州海康机器人股份有限公司【海康】 - 602、河南宸邦信息技术有限公司 - 603、成都次元节点网络科技有限公司 - 604、富士康科技集团【富士康】 - 605、青岛东软载波科技股份有限公司 - 606、小菊快跑科技有限公司 - 607、视源股份 - 608、宁波聚臻智能科技有限公司 - 609、阔天科技有限公司 - 610、网宿科技有限公司 - 611、南京梵鼎信息技术有限公司 - 612、房天下【房天下】 - 613、特瓦特能源科技有限公司 - 614、拓迪智能科技有限公司 - 615、东软集团【东软】 - 616、开普云 - 617、领课网络 - 618、南京特维软件有限公司 - 619、福建易联众保睿通信息科技有限公司 - 620、浙江核心同花顺金融科技有限公司【同花顺】 - 621、浙江博观瑞思科技有限公司 - 622、北京新美互通科技有限公司 - 623、北京有生博大软件股份有限公司 - 624、时代中国 - 625、鱼泡网 - 626、一粒方糖(安徽)科技有限公司 - 627、北京外研在线数字科技有限公司 - 628、德电(中国)通信技术有限公司 - 629、杭州寻联网络科技有限公司 - 630、橙联(中国)有限公司 - 631、北京承启通科技有限公司 - 632、银联数据服务有限公司【银联】 - 633、上海晶确科技有限公司 - 634、亚信科技有限公司 - 635、福建新航物联网科技有限公司 - 636、上扬软件 - 637、深蓝汽车科技有限公司 - 638、南昌节点汇智科技有限公司 - 639、锐明技术 - 640、再造再生健康科技有限公司 - 641、华宝证券 - 642、卓正医疗 - 643、深圳湛信科技 - 644、陕西鑫众为软件有限公司 - 645、深圳市润农科技有限公司 - 646、庚商教育智能科技有限公司 - 647、杭州祎声科技 - 648、四川久远银海软件股份有限公司 - 649、GeeFox极狐低代码 - 650、浙江和仁科技股份有限公司 - 651、宁波聚臻智能科技有限公司 - 652、福建福昕软件开发股份有限公司【福昕】 - 653、广州中长康达信息技术有限公司 - 654、武汉趣改信息科技有限公司 - …… > 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。 欢迎大家的关注和使用,XXL-JOB也将拥抱变化,持续发展。 ## Contributing Contributions are welcome! Open a pull request to fix a bug, or open an [Issue](https://github.com/xuxueli/xxl-job/issues/) to discuss a new feature or change. 欢迎参与项目贡献!比如提交PR修复一个bug,或者新建 [Issue](https://github.com/xuxueli/xxl-job/issues/) 讨论新特性或者变更。 ## Copyright and License This product is open source and free, and will continue to provide free community technical support. Individual or enterprise users are free to access and use. - Licensed under the GNU General Public License (GPL) v3. - Copyright (c) 2015-present, xuxueli. 产品开源免费,并且将持续提供免费的社区技术支持。个人或企业内部可自由的接入和使用。如有需要可邮件联系作者免费获取项目授权。 ## Donate No matter how much the donation amount is enough to express your thought, thank you very much :) [To donate](https://www.xuxueli.com/page/donate.html ) 无论捐赠金额多少都足够表达您这份心意,非常感谢 :) [前往捐赠](https://www.xuxueli.com/page/donate.html )
0
ppamorim/Dragger
Animate your activity!
null
![Logo 1][10] [![Build Status](https://api.travis-ci.org/ppamorim/Dragger.svg?branch=master)](https://travis-ci.org/ppamorim/Dragger) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Dragger-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1673) [![JitPack](https://img.shields.io/github/release/ppamorim/Dragger.svg?label=JitPack%20Maven)](https://jitpack.io/#ppamorim/Dragger) [![Join the chat at https://gitter.im/ppamorim/Dragger](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ppamorim/Dragger?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Warning ------- This library is not in development anymore, but we are accepting PRs or successors if anyone is interested. --- If you want to use these transitions with fragments, take a look at [PrismView][123456789] library! The library was created in order to provide new animations for activities on Android. Using the ViewDragHelper class, it is possible to create smooth animations that allow full control of the view by the user. This new component has been created using some concepts described on [Flavien Laurent Blog][1] and [Denevell Blog][2]. Dragger now uses [Rebound][14](tiny, 41.7kb) from Facebook to provide more realistic animations and improve performance for old devices. This library should work on API 10 (but not tested [yet][1337]). ![Demo 1][11] Usage ----- You can use this library like a view, you just need to do the following: * 1. Add ''DraggerView'' view to your root layout and add two layouts inside it. You can add a shadow view if you want (the first one) and it needs to be invisible. ```xml <com.github.ppamorim.library.DraggerView android:layout_width="match_parent" android:layout_height="match_parent" dragger_layout:drag_view_id="@+id/drag_view" dragger_layout:shadow_view_id="@+id/shadow_view" dragger_layout:drag_position="top"> <FrameLayout android:id="@+id/shadow_view" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/transparent" android:visibility="invisible"/> <LinearLayout android:id="@+id/drag_view" android:layout_width="match_parent" android:layout_height="match_parent"/> </com.github.ppamorim.library.DraggerView> ``` In your ''styles'' file, you need a config like this: ```xml <style name="YourTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="android:windowAnimationStyle">@null</item> </style> ``` And your ''manifest'': ```xml <activity android:name="com.github.dragger.BaseActivity" android:theme="@style/YourTheme"/> ``` Or, if you need it to be fast: ```java public class YourActivity extends DraggerActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setShadowView(R.layout.custom_shadow); // It is not necessary, use if you want. setContentView(R.layout.layout_content); } } ``` Now you can control the slide of the view, just use the method expand() when you want. Some methods that you can use: ```java setDraggerCallback(DraggerCallback) //Interface that's provides some infos of the animation. setSlideEnabled(boolean) //Enable or disable the drag, useful to use with ScrollViews. setHorizontalDragRange(float) //Draggable distance that the draggableView can use, horizontally. setVerticalDragRange(float) //Draggable distance that the draggableView can use, vertically. setRunAnimationOnFinishInflate(boolean) //Run the initial animation, useful if you only want the drag function. setDraggerLimit(float) //Set the max limit drag, default is 0.5 (center of the screen). setDraggerPosition(DraggerPosition) //Set the position of archor. setTension(float) //Tension of the animation. This represent with the friction, how much time the animation will be executed. setFriction(float) //Friction of the animation. This represent with the tension, how much friction is applied at the tension animation. show() //Show the drag view with Rebound animation. closeActivity() //Simply close the activity with Rebound animation, based of the DraggerPosition choosen. ``` Sample ------ <a href="https://play.google.com/store/apps/details?id=com.github.dragger"> <img alt="Get it on Google Play" src="https://developer.android.com/images/brand/en_generic_rgb_wo_60.png" /> </a> Import dependency -------------------------------- This library use `appcompat-v7:23.1.0`. But why not to add in MavenCentral? Because it is so much bureaucratic. JitPack is there and is the future! Into your build.gradle: ```groovy repositories { maven { url "https://jitpack.io" } } dependencies { implementation 'com.github.ppamorim:dragger:1.2' } ``` Will you use with lists(RecyclerView, List/GridView, ScrollView)? -------------------------------------------------------------------- I decided that need to be Out-Of-Box, then... You must use the [Android-ObservableScrollView][13], like this: ```groovy dependencies { implementation 'com.github.ksoichiro:android-observablescrollview:VERSION' } ``` ```java public void configRecyclerView() { ... recyclerView.setScrollViewCallbacks(onObservableScrollViewCallbacks); } private ObservableScrollViewCallbacks onObservableScrollViewCallbacks = new ObservableScrollViewCallbacks() { @Override public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) { draggerView.setSlideEnabled(scrollY != 0); } @Override public void onDownMotionEvent() { } @Override public void onUpOrCancelMotionEvent(ScrollState scrollState) { } }; ``` Contributors ------------ * [Pedro Paulo de Amorim][3] * [Falkirks][12] This was only possible because [Pedro Vicente Gómez Sánchez][4] helped me and I am very grateful for that! Thank you. :) And thank you Facebook for provide [Rebound][14] library! Developed By ------------ * Pedro Paulo de Amorim - <pp.amorim@hotmail.com> <a href="https://www.linkedin.com/profile/view?id=185411359"> <img alt="Add me to Linkedin" src="http://imageshack.us/a/img41/7877/smallld.png" /> </a> Libraries used on the sample project ------------------------------------ * [Butterknife][5] License ------- Copyright 2015 Pedro Paulo de Amorim 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]: http://flavienlaurent.com/blog/2013/08/28/each-navigation-drawer-hides-a-viewdraghelper/ [2]: http://blog.denevell.org/android-viewdraghelper-example-tutorial.html [3]: https://github.com/ppamorim/ [4]: https://github.com/pedrovgs/ [5]: https://github.com/JakeWharton/butterknife [6]: https://github.com/JakeWharton/NineOldAndroids/ [7]: https://github.com/square/picasso [10]: ./art/dragger_new.png [11]: https://github.com/ppamorim/Dragger/blob/master/art/app_sample_uncompressed.gif?raw=true [12]: https://github.com/Falkirks [13]: https://github.com/ksoichiro/Android-ObservableScrollView [14]: https://github.com/facebook/rebound [1337]: https://www.youtube.com/watch?v=eQyjP2O1S40 [123456789]: https://github.com/ppamorim/PrismView
0
alibaba/taokeeper
ZooKeeper-Monitor, a monitor for zookeeper in java. Download https://github.com/alibaba/taokeeper/downloads
null
null
0
Stericson/RootTools
RootTools Library
null
# RootTools RootTools Library
0
phodal/migration
《系统重构与迁移指南》手把手教你分析、评估现有系统、制定重构策略、探索可行重构方案、搭建测试防护网、进行系统架构重构、服务架构重构、模块重构、代码重构、数据库重构、重构后的架构守护
agile ddd ebook guard legacy-system migration refactoring tdd testing
// 版本:v0.1.0 // 作者:Phodal Huang (PS 1:考虑到内容的重复度和读者一定会懂得 Google,对于部分的内容,我只编写标题。) (PS 2:部分内容可以在书上找到对应的内容,我只会给个书名) (PS 3:我在寒冷的北方杭州,写下了此指南) Phodal 手把手教你分析、评估现有系统、制定重构策略、探索可行重构方案、搭建测试防护网、进行系统架构重构、服务架构重构、模块重构、代码重构、数据库重构、重构后的架构守护……。 对就是这些,但是还没完呢。 指南中所包含的书单: - 《重构与模式》 - 《设计模式:可复用面向对象软件的基础》 - 《重构:改善既有代码的设计》 - 《领域驱动设计:软件核心复杂性应对之道》 - 《修改代码的艺术:构建易维护代码的 9 条最佳实践》 - 《代码整洁之道》 - 《架构整洁之道》 - 《数据库重构》 - 《遗留系统重构指南》 - 《软件架构师应该知道的97件事》 - 《架构师修炼之道》 - 《实现模式》 - 《反模式:危机中的软件,架构和项目的重构》 - 《精益软件度量》 - 《设计模式沉思录》 - 《前端架构:从入门到微前端》 # [系统重构与迁移指南](https://migration.ink/) > 软件开发总成本 = 开发成本 + 维护成本;软件维护成本 = 理解成本 + 修改成本 + 测试成本 + 部署成本。—— Kent Beck 最新版本内容,请访问:[https://migration.ink/](https://migration.ink/),或者 [https://github.com/phodal/migration](https://github.com/phodal/migration) 模型与原则: ![To DDD](images/to-ddd.png) 流程: ![重构流程](images/refactoring-process.png) 索引: ![Index](images/toc.jpg) 目录: * [再说遗留系统重构](#%E5%86%8D%E8%AF%B4%E9%81%97%E7%95%99%E7%B3%BB%E7%BB%9F%E9%87%8D%E6%9E%84) * [为什么重构?](#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%87%8D%E6%9E%84%EF%BC%9F) * [重构的动机](#%E9%87%8D%E6%9E%84%E7%9A%84%E5%8A%A8%E6%9C%BA) * [重构不一定能带来什么?](#%E9%87%8D%E6%9E%84%E4%B8%8D%E4%B8%80%E5%AE%9A%E8%83%BD%E5%B8%A6%E6%9D%A5%E4%BB%80%E4%B9%88%EF%BC%9F) * [重构是一种文化](#%E9%87%8D%E6%9E%84%E6%98%AF%E4%B8%80%E7%A7%8D%E6%96%87%E5%8C%96) * [大规模重构的时机](#%E5%A4%A7%E8%A7%84%E6%A8%A1%E9%87%8D%E6%9E%84%E7%9A%84%E6%97%B6%E6%9C%BA) * [说清重构的价值](#%E8%AF%B4%E6%B8%85%E9%87%8D%E6%9E%84%E7%9A%84%E4%BB%B7%E5%80%BC) * [系统重构模式与原则](#%E7%B3%BB%E7%BB%9F%E9%87%8D%E6%9E%84%E6%A8%A1%E5%BC%8F%E4%B8%8E%E5%8E%9F%E5%88%99) * [重构模式:EPDCA](#%E9%87%8D%E6%9E%84%E6%A8%A1%E5%BC%8F%EF%BC%9Aipdca) * [四级重构](#%E5%9B%9B%E7%BA%A7%E9%87%8D%E6%9E%84) * [小步前进](#%E5%B0%8F%E6%AD%A5%E5%89%8D%E8%BF%9B) * [Git 工作流](#git--%E5%B7%A5%E4%BD%9C%E6%B5%81) * [Master 机制](#master-%E6%9C%BA%E5%88%B6) * [PR 机制](#pr-%E6%9C%BA%E5%88%B6) * [建立远景与方向](#%E5%BB%BA%E7%AB%8B%E8%BF%9C%E6%99%AF%E4%B8%8E%E6%96%B9%E5%90%91) * [拉通:对齐目标](#%E6%8B%89%E9%80%9A%EF%BC%9A%E5%AF%B9%E9%BD%90%E7%9B%AE%E6%A0%87) * [明确潜在风险](#%E6%98%8E%E7%A1%AE%E6%BD%9C%E5%9C%A8%E9%A3%8E%E9%99%A9) * [人评估](#%E4%BA%BA%E8%AF%84%E4%BC%B0) * [重构范围](#%E9%87%8D%E6%9E%84%E8%8C%83%E5%9B%B4) * [产出物](#%E4%BA%A7%E5%87%BA%E7%89%A9) * [KPI 度量](#kpi-%E5%BA%A6%E9%87%8F) * [重建规范](#%E9%87%8D%E5%BB%BA%E8%A7%84%E8%8C%83) * [团队赋能](#%E5%9B%A2%E9%98%9F%E8%B5%8B%E8%83%BD) * [原则与模式](#%E5%8E%9F%E5%88%99%E4%B8%8E%E6%A8%A1%E5%BC%8F) * [重构评估与度量](#%E9%87%8D%E6%9E%84%E8%AF%84%E4%BC%B0%E4%B8%8E%E5%BA%A6%E9%87%8F) * [识别技术债务](#%E8%AF%86%E5%88%AB%E6%8A%80%E6%9C%AF%E5%80%BA%E5%8A%A1) * [技术债风暴](#%E6%8A%80%E6%9C%AF%E5%80%BA%E9%A3%8E%E6%9A%B4) * [架构评估:技术驱动 vs 业务驱动](#%E6%9E%B6%E6%9E%84%E8%AF%84%E4%BC%B0%EF%BC%9A%E6%8A%80%E6%9C%AF%E9%A9%B1%E5%8A%A8-vs-%E4%B8%9A%E5%8A%A1%E9%A9%B1%E5%8A%A8) * [代码评估:收集 bad smell](#%E4%BB%A3%E7%A0%81%E8%AF%84%E4%BC%B0%EF%BC%9A%E6%94%B6%E9%9B%86-bad-smell) * [收集 Todo](#%E6%94%B6%E9%9B%86-todo) * [测试和文档评估](#%E6%B5%8B%E8%AF%95%E5%92%8C%E6%96%87%E6%A1%A3%E8%AF%84%E4%BC%B0) * [项目评估](#%E9%A1%B9%E7%9B%AE%E8%AF%84%E4%BC%B0) * [编写工具评估](#%E7%BC%96%E5%86%99%E5%B7%A5%E5%85%B7%E8%AF%84%E4%BC%B0) * [代码评估工具](#%E4%BB%A3%E7%A0%81%E8%AF%84%E4%BC%B0%E5%B7%A5%E5%85%B7) * [真实的测试覆盖率](#%E7%9C%9F%E5%AE%9E%E7%9A%84%E6%B5%8B%E8%AF%95%E8%A6%86%E7%9B%96%E7%8E%87) * [可测试性评估](#%E5%8F%AF%E6%B5%8B%E8%AF%95%E6%80%A7%E8%AF%84%E4%BC%B0) * [度量](#%E5%BA%A6%E9%87%8F) * [寻找专业人士](#%E5%AF%BB%E6%89%BE%E4%B8%93%E4%B8%9A%E4%BA%BA%E5%A3%AB) * [重构准入条件](#%E9%87%8D%E6%9E%84%E5%87%86%E5%85%A5%E6%9D%A1%E4%BB%B6) * [工具准备](#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87) * [重构看板](#%E9%87%8D%E6%9E%84%E7%9C%8B%E6%9D%BF) * [版本控制](#%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6) * [自动化重构工具](#%E8%87%AA%E5%8A%A8%E5%8C%96%E9%87%8D%E6%9E%84%E5%B7%A5%E5%85%B7) * [持续集成环境](#%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90%E7%8E%AF%E5%A2%83) * [记录](#%E8%AE%B0%E5%BD%95) * [探索性重构:可行方案](#%E6%8E%A2%E7%B4%A2%E6%80%A7%E9%87%8D%E6%9E%84%EF%BC%9A%E5%8F%AF%E8%A1%8C%E6%96%B9%E6%A1%88) * [准备知识:坏味道的模式](#%E5%87%86%E5%A4%87%E7%9F%A5%E8%AF%86%EF%BC%9A%E5%9D%8F%E5%91%B3%E9%81%93%E7%9A%84%E6%A8%A1%E5%BC%8F) * [C4 模型](#c4-%E6%A8%A1%E5%9E%8B) * [探索模式](#%E6%8E%A2%E7%B4%A2%E6%A8%A1%E5%BC%8F) * [1\. 从分层架构到具体代码](#1-%E4%BB%8E%E5%88%86%E5%B1%82%E6%9E%B6%E6%9E%84%E5%88%B0%E5%85%B7%E4%BD%93%E4%BB%A3%E7%A0%81) * [2\. 从外部适配器到内部适配器](#2-%E4%BB%8E%E5%A4%96%E9%83%A8%E9%80%82%E9%85%8D%E5%99%A8%E5%88%B0%E5%86%85%E9%83%A8%E9%80%82%E9%85%8D%E5%99%A8) * [3\. 查看测试情况](#3-%E6%9F%A5%E7%9C%8B%E6%B5%8B%E8%AF%95%E6%83%85%E5%86%B5) * [4\. 针对于最复杂的情形和最简单的情形](#4-%E9%92%88%E5%AF%B9%E4%BA%8E%E6%9C%80%E5%A4%8D%E6%9D%82%E7%9A%84%E6%83%85%E5%BD%A2%E5%92%8C%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84%E6%83%85%E5%BD%A2) * [工具:API 列表和调用关系](#%E5%B7%A5%E5%85%B7%EF%BC%9Aapi-%E5%88%97%E8%A1%A8%E5%92%8C%E8%B0%83%E7%94%A8%E5%85%B3%E7%B3%BB) * [构建领域知识](#%E6%9E%84%E5%BB%BA%E9%A2%86%E5%9F%9F%E7%9F%A5%E8%AF%86) * [了解业务架构](#%E4%BA%86%E8%A7%A3%E4%B8%9A%E5%8A%A1%E6%9E%B6%E6%9E%84) * [架构全景](#%E6%9E%B6%E6%9E%84%E5%85%A8%E6%99%AF) * [领域名词表](#%E9%A2%86%E5%9F%9F%E5%90%8D%E8%AF%8D%E8%A1%A8) * [寻找高引用 + 高修改](#%E5%AF%BB%E6%89%BE%E9%AB%98%E5%BC%95%E7%94%A8--%E9%AB%98%E4%BF%AE%E6%94%B9) * [第一步:防护网](#%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E9%98%B2%E6%8A%A4%E7%BD%91) * [防护网策略](#%E9%98%B2%E6%8A%A4%E7%BD%91%E7%AD%96%E7%95%A5) * [第一个测试](#%E7%AC%AC%E4%B8%80%E4%B8%AA%E6%B5%8B%E8%AF%95) * [持续集成重构](#%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90%E9%87%8D%E6%9E%84) * [检视测试](#%E6%A3%80%E8%A7%86%E6%B5%8B%E8%AF%95) * [系统架构重构](#%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84%E9%87%8D%E6%9E%84) * [高质量级 DDD 重构:演进驱动的事件风暴](#%E9%AB%98%E8%B4%A8%E9%87%8F%E7%BA%A7-ddd-%E9%87%8D%E6%9E%84%EF%BC%9A%E6%BC%94%E8%BF%9B%E9%A9%B1%E5%8A%A8%E7%9A%84%E4%BA%8B%E4%BB%B6%E9%A3%8E%E6%9A%B4) * [轻量级 DDD 重构:现状驱动的领域方案](#%E8%BD%BB%E9%87%8F%E7%BA%A7-ddd-%E9%87%8D%E6%9E%84%EF%BC%9A%E7%8E%B0%E7%8A%B6%E9%A9%B1%E5%8A%A8%E7%9A%84%E9%A2%86%E5%9F%9F%E6%96%B9%E6%A1%88) * [限界上下文要素](#%E9%99%90%E7%95%8C%E4%B8%8A%E4%B8%8B%E6%96%87%E8%A6%81%E7%B4%A0) * [微服务重构](#%E5%BE%AE%E6%9C%8D%E5%8A%A1%E9%87%8D%E6%9E%84) * [……](#%E2%80%A6%E2%80%A6) * [服务架构重构](#%E6%9C%8D%E5%8A%A1%E6%9E%B6%E6%9E%84%E9%87%8D%E6%9E%84) * [整洁架构](#%E6%95%B4%E6%B4%81%E6%9E%B6%E6%9E%84) * [设计新架构](#%E8%AE%BE%E8%AE%A1%E6%96%B0%E6%9E%B6%E6%9E%84) * [实施新分层架构](#%E5%AE%9E%E6%96%BD%E6%96%B0%E5%88%86%E5%B1%82%E6%9E%B6%E6%9E%84) * [划分类,移动代码](#%E5%88%92%E5%88%86%E7%B1%BB%EF%BC%8C%E7%A7%BB%E5%8A%A8%E4%BB%A3%E7%A0%81) * [技术模块化 => 重搭](#%E6%8A%80%E6%9C%AF%E6%A8%A1%E5%9D%97%E5%8C%96--%E9%87%8D%E6%90%AD) * [中间态分层](#%E4%B8%AD%E9%97%B4%E6%80%81%E5%88%86%E5%B1%82) * [验收条件:构建](#%E9%AA%8C%E6%94%B6%E6%9D%A1%E4%BB%B6%EF%BC%9A%E6%9E%84%E5%BB%BA) * [潜在问题](#%E6%BD%9C%E5%9C%A8%E9%97%AE%E9%A2%98) * [bean 注入](#bean-%E6%B3%A8%E5%85%A5) * [解决冲突](#%E8%A7%A3%E5%86%B3%E5%86%B2%E7%AA%81) * [同步 API 修改](#%E5%90%8C%E6%AD%A5-api-%E4%BF%AE%E6%94%B9) * [对齐新分层架构](#%E5%AF%B9%E9%BD%90%E6%96%B0%E5%88%86%E5%B1%82%E6%9E%B6%E6%9E%84) * [公共代码重构](#%E5%85%AC%E5%85%B1%E4%BB%A3%E7%A0%81%E9%87%8D%E6%9E%84) * [它真是个 util 吗?](#%E5%AE%83%E7%9C%9F%E6%98%AF%E4%B8%AA-util-%E5%90%97%EF%BC%9F) * [过度设计](#%E8%BF%87%E5%BA%A6%E8%AE%BE%E8%AE%A1) * [重新定义:消除二义性](#%E9%87%8D%E6%96%B0%E5%AE%9A%E4%B9%89%EF%BC%9A%E6%B6%88%E9%99%A4%E4%BA%8C%E4%B9%89%E6%80%A7) * [类进行内聚](#%E7%B1%BB%E8%BF%9B%E8%A1%8C%E5%86%85%E8%81%9A) * [划分技术部分](#%E5%88%92%E5%88%86%E6%8A%80%E6%9C%AF%E9%83%A8%E5%88%86) * [划分业务部分](#%E5%88%92%E5%88%86%E4%B8%9A%E5%8A%A1%E9%83%A8%E5%88%86) * [职责少 => 平级](#%E8%81%8C%E8%B4%A3%E5%B0%91--%E5%B9%B3%E7%BA%A7) * [业务代码多 => 再按业务拆分](#%E4%B8%9A%E5%8A%A1%E4%BB%A3%E7%A0%81%E5%A4%9A--%E5%86%8D%E6%8C%89%E4%B8%9A%E5%8A%A1%E6%8B%86%E5%88%86) * [模块重构](#%E6%A8%A1%E5%9D%97%E9%87%8D%E6%9E%84) * [组件聚合三原则](#%E7%BB%84%E4%BB%B6%E8%81%9A%E5%90%88%E4%B8%89%E5%8E%9F%E5%88%99) * [打破包之间的依赖关系](#%E6%89%93%E7%A0%B4%E5%8C%85%E4%B9%8B%E9%97%B4%E7%9A%84%E4%BE%9D%E8%B5%96%E5%85%B3%E7%B3%BB) * [依赖倒置](#%E4%BE%9D%E8%B5%96%E5%80%92%E7%BD%AE) * [更好的面向对象](#%E6%9B%B4%E5%A5%BD%E7%9A%84%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1) * [清理垃圾代码](#%E6%B8%85%E7%90%86%E5%9E%83%E5%9C%BE%E4%BB%A3%E7%A0%81) * [模型重构](#%E6%A8%A1%E5%9E%8B%E9%87%8D%E6%9E%84) * [聚合行为](#%E8%81%9A%E5%90%88%E8%A1%8C%E4%B8%BA) * [由内到外剥离,由外到内聚合](#%E7%94%B1%E5%86%85%E5%88%B0%E5%A4%96%E5%89%A5%E7%A6%BB%EF%BC%8C%E7%94%B1%E5%A4%96%E5%88%B0%E5%86%85%E8%81%9A%E5%90%88) * [识别模式 1:输入参数](#%E8%AF%86%E5%88%AB%E6%A8%A1%E5%BC%8F-1%EF%BC%9A%E8%BE%93%E5%85%A5%E5%8F%82%E6%95%B0) * [识别模式 2:返回参数](#%E8%AF%86%E5%88%AB%E6%A8%A1%E5%BC%8F-2%EF%BC%9A%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0) * [优化创建](#%E4%BC%98%E5%8C%96%E5%88%9B%E5%BB%BA) * [重命名:统一语言](#%E9%87%8D%E5%91%BD%E5%90%8D%EF%BC%9A%E7%BB%9F%E4%B8%80%E8%AF%AD%E8%A8%80) * [类](#%E7%B1%BB) * [状态](#%E7%8A%B6%E6%80%81) * [方法](#%E6%96%B9%E6%B3%95) * [容器](#%E5%AE%B9%E5%99%A8) * [离心分离模型:消除二义性](#%E7%A6%BB%E5%BF%83%E5%88%86%E7%A6%BB%E6%A8%A1%E5%9E%8B%EF%BC%9A%E6%B6%88%E9%99%A4%E4%BA%8C%E4%B9%89%E6%80%A7) * [提取参数对象](#%E6%8F%90%E5%8F%96%E5%8F%82%E6%95%B0%E5%AF%B9%E8%B1%A1) * [处理过程逻辑](#%E5%A4%84%E7%90%86%E8%BF%87%E7%A8%8B%E9%80%BB%E8%BE%91) * [领域特定语言](#%E9%A2%86%E5%9F%9F%E7%89%B9%E5%AE%9A%E8%AF%AD%E8%A8%80) * [模式重构](#%E6%A8%A1%E5%BC%8F%E9%87%8D%E6%9E%84) * [终止 Singleton](#%E7%BB%88%E6%AD%A2-singleton) * [工厂封装复杂构建](#%E5%B7%A5%E5%8E%82%E5%B0%81%E8%A3%85%E5%A4%8D%E6%9D%82%E6%9E%84%E5%BB%BA) * [重构手法](#%E9%87%8D%E6%9E%84%E6%89%8B%E6%B3%95) * [策略模式提供易变规则](#%E7%AD%96%E7%95%A5%E6%A8%A1%E5%BC%8F%E6%8F%90%E4%BE%9B%E6%98%93%E5%8F%98%E8%A7%84%E5%88%99) * [建造者模式拆解复杂对象](#%E5%BB%BA%E9%80%A0%E8%80%85%E6%A8%A1%E5%BC%8F%E6%8B%86%E8%A7%A3%E5%A4%8D%E6%9D%82%E5%AF%B9%E8%B1%A1) * [工具:自动化识别](#%E5%B7%A5%E5%85%B7%EF%BC%9A%E8%87%AA%E5%8A%A8%E5%8C%96%E8%AF%86%E5%88%AB) * [代码重构](#%E4%BB%A3%E7%A0%81%E9%87%8D%E6%9E%84) * [降低圈复杂度](#%E9%99%8D%E4%BD%8E%E5%9C%88%E5%A4%8D%E6%9D%82%E5%BA%A6) * [手法:提取](#%E6%89%8B%E6%B3%95%EF%BC%9A%E6%8F%90%E5%8F%96) * [手法:内联](#%E6%89%8B%E6%B3%95%EF%BC%9A%E5%86%85%E8%81%94) * [手法:移动](#%E6%89%8B%E6%B3%95%EF%BC%9A%E7%A7%BB%E5%8A%A8) * [方法移至其它类中](#%E6%96%B9%E6%B3%95%E7%A7%BB%E8%87%B3%E5%85%B6%E5%AE%83%E7%B1%BB%E4%B8%AD) * [标准:4 行的方法](#%E6%A0%87%E5%87%86%EF%BC%9A4-%E8%A1%8C%E7%9A%84%E6%96%B9%E6%B3%95) * [重构示例](#%E9%87%8D%E6%9E%84%E7%A4%BA%E4%BE%8B) * [评估](#%E8%AF%84%E4%BC%B0) * [C4 模型展开](#c4-%E6%A8%A1%E5%9E%8B%E5%B1%95%E5%BC%80) * [工具评估](#%E5%B7%A5%E5%85%B7%E8%AF%84%E4%BC%B0) * [代码统计](#%E4%BB%A3%E7%A0%81%E7%BB%9F%E8%AE%A1) * [基本情况评估](#%E5%9F%BA%E6%9C%AC%E6%83%85%E5%86%B5%E8%AF%84%E4%BC%B0) * [代码坏味道评估](#%E4%BB%A3%E7%A0%81%E5%9D%8F%E5%91%B3%E9%81%93%E8%AF%84%E4%BC%B0) * [架构评估](#%E6%9E%B6%E6%9E%84%E8%AF%84%E4%BC%B0) * [API 评估](#api-%E8%AF%84%E4%BC%B0) * [API 架构图](#api-%E6%9E%B6%E6%9E%84%E5%9B%BE) * [高引用 + 高修改分析](#%E9%AB%98%E5%BC%95%E7%94%A8--%E9%AB%98%E4%BF%AE%E6%94%B9%E5%88%86%E6%9E%90) * [测试](#%E6%B5%8B%E8%AF%95) * [重构策略](#%E9%87%8D%E6%9E%84%E7%AD%96%E7%95%A5) * [架构重构](#%E6%9E%B6%E6%9E%84%E9%87%8D%E6%9E%84) * [分层重构](#%E5%88%86%E5%B1%82%E9%87%8D%E6%9E%84) * [模型重构](#%E6%A8%A1%E5%9E%8B%E9%87%8D%E6%9E%84-1) * [代码重构](#%E4%BB%A3%E7%A0%81%E9%87%8D%E6%9E%84-1) * [自动化重构](#%E8%87%AA%E5%8A%A8%E5%8C%96%E9%87%8D%E6%9E%84) * [数据库重构(TBC)](#%E6%95%B0%E6%8D%AE%E5%BA%93%E9%87%8D%E6%9E%84%EF%BC%88tbc%EF%BC%89) * [数据库回归测试:数据不变性](#%E6%95%B0%E6%8D%AE%E5%BA%93%E5%9B%9E%E5%BD%92%E6%B5%8B%E8%AF%95%EF%BC%9A%E6%95%B0%E6%8D%AE%E4%B8%8D%E5%8F%98%E6%80%A7) * [前测试](#%E5%89%8D%E6%B5%8B%E8%AF%95) * [后测试](#%E5%90%8E%E6%B5%8B%E8%AF%95) * [引入数据库迁移工具](#%E5%BC%95%E5%85%A5%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%81%E7%A7%BB%E5%B7%A5%E5%85%B7) * [迁移源数据](#%E8%BF%81%E7%A7%BB%E6%BA%90%E6%95%B0%E6%8D%AE) * [汲取式重构:存储过程转换](#%E6%B1%B2%E5%8F%96%E5%BC%8F%E9%87%8D%E6%9E%84%EF%BC%9A%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B%E8%BD%AC%E6%8D%A2) * [重构之后:工具的问题](#%E9%87%8D%E6%9E%84%E4%B9%8B%E5%90%8E%EF%BC%9A%E5%B7%A5%E5%85%B7%E7%9A%84%E9%97%AE%E9%A2%98) * [架构守护](#%E6%9E%B6%E6%9E%84%E5%AE%88%E6%8A%A4) * [架构守护测试](#%E6%9E%B6%E6%9E%84%E5%AE%88%E6%8A%A4%E6%B5%8B%E8%AF%95) * [坏味道守护](#%E5%9D%8F%E5%91%B3%E9%81%93%E5%AE%88%E6%8A%A4) * [测试驱动开发](#%E6%B5%8B%E8%AF%95%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91) * [完善基础设施](#%E5%AE%8C%E5%96%84%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD) * [重构之后:解决人的问题](#%E9%87%8D%E6%9E%84%E4%B9%8B%E5%90%8E%EF%BC%9A%E8%A7%A3%E5%86%B3%E4%BA%BA%E7%9A%84%E9%97%AE%E9%A2%98) * [代码写得烂](#%E4%BB%A3%E7%A0%81%E5%86%99%E5%BE%97%E7%83%82) * [养成优秀的开发习惯](#%E5%85%BB%E6%88%90%E4%BC%98%E7%A7%80%E7%9A%84%E5%BC%80%E5%8F%91%E4%B9%A0%E6%83%AF) * [人员能力提升](#%E4%BA%BA%E5%91%98%E8%83%BD%E5%8A%9B%E6%8F%90%E5%8D%87) * [练习项目](#%E7%BB%83%E4%B9%A0%E9%A1%B9%E7%9B%AE) * [培训教程](#%E5%9F%B9%E8%AE%AD%E6%95%99%E7%A8%8B) * [典型问题](#%E5%85%B8%E5%9E%8B%E9%97%AE%E9%A2%98) * [重构之后:流程的问题](#%E9%87%8D%E6%9E%84%E4%B9%8B%E5%90%8E%EF%BC%9A%E6%B5%81%E7%A8%8B%E7%9A%84%E9%97%AE%E9%A2%98) * [流程优化](#%E6%B5%81%E7%A8%8B%E4%BC%98%E5%8C%96) * [需求规范化](#%E9%9C%80%E6%B1%82%E8%A7%84%E8%8C%83%E5%8C%96) * [实例化需求](#%E5%AE%9E%E4%BE%8B%E5%8C%96%E9%9C%80%E6%B1%82) * [行为驱动开发(BDD)](#%E8%A1%8C%E4%B8%BA%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91%EF%BC%88bdd%EF%BC%89) * [重构之后:提炼知识](#%E9%87%8D%E6%9E%84%E4%B9%8B%E5%90%8E%EF%BC%9A%E6%8F%90%E7%82%BC%E7%9F%A5%E8%AF%86) * [知识仓库](#%E7%9F%A5%E8%AF%86%E4%BB%93%E5%BA%93) * [重建知识仓库](#%E9%87%8D%E5%BB%BA%E7%9F%A5%E8%AF%86%E4%BB%93%E5%BA%93) * [问题是什么?](#%E9%97%AE%E9%A2%98%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F) * [为什么我们需要重构?](#%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E4%BB%AC%E9%9C%80%E8%A6%81%E9%87%8D%E6%9E%84%EF%BC%9F) * [重构到微服务](#%E9%87%8D%E6%9E%84%E5%88%B0%E5%BE%AE%E6%9C%8D%E5%8A%A1) * [未来](#%E6%9C%AA%E6%9D%A5) * [追求技术卓越。](#%E8%BF%BD%E6%B1%82%E6%8A%80%E6%9C%AF%E5%8D%93%E8%B6%8A%E3%80%82) * [推动个人变革,进而引领组织变革](#%E6%8E%A8%E5%8A%A8%E4%B8%AA%E4%BA%BA%E5%8F%98%E9%9D%A9%EF%BC%8C%E8%BF%9B%E8%80%8C%E5%BC%95%E9%A2%86%E7%BB%84%E7%BB%87%E5%8F%98%E9%9D%A9) * [整理知识,加强教育](#%E6%95%B4%E7%90%86%E7%9F%A5%E8%AF%86%EF%BC%8C%E5%8A%A0%E5%BC%BA%E6%95%99%E8%82%B2) * [在整个流程中将价值创造最大化](#%E5%9C%A8%E6%95%B4%E4%B8%AA%E6%B5%81%E7%A8%8B%E4%B8%AD%E5%B0%86%E4%BB%B7%E5%80%BC%E5%88%9B%E9%80%A0%E6%9C%80%E5%A4%A7%E5%8C%96) ## 再说遗留系统重构 > 当你试图对工作方式进行这些改进时,政治斗争可能抬起它丑陋的头——《拥抱变革:从优秀走向卓越的 48 个组织转型模式》 4 年前,也就是 2016 年,我一直在思索着如何更好的构建软件?如何更好的重写软件系统?思索出了 RePractise 七步曲,顺带着写了那本《全栈应用开发:精益实践》。书中,对于遗留系统的建议,便是**重写**。 而在我的最近一本书《[前端架构:从入门到微前端](https://book.douban.com/subject/33477112/)》中,我提及到了五种前端架构的改进方式:更新、迁移、重构、重写、重搭。重写,依旧是我推荐的主要方式,技术栈老旧、旧有代码不规范。 可是呢,随着岁月的流失,我发现重写并不能大部分的解决问题。 我总以为,编写软件的的人会随着年龄的增长,写出更好的软件系统。然而,软件开发者在经历到了 3 ~ 5 年的职业编码之后,有些成为了技术管理者,写不下去的转行、在线炒粉去了,还有的 `return true` 成为了销售……,剩下的,还有那个不断接锅的 Tech Lead(还在继续写代码)。就好像韭菜一样,总可以吃掉新鲜的,总会由新的人来开发新的系统。所以,《重构:改善既有代码的设计》总是能割到一波又一波的韭菜 —— 那个会重构的人,代码写得少了。 时过境迁,我对软件开发又有一些新的领悟:重构比重写更有挑战性。或许是重写和新写没有区别,或者是经历了一个个系统的重构过程,我大抵是明白了:**哪来的和旧系统划清界线**。系统腐烂时,没有人能说清整个系统,甚至于一半的功能都相当的困难。与此同时,或许系统的用户对系统的功能比你更加了解。因为,你会从他们那收到 bug 的反馈:以前不是有这个功能吗,非常好用 —— 用户可能会骗你,他/她经常用那个功能,但是那个功能是存在的。 从旧系统中汲取知识,一个逃离不了的话题,一个永远的痛。系统重构并不是一个简单的活,我们要不断地平衡:业务开发与重构过程,并尽量保证业务优先。它还涉及到一系列的软件开发实践: - 创建重构防护网,保证重构过程的安全性 - 可随时继续的重构演进策略 - 评估 - API 设计合理性评估 - 模块分层架构 - 架构合理度评估与对应的改进方案 - 公共代码的拆分策略 - 面向过程代码转面向对象 - 代码坏味道识别与代码重构 - 合适的设计模式替换旧的散弹式修改 - …… 也因此,在先前提到的 5 种方式中,重构可以说是最难的一种。设计新的架构很容易,但是要重构到设计模式,重构到领域驱动设计,重构到整洁的架构,并不是一件容易的事情。你需要持续不断地练习,但是这样的机会并不多。 可重构到最后,我们还会再回过头来看这些问题。我们的重点应该是:解决提出问题的人。正是那些能力不够的开发人员,导致了我们的系统需要一次大规模的重构。 那么,正确的做法,应该是在日常的开发中不断重构,并引入技术债看板,不断优化和解决这些技术债。故而,技术债管理优于重构。 ## 为什么重构? > 重构(名词):对软件内部结构的一种调整,目的是在不改变软件可观察行为的前提下,提高其可理解性,降低其修改成本。 重构(动词):使用一系列重构手法,在不改变软件可观察行为的前提下,调整其结构。 从定义上来说,重构意味着,我们不能改变现有软件的行为,你的 bug 还应该是 bug。只是呢,我们可以顺带着修复这个 bug,但是它绝不能冠上重构的名义。如此一来,怕是会被人误解。 既然,不添加新的功能,也不减少现有的功能,那对于业务系统来说有什么价值呢? > 重构的唯一目的就是让我们开发更快,用更少的工作量创造更大的价值。—— 《重构:改善既有代码的设计》 所以,总的来说,重构是为了 `¥¥¥`。如果不能创造更多的价值,那么你在扯什么犊子的重构。但是,这种价值往往都不是直接体现。 ### 重构的动机 我知道你已经熟悉了这些说辞,而我也是复制过来的: - 改善既有代码的设计。副标题是最好的说明。 - 帮助找到软件中的 bug。review 旧有代码的过程中,会发现一些不符合业务的代码。 - 提升开发效率。让代码易于扩展 - 提高编程的趣味性——《重构与模式》 我也懒得打了。 ### 重构不一定能带来什么? > 重构的投入与回报并非呈线性关系。—— 《领域驱动设计:软件核心复杂性应对之道》 人们总以为重构能带来: - **更少的代码**。 - **更稳定的系统**。 - …… 它们都是**可能**带来的效果,而不是一定会。如: - 当我们拆分一个上帝类的时候,我们可能拆出了三个类、四个类,因为那些 import、package、type 的 declaration,反而带来了更多的代码。 - 而当我们发现重复代码,并且它们是可被抽象的,那么我们就可以消去一半的代码。 - 如果我们在重构的过程中,发现 bug,那么必然系统会更加稳定。 - 而如果因为我们重构,导致别人合并代码时发生冲突,反而可能会带来 bug。 - …… 我们是基于一系列的假设,才有了对应的结果描述。 而尽管我们达不成上述的好处,但我们仍然可以追求: - **编程的技艺**。稳定的业务代码,便容易选择合理的识别设计模式。 - **重构的手法**。是的,如果你持续练习的话。 - **持续重构的意识** 。我们真正意识到烂代码带来的问题。 - **模式和原则**。遇到相似的情况时,可以用相似的重构手法。 - **抽象能力**。后期总结,往往比前期更易于实践。 总的来说,它带来了更好的效果。 ### 重构是一种文化 日常的开发中,如果你说出你要重构的时候,有人对此挑战的话,那么说明需要培养相应的文化 —— 程序员的匠艺。好的代码不是一把写出来的,而是持续的演进和重构出来的 如果有开发人员,经常提出需要重构的时候,你要看看是否真的合理。 持续在在日常开发中进行小重构,应该是开发人员的一种**自我修养**。 ### 大规模重构的时机 对于大规模重构来说 ,一个最为常见的例子是:在接手别人或者别的系统的代码。觉得原有的代码不符合现有团队的风格,不满足再有的开发习惯。但是,根据我的观察,开发人员往往只是在改造系统,而非真正意义上的重构。 把握重构的时机是很难的一件事情,特别是如果你要进行大的系统改动,如果没有出现真正的痛点。那么,即使我们觉得诸多设计不合理的地方,我们往往可能并不被允许重构,也没有时间进行重构。可一旦连业务人员,也觉得系统需要重构的时候,那么系统也许需要重写了。 即便于对未来有价值,我们也仍需要等待更合适的时机,如:代码库拆分、整洁架构中的领域层拆分等等。我们都知道它们带来的好处,但是我们尚没有那么迫切。反而,因为拆分,我们可能会带来额外的重构成本和维护成本。如我之前在重构 [Coca](https://github.com/phodal/coca) 的时候,我在拆分 domain 层的时候,显得没有价值。我花了一两天的时间,把依赖于操作系统的部分,从代码中剥离了出去。我只是在试验 domain 层的好处,但是我并没有办法直接证明它的好处。 直到,我开始为 Coca 添加 WASM 支持的时候,编译成功了。并且,拆分之后,构建出来的 wasm 包的大小减少到原来的一半,因为有大量的依赖是我所不需要的。如果按正常的重构逻辑,应该是在我们在未来计划添加 WASM 的时候,架构师才允许我们拆分出来。 我们不应该做大规模预先的设计,也不应该过度的设计;我们也没有理由做大规模的预先重构设计,准备好方案,在时间恰当的时候,实施方案。 ### 说清重构的价值 重构,无法在短期内创造价值,哪怕是创造了大量的价值,它也难以**直接**体现出来。它可以提升代码的可读性,可维护性……,但是总的来说,它是在以特定的方式降低系统的维护成本。 再说说可维护性,比如,你使用了更好的设计模式代替了复制、粘贴,它可能还不如原来的代码生成器好用。开发的过程快了,维护就是一坨屎。所以,我说没有维护过旧系统的人,不懂得重构的好处。白天不懂得夜的美。 既然如此,让我们就再考虑一下重构的价值。我想了很久这个问题,直到我从《遗留系统重构指南》看到一些示例: | 阶段 | 描述 | 业务价值 | |------|-------------------------|----------------------| | 0 | 初步重构。定义组件接口,将组件拆分为独立的 jar | 清晰的接口能增加代码的可维护性 | | 1 | 重写身份认证。更改密码的存储方式 | 更好地遵守数据安全法规 | | 2 | 重写搜索组件。切换到不同的搜索引擎实现 | 搜索结果质量更好。用户更容易找到产品 | | 3 | 重构推荐组件。 | 可以快速地切换不同的算法 | 不过,仍旧存在大量的难以描述的价值——至少我是不知道从何说起。这里的代码、架构有坏味道,得去重构,便是我,一个工程师的思维。只是呢,真正有意义的业务价值,都是 TBC……。 尽管我们说,重构尽量不要影响业务开发,但是如果正在开发的功能部分,有较大的问题。那么,我们不得不调整策略,优先支持这部分的功能,而不是等完成后,再花费时间来对它们进行重构。 ## 系统重构模式与原则 > 设计模式强调为开发大规模系统提供可复用的设计指南。 —— 《反模式:危机中软件、架构和项目的重构》 就重构的基本原则来说,倒也不是很复杂: - 小步前进。走一小步,提交一次代码,方便回滚,有一天你会懂的。 - 随时可用。如果不能保证随时可用,那就说不上是重构了。 - 融入日常。 当你习惯了重构,记得在日常工作中使用。 ### 重构模式:EPDCA 我尝试从书中找到一个合适的模式,但是都没有发现符合我的步骤。便在 PDCA 的前面加了个 E,代表了 evaluate: 1. 识别需要重构的地方 2. 制定重构计划, 3. 执行计划的重构任务 4. 使用测试对重构是否影响业务功能进行检察 5. 调整下一次重构策略 对系统进行大规模重构的过程中,最难的地方在于识别,因为代码坏味道多的地方不一定是价值最高的。寻找你的价值曲线,寻找价值高、实施难度低的部分,是最体现你价值的地方。 ### 四级重构 实践的过程中,我们以拆解的方式,一步步由系统架构到代码级拆分。在某次吃饭的过程中,我发现不太对劲。我明明用的是敏捷式的重构方式,而非瀑布模式。它对应于四个不同的重构级别: - **架构重构**。在不改变业务逻辑的情况下,根据单一职责和依赖倒置原则的思想:对系统进行模块拆分与合并,以明确职责降低耦合度;对包进行重新规划,划分包之间的边界,减少代码间的耦合。 - **模型重构**。在包含测试的情况下,通过识别和发现模型的行为,将行为聚合到模型中:根据方法名称、参数、返回判定内聚到模型中;从流程梳理是否符合业务场景 。 - **模式重构**。对于特定代码坏味道产生的问题,通过结合架构模式、设计模式来提升可读性。如:使用工厂模式统一管理对象的创建;使用策略模式降低复杂度。 - **代码重构**。对于一些小的代码坏味道,可以通过 IDE 重构来快速改善即有代码,而不会影响到业务功能。如:复杂条件语句的提取;使用参数对象重构参数过多。 对应的模式如下图所示: ![四级重构](https://migration.ink/images/refactoring-levels.png) 这一点倒是与我们设计系统的时候,采用的《[架构金字塔](https://www.phodal.com/blog/architecture-pyramid/)》颇为一致的: ![架构金字塔](https://migration.ink/images/architecture-primard.jpg) ### 小步前进 **小步前进,拉一下最新的代码。** 不论改动的大小,一旦变动的文件多了,如移包、重命名用得广泛的类等等,记得随时提交。 多说无益,步子迈大的时候,你就会回到这句话上。 ### Git 工作流 如果你们使用的版本控制工具,还不是 Git 话,那么你们可能需要好好反思一下,为什么会到现在的这种地步? #### Master 机制 或许因为我合作的同事主要是 ThoughtWorks 的员工,所以在项目合作上,代码水平并不会太差;或许因为我能容忍那些年轻的开发人员犯的错。 我是一个喜欢用 master 分支的开发人员,主要是作为一个 Tech Lead,我并不想成为一个专职的 code reviewer。 所以,在 master 分支上重构,对于每个人都是一个极大的考验。有没有足够的测试覆盖?有没有足够的工程支持?有没有配合的团队合作? #### PR 机制 对于采用 pull request / merge request 机制的团队来说,重构并不会一帆风顺。 对于大的重构来说,如目录调整,你还能在花点时间重做。如果是代码重构,一旦重来的话,你可能会忘记你到底修改了什么。 也经常不得不找个夜深人静的时间,加会班,提交上代码。 所以,当你采用 PR 机制的时候,记得做一下笔记,写写你打算怎么改。 ## 建立远景与方向 TBD ### 拉通:对齐目标 会遇到不一样的需求,有的是明确的重构需求,有的则是隐藏在需求之后,有的则是看上去没有而已。 ### 明确潜在风险 你懂的。 ### 人评估 并非所有的人都具备足够的能力参与到重构的过程中。 所以,在我们进入重构之前,需要: - 确保对方有足够的能力 - 确保和对方对于重构有共同的看法 - 确保对方能配合你工作 为此,需要一些培训,又或者是激烈的讨论。 他/她们需要具备以下的基本技能: - 理解面向对象设计 - 了解设计模式 - 了解写测试的重要性 - 了解为什么要重构 - 追求代码质量 当然了,在了解的基本上有更深入的理解也是不错的。 ### 重构范围 对于一个大的系统来说,系统的每一部分并非都是等价的。 系统的核心就是系统的 core domain(核心域),一个有能力的管理者,能识别到哪一部分是系统的核心组成,并为它分配最好的开发人员;与此同时,对于支撑的部分来说,管理者只会分配少数的核心开发人员,只用于确保功能能按期完成。 按照 DDD 的思想来看,就是核心域、支撑域、通用域的区别。 ### 产出物 #### KPI 度量 #### 重建规范 #### 团队赋能 #### 原则与模式 ## 重构评估与度量 在接触代码之前,我们可以通过一些现成的工具,来对现有的项目进行一些不评估,并通过度量来提供指标。 ### 识别技术债务 > 对于技术债务,它的利息表现为系统的不稳定性,以及由于临时性手段和缺乏合适的设计、文档工作和测试带来的不断攀升的维护成本。 —— 《软件架构师应该知道的 97 件事》 如 Robert Nord 提出的 “技术债务全景图”(Tech Debt Landscape) 所示: ![技术债全景图](images/tech-debt-landscape.png) 技术债对于软件的影响:可维护性(Maintainability)、可演进性(Evolvability),而这些技术债对于非技术人员来说都是不可见的。它们源于生活,藏于黑暗中。 #### 技术债风暴 在重构开始之前,我们可以进行技术债的头脑风暴,收集每个开发人员每迫切解决的技术痛点。并按照优先级来评估这些技术债,列入我们的重构范围中。 如我的同事在《[技术债治理的四条原则](https://insights.thoughtworks.cn/managing-technical-debt/)》 一文中所介绍的,我们可以在对应的限界上下文里,可视化技术债: ![Classified Technical Debt Mapping](images/tech-debt-mapping.png) 再根据 “核心领域优于其他子域” 的原则,及其严重程度,来划分出技术债的优先级。 #### 架构评估:技术驱动 vs 业务驱动 如我在那篇 《[分层架构重构](https://www.phodal.com/blog/refactor-mvc-architecture-to-ddd/)》 中所说,在大量的现有系统中,我们发现了 MVC 架构模式被落地为三层分层架构(controller-service-model)。开发人员对它们的错误等同,导致了架构上的一系列错误。 对于简单的系统来说,CSM 的包结构问题不大。或者说,对于非常简单的系统来说,大泥球架构也没有问题。我们所针对的是那些中大规模的系统。在这些系统里,系统并非一次性的,开发出来就不再维护了。因此,它们需要对更合适的架构设计和包的拆分分。 借助于 [Tequila](https://github.com/newlee/tequila) 这样的架构可视化工具,又或者是 `coca arch`,便可以得到项目的调用关系图,它可以在某种层面上反应出系统的架构。根据它,我们可以知道: - 项目的结构划分是否合理 - 查看项目的代码中是否存在循环依赖的情况 结果如下图所示: ![Coca Call Graph](images/coca-call.png) 通过调用关系图,我们也可以查看类之间、包之间是否存在相互依赖。 #### 代码评估:收集 bad smell 对于这部分内容来说,你可以直接采用成熟的商业工具,如 SonarQube 便可以完成这方面的工作。 你也可以通过 `coca bs` 来做一些简单的 Bad Smell 收集: ```json { "dataClass": [ { "File": "examples/api/BookController.java", "BS": "dataClass" } ], "lazyElement": [ { "File": "examples/api/model/BookRepresentaion.java", "BS": "lazyElement" } ] } ``` 而后,再生成对应的重构建议。 #### 收集 Todo 代码中的 Todo 注释,是一些本应该发生的事情,本应该做好,但是我没有立即去做。换句话来说,Todo 都是项目中的技术债务,就了可能就永远不会做。 所以,我们需要有工具来查找项目的 Todo,如笔者编写的 Coca,可以寻找代码中的 Todo,包含其对应的日期、作者、提交信息、文件名及对其的行数等信息: | MESSAGES | FILENAME | LINE | |--------------------------------|--------------------------------------------------------------------------------------|------| happens on macosx, don't know why | .../ContributedLibraryTableCellJPanel.java | 118 Make this a method of Theme | .../ContributedLibraryTableCellJPanel.java | 233 Do a better job in refreshing only the needed element | .../LibraryManagerUI.java | 241 Do a better job in refreshing only the needed element | .../LibraryManagerUI.java | 273 Make this a method of Theme |.../MultiLibraryInstallDialog.java | 149 happens on macosx, don't know why | .../ContributedPlatformTableCellJPanel.java | 183 show error error when importing. ignoring :( | .../Base.java | 2423 Improve / move error handling |.../Editor.java | 1541 Should be a Theme value? |.../EditorHeader.java | 78 Should be a Theme value? |.../EditorStatus.java | 73 Improve decoupling | .../EditorTab.java | 465 随后,我们只需要根据真实的情况,更新项目中的 Todo,以确认出我们需要完成的技术债务。 不过,写好一个 Todo 并不是容易,万一以后大家都不写了呢? #### 测试和文档评估 关于测试的话题,我们会有一个大的专题来介绍相关的活动。 至于文档的缺乏,会在文中的最后介绍。 不过,你也可以参考我的那篇《[构建质量可信的软件系统](https://www.phodal.com/blog/build-trusted-software-system/)》 来对你的文档进行评估。 ### 项目评估 根据不同的项目,侧重点有所不同。 但是毫无疑问地,我们可以统计: - 功能的 bug 率,对应的 bug 修改时间 - bug 常见的问题 - …… 你都懂的。我暂时就不 copy 了。 ### 编写工具评估 在我遇到的一个重构项目中,项目中经常抛出Null Pointer Exception的问题。于是,我便写了一个简单的工具,来查找项目中返回Null Pointer Exception的代码,并对调用的地方进行评估。 随着评估的进一步深入,我在工具中加入了更多的功能,如: - 静态方法多,难以进行测试。要么是工具类过多,需要抽取基础设施;要么就是缺乏 OO 设计,导致过程性代码……。 - Util 过多,同上。 - Null Pointer Exception越多,则项目的出错可能性越多。 - 类方法数的标准差,能判断出对应的上帝类情况。 - 方法长度的标准差,越大则意味着方法的长度都比较长,方便于重构。 只需要运行 `coca evaluate`,就能得到以下的结果: | TYPE | COUNT | LEVEL | TOTAL | RATE | |--------------------------------|-------|-----------------------|-------|-----------| | Nullable / Return Null | 0 | Method | 1615 | 0.00% | | Utils | 7 | Class | 252 | 2.78% | | Static Method | 0 | Method | 1615 | 0.43% | | Average Method Num. | 1615 | Method/Class | 252 | 6.408730 | | Method Num. Std Dev / 标准差 | 1615 | Class | - | 7.344917 | | Average Method Length | 13654 | Without Getter/Setter | 1100 | 12.412727 | | Method Length Std Dev / 标准差 | 1615 | Method | - | 20.047092 | 笑,你只要加强使用 TDD,那么上述的大部分问题,都能得到进一步的缓解。 ### 代码评估工具 Java 世界流行的几个找问题工具: - FindBugs/SpotBugs - PMD/CPD - Checkstyle 试试你就知道了。 ### 真实的测试覆盖率 尽管有越来越多的项目将测试覆盖率作为一项考核指标。但是,对于诸多编程实践本身就好的公司为说,测试覆盖率也往往不是真的。 我们编写测试的其中一个目的是用于快速反馈,即当我们的功能出现问题的时候,我们可以快速通过测试来定位到问题所。然而,如果那些是没有断言的测试,那么我们就无法通过它来进行快速反馈。即,如果我们重构过程中,修改了某一块的功能,可能会进一步导致出现 bug。 为此,你可以借助于 Coca 的 Test Bad Smell 功能,来找到对应的问题。只需要执行 `coca tbs`,便能帮助你找到代码中的坏味道。它可以在你进入重构之前,帮你看看是否有对应的风险。 如下是 Coca 扫描出来的 Arduino 开源项目测试问题: | TYPE | FILENAME | LINE | |---------------------|---------------------------------------------------------------|------| | DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java | 107 | | DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java | 41 | | DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java | 63 | | RedundantPrintTest | app/test/cc/arduino/i18n/I18NTest.java | 71 | | RedundantPrintTest | app/test/cc/arduino/i18n/I18NTest.java | 72 | | RedundantPrintTest | app/test/cc/arduino/i18n/I18NTest.java | 77 | | DuplicateAssertTest | app/test/cc/arduino/net/PACSupportMethodsTest.java | 19 | | DuplicateAssertTest | app/test/processing/app/macosx/SystemProfilerParserTest.java | 51 | | DuplicateAssertTest | app/test/processing/app/syntax/PdeKeywordsTest.java | 41 | | DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java | 57 | | DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java | 83 | | DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java | 109 | 好在上述的测试代码中,没有出现诸如于下面场景的测试坏味道: - EmptyTest。测试函数里空空如也 - UnknownTest。测试中没有对应的断言 - IgnoreTest。测试是被 Ingore 的,即不会运行的测试。 如果你的代码中出现了大量的上述问题,你需要好好反思一下,你的测试覆盖率是真实的吗? ### 可测试性评估 代码本身是缺乏测试的,那么它就是一个遗留系统。 ### 度量 根据《精益软件度量》对于度量的定义: - 度量在组织上下文中形成的一系列共识 - 将经验性模型转换为向量化模型(修改) - 包含人、流程、组织和工具的一个动态系统 TBD #### 度量缺陷 ### 寻找专业人士 你懂的。 ## 重构准入条件 看标题就够了。 ### 工具准备 ### 重构看板 ### 版本控制 ### 自动化重构工具 ### 持续集成环境 ### 记录 ## 探索性重构:可行方案 我喜欢重构的那种感觉 —— 把一坨烂代码,驯服成更易于阅读的代码。 ### 准备知识:坏味道的模式 软件开发是一种团队活动,当组织**缺乏强有力的**新鲜血液时,代码便会以相同的模式编写。该组织设计出来的架构,也从某种意义上出现了大量的趋同 —— 创新反而可能不好。在这种统一的模式之下,组织的代码也会呈现相似的坏味道。代码中的坏味道的模式也往往极为相似。 也因此,我们能快速地通过一小部分代码,了解整个项目的情况。 为此,我们只需要根据《重构:改善既有代码的设计》一书提出的 23 种代码坏味道,整理出系统中的常见坏味道。 | 集合类型 | 坏味道 | |---------|---------------| | 代码臃肿 | 过长函数,过大的类,基本类型偏执,过长参数列,数据泥团 | | 滥用面向对象 | Switch 声明,临时字段,被拒绝的遗赠,异曲同工的类 | | 变革的障碍 |发散式变化,霰弹式修改,平行继承体系 | | 非必要的 | 冗余类,纯稚的数据类,重复代码,夸夸其谈的未来性,注释 | | 耦合 | 不完美的类库,依恋情结,狎昵关系,消息链,中间人 | 随后,我们便能有针对性地对代码进行重构。 #### C4 模型 C4 Model 是一个非常不错的架构可视化工具,它从系统 System、容器 Container、组件 Component 和代码 Code 四个层次,由顶至底来介绍系统的架构: ![C4 模型](images/c4-model.jpg) 所以,我们可以根据 C4 模型的思路来查看整个应用的架构设计和代码情况。 ### 探索模式 #### 1. 从分层架构到具体代码 - 代码库间关系 - 代码库内模块化结构 - 模块化包结构 - 包内代码结构 #### 2. 从外部适配器到内部适配器 举个例子,从 API 入手: - Controller - Service - Model - DAO #### 3. 查看测试情况 - 是否包含单元测试 - 是否包含集成测试 - 测试覆盖率情况 - 测试编写情况 #### 4. 针对于最复杂的情形和最简单的情形 1. 从最简单的场景出发,对常规流程、包间关系有一定的了解 2. 从复杂的场景收尾,看最复杂的场景下会有什么问题 3. 根据需要寻找一个适合的场景, #### 工具:API 列表和调用关系 针对于那些使用 Spring 框架的后端项目来说,可以尝试使用 `coca api` 来生成项目 API 调用图。 ### 构建领域知识 作为一个碳基生物,我们要承认我们并非是全知的。我们所能做的事,来到一个新的领域时,能快速学习相关的知识。 #### 了解业务架构 > 高水平的软件架构师不仅要懂技术,还要掌握问题空间对应的业务领域知识。—— 《软件架构师应该知道的 97 件事》 #### 架构全景 简单来说,就是你知道对系统有一个初步的认知,它包含了:业务架构、技术架构、开发组成等等。 #### 领域名词表 根据开发人员介绍的各种概念,抽象出一份系统的领域名词表。它的来源是: - 项目的相关开发文档 - 项目中的架构资源 - 项目的代码 - …… 也因此,当你需要到一个新的项目实施重构计划时,一定需要有一个能与你结对编程的人。一个领域专家,一个代码专家,双方的无间配合,才能快速落地完成重构工作。 我们所要做的一个努力是,让文档、架构、元模型概念与代码实现一一对齐。这并不是一件容易的事情。从大多数项目的实践来看,架构师的设计和模型的实现往往是脱离的。因为设计架构的人和实现模型的人,往往不是同一些人。 我正在尝试根据它来编写这样的一个功能,但是它不是一件容易的事。只是呢,已经有一个小的雏形,通过 `coca concept` 从函数名称中抽取出部分的对应模式 | WORDS | COUNTS | |-------------|---------| | blog | 15 | | publish | 7 | | entity | 6 | | domain | 5 | | published | 5 | | resource | 4 | | criteria | 4 | 但是,这只能是构建领域名词表的一个 hello, world,并不足以承担起真正的领域名词活动,也无法构建真正的领域名词表体系。 除此,我还在寻找一种更高效的构建领域特定语言方式,它用于帮助我们高效地进行软件开发,这种社会学活动。 ### 寻找高引用 + 高修改 经常修改的代码,并不是见得是件好事。我们可以从中看到一些代码的坏味道,把它朝合适的方便引进,如类库,如包内聚等等 ![高引用 + 高修改](images/refs-change.png) 如果你使用的是 Git,可以通过 `coca git -t` 识别到高修改的文件: | ENTITYNAME | REVSCOUNT | AUTHORCOUNT | |---------------------------------------------------------------------------------------------------------------------|-----------|-------------| | build.gradle | 1326 | 36 | | src/asciidoc/index.adoc | 239 | 20 | | build-spring-framework/resources/changelog.txt | 187 | 10 | | spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java | 170 | 10 | | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java | 159 | 15 | | src/docs/asciidoc/web/webmvc.adoc | 121 | 24 | | spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java | 118 | 9 | | src/dist/changelog.txt | 118 | 9 | | spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java | 116 | 15 | 上述的代码是 Spring Framework 中最常修改的文件,前面三个文件看上去是合理的,但是 ``AnnotationUtils.java`` 显然有问题。 对应的 ``DefaultListableBeanFactory.java`` 也有 2000+ 行左右的规模。 从代码的行数和修改次数来看,它们都是上帝类,并且经常出现 Bug。 下表是 Spring 源码中引用最多的方法: | REFS COUNT | METHOD | |------------|------------------------------------------------| | 2086 | org.springframework.util.Assert.notNull | | 952 | org.apache.commons.logging.Log.debug | | 773 | org.springframework.util.Assert.state | | 666 | org.apache.commons.logging.Log.isDebugEnabled | | 482 | org.apache.commons.logging.Log.trace | | 425 | org.springframework.util.StringUtils.hasText | | 398 | org.apache.commons.logging.LogFactory.getLog | | 392 | org.apache.commons.logging.Log.isTraceEnabled | | 268 | org.springframework.util.StringUtils.hasLength | | 213 | org.springframework.util.Assert.isTrue | 从代码上来看,还是 Util 方法被引用得最多。似乎我们仍然需要一个更可靠的算法,来保证被引用的正常度。 ## 第一步:防护网 尽管对于某些部分的重构来说,我们只是移动一下代码的位置 —— 如分层架构的调整,它不需要我们编写对应的测试。但是呢,出于流程完整性的考虑,这一步步往往流程比较长,毕竟它可以减少系统中 bug 的出现,降低重构的风险。与此同时,这是可以由团队一起协作完成的工作,特别适合于多人的协同重构方式。 ### 防护网策略 为了**保证对外暴露的 API 好的**,即我的重构不影响 API 的使用方,我们需要设计一个合适的防护策略。 在设计的时候,我们采用的是测试金字塔来帮助我们搭建测策略。我们会从下(单元测试)向上(集成测试)一步步搭建测试策略。 ![测试金字塔](images/test-primard.png) 而当我们重构的时候,我们则是自顶向下设计防护策略。常见的测试策略有 - 框架/模式库测试。xUnit,xMock,如 Java 语言里的 JUnit, Mockito;JavaScript 中的 Jest - 端到端 API 测试。JMeter,Postman,Rest Assured,Karate - UI 集成测试。Protractor 考虑到测试即文档,在实现实现的时候,会配合一些支持自然语言描述的框架,如: - 文档式测试,Gauge (主流语言),Concordion(Java) - BDD 测试,Cucumber(主流语言) - ATDD 测试,Robot Framework(Python 语言) 为了与运行客户端一配合,我们还需要有底层 API 来控制浏览器、客户端应用: - Appium。移动 APP 和桌面应用,支持主流语言 - Selenium。Web 浏览器,支持主流语言 - Puppeteer。Node.js API 操作 Chrome 浏览器 关于 APP 测试方案,可以参考我之前写的《[【架构拾集】移动应用的自动化测试(BDD 方式)](https://www.phodal.com/blog/phodal-architecture-101-mobile-appllication-test-architecture/)》 根据现有的 E2E(端到端)/集成测试框架的架构,我画了一个大致的测试策略分层架构图: ![测试架构](images/test-arch.png) 选择适合你们团队的测试架构,然后编写你的第一个测试。 ### 第一个测试 这个就简单了: 1. 选择方案,然后 Google 2. 寻找最简单的情形,编写测试 3. 只需要有了第一个,剩下的就是时间问题。 Done! ### 持续集成重构 如果你还没有持续集成环境的话,那么请搭建它。 考虑到这是一个体力活,而且这方面的资料已经足够的多,我就不浪费大家的时间了。 顺带一提,如果你的分支比较多,而且构建比较多,那么你可以考虑 `pipeline as pipeline` 的方式进行构建。 ### 检视测试 某次代码重构中,我发现代码的测试覆盖率很高,过程中出了一些错误,重构手法不正确是一个问题。但是在重构的过程中,发现有些测试都是没有意义的,所以这让我意思到在构建防护网的时候,有必要审视一遍测试,查找测试代码中的坏味道。 > 测试代码坏味道,是指单元测试代码中的不良编程实践(例如,测试用例的组织方式,实现方式以及彼此之间的交互方式),它们表明测试源代码中潜在的设计问题。 常见的测试坏味道有: - 空的测试。测试是生成的,但是没有内容。 - 忽略的测试。即测试被 Ignore - 没有断言的测试。为了测试覆盖率而出现的测试 - 多余的 Println。调试时留下的讯息。 - 多重断言。每个测试函数只应该测试一个概念。 - …… 有兴趣进一步了解的话,可以阅读《[测试代码的坏味道](https://www.phodal.com/blog/test-bad-smell/)》。 也可以 `coca tbs` 来查找测试中的坏味道: | TYPE | FILENAME | LINE | |---------------------|---------------------------------------------------------------|------| | DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java | 107 | | DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java | 41 | | DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java | 63 | | RedundantPrintTest | app/test/cc/arduino/i18n/I18NTest.java | 71 | | RedundantPrintTest | app/test/cc/arduino/i18n/I18NTest.java | 72 | | RedundantPrintTest | app/test/cc/arduino/i18n/I18NTest.java | 77 | | DuplicateAssertTest | app/test/cc/arduino/net/PACSupportMethodsTest.java | 19 | | DuplicateAssertTest | app/test/processing/app/macosx/SystemProfilerParserTest.java | 51 | | DuplicateAssertTest | app/test/processing/app/syntax/PdeKeywordsTest.java | 41 | | DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java | 57 | | DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java | 83 | | DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java | 109 | ## 系统架构重构 > 架构将大问题分解为容易处理的小问题。——《架构师修炼之道 》 重量级 DDD 更多的是结合现状 + 未来出发,更多的人参与,提供准确的信息。 轻量级 DDD 则是通过现状,只需要少数熟悉的人,没有完成一致的达成,通过**持续性赋能**改善模型。 产品线 / 业务线来说,并非每一个子系统都是核心域,也不会投入大量的人和精力在上面。特别是,当你在重构的时候,投入的人员和精力不足以实施一个合理的事件风暴,以完成对应的领域驱动设计活动。所以,我们只能尽可能完善系统的设计。 ### 高质量级 DDD 重构:演进驱动的事件风暴 它意味着,重构时需要有: 1. 积极专注的团队参与 2. 复杂的场景 3. 领域专家参与协作 4. 迭代式的模型设计 为此需要: 1. 事件风暴 2. 识别上下文 3. 梳理上下文关系 4. 划分问题子域 5. 识别弹性边界 6. 领域建模 7. 分层架构 对应的我们需要: 1. 重搭架构 2. 编写集成测试 3. 搬移代码 4. …… 考虑到其复杂性,我建议采用《事件风暴设计工作坊》来完成相关的流程。 ### 轻量级 DDD 重构:现状驱动的领域方案 有意思的一个现象是,在真正落地的时候,对于核心的系统往往会抱着比较谨慎的态度 —— 除非原来的模式真的有问题。又或者是,所处的部门不是系统的核心部门时,在投入在会出现一定的问题。 看图: ![Quick ES](images/quick-ddd.png) 相应的步骤如下: 1. 结合工具识别所有的接口 2. 通过接口识别出领域名词(聚合、实体等) 3. 分析接口设计是否合理 4. 通过领域名词划分上下文边界 5. 重新定义领域名词 6. 结合领域名词划分新的 API 7. 划分领域和分层架构 8. 重新划分分层架构 9. 重构 service 代码,剥离领域逻辑 10. 重构代码到领域模型 对于未采用 Swagger 等 API 管理工具的项目,可以通过 `coca api` 生成 API 列表: ``` GET /aliyun/oss/policy POST /aliyun/osscallback GET /subject/list GET /esProduct/search GET /order/list GET /productAttribute/list/{cid} GET /productCategory/list/{parentId} GET /brand/list GET /esProduct/search/simple ... ``` ### 限界上下文要素 包含相关上下文的: - 实体(entity)。只要一个对象在生命周期中能够保持连续性,并且独立于它的属性(即使这些属性对系统用户非常重要),那它就是一个实体。它具有唯一标识和生命周期。 - 值对象(value object)。当你只关心某个对象的属性时,该对象便可作为一个值对象。它是实体的附加业务概念,用来描述实体所包含的业务信息。 - 领域服务(domain service)。封装了没有在模型中自然建模为值对象或实体的领域逻辑和概念。它的主要职责是使用实现和值对象编排业务逻辑。 - 领域事件(domain event)。它用于表明问题域中发生了一些业务人员关心的事情。在命名领域事件时,我们往往选择动词的过去分词,以明确表达事件的属性,其中文形式往往是『XXX已YYY』。 - 资源库(repository)。公开聚合根在内存中的集合的接口,提供聚合根的检索和持久化需要。 - 工厂(factory)。即在实体或者值对象创建复杂时,可以委托给工厂(模式)进行创建。。 - 聚合(aggregate)。是一种边界内的领域对象的集群,可以将其视为一个单元。可以封装一个到多个实体与值对象,用来维护该边界范围之内的业务完整性。 ### 微服务重构 一旦涉及到对微服务进行重构的时候,我们有很大的可能性要对系统进行 API 的重构设计。它也意味着,我们可能会影响到 API 的使用方,如果 API 也是自己内部的系统,那么问题就不是太大;如果 API 的使用方是第三方团队的系统时,我们就需要考虑一下兼容方案。这种兼容方案会在一定程度上影响到我们的重构,甚至于我们有可能不对做这方面的重构。 重构到微服务是一个巨大的挑战。 微服务是一个生态系统,它需要大量的基础设施进行配合,如部署管道、服务注册与发现、日志和监控、负载均衡等。 如果团队本身没有相关的经验,并且尝试往上调整的话,那么需要在心理上做好大量的准备。 如果你的目标是重构到微服务架构,那么我建议你先重构到 DDD + 整洁架构,它是微服务架构的一个中间态。即,先看看容器架构重构。 ### …… 待定。 由于笔者在这方面的经验不是非常丰富,但是我知道这里仍然有非常多的内容,可以探索。 欢迎大家来 pull request。 ## 服务架构重构 **小步前进,拉一下最新的代码。** 我在设计之初,想把标题改为容器架构重构,它对应上 C4 模型。纠结之后,我还是改为了服务架构。可见,命名之难。 ### 整洁架构 ![整洁架构](images/full-clean-architecture.png) Robert C. Martin 总结了六边形架构(即端口与适配器架构)、DCI (Data-Context-Interactions,数据-场景-交互)架构、BCI(Boundary Control Entity,Boundary Control Entity)架构等多种架构,归纳出了这些架构的基本特点: - 框架无关性。系统不依赖于框架中的某个函数,框架只是一个工具,**系统不能适应于框架**。 - 可被测试。业务逻辑脱离于 UI、数据库等外部元素进行测试。 - UI 无关性。不需要修改系统的其它部分,就可以变更 UI,诸如由 Web 界面替换成 CLI。 - 数据库无关性。业务逻辑与数据库之间需要进行解耦,我们可以随意切换 LocalStroage、IndexedDB、Web SQL。 - 外部机构(agency)无关性。系统的业务逻辑,不需要知道其它外部接口,诸如安全、调度、代理等。 如图所示 Clean Architecture 一共分为四个环,四个层级。环与环之间,存在一个依赖关系原则:**源代码中的依赖关系,必须只指向同心圆的内层,即由低层机制指向高级策略**。其类似于 SOLID 中的依赖倒置原则: - 高层模块不应该依赖低层模块,两者都应该依赖其抽象 - 抽象不应该依赖细节,细节应该依赖抽象 与此同时,四个环都存在各自核心的概念: - 实体 Entities (又称领域对象或业务对象,实体用于封装企业范围的业务规则) - 用例 Use Cases(交互器,用例是特定于应用的业务逻辑) - 接口适配器 Interface Adapters (接口适配器层的主要作用是转换数据) - 框架和驱动(Frameworks and Drivers),最外层由各种框架和工具组成,比如 Web 框架、数据库访问工具等 这个介绍可能有些简单,让我复制/粘贴一下更详细的解释: **实体(Entities)**,实体用于封装企业范围的业务规则。实体可以是拥有方法的对象,也可以是数据结构和函数的集合。如果没有企业,只是单个应用,那么实体就是应用里的业务对象。这些对象封装了最通用和高层的业务规则,极少会受到外部变化的影响。任何操作层面的改动都不会影响到这一层。 **用例(Use Cases)**,用例是特定于应用的业务逻辑,一般用来完成用户的某个操作。用例协调数据流向或者流出实体层,并且在此过程中通过执行实体的业务规则来达成用例的目标。用例层的改动不会影响到内部的实体层,同时也不会受外层的改动影响,比如数据库、UI 和框架的变动。只有而且应当应用的操作发生变化的时候,用例层的代码才随之修改。 **接口适配器(Interface Adapters)**。接口适配器层的主要作用是转换数据,数据从最适合内部用例层和实体层的结构转换成适合外层(比如数据持久化框架)的结构。反之,来自于外部服务的数据也会在这层转换为内层需要的结构。 **框架和驱动(Frameworks and Drivers)**。最外层由各种框架和工具组成,比如 Web 框架、数据库访问工具等。通常在这层不需要写太多代码,大多是一些用来跟内层通信的胶水代码。这一层包含了所有实现细节,把实现细节锁定在这一层能够减少它们的改动对整个系统造成的伤害。 ### 设计新架构 根据不同项目的实际情况,在真正落地的时候,会存在一些细微的差距。 如我的同事 [@huleTW](https://github.com/huleTW) 在 [django-ddd-demo](https://github.com/huleTW/django-ddd-demo) 项目中使用的 Python + Django 下的 DDD 分层架构如下所示: - **apis**:放各种 url 的 dispatcher - **application**:放各种 use case,use case 只能访问 domain 里面的 domain service - **domain**:放各个聚合,各个聚合里面有一个 domain service,domain service 操作可以聚合根,包含业务逻辑 - **infrastructure**:放读取数据(服务,中间件),以及公共的 util 包 我的同事 [@howiehu](https://github.com/howiehu) 在 [DDD Architecture Samples](https://github.com/howiehu/ddd-architecture-samples) 项目中使用了整洁架构分层如下: ``` ├── adapters 适配器 │   ├── inbound 入站适配器 │   └── outbound 出站适配器 ├── application 应用层 │   ├── concepts │   ├── dto │   ├── gateway │   └── usecases 用例 └── domain 领域层 ├── contexts 限界上下文 └── core 核心概念 ``` 因此对于整洁架构的外部适配器,人们通过有多种叫法 interfaces、apis、facades、presentation、adapters 等等, 而诸如 application、domain 和 infrastructure 来说,命名上倒是没有太大的区别。但是在实现上还是有相当大的区别: **粘合层(service)**。在 application 中的粘合层倒是有不同的叫法 service(application service)、usecases、interactors。但是在真正实施的时候,还会有巨大的差别,采用 service 可能会出现上帝类,于是就出现用例驱动的 xxxUsecase。 **瘦 application vs 胖 application**。采用 PresentationDomainDataLayering 架构,即瘦 application 层,会把用例放在 domain 中;而采用胖 application 架构,则会把 usecase 放在 application 中。两者的使用场景的区别,主要取决于 CRUD 的**纯净度**。如果你有 BFF,那么瘦 application 层适合于你;如果你是单体,又或者是跨实体操作多,那么胖 application 层适合你。 不过,这些都不重要,重要的是要不要出现尖叫架构 —— 一看就懂得业务: ![尖叫架构](images/screaming-architecture.png) 你只需要回答一个问题,你的场景复杂吗?复杂的话,你就拆 —— 将复杂问题繁杂化。 ### 实施新分层架构 实施新分层架构是一个持续的过程,它需要配合后续的各种重构模式。 #### 划分类,移动代码 这一步我们所做的是:移动旧的 service、controller、model 为竖直 + 水平架构。 对于大单体应用来说,从分层架构上,移到新的架构并不难:按各种层级创建应用,移动代码。 对于微服务架构应该来说,这一步也不算麻烦。 #### 技术模块化 => 重搭 对于原先模块划分不合理的应用来说,如: ``` ├── pom.xml ├── zheng-api-common │   └── pom.xml ├── zheng-api-rpc-api │   └── pom.xml ├── zheng-api-rpc-service │   └── pom.xml └── zheng-api-server └── pom.xml ``` 因为包、类之间本身是根据技术维度来划分的,如果我们计划以业务维度重新开发时,便就得创建新的目录结构,再移入新的类包。但是这样做的一个问题是,中间存在一个不可恢复的状态,会在一定程度上影响重构效果。 ### 中间态分层 考虑到服务重构的难度,它会存在着一个长期的中间态分层架构。原因有很多: - 无法短期内重构完 - 未拆到正确位置的 API - 领域层中的 repository 未拆分 所以,可以考虑将瘦 application 层作为中间态架构。 ### 验收条件:构建 是的,在这一步里,由于只是移动文件,所以只需要执行一下构建,你就能验证移动文件是否正确。 不过,由于有 IDEA 这样的工具上,想必不是问题。 然而,要是代码库过于庞大,那么我建议你试试 `coca refactor`。 ### 潜在问题 #### bean 注入 #### 解决冲突 #### 同步 API 修改 #### 对齐新分层架构 ## 公共代码重构 **小步前进,拉一下最新的代码。** > 创建通用的共享组件导致了一系列问题,比如耦合、协调难度和复杂度增加。 当我看到一个个巨大的 common 包时,我开始痛恨 `common`、`base`、`util` 这些该死的包,还有它们目录下统一管理的 `bean`。我们真的已经把它们用烂了,所以你应该重新审视一下你的项目代码。 所以,从这种意义上来说:**复用与低耦合**,本身存在一定的互斥关系。 公共代码往往缺乏抽象,又或者是追求过度的复用。 ### 它真是个 util 吗? > 哦,不,它是个恶魔,因为它是 util。 你会往 xxUtil 不加思索地扔入逻辑,正如你会往 common/bean 中扔入所有的 model,直次有一天,你拥有一个巨大无比的 base、common 代码。 大多数情况下,所有和业务相关的 Util 都存在一定的问题,如 CaptchaUtil,它要么应该划到自己的上下文中去,要么扔到诸如于 domain/shared 等共享上下文,而不是和其它 util 放到一起。 而诸如 FileUtil、DateUtil、RedisUtil、JdbcUtil 这些都可以说是基础设施相关的部分,它们可以划到 infrastructure/file 又或者是 infrastructure/date 目录下,而不是统一的管理这些 util。 如 [StackOverflow](https://stackoverflow.com/questions/1866794/naming-classes-how-to-avoid-calling-everything-a-whatevermanager) 的相关问题所列,我们还有诸如 Coordinator、Builder、Writer、Reader、Handler、Container、Protocol、Target、Converter、Controller、View、Factory、Entity、Bucket 等名称。 含义更加丰富的名字启示如下: **XXX器[拟物化]:** | Listener 监听器 | Adapter 适配器 | Filter 过滤器 | Iterator 迭代器 | Buffer 缓冲器 | Connector 连接器 | | ---------------------- | ---------------- | --------------------- | ------------------- | ------------------- | -------------------------- | | Decortor 装饰器 | Iterepter 解释器 | Interceptor 拦截器 | Reactor 反应器 | Configurator 配置器 | Wrapper 包装器 | | Proactor 主动器 | Monitor 监视器 | Controller 控制器 | Translator 转换器 | Acceptor 接收器 | Selector 选择器 | | Container 容器 | Manager 管理器 | Evictor 驱逐器 | Activator 激活器 | Mapper映射器 | Locator 定位器 | | Handler 处理器 | Assembler 汇编器 | Driver 驱动器 | Spliterator 分割器 | Builder 构建器 | Formatter 格式器 | | Scanner 扫描器 | Timer 定时器 | Converter 转化器 | Dispatcher 分配器 | Multicaster 广播器 | Transfer 传输器 | | Desriptor 描述器 | Encoder编码器 | Decoder 解码器 | Introspector 内省器 | Tokenizer 分词器 | Loader 加载器(ClassLoader) | | Logger 记录器 | Parser 解析器 | Resolver 分解器 | Incrementer 增加器 | Counter 计数器 | Collector 收集器 | | Initializer 初始化器 | Setter 设置器 | Getter 取值器 | Marshaller 编组器 | UnMarshaller 解组器 | Helper 帮助器 | | Accessor 访问器 | Visitor 访问器 | Reflector 反射器 | Embedder 嵌入器 | Finalizer 回收器 | Specifier 标识器 | | Supplier 供应器 | Processor 处理器 | Joiner 接合器 | Recorder 记录器 | Reducer 归集器 | Analyzer 分析器 | | Invoker 调用器 | Provider 供应器 | Renderer 渲染器 | Holder 持有器 | Closer 关闭器 | Operator 操作器 | | Appender 添加器 | Printer 打印器 | Tuplizer 元组器 | Caller 调用器 | Identifier 标识器 | Walker 漫步器 | | Brower 浏览器 | Server 服务器 | Aggregator 聚合器 | Binder 绑定器 | Validator 校验器 | Finder 查找器 | | Launcher 发射器/启动器 | Weaver 织入器 | Messenger 信差/消息器 | Extractor 提取器 | Sampler 取样器 | Profiler 优化器 | | Tracer 追踪器 | Estimator 预估器 | Generator 生成器 | Instrumenter 插装器 | Viewer 查看器 | Debugger 调试器 | | Analyser 分析器 | Inspector 检查器 | Linker 链接器 | Editor 编辑器 | Recognizer 识别器 | Decompiler 反编译器 | | Translator 解释器 | Lexer 词法分析器 | Tracker 追踪器 | Constructor 构造器 | Destructor 析构器 | Executor 执行器 | | Synchronizer 同步器 | Barrier 障碍器 | Allocator 分配器 | Bundler 打包器 | Applier 分发器 | Trigger 触发器 | **XXX者[拟人化]:** | Consumer消费者 | Producer 生产者 | Observer 观察者 | Caller 调用者 | Supervisor 监管者 | Keeper 管理员(ZooKeeper) | | -------------- | --------------- | --------------- | ------------- | ----------------- | ------------------------ | | Wokrer 工作者 | | | | | | 器和者的一些名字可以互换。比如Builder 可以是构建器,也可以是构建者。名字选择很多,但是不要过度封装,用最简单的概念表现更多的含义。 试着干掉 Utils ,你将收获更多的类,笑~。 Utils / Helper 多数是恶魔,无法满足单一职责和开闭原则。好的 OO 设计,大部分的类只表示一个事物,及其所有属性和操作。 1. 尽可能减少 Utils / Helper 类。好的 OO 设计,大部分的类只表示一个事物,及其所有属性和操作。 2. 如果使用一个 Utils 用于操作类,如 IList,那么它应该划到类中。除非该类不存在于当前的应用中。 3. Utils 中的方法应该是无状态的,比如没有 static 变量。 4. 如果有大量的 Utils 方法,应该把划分到类中,以便快速找到它们。 ### 过度设计 好的设计是尽可能简单的,它最易于适应新的设计,并能跟随业务的变化而变化。 - 开发人员:『这个功能是给未来准备的』 - Tech Lead:未来是多久?一个月后?半年后? - 开发人员:…… ![](images/balanced-design.png) 图片出自:https://stackoverflow.com/questions/1001120/what-is-over-engineering-as-applied-to-software 与之相对应的设计不足,则是因为经验的缘故。 ### 重新定义:消除二义性 当我们谈论 service 的时候,我们谈论的是同一个 service 吗? 当我们谈论 model 的时候,我们谈论的是同一种 model 吗? > 若对于一个文法的某一句子存在两棵不同的语法树,则该文法是二义性文法。 如果有多种不同类型的类,都被放置在 model 包下。那么,你应该消除 model 这个包,改为更表意的名称,如 Entity、Request、Response 等等。同理,一旦你们展开对某个名称的讨论时,是时候好好考虑其中的二义性。 最后,你还需要有一个相关领域的名词表。 避免产生二异性的词语。 ### 类进行内聚 参考下文中的模型重构。 ### 划分技术部分 如 Spring 框架的源码: ``` └── springframework ├── cache │ ├── annotation │ ├── concurrent │ ├── config │ ├── interceptor │ └── support ├── context │ ├── annotation │ ├── config │ ├── event │ ├── expression │ ├── i18n │ ├── index │ ├── support │ └── weaving ``` ### 划分业务部分 业务模块中的技术部分。 #### 职责少 => 平级 ``` └── orm ├── context ├── support ``` #### 业务代码多 => 再按业务拆分 ``` infrastructure └── repository ├── context │ ├── blog │ ├── advert │ └── pages ├── kafka ``` ## 模块重构 **小步前进,拉一下最新的代码。** > 模块/组件是软件的部署单元,是整个软件系统在部署过程中可以**独立部署**的最小实体。 —— 《架构整洁之道》 ### 组件聚合三原则 在我们设计软件工程的时候,我们 ![组件聚合](images/components-rules.png) Bob 大叔在书中提到了三个原则: - 复用/发布等同原则(REP)。软件复用的最小粒度等同于其发布的最小粒度。 - 共同闭包原则(CCP)。我们应该将那些会同时修改,并且为相同目的而修改的类放到同一个组件中,而将不会同时修改,并且不会为了相同目的而修改的那些类放到不同组件中。 - 共同复用原则(CRP)。不要强迫一个组件的用户依赖他们不需要的东西。 不过,其实按我的理解,第一条原则讲的是合理、有效的包发布策略;而后两条原则,只需要满足我们的模块/包满足开闭原则、单一职责,就可以合理地解决整个流程了。不过,这三个原则可以合理地解释在软件生命周期中,我们应该如何管理模块。 因此,对于自家的模块只需要:**根据技术、业务划分包,形成上下文边界,防止代码越界**。 ### 打破包之间的依赖关系 这一步理论上来看,倒也是蛮简单的: 1. 从 Gradle / Maven 找到想去除的依赖 2. 全局搜索依赖的包名 3. 解决依赖 - 提取到类库中 - 剥离并使用依赖注入 4. 删除依赖的包 5. 执行构建和 E2E 测试 TBC。工具还在写,目前主要要看人眼识别。 ### 依赖倒置 为此,我们可能需要寻找一些合适的依赖注入框架: - Java。Spring,Dagger 2,Guice 等等 - Go。Facebook Inject、Uber Dig、Google Wire 等 对了,静态语言呢? - 不需要。 #### 更好的面向对象 事实上,如果我们把面向对象做好的话,那么对应的逻辑就会封装到相应的对象中。 ### 清理垃圾代码 未使用的类,未使用方法。 它根本不知道什么时候会使用到,又或者是它已经通过多态来实现。 ## 模型重构 **小步前进,拉一下最新的代码。** > 架构元模型定义了模型中使用的概念和使用规则。 —— 《架构师修炼之道》 你可以将其对比于领域模型。 ### 聚合行为 对于领域模型来说,我们也无法直接在代码中实现架构元模型的所有概念。但是,我们所要做的事不断减少模型与代码之间的差异。如果我们不创建模式,而直接开始编写代码,那么我们会收获一堆上帝类。但是,反过来,当我们有一堆上帝类的时候,那么我们就需要从类中把行为都抽取出来。 当我们的贫血模型,拥有了行为,就可以进一步构成富血模型,符合面向对象(OO)的思想。进一步的,我们可以从业务的角度来考虑这个问题,将充血模型改为领域模型。 #### 由内到外剥离,由外到内聚合 对于那些已经采用 DDD 架构的项目来说,往往会遇到一些领域模型不完整、包含非领域相关代码等的情况。 遇到这种情况时,可以尝试: 1. 由内到外剥离非模型相关代码。只需要浏览一遍领域模型相关的代码,然后剥离不属于模型的代码;通过依赖注入、工厂模式等方式,建立整洁的 domain 层。 2. 由外到内聚合领域模型相关逻辑。这是一个复杂的过程,需要每个使用到模型的调用方,再看是属于领域相关的行为。 第一步可以在短期内快速实现,而第二步则需要一个漫长的过长 —— 取决于项目的大小。 #### 识别模式 1:输入参数 你懂的 #### 识别模式 2:返回参数 你懂的 #### 优化创建 笔者在某个重构项目中,遇到模型的创建逻辑很复杂 —— 参数多、场景多,所以做的第一件事情是:使用工厂模式优化了创建过程。 参考工厂模式。 ### 重命名:统一语言 在 DDD 中强调了统一语言的重要性,为此我们有必要对代码中的模型名称及其行为进行检视。在软件工程实践不好的团队中,你往往会出现**对于同一个事件,往往会有多种命名方式**。哪怕你觉得它是不正确的,因为 ownership 的缺乏,也没有人来统一对应的命名。 所以,在我们决定继续往下走之前,先学习一下怎么命名。 > 计算机科学只存在两个难题:缓存失效和命名。 —— Phil KarIton ![Arlo Belshee 命名的七步骤](images/7_stages_of_naming.png) 原文链接:[naming is a process](https://www.digdeeproots.com/articles/on/naming-as-a-process/) 但是还是更习惯于原来的文章中的: | 阶段 | 解释 | 示例 | |-----|------|------| | 空白 | 没有名称 | doSomething() | | 凑合 | 名称不能准确反应元素的含义| preload() | | 沾边 | 名称至少反映了元素某一方面的功能 | DomSomethingEvilToDB() | | 反映功能 | 名称直接描述了元素的所有功能 | ParseXmlAndStoreFightToDbAndLocalCacheAndStartProcessing() | | 反映角色 | 名称充分地反映了元素在架构中的角色 | StoreFightlightToDatabaseAndStartProcessing | | 反映意图 | 名称不仅反映元素的功能,还能反映其目的。 | BeginTrackingFlight() | | 领域抽象 | 名称超越了单个元素本身,成为一个新的抽象概念。 | MonitoringPanle.Add(new Flight()) | 偶然间,我看到我找到我书架上的《重构与模式》时,刚好看到一本《实现模式》,顺便看了看,发现书的内容对于本文有启发意义。 ![《实现模式》概览](images/implementation-patterns.png) 书中提及了四五种类型类、状态、消息与流(原行为)、方法,但是对于我们的统一语言工作来说,只需要重命名类、方法、状态就够了。 对应的解释如下: #### 类 > 数据的变化比逻辑要繁琐得多,正是这种现象让类有了存在的意义。—— 《实现模式》 对于继承的类来说,它应该遵循这么一些原则: - 超类名称要简单 - 子类名称要合格 #### 状态 状态包含了变量、字段、常量、局部参数、参数、参数对象等等。 #### 方法 > 在命名类和操作时要描述它们的效果和目的,而不要表露它们是通过何种方式达到目。 —— Eric Evans #### 容器 ### 离心分离模型:消除二义性 接下来就是处理剩下的 bean、model 等等模型。 在一个系统中,你会存在这么一些不同的 model: (PS:部分描述可能不准确,欢迎指正) * 与数据库表结构对应的 DO( Data Object)/ PO(Persistant Object)。 * 查询数据的 Query、Request。 * 对外传输的对象:DTO( Data Transfer Object)。 * 业务层之间的数据对象:VO(Value Object) / BO(Business Object)。 * 访问数据库的:DAO (Data Access Object数据访问对象)。 * 以及我们想要的 DDD 中的实体 Entity * 还有其它的 POJO( Plain Ordinary Java Object) 但是它们都是 model,所以它们都被扔到 model 中……,又或者是 bean 中……。导致,你有了一个巨大比的 model 层。 所以,在 DDD 又或者是 Clean Architecture,我们重新命名了不同的模式: * 使用 Command / Request 作为输入参数。其中的 Command 模式在完成后需要发出对应的 Event。 * 使用 Response / DTO / Representation 作为返回结果。 * 对 Entity 大家保持了一致的意见 * 还有 PO / DO 作为作为数据库的存储模型 * DAO 作为数据库的访问模型 * …… 不过,其实你只要不再让使用 model 和 bean,相信会有更多地收获。 ### 提取参数对象 如果一个类包含大量的参数,并且参数中存在一些相似的情形。对于概念统一的情况,可以提取成参数对象。 ### 处理过程逻辑 过程不应该模型的一部分,但是它是领域的一部分。 如 Eric Evans 在所说,区分是否显式表达概念的关键在于:过程是否经常被领域专家谈起,又或者只是计算机程序机制的一部分。 这时候,我们就需要规格(Specification)模式。 ### 领域特定语言 ## 模式重构 > 模式是某种场合下对某个问题的一个解决方案的**一种结构化展现**。 —— Jon Vlissides(GoF 成员)《设计模式沉思录》 **小步前进,拉一下最新的代码。** 不过,人们对于设计模式的看法就变成了砒霜,听上去有害,实际上真香。 我不是想鼓励使用设计模式,只是呢,如开头所说,我想展示的是如何用它来提升代码的可读性。也因此,我们的第一个例子是,干掉反模式的设计模式。 一旦你决定使用某种设计模式的时候,请确保**团队的所有人知道它解决了什么问题?** ### 终止 Singleton > 确保一个类只有一个实例,并提供一个全局访问点来访问该实例。—— 《设计模式:可复用面向对象软件的基础》 单例对象存活的时间通常很长,它们通常存在于程序的整个生命周期中。一个复杂应用可能有很多个单例,会使得上述问题更加严重。 整体来说它的缺点大过优点: 1. 对单例类的依赖被硬编码到其他类中,对具体类的依赖性破坏了OO。 2. 单例对接口不友好。 3. 单例getInstance没有继承性。 4. 多线程情况下有线程安全问题。 ### 工厂封装复杂构建 工厂是领域驱动设计中的重要组件。 工厂的目标: 1. 隐藏创建对象的复杂性 2. 减少对外暴露过多的内部结构 工厂模式是一种创建方法: 1. 工厂方法(factory method) 2. 抽象工厂(abstracty factory) 3. 建造者模式(builder) 值得注意的是:工厂并不总是需要独立的静态类。 尝试使用 `coca suggest` 会有惊喜。 #### 重构手法 对应的手法是: 1. 提取构建步骤到新的构建方法中 2. 将构建步骤方法转为 static 方法 3. 将这个 static 方法移到工厂类中 4. 将旧的构建函数提取成工厂方法 5. 将提取的工厂方法移到类中 6. 内联原有的工厂使用方 ### 策略模式提供易变规则 > 我们需要把过程中的易变部分提取到模型的一个单独的『策略』对象中,将规则与它控制的行为分开。——《领域驱动设计:软件核心复杂性应对之道》 看标题,你懂的。 ### 建造者模式拆解复杂对象 看标题,你懂的。 ### 工具:自动化识别 如 Coca 提供的 `coca suggest`功能,可以对相应的类提供一些建议,如: | CLASS | PATTERN | REASON | |--------|------------------|--------------------------------| | Insect | factory | too many constructor | | Bee | factory, builder | complex constructor, too many constructor, too many parameters | ## 代码重构 > 理想的方法长度不应该超过 4 行代码。—— Robert C Martin 常见的富血模型的类,往往包含了系统的行为。 常见贫血的原因是: 1. 缺乏抽象 2. 过程代码 3. 行为无法附着 4. 未考虑复用 从技巧上来说,主要是**提取、内联与移动**,配合上 IDE 的重构功能和《重构:改善既有代码的设计》,那么剩下的事件就简单了。 如果你缺乏这方面的技巧,欢迎与我们联系。 ### 降低圈复杂度 圈复杂度过大的代码,容易出问题。也因此呢,作为重构的第一步,只需要找一个工具,然后消除即可。 ### 手法:提取 提取分为: 1. 提取参数 2. 提取参数对象 3. 提取变量 4. 提取常量 5. 提取方法 ### 手法:内联 内联上的手法则是: 1. 内联参数 2. 内联变量 3. 内联常量 4. 内联方法 ### 手法:移动 移动的关键不在于 #### 方法移至其它类中 这里的 Ctrl + T 对应于老式的 IDEA 快捷键 Ctrl + Alt + Shift + T 1. 将函数转为静态方法,以解除对外的依赖(可选)(Static Method,Ctrl + T) 2. 将与函数职责无关的部分提取为函数的参数(Extract Functional Parameter,Ctrl + T) 3. 将函数的参数提取为参数对象(Extract Parameter Object,Ctrl + T) 4. 将函数移到参数对象中(Move Instance Method, F6) 完美。 ### 标准:4 行的方法 偶然间在《修改代码的艺术:构建易维护代码的 9 条最佳实践》上看到了那句:『理想的方法长度不应该超过 4 行代码』。 所以,我找出了书架上的那本《代码整洁之道》,找到了出处 32 页。 > 函数不该有 100 行那么长,20 行封顶最佳。 然后就是 Kent Beck 的 Java/Swing 小程序四行的故事。 但是,要保持一个好的习惯,寻找合适的机会去重构它。 ## 重构示例 我正在寻找一个合适的项目来演示如何重构。事实上,我已经找到了一些,但是它们的复杂度不太适合在线教学,所以我正在努力简化出一个可用的版本。 如果你已经迫不急待的话,可以尝试对以下的项目进行重构: - https://github.com/shuzheng/zheng - https://github.com/macrozheng/mall 它们是我在 GitHub 上找到的 Star 数相当多的开源 Java 项目,所以让我们来进行评估吧。 这两个项目的作者在项目中展示了极高的专业性和原则性。无论怎么说,这都是“好代码”,我也并非出于恶意的目的。如果你看了我在 GitHub 上的项目,你也会对我有诸多吐槽。我所尝试去做的是,以专业眼光来检视问题,不多也不少。作为一个追求匠艺的手工艺人,我们应该欢迎别人对我们这么做。只有批评才能让我们学到更多的东西。在进一步的重构之前,我们要再一次感谢两位作者将代码免费给社区的勇气和信心。他们做得相当的好。 相比之下,我大抵就只会复制和粘贴内容。 开始之前,你大可以从 GitHub 上复制这两个项目的其中一个,然后这里的例子以 mall 为例。你可以将 zheng 作为你的练手项目。 ### 评估 这两个项目都有丰富的文档,足够让你搭建好它们的环境。事实上,我觉得你可能不需要这样的操作,你需要打开你的 Intellij IDEA,然后构建一下,就可以阅读代码了。 #### C4 模型展开 首先,让我们以 C4 模型来展开这个项目的代码。 **展开系统目录结构**。从目录结构上来看,mall 系统的组织相当的不错,按业务和通用模块进行了拆分。 ``` ├── mall-common -- 工具类及通用代码 ├── mall-mbg -- MyBatisGenerator生成的数据库操作代码 ├── mall-security -- SpringSecurity封装公用模块 ├── mall-admin -- 后台商城管理系统接口 ├── mall-search -- 基于Elasticsearch的商品搜索系统 ├── mall-portal -- 前台商城系统接口 └── mall-demo -- 框架搭建时的测试代码 ``` **展开其中的一个微服务**。这里以 mall 为例,这是典型的 controller-service-dao 架构: ``` mall-admin ├── bo ├── component ├── config ├── controller ├── dao ├── dto ├── service └── validator ``` 而其中的 `home` 包,又以 **展开包架构**。接着,让我们看看 controller 包下的目录结构,这是按技术划分服务的架构模式: ``` controller ... ├── SmsFlashPromotionController.java ├── SmsFlashPromotionProductRelationController.java ├── SmsFlashPromotionSessionController.java ├── SmsHomeAdvertiseController.java ├── SmsHomeBrandController.java ├── SmsHomeNewProductController.java ├── SmsHomeRecommendProductController.java ├── SmsHomeRecommendSubjectController.java ├── UmsAdminController.java ├── UmsMemberLevelController.java ├── UmsPermissionController.java └── UmsRoleController.java ``` **展开类**。接着,让我们查看一下 OmsOrderReturnApplyController.java 文件,看看最后的接口: ```java @ApiOperation("修改申请状态") @RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST) @ResponseBody public CommonResult updateStatus(@PathVariable Long id, @RequestBody OmsUpdateStatusParam statusParam) { int count = returnApplyService.updateStatus(id, statusParam); if (count > 0) { return CommonResult.success(count); } return CommonResult.failed(); } ```` 用 OmsUpdateStatusParam 封装了请求参数,这个实践相当的不错。 接着,我们进入 `updateStatus` 方法看看: ```java @Override @Override public int updateStatus(Long id, OmsUpdateStatusParam statusParam) { Integer status = statusParam.getStatus(); OmsOrderReturnApply returnApply = new OmsOrderReturnApply(); if(status.equals(1)){ //确认退货 returnApply.setId(id); returnApply.setStatus(1); returnApply.setReturnAmount(statusParam.getReturnAmount()); returnApply.setCompanyAddressId(statusParam.getCompanyAddressId()); returnApply.setHandleTime(new Date()); returnApply.setHandleMan(statusParam.getHandleMan()); returnApply.setHandleNote(statusParam.getHandleNote()); }else if(status.equals(2)){ //完成退货 returnApply.setId(id); returnApply.setStatus(2); returnApply.setReceiveTime(new Date()); returnApply.setReceiveMan(statusParam.getReceiveMan()); returnApply.setReceiveNote(statusParam.getReceiveNote()); } ... ``` 嗯,这是一个典型的贫血模型设计,这些业务逻辑都可以内聚到领域模型中。 所以,我们有了初步的结论,可以尝试的内容: 1. 典型三层架构。可以业务维度重新做分层架构 2. 贫血模型。可以重构到充血模型 ### 工具评估 现在,是时候拿出我的 Coca:https://github.com/phodal/coca #### 代码统计 执行一下 `coca cloc` 可以看看项目的行数统计: ``` ─────────────────────────────────────────────────────────────────────────────── Language Files Lines Blanks Comments Code Complexity ─────────────────────────────────────────────────────────────────────────────── Java 471 80837 16265 2276 62296 1405 XML 112 21710 61 119 21530 0 YAML 12 430 36 8 386 0 Markdown 10 1211 271 0 940 0 JSON 8 1345664 0 0 1345664 0 gitignore 6 119 15 17 87 0 Shell 3 46 0 3 43 0 SVG 2 6132 0 988 5144 0 License 1 201 32 0 169 0 Properties File 1 4 0 0 4 0 SQL 1 2192 143 440 1609 0 ─────────────────────────────────────────────────────────────────────────────── Total 627 1458546 16823 3851 1437872 1405 ─────────────────────────────────────────────────────────────────────────────── Estimated Cost to Develop $55,872,945 Estimated Schedule Effort 70.766444 months Estimated People Required 93.525243 ─────────────────────────────────────────────────────────────────────────────── ``` #### 基本情况评估 先执行一下 `coca analysis`,然后 `coca evaluate`,得到一个基本的情况 | TYPE | COUNT | LEVEL | TOTAL | RATE | |--------------------------------|-------|-----------------------|-------|-----------| | Nullable / Return Null | 21 | Method | 13757 | 0.15% | | Utils | 2 | Class | 604 | 0.33% | | Static Method | 7 | Method | 13757 | 0.01% | | Average Method Num. | 13757 | Method/Class | 604 | 22.776490 | | Method Num. Std Dev / 标准差 | 13757 | Class | - | 52.137890 | | Average Method Length | 46177 | Without Getter/Setter | 11218 | 4.116331 | | Method Length Std Dev / 标准差 | 13757 | Method | - | 2.928149 | 从数据上看,静态方法只有 7 个,返回 null 的情况有 21 个,保持得不错。项目的平均方法长度也还行,就是平均方法有点多。 #### 代码坏味道评估 接着试试 `coca bs -s=type` 来查看代码中的常见坏味道,限于篇幅的原因这里就不复杂了,说主要问题:大的类一共有 72 个,其中 OmsOrderExample.java 类,在没有 set/get 的情况下有 576 个方法。查看了一下引用情况,好像是来看数据库查询用的……: ```java public Criteria andProductSnLike(String value) { addCriterion("product_sn like", value, "productSn"); return (Criteria) this; } ``` 这要重构的话是个体力活,详细见 [coca_reporter/bs.json](coca_reporter/bs.json) #### 架构评估 执行了一下 `coca arch`,由于是扁平的三层架构,没有太多的问题。 #### API 评估 执行 `coca api -c -r com.macro.mall.` 获得基本的 API 列表情况: | SIZE | METHOD | URI | CALLER | |------|--------|------------------------------------------------|--------------------------------------------------------------------| | 5 | GET | /prefrenceArea/listAll | controller.CmsPrefrenceAreaController.listAll | | 5 | GET | /subject/listAll | controller.CmsSubjectController.listAll | | 18 | GET | /subject/list | controller.CmsSubjectController.getList | | 28 | POST | /minio/upload | controller.MinioController.upload | | 13 | POST | /minio/delete | controller.MinioController.delete | | 5 | GET | /companyAddress/list | controller.OmsCompanyAddressController.list | | 18 | GET | /order/list | controller.OmsOrderController.list | | 11 | POST | /order/update/delivery | controller.OmsOrderController.delivery | | 11 | POST | /order/update/close | controller.OmsOrderController.close | | 11 | POST | /order/delete | controller.OmsOrderController.delete | 这里的 size 指的是调用的方法里,这里的 MinioController 的 upload 方法里一共调用了 28 个方法,打开一看: ```java @ApiOperation("文件上传") @RequestMapping(value = "/upload", method = RequestMethod.POST) @ResponseBody public CommonResult upload(@RequestParam("file") MultipartFile file) { try { //创建一个MinIO的Java客户端 MinioClient minioClient = new MinioClient(ENDPOINT, ACCESS_KEY, SECRET_KEY); boolean isExist = minioClient.bucketExists(BUCKET_NAME); ... minioClient.putObject(BUCKET_NAME, objectName, file.getInputStream(), file.getContentType()); LOGGER.info("文件上传成功!"); MinioUploadDto minioUploadDto = new MinioUploadDto(); minioUploadDto.setName(filename); minioUploadDto.setUrl(ENDPOINT + "/" + BUCKET_NAME + "/" + objectName); return CommonResult.success(minioUploadDto); } catch (Exception e) { LOGGER.info("上传发生错误: {}!", e.getMessage()); } return CommonResult.failed(); } ``` 嗯,它可能需要一个 service,而考虑到 Minio 是一个云存储服务器,还需要通过接口来封装这些细节。 #### API 架构图 在生成 API 结果之后,可以打开 `coca_reporter/arch.svg` 查看项目的架构图。不过,由于项目的 API 较多,便需要一个个分析,所以你可以通过 `coca api -c -r com.macro.mall. -a /order` 查看 /order 的所有接口情况: | SIZE | METHOD | URI | CALLER | |------|--------|-----------------------------|-----------------------------------------------------------------| | 17 | GET | /order/list | controller.OmsOrderController.list | | 11 | POST | /order/update/delivery | controller.OmsOrderController.delivery | | 11 | POST | /order/update/close | controller.OmsOrderController.close | | 11 | POST | /order/delete | controller.OmsOrderController.delete | | 5 | GET | /order/{id} | controller.OmsOrderController.detail | | 11 | POST | /order/update/receiverInfo | controller.OmsOrderController.updateReceiverInfo | | 11 | POST | /order/update/moneyInfo | controller.OmsOrderController.updateReceiverInfo | | 11 | POST | /order/update/note | controller.OmsOrderController.updateNote | | 5 | GET | /orderSetting/{id} | controller.OmsOrderSettingController.getItem | | 11 | POST | /orderSetting/update/{id} | controller.OmsOrderSettingController.update | | 5 | POST | /order/generateConfirmOrder | portal.controller.OmsPortalOrderController.generateConfirmOrder | | 2 | POST | /order/generateOrder | portal.controller.OmsPortalOrderController.generateOrder | | 2 | POST | /order/paySuccess | portal.controller.OmsPortalOrderController.paySuccess | | 2 | POST | /order/cancelTimeOutOrder | portal.controller.OmsPortalOrderController.cancelTimeOutOrder | | 5 | POST | /order/cancelOrder | portal.controller.OmsPortalOrderController.cancelOrder | 结果见下图(建议新窗口打开) ![Coca Reporter](coca_reporter/api.svg) #### 高引用 + 高修改分析 执行 `coca count` 可以查看高引用的方法: | REFS COUNT | METHOD | |------------|-----------------------------------------------------------------------| | 8055 | com.macro.mall.model.GeneratedCriteria.addCriterion | | 199 | com.macro.mall.common.api.CommonResult.success | | 125 | com.macro.mall.common.api.CommonResult.failed | | 30 | com.macro.mall.model.GeneratedCriteria.addCriterionForJDBCDate | | 23 | com.macro.mall.common.api.CommonPage.restPage | | 20 | com.macro.mall.model.GeneratedCriteria.addCriterionForJDBCTime | | 17 | com.macro.mall.portal.service.UmsMemberService.getCurrentMember | | 17 | com.macro.mall.model.UmsMember.getId | | 16 | com.macro.mall.service.impl.PmsProductServiceImpl.relateAndInsertList | | 7 | com.macro.mall.portal.domain.OrderParam.getUseIntegration | | 7 | com.macro.mall.portal.domain.OrderParam.getCouponId | 看上去,主要问题还在数据库查询语句拼接那一部分。 执行 `coca git -t` 可以查看经常修改的文件: | ENTITYNAME | REVSCOUNT | AUTHORCOUNT | |---------------------------------------------------------------------------------------------------------|-----------|-------------| | README.md | 121 | 2 | | document/pdm/mall.pdm | 29 | 2 | | document/pdm/mall.pdb | 26 | 2 | | mall-admin/pom.xml | 23 | 2 | | mall-portal/pom.xml | 18 | 2 | | document/sql/mall.sql | 16 | 2 | | mall-portal/src/main/java/com/macro/mall/portal/service/impl/OmsPortalOrderServiceImpl.java | 14 | 2 | | mall-admin/src/main/java/com/macro/mall/controller/PmsBrandController.java | 14 | 2 | | document/reference/deploy-windows.md | 14 | 2 | | mall-search/pom.xml | 14 | 2 | | document/docker/docker-deploy.md | 13 | 2 | 经常修改的地方是 pom 文件和文档,看上去没啥问题。考虑到 `OmsPortalOrderServiceImpl.java` 文件修改了 16 次,我决定打开这个文件看看: 1. 有一个 150 行左右的方法 2. 总行数 643 行 明显这是一个订单相关的上帝类,关联的 OmsOrder 模型有 40 ~ 50 左右的字段。毫无疑问,这里就是代码中经常出现问题的地方。 #### 测试 执行了 `coca tbs`,一共找到了这几个文件 ``` Start parse java call: PmsDaoTests.java Start parse java call: MallDemoApplicationTests.java Start parse java call: MallPortalApplicationTests.java Start parse java call: PortalProductDaoTests.java Start parse java call: MallSearchApplicationTests.java ``` 这个相当于是没有测试吧。 ### 重构策略 1. 进行 DDD 建模 2. 搭建 E2E 测试 3. 引入 Flyway 做数据库迁移 4. 分层架构重构 5. 重构到充血模型 6. …… ### 架构重构 以下内容暂不免费开放。 ### 分层重构 以下内容暂不免费开放。 ### 模型重构 以下内容暂不免费开放。 ### 代码重构 以下内容暂不免费开放。 ## 自动化重构 TBD ## 数据库重构(TBC) > 数据库重构,是对数据库 schema 的一个简单变更,在保持其行为语义和信息语义的同时,改进了它的设计。 —— 《数据库重构》 换言之,你既没有增加新功能,也没有破坏原有的功能,没有添加新的数据,也没有改变原有数据的语义。值得注意的是,尽管你的领域模型发生了变化,但是这也不意味着数据库 schema 需要因此而发生改变;与此同时,一些公司的制度也会限制我们对数据库进行重构。 它们之间的关系如下图所示: ![Modeling](images/modeling.jpg) 如《数据库重构》一书所说:数据库重构是一种数据库实现技术,就像代码重构是一种应用实现技术一样。当我们在不断对代码调优的同时,我们也在不断地对数据库进行调优。 ### 数据库回归测试:数据不变性 #### 前测试 采用传统的数据库测试工具,如 DBUnit,SQLUnit,通过诸如 TDD 的方式来完成对数据库的测试,随后开展对代码的重构。 #### 后测试 为了对重构进行验证,我们需要对数据库进行回归测试。一种常见的做法是: 1. 录制行为数据 2. 通过回复验证功能不被破坏 3. 通过影子流量进行验证 这样的工具有很多,如我司吴大师写的 [DBdiff](https://github.com/XuefengWu/dbdiff),可以用于 Oracle 数据库的迁移。 ### 引入数据库迁移工具 尽管,我并没有实践过大规模的数据库重构,但是和其他/她的后端开发一样,在日常的开发中,我们也时不时会做一些数据库重构 —— 数据库迁移。 - 代码版本控制 - 数据库版本控制 - 多数据识别 诸如于 Flyway 和 Liquibase 都是一些不错的工具。 ### 迁移源数据 我尝试编写脚本来将我的博客 [https://www.phodal.com](https://www.phodal.com) 从 SQLite3 迁移到 MySQL,这并不是一件困难的事情。因为 SQLite3 是一种嵌入式数据库,而我们可以通过 `mysqldump` 出 MySQL 的数据。 如此一来,我们便可以用于做数据库重构练习,并编写数据库的回归测试。 ### 汲取式重构:存储过程转换 对于采用 Oracle 的项目来说,数据重构不是一件容易的事情。它还涉及到一系列的存储过程代码。 所以,我们还可以尝试将 PLSQL 转为 Kotlin 代码:https://github.com/XuefengWu/LADE_Analysis ## 重构之后:工具的问题 ### 架构守护 在重构的过程中,我们也可以尝试将它引入到系统中使用。它可以作为我们的架构适应度函数,不断地见证我们架构的变化和成长 —— 以一种肉眼的方式持续演进。 #### 架构守护测试 ArchUnit 是一个不错的架构守护框架。你可以尝试引入项目的架构中, #### 坏味道守护 我的意思是,只需要集成到持续构建中即可。 ### 测试驱动开发 测试驱动开发适合于解决复杂的问题。 我并不是一个 TDD 的死忠粉,但是我发现 TDD 非常适合于解决复杂问题。在这个场景下,我有一堆事先准备好的 Test Bad Smell,它们拥有一些对应的检测规则,这些规则相互之间存在一些影响。因此,我将这些 Bad Smell 作为我的测试用例: ``` AssertionRouletteTest.java ConditionalTest.java ConstructorInitializationTest.java DuplicateAssertTest.java EmptyTest.java IgnoreTest.java MagicNumberTest.java MysteryGuestTest.java RedundantAssertionTest.java ``` 于是,我可以写出我的第一个测试: ```java func TestTbsApp_EmptyTest(t *testing.T) { g := NewGomegaWithT(t) var codePath = "../../../_fixtures/tbs/code/EmptyTest.java" var result = buildTbsResult(codePath) g.Expect(result[0].Type).To(Equal("EmptyTest")) } ``` 对应的一步步完成出整个功能的代码。而后,我们就可以重构出理想的代码 —— 因为我们已经有了对应的测试。 ### 完善基础设施 ## 重构之后:解决人的问题 我们把所有的问题都归到人的问题。 ### 代码写得烂 如我们所见,我们在不同的公司里,会看到不同的人写出来的代码水平是不一样的。比如有一些是由供应商写的代码 不过,既然给这引起供应商的工资本身就不高,那么怎么能指望出他/她写出好的代码。 与此同时,由于种种原因,教他们学习的成本又特别高,甚至于你还要担心如果你教会了供应商,他/她们可能寻找一个新的工作。 ### 养成优秀的开发习惯 ### 人员能力提升 #### 练习项目 #### 培训教程 #### 典型问题 ## 重构之后:流程的问题 ### 流程优化 我们在开发的前期缺少对于系统的设计,那么我们将需要花费大量的成本在后期修复他们。 你可以查看我先前写的《[新项目检查清单](https://www.phodal.com/blog/new-project-check-lists/)》完善项目的启动流程,通过 [https://phodal.github.io/new-project-checklist/](https://phodal.github.io/new-project-checklist/) 可以使用这个工具。并借助于《[如何创建你的应用脚手架](https://www.phodal.com/blog/how-to-create-application-boilerplate/)》搭建好项目的脚手架。 借助于 Path to Production [优化你的上线流程](https://www.phodal.com/blog/tech-lead-tools-path-to-production/) ![Path to Production](images/path-to-production.png) 工具见:[https://phodal.github.io/path/](https://phodal.github.io/path/) 你可以在我的 Tech Lead 工具箱中,获得更多工具:https://github.com/phodal/techlead ### 需求规范化 #### 实例化需求 #### 行为驱动开发(BDD) > 行为驱动开发是一种敏捷软件开发的技术,它鼓励软件项目中的开发者、QA 和非技术人员或商业参与者之间的协作。 年轻的时候(我刚毕业),我并不懂得 BDD 的好处——相当的繁琐,到了现在我又有一番不一样的体会。思来想去主要的原因是,当时我们是一个全功能的团队,不存在跨部门协作,也因此我并不觉得 BDD 能为我们带来多大的好处。 可是在 ThoughtWorks 公司之外,开发、测试和业务都是各自的部门,有着各自的利益。通过 BDD 的协作方式,可以让交付物有一个一致的观点。 ## 重构之后:提炼知识 ### 知识仓库 预先设计: - 一无是处的代码注释。 - 没有搭建信息的 README。 - 没有版本化的、二进制的项目文档 ### 重建知识仓库 请参考:[构建可信软件系统](https://github.com/phodal/trusted) ## 问题是什么? ### 为什么我们需要重构? 这个问题,就该你回答了:为什么我们需要重构? ## 重构到微服务 重构比重写来得更有价值。重写往往有可能带来更多的技术债,还可能犯上同样的错误。 你为什么不重写呢??? 这样更省时间? ## 未来 未来 10 年,你应当: ### 追求技术卓越。 ### 推动个人变革,进而引领组织变革 ### 整理知识,加强教育 ### 在整个流程中将价值创造最大化 LICENSE --- [![Phodal's Book](http://brand.phodal.com/shields/book-small.svg)](https://www.phodal.com/) © 2020 [Phodal Huang](https://www.phodal.com). This code is distributed under the Creative Commons Attribution-Noncommercial-No Derivative Works 4.0 License. See `LICENSE` in this directory. [![待我代码编成,娶你为妻可好](http://brand.phodal.com/slogan/slogan.svg)](http://www.xuntayizhan.com/person/ji-ke-ai-qing-zhi-er-shi-dai-wo-dai-ma-bian-cheng-qu-ni-wei-qi-ke-hao-wan/)
0
HummerRisk/HummerRisk
HummerRisk 是云原生安全平台,包括混合云安全治理和云原生安全检测。
cloud-custodian cloud-native cloud-native-security compliance compliance-as-code cspm k8s-security kubernetes-security prowler sbom security trivy vulnerability
<p align="center"> <a href="https://hummerrisk.com"> <img src="./hummer-ui/src/assets/img/logo/logo-dark.png" alt="HummerRisk" width="300"/> </a> </p> <h3 align="center"> 云原生安全平台 <a href="https://github.com/hummerrisk/hummerrisk/blob/master/README_EN.md" style="color: #df913c;">[English]</a> </h3> <p align="center"> <a href="https://www.codacy.com/gh/hummerrisk/hummerrisk/dashboardutm_source=github.com&amp;utm_medium=referral&amp;utm_content=hummerrisk/hummerrisk&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/3331d2c045ae4d0ba1fd8fdd623186e7" alt="A"/></a> <a href="https://www.gnu.org/licenses/old-licenses/gpl-3.0"><img src="https://img.shields.io/github/license/hummerrisk/hummerrisk?color=%231890FF&style=flat-square" alt="License: GPL v3"></a> <a href="https://github.com/hummerrisk/hummerrisk/releases/latest"><img src="https://img.shields.io/github/v/release/hummerrisk/hummerrisk" alt=""></a> <a href="https://github.com/hummerrisk/hummerrisk"><img src="https://img.shields.io/github/stars/hummerrisk/hummerrisk?color=%231890FF&style=flat-square" alt=""></a> <a href="https://github.com/hummerrisk/hummerrisk/releases"><img src="https://img.shields.io/github/downloads/hummerrisk/hummerrisk/total" alt=""></a> </p> <hr/> ## HummerRisk 是什么 > HummerRisk 是开源的云原生安全平台,以非侵入的方式解决云原生的安全和治理问题。核心能力包括混合云的安全治理和云原生安全检测。 HummerRisk is an opensource cloud-native security platform. It resolve the cloud-native security and governance issues in agentless way. Core capabilities include hybrid-cloud security and K8S container cloud detection. ![架构](./hummer-ui/src/assets/img/readme/architecturev.png) ## HummerRisk 能做什么 ### **混合云安全治理** * 混合云安全合规检测: 对主流的公(私)有云资源进行安全合规检测,例如等保2.0预检、CIS 合规检查、最佳实践检测、各种基线检测,同时可自定义检测规则; * 云资源态势: 同步云上资源,快速查看混合云的各种资源态势与云资源拓扑图; * 合规报告: 一键获取合规报告,全面掌控安全态势; * 操作审计: 统一监控多云环境上的账号活动,对云上产品和服务的访问和使用行为的操作日志进行审计; * 对象存储: 同步云上对象存储桶资源,查看、上传、下载存储对象。根据对象存储安全与合规要求,快速检测并生成报告。 ![混合云安全合规](./hummer-ui/src/assets/img/readme/multicloud.png) >**优势是什么?** * 支持全面: 支持的几乎所有公有云,包括:阿里云、腾讯云、华为云、火山引擎、百度云、青云、京东云、金山云、七牛云、UCloud、Amazon Web Services、Microsoft Azure、Google Cloud,支持的私有云包括:OpenStack、VMware vSphere,并还在不断的扩充支持的范围; * 容易上手: 只需绑定云账号,就可以一键执行检测; * 灵活便捷: 多种维度查看检测结果,根据需求任务编排; * 开箱即用: 内置大量规则,并且不断迭代新增。用户可以按需自定义规则。 ### **容器云安全** * K8S 资源态势: 可以关联多个 K8S 集群,统一查看各个关联环境的资源态势; * 主机检测: 可以自定义检测内容,发现底层主机、虚机中存在问题; * K8s 检测: 根据 K8S 安全基线进行检测,发现存在的配置错误、安全漏洞、危险动作等内容; * 部署检测: 检测 K8S 的部署编排文件,在部署前发现其中的配置问题; * 镜像检测: 全面检测镜像相关的漏洞,包括操作系统、软件包、应用程序依赖等方面; * 源码检测: 检测开发者的源代码,提前发现其中的开源协议、依赖、漏洞、代码等问题; * 文件检测: 检测源码项目中特定的语言文件或文件夹,发现应用程序依赖的漏洞风险; * SBOM 管理: SBOM 的可视化管理和分析,检测 SBOM 的变更,快速发现和定位软件供应链中的风险和漏洞,给出合理地处理建议。 ![容器云安全](./hummer-ui/src/assets/img/readme/k8s.png) >**优势是什么?** * 兼容性: 支持多种 K8s 发行版; * 独立性: 中立产品,客观检测; * 可靠性: 急速响应,快速准确; * 无侵入:无侵入式检测。 ## UI 展示 ![UI 展示](./hummer-ui/src/assets/img/gif/hummerrisk.gif) > 更多优质功能持续迭代中... ## 快速开始 仅需两步快速安装 HummerRisk: 1. 准备一台不小于 4 核 8 G 内存的 64 位 Linux 主机; 2. 以 root 用户执行如下命令一键安装 HummerRisk。 全球: ```sh curl -sSL https://github.com/HummerRisk/HummerRisk/releases/latest/download/quick_start.sh | sh ``` 中国大陆: ```sh curl -sSL https://download.hummerrisk.com/hummerrisk/hummerrisk/releases/download/latest/quick_start.sh | sh ``` ## 帮助文档 获取更多的产品信息和使用说明,可以访问我们的在线帮助文档 > [帮助文档](https://docs.hummerrisk.com) ## 技术优势 - [x] 开源开放:HummerRisk 遵循 GPL v3 开源协议; - [x] 无侵入式:基于无侵入式的实现方式,快速上手,降低潜在风险; - [x] 支持全面:覆盖云原生环境的多种方面,几乎支持全部云; - [x] 规则丰富:大量内置检测规则,如 CIS 规则,等保2.0 规则等,同时支持自定义规则; - [x] 支持信创:支持在信创环境中部署。 ## 微信群 ![微信群](./hummer-ui/src/assets/img/readme/contact_me_qr.png) ## 公众号 ![公众号](./hummer-ui/src/assets/img/readme/qrcode_gongzhonghao.jpeg) ## 安全说明 如果您在使用过程中发现任何安全问题,请通过以下方式直接联系我们: - 邮箱:support@hummercloud.com ## 技术栈 - [Vue](https://vuejs.org/):使用了 Vue.js 作为前端技术栈 - [Spring Cloud](https://spring.io/projects/spring-cloud):使用了 Spring Cloud 作为微服务框架 - [MySQL](https://www.mysql.com/):使用了 MySQL 作为数据库引擎 - [Cloud Custodian](https://cloudcustodian.io/):使用了 Cloud Custodian 作为云平台检测引擎 - [Prowler](https://prowler.pro/):使用了 Prowler 作为 AWS 检测引擎 - [Trivy](https://github.com/aquasecurity/trivy):使用了 Trivy 作为云原生检测引擎 - [Kube-Bench](https://github.com/aquasecurity/kube-bench):使用了 Kube-Bench 作为 CIS Kubernetes Benchmark 检测工具 - [Element](https://element.eleme.cn/#/):使用了 Element 作为桌面端组件库 ## License Licensed under The GNU General Public License version 3 (GPLv3) (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.gnu.org/licenses/gpl-3.0.html 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
jenkinsci/jenkinsfile-runner
A command line tool to run Jenkinsfile as a function
cli docker-image faas hacktoberfest jenkins jenkins-pipeline jenkinsfile jenkinsfile-runner
null
0
aistrate/AlgorithmsSedgewick
Code from the book Algorithms" (4th ed.) by Robert Sedgewick and Kevin Wayne (original
and my solutions to exercises)."
null
0
lerry903/RuoYi
基于SpringBoot2.1的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖。直接运行即可用
druid-spring-boot-starter hutool mybatis shiro spring-boot swagger2
[![License](https://img.shields.io/github/license/lerry903/RuoYi.svg)](https://github.com/lerry903/RuoYi/blob/master/LICENSE) [![SpringBoot](https://img.shields.io/badge/SpringBoot-2.1.5.RELEASE-brightgreen.svg)](https://docs.spring.io/spring-boot/docs/2.1.5.RELEASE/reference/htmlsingle/) [![GitHub Release](https://img.shields.io/github/release/lerry903/RuoYi.svg)](https://github.com/lerry903/RuoYi/releases) ## 平台简介 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适的。于是利用空闲休息时间开始自己写了一套后台系统。如此有了若依。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 寓意:你若不离不弃,我必生死相依 > ## 内置功能 1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。 2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。 3. 岗位管理:配置系统用户所属担任职务。 4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。 5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。 6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。 7. 参数管理:对系统动态配置常用参数。 8. 通知公告:系统通知公告信息发布维护。 9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。 10. 登录日志:系统登录日志记录查询包含登录异常。 11. 在线用户:当前系统中活跃用户状态监控。 12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。 13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。 14. 系统接口:根据业务代码自动生成相关的api接口文档。 15. 在线构建器:拖动表单元素生成相应的HTML代码。 16. 连接池监视:监视当期系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。 17. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。 ## 源码托管 > **[Github](https://github.com/lerry903/RuoYi)** | **[Gitee](https://gitee.com/lerry903/RuoYi)** ## 在线体验 > admin/admin123 演示地址:http://ruoyi.vip 文档地址:http://doc.ruoyi.vip ## 演示图 <table> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/login.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/index.jpg"/></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/user_list.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/user_update.jpg"/></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/role_list.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/role_update.jpg"/></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/user_role.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/role_data.jpg"/></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/function.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/function_update.jpg"/></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/gen_code.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/user.jpg"/></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/oper_log.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/login_log.jpg"/></td> </tr> <tr> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/server_monitoring.jpg"/></td> <td><img src="https://raw.githubusercontent.com/lerry903/RuoYi/master/img/prize.jpg"/></td> </tr> </table> ## License 用户在遵循本项目协议的同时,如果用户下载、安装、使用本项目中所提供的软件,软件作者对任何原因在使用本项目中提供的软件时可能对用户自己或他人造成的任何形式的损失和伤害不承担任何责任。作者有权根据有关法律、法规的变化修改本项目协议。修改后的协议会随附于本项目的新版本中。当发生有关争议时,以最新的协议文本为准。如果用户不同意改动的内容,用户可以自行删除本项目。如果用户继续使用本项目,则视为您接受本协议的变动。 感谢大家 [Star](https://github.com/lerry903/RuoYi/stargazers) & [Fork](https://github.com/lerry903/RuoYi/network/members) 的支持。
0
Eajy/MaterialDesignDemo
A beautiful app designed with Material Design.
design material material-design materialdesign
[Language:简体中文](https://github.com/Eajy/MaterialDesignDemo/blob/master/README_CN.md) --- **This is a demo app designed with the fascinating and modern Google's Material Design. It was created using design support library to show how to implement material design in apps. It covers many material design components, such as:** - NavigationView - CoordinatorLayout - AppBarLayout - CollapsingToolbarLayout - NestedScrollView - TabLayout - FloatingActionButton - SnackBar - SwipeRefreshLayout - RecyclerView - CardView - TextInputLayout - BottomSheetDialog - SharedElementTransitions - BottomNavigationView - ConstraintLayout - Chips - BottomAppBar - Material Buttons - Adaptive icon - App shortcuts Please see my another App: [Material Design 2](https://github.com/Eajy/MaterialDesign2) which is designed with MD2 using Androidx Libraries and Material Components. #### Google Play: https://play.google.com/store/apps/details?id=com.eajy.materialdesigndemo ![image](https://github.com/Eajy/MaterialDesignDemo/blob/master/pictures/1.png) ![image](https://github.com/Eajy/MaterialDesignDemo/blob/master/pictures/2.png) ![image](https://github.com/Eajy/MaterialDesignDemo/blob/master/pictures/3.png) ![image](https://github.com/Eajy/MaterialDesignDemo/blob/master/pictures/pad_1.png) ![image](https://github.com/Eajy/MaterialDesignDemo/blob/master/pictures/pad_2.png) --- #### Contributors - [Gurupreet](https://github.com/Gurupreet) #### Open Source Licenses: Copyright 2016 Eajy The product includes: Apache License, Version 2.0 You may obtain a copy of the license at http://www.apache.org/licenses/LICENSE-2.0 Android Support Library Copyright © 2005 The Android Open Source Project. All rights reserved. http://developer.android.com/tools/extras/support-library.html Glide Copyright © 2014 Google, Inc. All rights reserved. https://github.com/bumptech/glide Google Material Design Icons Copyright © Google, Inc. All rights reserved. https://material.io/icons/ [_**- Designed by Eajy in China.**_](https://sites.google.com/view/eajy)
0
rubensousa/FloatingToolbar
A toolbar that morphs from a FloatingActionButton
fab floatingactionbutton floatingmenu toolbar transition
# FloatingToolbar A toolbar that morphs from a FloatingActionButton Inspired by the material design spec: https://www.google.com/design/spec/components/buttons-floating-action-button.html#buttons-floating-action-button-transitions Available from API 14. <img src="screenshots/demo.gif" width="350"><img src="screenshots/demo_scroll.gif" width="350"> ## How to use ##### 1. Add the following to your build.gradle: ```groovy compile 'com.github.rubensousa:floatingtoolbar:1.5.1' ``` ##### 2. Add FloatingToolbar as a direct child of CoordinatorLayout and before the FloatingActionButton: ```xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/coordinatorLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <!-- Appbar --> <com.github.rubensousa.floatingtoolbar.FloatingToolbar android:id="@+id/floatingToolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_gravity="bottom" app:floatingMenu="@menu/main" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" android:src="@drawable/ic_share_black_24dp" /> </android.support.design.widget.CoordinatorLayout> ``` ##### 3. Specify a menu resource file or custom layout with app:floatingMenu or app:floatingCustomView You can also build a menu programmatically using FloatingToolbarMenuBuilder: ```java mFloatingToolbar.setMenu(new FloatingToolbarMenuBuilder(this) .addItem(R.id.action_unread, R.drawable.ic_markunread_black_24dp, "Mark unread") .addItem(R.id.action_copy, R.drawable.ic_content_copy_black_24dp, "Copy") .addItem(R.id.action_google, R.drawable.ic_google_plus_box, "Google+") .addItem(R.id.action_facebook, R.drawable.ic_facebook_box, "Facebook") .addItem(R.id.action_twitter, R.drawable.ic_twitter_box, "Twitter") .build()); ``` ##### 4. Attach the FAB to the FloatingToolbar to automatically start the transition on click event: ```java mFloatingToolbar.attachFab(fab); ``` ##### 5. Set a click listener ```java mFloatingToolbar.setClickListener(new FloatingToolbar.ItemClickListener() { @Override public void onItemClick(MenuItem item) { } @Override public void onItemLongClick(MenuItem item) { } }); ``` ##### 6. If you want to show a snackbar in the same layout as the FloatingToolbar, please use: ```java mFloatingToolbar.showSnackBar(snackbar); ``` ##### 7. (Optional) Attach a RecyclerView to hide the FloatingToolbar on scroll: ```java mFloatingToolbar.attachRecyclerView(recyclerView); ``` ##### 8. (Optional) Use show() and hide() to trigger the transition anytime: ```java mFloatingToolbar.show(); mFloatingToolbar.hide(); ``` ##### 9. (Optional) Add a MorphListener to listen to morph animation events ```java mFloatingToolbar.addMorphListener(new FloatingToolbar.MorphListener() { @Override public void onMorphEnd() { } @Override public void onMorphStart() { } @Override public void onUnmorphStart() { } @Override public void onUnmorphEnd() { } }); ``` ## Attributes - app:floatingToastOnLongClick -> boolean. Defaults to true - app:floatingHandleFabClick -> boolean. Defaults to true - app:floatingMenu -> Menu resource - app:floatingItemBackground -> Drawable resource - app:floatingCustomView -> Layout resource - app:floatingAutoHide -> boolean. Defaults to true ## Apps using FloatingToolbar (Send a PR to add your app here) - [EuroMillions](https://play.google.com/store/apps/details?id=io.github.rubensousa.euromillions) ## License Copyright 2016 Rúben Sousa 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
long1eu/SpaceTabLayout
Not actively maintained, but PR are welcomed
null
null
0
aol/cyclops
An advanced, but easy to use, platform for writing functional applications in Java 8.
asynchronous collections data-structures functional-programming java java8 monad monad-transformers monoid reactive reactive-streams streams streams-api
# Getting Cyclops X (10) * The latest version is [cyclops:10.4.0](http://mvnrepository.com/artifact/com.oath.cyclops/cyclops/10.4.0) * Stackoverflow tag [cyclops-react](http://stackoverflow.com/search?q=cyclops-react) * [Documentation](https://github.com/aol/cyclops/wiki) (work in progress for Cyclops X) * [Integration modules](https://github.com/aol/cyclops-integration) # Tutorial : * [Dysfunctional programming in Java : A functional tutorial](https://medium.com/@johnmcclean/dysfunctional-programming-in-java-a-functional-tutorial-20e0bebd2ec9) - [Part 1 : Laziness (Covering Supplier & the Eval monad)](https://medium.com/@johnmcclean/dysfunctional-programming-in-java-i-laziness-cc9c6981de39) - [Part 2 : Immutability (Covering Immutable Objects with Lombok, withers)](https://medium.com/@johnmcclean/dysfunctional-programming-in-java-2-immutability-a2cff487c224) - [Part 3 : Functional Composition (Covering method chaining, Streams, ReactiveSeq, Flux from Reactor)](https://medium.com/@johnmcclean/dysfunctional-programming-in-java-3-functional-composition-16828f0609c2) - [Part 4 : No nulls allowed (Covering class design, Optional, eager / lazy / reactive Option types, Mono from Reactor)](https://blog.usejournal.com/dysfunctional-programming-in-java-4-no-nulls-allowed-88e8735475a) - [Part 5 : No exceptions (Covering making illegal states unrepresentable, eager / lazy Either type, Try)](https://medium.com/@johnmcclean/dysfunctional-programming-in-java-5-no-exceptions-5f37ac594323) - [Part 6 : No locks or synchronized blocks (Covering Future, Sequence, FutureStreams and reactive-streams)](https://medium.com/@johnmcclean/dysfunctional-programming-in-java-6-no-locks-or-synchronized-blocks-ea5a47644689) - [Part 7 : Immutable Collections (Covering Vector, NonEmptyList and reactive processing)](https://medium.com/@johnmcclean/dysfunctional-programming-in-java-7-immutable-collections-83ba78aaf4dd) * [Tagless Final in Java](https://medium.com/@johnmcclean/powerful-extensible-code-with-tagless-final-in-java-4094f923cdea) * [A Java long read : Is functional programming worth it?](https://medium.com/@johnmcclean/a-java-long-read-is-functional-programming-worth-it-ca53bfcd0c6a) # What's new in Cyclops X (cyclops 10) ![cyclops-data-types](https://user-images.githubusercontent.com/9964792/37656704-b4266d7a-2c40-11e8-84d9-23a4a77e0341.jpeg) - Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map ) - Structural Pattern Matching API (deconstruct algebraic product and sum types) - Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example) - Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive) - Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor) - Group id is changed to com.oath.cyclops - Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X) - Light weight dependencies : reactive-streams API, KindedJ & Agrona - JVM Polyglot Higher Kinded Types Support with KindedJ ## Modules * [cyclops](https://github.com/aol/cyclops-react/tree/master/cyclops) - Persistent data structures and control types * [cyclops-futurestream](https://github.com/aol/cyclops-react/tree/master/cyclops-futurestream) - Parallel asynchronous streaming * [cyclops-reactive-collections](https://github.com/aol/cyclops-react/tree/master/cyclops-reactive-collections) - Fast, non-blocking, asynchronous extensions for JDK and Persistent Collections * [cyclops-anyM](https://github.com/aol/cyclops-react/tree/master/cyclops-anym) - Higher kinded abstractions for working with any Java Monad type. * [cyclops-pure](https://github.com/aol/cyclops-react/tree/master/cyclops-pure) - Higher kinded type classes for pure functional programming in Java * [cyclops-reactor-integration](https://github.com/aol/cyclops-react/tree/master/cyclops-reactor-integration) - Reactive collections and AnyM integrations with Reactor. * [cyclops-rxjava2-integration](https://github.com/aol/cyclops-react/tree/master/cyclops-rxjava2-integration) - Reactive collections and AnyM integrations with Rx Java 2. * [cyclops-jackson-integration](https://github.com/aol/cyclops-react/tree/master/cyclops-jackson) - Jackson databindings for Cyclops persistent data structures and control types. ## Gradle where x.y.z represents the latest version ```groovy compile 'com.oath.cyclops:cyclops:x.y.z' ``` ## Maven ```xml <dependency> <groupId>com.oath.cyclops</groupId> <artifactId>cyclops</artifactId> <version>x.y.z</version> </dependency> ``` <img width="820" alt="screen shot 2016-02-22 at 8 44 42 pm" src="https://cloud.githubusercontent.com/assets/9964792/13232030/306b0d50-d9a5-11e5-9706-d44d7731790d.png"> Powerful Streams and functional data types for building modern Java 8 applications. We extend JDK interfaces where possible for maximum integration. This is the 10.x branch for 2.x branch click the link below * [2.x](https://github.com/aol/cyclops-react/tree/2.x) * [1.x](https://github.com/aol/cyclops-react/tree/1.x) # License cyclops is licensed under the Apache 2.0 license. http://www.apache.org/licenses/LICENSE-2.0 # Thanks to our Sponsors * ![YourKit Logo](https://www.yourkit.com/images/yklogo.png) YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of <a href="https://www.yourkit.com/java/profiler/">YourKit Java Profiler</a>, <a href="https://www.yourkit.com/.net/profiler/">YourKit .NET Profiler</a>, and <a href="https://www.yourkit.com/youmonitor/">YourKit YouMonitor</a>.
0
mxn21/FlowingDrawer
swipe display drawer with flowing & bouncing effects.
android-ui
# FlowingDrawer [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FlowingDrawer-green.svg?style=flat)](https://android-arsenal.com/details/1/2658) [![travis-ic](https://travis-ci.org/mxn21/FlowingDrawer.svg?branch=master)](https://travis-ci.org/mxn21/FlowingDrawer) ![Showcase](/screen.gif) swipe right to display drawer with flowing effects. ## Download Include the following dependency in your build.gradle file. Gradle: ```Gradle repositories { jcenter() } dependencies { implementation 'com.mxn.soul:flowingdrawer-core:2.1.0' implementation 'com.nineoldandroids:library:2.4.0' } ``` ## V2.0.0 Features * The menu can be positioned along two edges:left and right . * Allows the drawer to be opened by dragging the edge or the entire screen. ## Usage *For a working implementation of this project see the `app/` folder and check out the sample app* activity_main.xml: ```xml <com.mxn.soul.flowingdrawer_core.FlowingDrawer xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawerlayout" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false" android:clipToPadding="false" app:edPosition="1" app:edMenuSize="260dp" app:edMenuBackground="#dddddd"> <!--content--> <RelativeLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent"/> <!--menu--> <com.mxn.soul.flowingdrawer_core.FlowingMenuLayout android:id="@+id/menulayout" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/id_container_menu" android:layout_width="match_parent" android:layout_height="match_parent"/> </com.mxn.soul.flowingdrawer_core.FlowingMenuLayout> </com.mxn.soul.flowingdrawer_core.FlowingDrawer> ``` To use a FlowingDrawer, position FlowingDrawer as the root , position your primary content view as the first child with width and height of match_parent . Add FlowingMenuLayout as child views after the main content view . FlowingMenuLayout commonly use match_parent for height and width. Don't set any background on FlowingMenuLayout or FlowingMenuLayout's children, it means their background should be transparent. Don't set FlowingMenuLayout's width with a fixed width, it's not a useful way to change it's width . You can change menu's attribute in FlowingDrawer layout node use custom attribute,like edMenuBackground,edMenuSize, edPosition. Use edPosition attribute corresponding to which side of the view you want the drawer to emerge from: left or right.Left menu : edPosition =1 ; Right menu: edPosition =2 . For more custom attribute ,you can see in attrs.xml. MainActivity: ```java mDrawer = (FlowingDrawer) findViewById(R.id.drawerlayout); mDrawer.setTouchMode(ElasticDrawer.TOUCH_MODE_BEZEL); mDrawer.setOnDrawerStateChangeListener(new ElasticDrawer.OnDrawerStateChangeListener() { @Override public void onDrawerStateChange(int oldState, int newState) { if (newState == ElasticDrawer.STATE_CLOSED) { Log.i("MainActivity", "Drawer STATE_CLOSED"); } } @Override public void onDrawerSlide(float openRatio, int offsetPixels) { Log.i("MainActivity", "openRatio=" + openRatio + " ,offsetPixels=" + offsetPixels); } }); ``` setTouchMode can allows the drawer to be opened by dragging the edge or the entire screen. setOnDrawerStateChangeListener can be used to monitor the state and motion of drawer views. Avoid performing expensive operations such as layout during animation as it can cause stuttering. ElasticDrawer.OnDrawerStateChangeListener offers default/no-op implementations of each callback method. License ======= Copyright 2015 soul.mxn 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
mpatric/mp3agic
A java library for reading mp3 files and reading / manipulating the ID3 tags (ID3v1 and ID3v2.2 through ID3v2.4).
null
null
0
uber-common/jvm-profiler
JVM Profiler Sending Metrics to Kafka, Console Output or Custom Reporter
agent java performance profiler
# Uber JVM Profiler [![Build Status](https://api.travis-ci.org/uber-common/jvm-profiler.svg)](https://travis-ci.org/uber-common/jvm-profiler/) Uber JVM Profiler provides a Java Agent to collect various metrics and stacktraces for Hadoop/Spark JVM processes in a distributed way, for example, CPU/Memory/IO metrics. Uber JVM Profiler also provides advanced profiling capabilities to trace arbitrary Java methods and arguments on the user code without user code change requirement. This feature could be used to trace HDFS name node call latency for each Spark application and identify bottleneck of name node. It could also trace the HDFS file paths each Spark application reads or writes and identify hot files for further optimization. This profiler is initially created to profile Spark applications which usually have dozens of or hundreds of processes/machines for a single application, so people could easily correlate metrics of these different processes/machines. It is also a generic Java Agent and could be used for any JVM process as well. ## How to Build 1. Make sure JDK 8+ and maven is installed on your machine. 2. Run: `mvn clean package` This command creates **jvm-profiler.jar** file with the default reporters like ConsoleOutputReporter, FileOutputReporter and KafkaOutputReporter bundled in it. If you want to bundle the custom reporters like RedisOutputReporter or InfluxDBOutputReporter in the jar file then provide the maven profile id for that reporter in the build command. For example to build a jar file with RedisOutputReporter, you can execute `mvn -P redis clean package` command. Please check the pom.xml file for available custom reporters and their profile ids. ## Example to Run with Spark Application You could upload jvm-profiler jar file to HDFS so the Spark application executors could access it. Then add configuration like following when launching Spark application: ``` --conf spark.jars=hdfs://hdfs_url/lib/jvm-profiler-1.0.0.jar --conf spark.executor.extraJavaOptions=-javaagent:jvm-profiler-1.0.0.jar ``` ## Example to Run with Java Application Following command will start the example application with the profiler agent attached, which will report metrics to the console output: ``` java -javaagent:target/jvm-profiler-1.0.0.jar=reporter=com.uber.profiling.reporters.ConsoleOutputReporter,tag=mytag,metricInterval=5000,durationProfiling=com.uber.profiling.examples.HelloWorldApplication.publicSleepMethod,argumentProfiling=com.uber.profiling.examples.HelloWorldApplication.publicSleepMethod.1,sampleInterval=100 -cp target/jvm-profiler-1.0.0.jar com.uber.profiling.examples.HelloWorldApplication ``` ## Example to Run with Executable Jar Use following command to run jvm profiler with executable jar application. ``` java -javaagent:/opt/jvm-profiler/target/jvm-profiler-1.0.0.jar=reporter=com.uber.profiling.reporters.ConsoleOutputReporter,metricInterval=5000,durationProfiling=foo.bar.FooAppication.barMethod,sampleInterval=5000 -jar foo-application.jar ``` ## Example to Run with Tomcat Set the jvm profiler in CATALINA_OPTS before starting the tomcat server. Check logs/catalina.out file for metrics. ``` export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/jvm-profiler/target/jvm-profiler-1.0.0.jar=reporter=com.uber.profiling.reporters.ConsoleOutputReporter,metricInterval=5000,durationProfiling=foo.bar.FooController.barMethod,sampleInterval=5000" ``` ## Example to Run with Spring Boot Maven Plugin Use following command to use jvm profiler with Spring Boot 2.x. For Spring Boot 1.x use `-Drun.arguments` instead of `-Dspring-boot.run.jvmArguments` in following command. ``` mvn spring-boot:run -Dspring-boot.run.jvmArguments="-javaagent:/opt/jvm-profiler/target/jvm-profiler-1.0.0.jar=reporter=com.uber.profiling.reporters.ConsoleOutputReporter,metricInterval=5000,durationProfiling=foo.bar.FooController.barMethod,sampleInterval=5000" ``` ## Send Metrics to Kafka Uber JVM Profiler supports sending metrics to Kafka. For example, ``` java -javaagent:target/jvm-profiler-1.0.0.jar=reporter=com.uber.profiling.reporters.KafkaOutputReporter,metricInterval=5000,brokerList=localhost:9092,topicPrefix=profiler_ -cp target/jvm-profiler-1.0.0.jar com.uber.profiling.examples.HelloWorldApplication ``` It will send metrics to Kafka topic profiler_CpuAndMemory. See bottom of this document for an example of the metrics. ## More Details See [JVM Profiler Blog Post](https://eng.uber.com/jvm-profiler/). ## Feature List Uber JVM Profiler supports following features: 1. Debug memory usage for all your spark application executors, including java heap memory, non-heap memory, native memory (VmRSS, VmHWM), memory pool, and buffer pool (directed/mapped buffer). 2. Debug CPU usage, Garbage Collection time for all spark executors. 3. Debug arbitrary java class methods (how many times they run, how much duration they spend). We call it Duration Profiling. 4. Debug arbitrary java class method call and trace it argument value. We call it Argument Profiling. 5. Do Stacktrack Profiling and generate flamegraph to visualize CPU time spent for the spark application. 6. Debug IO metrics (disk read/write bytes for the application, CPU iowait for the machine). 7. Debug JVM Thread Metrics like Count of Total Threads, Peak Threads, Live/Active Threads and newly Threads. ## Parameter List The java agent supports following parameters, which could be used in Java command line like "-javaagent:agent_jar_file.jar=param1=value1,param2=value2": - reporter: class name for the reporter, e.g. com.uber.profiling.reporters.ConsoleOutputReporter, or com.uber.profiling.reporters.KafkaOutputReporter, which are already implemented in the code. You could implement your own reporter and set the name here. - configProvider: class name for the config provider, e.g. com.uber.profiling.YamlConfigProvider, which are already implemented in the code. You could implement your own config provider and set the name here. - configFile: config file path to be used by YamlConfigProvider (if configProvider is set to com.uber.profiling.YamlConfigProvider). This could be a local file path or HTTP URL. - tag: plain text string which will be reported together with the metrics. - metricInterval: how frequent to collect and report the metrics, in milliseconds. - durationProfiling: configure to profile specific class and method, e.g. com.uber.profiling.examples.HelloWorldApplication.publicSleepMethod. It also support wildcard (\*) for method name, e.g. com.uber.profiling.examples.HelloWorldApplication.*. - argumentProfiling: configure to profile specific method argument, e.g. com.uber.profiling.examples.HelloWorldApplication.publicSleepMethod.1 (".1" means getting value for the first argument and sending out in the reporter). - sampleInterval: frequency (milliseconds) to do stacktrace sampling, if this value is not set or zero, the profiler will not do stacktrace sampling. - ioProfiling: whether to profile IO metrics, could be true or false. - brokerList: broker list if using com.uber.profiling.reporters.KafkaOutputReporter. - topicPrefix: topic prefix if using com.uber.profiling.reporters.KafkaOutputReporter. KafkaOutputReporter will send metrics to multiple topics with this value as the prefix for topic names. - outputDir: output directory if using com.uber.profiling.reporters.FileOutputReporter. FileOutputReporter will write metrics into this directory. ## YAML Config File The parameters could be provided as arguments in java command, or in a YAML config file if you use configProvider=com.uber.profiling.YamlConfigProvider. Following is an example of the YAML config file: ``` reporter: com.uber.profiling.reporters.ConsoleOutputReporter metricInterval: 5000 ``` ## Metrics Example Following is an example of CPU and Memory metrics when using ConsoleOutputReporter or KafkaOutputReporter: ```json { "nonHeapMemoryTotalUsed": 11890584.0, "bufferPools": [ { "totalCapacity": 0, "name": "direct", "count": 0, "memoryUsed": 0 }, { "totalCapacity": 0, "name": "mapped", "count": 0, "memoryUsed": 0 } ], "heapMemoryTotalUsed": 24330736.0, "epochMillis": 1515627003374, "nonHeapMemoryCommitted": 13565952.0, "heapMemoryCommitted": 257425408.0, "memoryPools": [ { "peakUsageMax": 251658240, "usageMax": 251658240, "peakUsageUsed": 1194496, "name": "Code Cache", "peakUsageCommitted": 2555904, "usageUsed": 1173504, "type": "Non-heap memory", "usageCommitted": 2555904 }, { "peakUsageMax": -1, "usageMax": -1, "peakUsageUsed": 9622920, "name": "Metaspace", "peakUsageCommitted": 9830400, "usageUsed": 9622920, "type": "Non-heap memory", "usageCommitted": 9830400 }, { "peakUsageMax": 1073741824, "usageMax": 1073741824, "peakUsageUsed": 1094160, "name": "Compressed Class Space", "peakUsageCommitted": 1179648, "usageUsed": 1094160, "type": "Non-heap memory", "usageCommitted": 1179648 }, { "peakUsageMax": 1409286144, "usageMax": 1409286144, "peakUsageUsed": 24330736, "name": "PS Eden Space", "peakUsageCommitted": 67108864, "usageUsed": 24330736, "type": "Heap memory", "usageCommitted": 67108864 }, { "peakUsageMax": 11010048, "usageMax": 11010048, "peakUsageUsed": 0, "name": "PS Survivor Space", "peakUsageCommitted": 11010048, "usageUsed": 0, "type": "Heap memory", "usageCommitted": 11010048 }, { "peakUsageMax": 2863661056, "usageMax": 2863661056, "peakUsageUsed": 0, "name": "PS Old Gen", "peakUsageCommitted": 179306496, "usageUsed": 0, "type": "Heap memory", "usageCommitted": 179306496 } ], "processCpuLoad": 0.0008024004394748531, "systemCpuLoad": 0.23138430784607697, "processCpuTime": 496918000, "appId": null, "name": "24103@machine01", "host": "machine01", "processUuid": "3c2ec835-749d-45ea-a7ec-e4b9fe17c23a", "tag": "mytag", "gc": [ { "collectionTime": 0, "name": "PS Scavenge", "collectionCount": 0 }, { "collectionTime": 0, "name": "PS MarkSweep", "collectionCount": 0 } ] } ``` ## Metric Details A list of all metrics and information corresponding to them can be found [here](metricDetails.md). ## Generate flamegraph of Stacktrack Profiling result We can take the output of Stacktrack Profiling to generate flamegraph to visualize CPU time. Using the Python script `stackcollapse.py`, following command will collapse Stacktrack Profiling json output file to the input file format for generating flamegraph. The script `flamegraph.pl` can be found at [FlameGraph](https://github.com/brendangregg/FlameGraph). ``` python stackcollapse.py -i Stacktrace.json > Stacktrace.folded flamegraph.pl Stacktrace.folded > Stacktrace.svg ``` Note that it is required to enable stacktrace sampling, in order to generate flamegraph. To enable it, please set `sampleInterval` parameter. If it is not set or zero, the profiler will not do stacktrace sampling.
0
codingXiaxw/CustomerManagement
a simple customer management system using MVC model with development ducumentation :bowtie:
null
## JavaWeb项目之客户管理系统 ## 项目介绍 详细讲解请点击这里前往我的博客[客户管理系统项目](http://codingxiaxw.cn/2016/10/25/25-JavaWeb%E9%A1%B9%E7%9B%AE%E4%B9%8B%E5%AE%A2%E6%88%B7%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/) ### 功能介绍 - 添加客户:添加客户的信息,包括姓名,性别,手机,邮箱,自我描述 - 查询客户:查询数据库中所有的客户,查询结果将客户信息以列表的形式给出,可以对列表中的客户信息进行编辑及删除 - 高级搜索:多条件组合在数据库中进行客户信息的查询,搜索结果以列表的形式给出,可以对列表中的客户信息进行编辑及删除 - 新增分页功能,逻辑很强。 ### 运用知识 - 数据库基本查询 - 数据库连接池c3p0 - 运用dbutil.jar包一键封装表单数据到bean对象中 - 利用dbutils.jar包简化对数据库增、删、改、查的代码 - 标签库 - JavaWeb三层框架的分离 - 将servlet的转发、重定向及方法进行封装,这样当设计到多个功能时不用建立多个servlet类。 - 反射 ## 准备 1.导入第三方jar包以及c3p0配置文件。 - c3p0.jar - mchange-commons.java.jar - commons-beanutils.jar - commons-dbutils.jar - commons-logging.jar - 自己写的小工具itcast-tools.jar - jstl.jar - mysql-connector-java.jar 2.建包 - dao - service - servlet - domain ## 搭建环境 IntelliJ IDEA + MySQL 或者 eclipse + MySQL ## 使用方法 1. git clone `https://github.com/codingXiaxw/CustomerManagement.git` 2. 使用IntelliJ IDEA导入打开 或者 使用eclipse打开`CustomerManagement_for_Eclipse`项目 3. 使用eclipse/src/create_table.sql文件中的sql语句创建相应的数据库及表 4. 修改`CustomerManagement/src`下`c3p0-config.xml`中数据库相关信息 5. 部署Tomcat并启动 6. enjoy it ## 项目功能截图 ### 添加客户 <img src="http://od2xrf8gr.bkt.clouddn.com/tianjia.png" width="50%" height="50%"> ### 查询客户 <img src="http://od2xrf8gr.bkt.clouddn.com/chaxun.png" width="80%" height="50%"> ### 编辑客户 <img src="http://od2xrf8gr.bkt.clouddn.com/bianji.png" width="50%" height="50%"> ### 高级搜索客户 <img src="http://od2xrf8gr.bkt.clouddn.com/sousuo.png" width="50%" height="50%"> ### 新增分页后的界面 <img src="http://od2xrf8gr.bkt.clouddn.com/fenye.png" width="50%" height="50%">
0
baichengzhou/SpringMVC-Mybatis-Shiro-redis-0.2
基于SpringMVC、Mybatis、Redis、Freemarker的Shiro管理Demo源码的升级版。
null
null
0
rubensousa/PreviewSeekBar
A SeekBar suited for showing a preview of something. As seen in Google Play Movies.
null
# PreviewSeekBar A SeekBar suited for showing a video preview. As seen in Google Play Movies ### Google Play Movies <img src="screenshots/playmovies.gif" width=600></img> ### PreviewSeekBar's sample <img src="screenshots/sample.gif" width=600></img> ## Build Add the following to your app's build.gradle: ```groovy dependencies { // Base implementation with a standard SeekBar implementation 'com.github.rubensousa:previewseekbar:3.1.1' // Media3 extension that contains a TimeBar. implementation 'com.github.rubensousa:previewseekbar-media3:1.1.1.0' // (Deprecated) ExoPlayer Extension that contains a TimeBar. implementation 'com.github.rubensousa:previewseekbar-exoplayer:2.18.1.0' } ``` ## How to use with Media3 ### Add a custom controller to your PlayerView ```xml <androidx.media3.ui.PlayerView android:id="@+id/playerView" android:layout_width="match_parent" android:layout_height="match_parent" app:controller_layout_id="@layout/exoplayer_controls"/> ``` Here's the sample's exoplayer_controls: https://github.com/rubensousa/PreviewSeekBar/blob/master/sample/src/main/res/layout/exoplayer_controls.xml ### Change your TimeBar to a PreviewTimeBar ```xml <FrameLayout android:id="@+id/previewFrameLayout" android:layout_width="@dimen/video_preview_width" android:layout_height="@dimen/video_preview_height" android:background="@drawable/video_frame"> <ImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout> <com.github.rubensousa.previewseekbar.exoplayer.PreviewTimeBar android:id="@+id/exo_progress" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" app:previewAnimationEnabled="true" app:previewFrameLayout="@id/previewFrameLayout"/> ``` Place the View you want to use to display the preview in the FrameLayout above. In this example it's an ImageView but you can place any View inside. PreviewTimeBar will animate and show that FrameLayout for you automatically. **The FrameLayout must have the same parent as the PreviewTimeBar if you want the default animations to work** ### Create a PreviewLoader and pass it to the PreviewTimeBar **Note**: A PreviewLoader is an interface that you need to implement yourself. This library isn't opinionated about how you actually show a preview. Check the sample code for an example on how it can be done using thumbnail sprites. ```java PreviewLoader imagePreviewLoader = ImagePreviewLoader(); previewTimeBar.setPreviewLoader(imagePreviewLoader); ``` In this project's sample, Glide is used with a custom transformation to crop the thumbnails from a thumbnail sprite. [GlideThumbnailTransformation](https://github.com/rubensousa/PreviewSeekBar/blob/master/sample/src/main/java/com/github/rubensousa/previewseekbar/sample/glide/GlideThumbnailTransformation.java) ```java @Override public void loadPreview(long currentPosition, long max) { GlideApp.with(imageView) .load(thumbnailsUrl) .override(GlideThumbnailTransformation.IMAGE_WIDTH, GlideThumbnailTransformation.IMAGE_HEIGHT) .transform(new GlideThumbnailTransformation(currentPosition)) .into(imageView); } ``` ### Listen for scrub events to control playback state When the user starts scrubbing the PreviewTimeBar, you should pause the video playback After the user is done selecting the new video position, you can resume it. ```java previewTimeBar.addOnScrubListener(new PreviewBar.OnScrubListener() { @Override public void onScrubStart(PreviewBar previewBar) { player.setPlayWhenReady(false); } @Override public void onScrubMove(PreviewBar previewBar, int progress, boolean fromUser) { } @Override public void onScrubStop(PreviewBar previewBar) { player.setPlayWhenReady(true); } }); ``` ### Customize the PreviewTimeBar Available XML attributes: ```xml <attr name="previewAnimationEnabled" format="boolean" /> <attr name="previewEnabled" format="boolean" /> <attr name="previewAutoHide" format="boolean" /> ``` ```java // Disables auto hiding the preview. // Default is true, which means the preview is hidden // when the user stops scrubbing the PreviewSeekBar previewTimeBar.setAutoHidePreview(false); // Shows the preview previewTimeBar.showPreview(); // Hides the preview previewTimeBar.hidePreview(); // Disables revealing the preview previewTimeBar.setPreviewEnabled(false); // Disables the current animation previewTimeBar.setPreviewAnimationEnabled(false); // Change the default animation previewTimeBar.setPreviewAnimator(new PreviewFadeAnimator()); // Changes the color of the thumb previewTimeBar.setPreviewThumbTint(Color.RED); // Listen for scrub touch changes previewTimeBar.addOnScrubListener(new PreviewBar.OnScrubListener() { @Override public void onScrubStart(PreviewBar previewBar) { } @Override public void onScrubMove(PreviewBar previewBar, int progress, boolean fromUser) { } @Override public void onScrubStop(PreviewBar previewBar) { } }); // Listen for preview visibility changes previewTimeBar.addOnPreviewVisibilityListener(new PreviewBar.OnPreviewVisibilityListener() { @Override public void onVisibilityChanged(PreviewBar previewBar, boolean isPreviewShowing) { } }); ``` ## How to use with a standard SeekBar ### Setup your layout like the following: ```xml <FrameLayout android:id="@+id/previewFrameLayout" android:layout_width="160dp" android:layout_height="90dp"> <ImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent" /> </FrameLayout> <com.github.rubensousa.previewseekbar.PreviewSeekBar android:id="@+id/previewSeekBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" android:max="800" app:previewFrameLayout="@id/previewFrameLayout"/> ``` Place the View you want to use to display the preview in the FrameLayout above. In this example it's an ImageView but you can place any View inside. PreviewSeekBar will animate and show that FrameLayout for you automatically. **The FrameLayout must have the same parent as the PreviewSeekBar if you want the default animations to work** ### Create a PreviewLoader and pass it to the PreviewSeekBar ```java PreviewSeekBar previewSeekBar = findViewById(R.id.previewSeekBar); PreviewLoader imagePreviewLoader = ImagePreviewLoader(); previewSeekbar.setPreviewLoader(imagePreviewLoader); ``` ### Customization Available XML attributes for styling: ```xml <attr name="previewAnimationEnabled" format="boolean" /> <attr name="previewEnabled" format="boolean" /> <attr name="previewThumbTint" format="color" /> <attr name="previewAutoHide" format="boolean" /> ``` ## Important note **This library is just an UI component for displaying previews. It doesn't handle generating thumbnail sprites from videos.** ## License Copyright 2017 The Android Open Source Project Copyright 2020 Rúben Sousa 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
elonlit/Genesis
God's actual programming language.
bible hebrew interpreter procedural-programming
# Genesis ***𐤁*** [![Open Source Love svg2](https://badges.frapsoft.com/os/v2/open-source.svg?style=for-the-badge)](https://github.com/ellerbrock/open-source-badges/) > "*My frame was not hidden from you, when I was being made in secret, intricately woven in the depths of the earth. Your eyes saw my unformed substance; in your book were written, every one of them, the days that were formed for me, when as yet there was none of them*" [^1] Genesis is an interpreted, procedural, and Turing-complete Paleo-Hebrew programming language. Diacritical signs are forgone for simplification, though maybe Nikud can be used in prospect as a means for more reserved keywords. <p align="center"> <img src="https://img.shields.io/badge/Platforms-win%20%7C%20linux%20%7C%20osx-lightgrey" /> <!--<img src="https://img.shields.io/powershellgallery/p/DNS.1.1.1.1" />--> <a href="https://github.com/elonlit/Genesis/blob/master/LICENSE"> <img src="https://img.shields.io/badge/license-HOLY--LICENSE-yellow" /> </a> </p> <p align="center"> <a href="#valid-keywords">Keywords</a> • <a href="#operations-punctuation-elements--identifiers">Operators</a> • <a href="#data-types--literals">Types</a> • <a href="#control-flow">Control Flow</a> • <a href="#subroutines">Subroutines</a> • <a href="#data-structures">Data Structures</a> • <a href="#math-library--native-utilities">Utilities</a> • <a href="#faq">FAQ</a> </p> --- ## Valid Keywords | Lexeme | 𐤁 Equivalent(s) | | ------------- | ------------- | | Print | 𐤄𐤃𐤐𐤎 | | Print Line | 𐤄𐤃𐤐𐤎𐤇 | | Declare/Initialize Variable | 𐤄𐤂𐤃𐤓 | | Declare Subroutine | 𐤐𐤅𐤍𐤒𐤑𐤉𐤄 | | If | 𐤀𐤌 | | Then | 𐤀𐤆 | | While | 𐤁𐤏𐤅𐤃 | | For | 𐤏𐤁𐤅𐤓 | | For Each | 𐤏𐤁𐤅𐤓𐤊𐤋 | | Sleep | 𐤉𐤔𐤍 | | Consecrate | 𐤒-𐤃-𐤔 | The `𐤒-𐤃-𐤔` keyword, meaning literally "to consecrate" or "to purify," denotes when the scope of a subroutine or loop terminates. ## Operations, Punctuation Elements, & Identifiers Java-style syntax and precedence are preserved for most operators: `+` - addition (numbers, strings)<br /> `-` - subtraction (numbers)<br /> `/` - division (numbers)<br /> `*` - multiplication (numbers)<br /> `^` - power (numbers)<br /> `=` - assignment (numbers, strings)<br /> `==` - logical equals (numbers, strings)<br /> `=!` - not equal to (numbers, strings)<br /> `<` - less than (numbers)<br /> `>` - greater than (numbers)<br /> `=>` - greater than or equal to (numbers)<br /> `=<` - less than or equal to (numbers)<br /> `&&` - logical and (booleans)<br /> `||` - logical or (booleans)<br /> However, the associativity of most operators is from right-to-left: <pre dir="rtl" align="right"> 𐤄𐤂𐤃𐤓 𐤐𐤅 = 𐤊״𐤇 - 𐤄׳ // 23 </pre> Identifiers can be represented by alphanumeric text (including `_`) and do not have to start with an alphabetic character. ## Data Types & Literals Genesis is weakly and dynamically typed, so casting between primitives is handled implicitly by the interpreter. There are three data types: 1. Number - Encompasses `Bytes`, `Shorts`, `Integers`, `Longs`, `Doubles`, and `Floats`. 2. Boolean - Supports literals `𐤀𐤌𐤕` or `𐤔𐤒𐤓`, which correspond to `True` or `False`, respectively. 3. String - Delimited by quotation marks, e.g. `"!𐤔𐤋𐤅𐤌 𐤏𐤅𐤋𐤌"`. The Paleo-Hebrew alphabet may have used gematria to denote cardinal values, although there is only evidence of this on the Samaria Ostraca and Dead Sea Scroll 4Q252. This quasi-decimal isopsephic number system is adopted for a lack of an academic consensus. In this paradigm of numerology, there is no notation for zero, and the numeric values for individual letters are added together. Each unit (`1`, `2`, ..., `9`) is assigned a separate letter, each tens (`10`, `20`, ..., `90`) a separate letter, and the first four hundreds (`100`, `200`, `300`, `400`) a separate letter. The later hundreds (`500`, `600`, `700`, `800`, and `900`) are represented by the sum of two or three letters representing the first four hundreds. To represent numbers from `1,000` to `999,999`, the same letters are reused to serve as thousands, tens of thousands, and hundreds of thousands. Biblical pseudepigrapha use these transformations extensively. Standard (normative value) encoding per the conventional affine Mispar Hechrachi method of gematria is as follows: | Decimal | Hebrew | 𐤁 Glyph | | --- | --- | --- | | 1 | Alep | 𐤀 | | 2 | Bet | 𐤁 | | 3 | Gimel | 𐤂 | | 4 | Dalet | 𐤃 | | 5 | He | 𐤄 | | 6 | Waw | 𐤅 | | 7 | Zayin | 𐤆 | | 8 | Het | 𐤇 | | 9 | Tet | 𐤈 | | 10 | Yod | 𐤉 | | 20 | Kaf | 𐤊 | | 30 | Lamed | 𐤋 | | 40 | Mem | 𐤌 | | 50 | Nun | 𐤍 | | 60 | Samek | 𐤎 | | 70 | Ayin | 𐤏 | | 80 | Pe | 𐤐 | | 90 | Sade | 𐤑 | | 100 | Qop | 𐤒 | | 200 | Res | 𐤓 | | 300 | Sin | 𐤔 | | 400 | Taw | 𐤕 | Gershayim `״` (U+05F4 in Unicode, and resembling a double quote mark) (sometimes erroneously referred to as merkha'ot, which is Hebrew for double quote) are inserted before (to the right of) the last (leftmost) letter to indicate that the sequence of letters represents a gematric sequence of at least two Hebrew numerals (e.g., `28` → `𐤊״𐤇` and `5782` → `𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤕𐤒𐤐״𐤁`). Similarly, a single geresh `׳` (U+05F3 in Unicode, and resembling a single quote mark) is appended after (to the left of) a single letter in the case where a number is represented by a single Hebrew numeral (e.g. `100` → `𐤒׳`). ## Control Flow > "*Seek the Lord while he may be found; call on him while he is near*" [^2] The standard suite of loop constructs is supported. An iterative implementation for generating the first ten terms of the Fibonacci sequence using a `𐤁𐤏𐤅𐤃` loop is formulated as an example: <pre dir="rtl" align="right"> 𐤄𐤂𐤃𐤓 𐤌𐤎𐤐𐤓 = 𐤉׳ 𐤄𐤂𐤃𐤓 𐤓𐤀𐤔𐤅𐤍 = 𐤀׳ 𐤄𐤂𐤃𐤓 𐤔𐤍𐤉𐤄 = 𐤀׳ - 𐤀׳ 𐤄𐤂𐤃𐤓 𐤃𐤋𐤐𐤒 = 𐤀׳ - 𐤀׳ 𐤄𐤂𐤃𐤓 𐤆𐤌𐤍𐤉 = 𐤀׳ - 𐤀׳ 𐤁𐤏𐤅𐤃 𐤃𐤋𐤐𐤒 <= 𐤌𐤎𐤐𐤓: 𐤄𐤃𐤐𐤎𐤇 𐤔𐤍𐤉𐤄 𐤆𐤌𐤍𐤉 = 𐤓𐤀𐤔𐤅𐤍 + 𐤔𐤍𐤉𐤄 𐤓𐤀𐤔𐤅𐤍 = 𐤔𐤍𐤉𐤄 𐤔𐤍𐤉𐤄 = 𐤆𐤌𐤍𐤉 𐤃𐤋𐤐𐤒 = 𐤃𐤋𐤐𐤒 + 𐤀׳ 𐤒-𐤃-𐤔 </pre> The following `𐤏𐤁𐤅𐤓` loop prints out the first ten natural numbers: <pre dir="rtl" align="right"> 𐤏𐤁𐤅𐤓 𐤌𐤎𐤐𐤓=𐤉׳,𐤌𐤎𐤐𐤓>=𐤀׳,𐤌𐤎𐤐𐤓=𐤌𐤎𐤐𐤓-𐤀׳: 𐤄𐤃𐤐𐤎𐤇 𐤌𐤎𐤐𐤓 𐤒-𐤃-𐤔 </pre> To accomplish nested operations or anamorphism, it is recommended to do a composition of subroutines. ## Subroutines > "*'I AM THAT I AM'*" [^3] Functions in Genesis are declared using the `𐤐𐤅𐤍𐤒𐤑𐤉𐤄` keyword. Being void and non-parameterized, however, they are actually subroutines. There is recursion insomuch that making a self-referential call from within a subroutine is possible, but there is no means to exit that recursion to express the irrevocable danger of pride and egoism. This design follows the contention that recursion, as Peter Deutsch identified, is divine and not encompassed by the domain of human programmers, as evidenced by God identifying himself recursively. <!--- > "*For if, after they have returned from the defilements of the world by the knowledge of the Lord and Savior Jesus Christ, they are again entangled in them and are overcome, the last state has become worse for them than the first*"--> To call on a subroutine, use the reference name with which it was defined. The following subroutine `𐤇𐤉𐤁𐤅𐤓` approximates the gravitational force of a 290-gram KJV Compact Ultraslim Bible one meter from a 70-kg human being: <pre dir="rtl" align="right"> 𐤄𐤂𐤃𐤓 𐤊𐤅𐤇 = (𐤀׳ / (𐤉׳ ^ 𐤉״𐤀)) * (𐤕𐤓𐤎״𐤆 / 𐤒׳) 𐤄𐤂𐤃𐤓 𐤕𐤅𐤓𐤄 = 𐤊״𐤈 / 𐤒׳ 𐤄𐤂𐤃𐤓 𐤀𐤃𐤌 = 𐤏׳ 𐤄𐤂𐤃𐤓 𐤌𐤓𐤇𐤒 = 𐤀׳ 𐤐𐤅𐤍𐤒𐤑𐤉𐤄 𐤇𐤉𐤁𐤅𐤓: 𐤄𐤂𐤃𐤓 𐤄𐤇𐤉𐤁𐤅𐤓 = (𐤊𐤅𐤇 * 𐤕𐤅𐤓𐤄 * 𐤀𐤃𐤌) / (𐤌𐤓𐤇𐤒 * 𐤌𐤓𐤇𐤒) 𐤄𐤃𐤐𐤎 𐤄𐤇𐤉𐤁𐤅𐤓 𐤒-𐤃-𐤔 𐤇𐤉𐤁𐤅𐤓 </pre> Other examples can be found in the respository. ## Data Structures Genesis provides fixed-length untyped array data structures. Curly braces are used to initialize arrays, and elements can be accessed or mutated through square bracket index operators: <pre dir="rtl" align="right"> 𐤄𐤂𐤃𐤓 𐤌𐤎𐤐𐤓 = {𐤀׳, 𐤁׳, 𐤂׳} 𐤌𐤎𐤐𐤓[𐤈׳/𐤈׳] = 𐤔𐤒𐤓 𐤏𐤁𐤅𐤓𐤊𐤋 𐤀𐤋𐤌𐤍𐤈, 𐤌𐤎𐤐𐤓: 𐤄𐤃𐤐𐤎𐤇 𐤀𐤋𐤌𐤍𐤈 𐤒-𐤃-𐤔 </pre> As denoted, `𐤏𐤁𐤅𐤓` or `𐤏𐤁𐤅𐤓𐤊𐤋` looping an array will yield its values. ## Math Library & Native Utilities | Function | Description | 𐤁 Equivalent(s) | | :-- | --- | --: | | Sqrt(#) | Returns the correctly rounded positive square root of a number value. | 𐤔𐤅𐤓𐤔(𐤍) | | Sin(∠) | Returns the trigonometric sine of an angle. | 𐤎𐤉𐤍(𐤈) | | Cos(∠) | Returns the trigonometric cosine of an angle. | 𐤒𐤅𐤎(𐤈) | | Tan(∠) | Returns the trigonometric tangent of an angle. | 𐤈𐤍(𐤈) | | ToDegrees(C) | Converts an angle measured in radians to degrees. | 𐤋𐤃(𐤒) | | ToRadians(∠) | Converts an angle measured in degrees to radians. | 𐤋𐤓(𐤈) | | Absolute(#) | Returns the absolute value of a number value. | 𐤏𐤌𐤇(𐤍) | | Log(#) | Returns the natural logarithm (base *e*) of a number value. | (𐤍)𐤋𐤅𐤂 | | Exp(#) | Returns Euler's number *e* raised to the power of a number value. | (𐤍)𐤀𐤒𐤎𐤐 | | Ulp(#) | Returns the size of an ulp of the argument. | (𐤍)𐤀𐤅𐤋𐤐 | | PI() | Returns π rounded to double precision. | ()𐤐𐤉𐤉 | | Random() | Returns a number value greater than or equal to 0.0 and less than 1.0. | ()𐤓𐤍𐤃 | | Evince() | Returns a random Bible quote. | ()𐤁𐤓𐤀 | Some calculations: <pre dir="rtl" align="right"> 𐤄𐤂𐤃𐤓 𐤔𐤈𐤇 = 𐤃׳ * 𐤐𐤉𐤉() * (𐤉״𐤁 ^ 𐤁׳) 𐤄𐤂𐤃𐤓 𐤌𐤔𐤅𐤋𐤔 = (𐤀׳/𐤁׳) * (𐤄׳ * 𐤎״𐤃 * 𐤎𐤉𐤍(𐤌״𐤄)) 𐤄𐤂𐤃𐤓 𐤒𐤋 = 𐤔𐤅𐤓𐤔(𐤎״𐤃) * 𐤓𐤍𐤃() 𐤄𐤃𐤐𐤎𐤇 𐤔𐤈𐤇 𐤄𐤃𐤐𐤎𐤇 𐤌𐤔𐤅𐤋𐤔 𐤄𐤃𐤐𐤎𐤇 𐤒𐤋 </pre> A subroutine for calculating the energy of an electron in the <i>`𐤍`</i>-th orbital of a hydrogenic atom in Joules: <pre dir="rtl" align="right"> 𐤐𐤅𐤍𐤒𐤑𐤉𐤄 𐤀𐤍𐤓𐤂𐤉𐤄: 𐤄𐤂𐤃𐤓 𐤍 = 𐤁׳ 𐤄𐤂𐤃𐤓 𐤂𐤀𐤅𐤋 = ((𐤂׳ * (𐤉׳ ^ 𐤇׳)) * ((𐤉״𐤀 / 𐤉׳) * (𐤉׳ ^ 𐤆׳)) * (((𐤔׳ + 𐤔׳ * 𐤉׳) / (𐤕״𐤒)) * (𐤉׳ ^ (𐤅׳ - 𐤌׳))) * (𐤀׳ - 𐤁׳)) * (𐤀׳ / (𐤍 * 𐤍)) 𐤄𐤃𐤐𐤎 𐤂𐤀𐤅𐤋 𐤒-𐤃-𐤔 𐤀𐤍𐤓𐤂𐤉𐤄 </pre> FAQ ------ ### Why not use Modern Hebrew? If you are able to program in this language, I have failed. ### Why are you running an interpreted language over an interpreted language? > "*Wherefore, just as sin came into the world through one man, and death through sin, and so death spread to all men because all sinned*" [^4] ### Why not make an object-oriented language? This suggestion makes me consternated. Genesis will never be object-oriented because the Bible explicitly forbids object worship: > "*These prized objects are really worthless. The people who worship idols don’t know this, so they are all put to shame. []Their eyes are closed, and they cannot see. Their minds are shut, and they cannot think. The person who made the idol never stops to reflect, 'Why, it’s just a block of wood! I burned half of it for heat and used it to bake my bread and roast my meat. How can the rest of it be a god? Should I bow down to worship a piece of wood?'*" [^5] [^1]: [Psalm 139:13-16](https://www.biblegateway.com/passage/?search=Psalm%20139%3A13-16&version=NIV) [^2]: [Isaiah 55:6-7](https://www.biblegateway.com/passage/?search=Isaiah%2055%3A6-7&version=KJV) [^3]: [Exodus 3:14](https://www.biblegateway.com/passage/?search=Exodus%203%3A14&version=KJV) [^4]: [Romans 5:12-13](https://biblia.com/bible/esv/romans/5/12-13) [^5]: [Isaiah 44:9-20](https://www.biblestudytools.com/nlt/isaiah/passage/?q=isaiah+44:9-20)
0
oracle/tribuo
Tribuo - A Java machine learning library
classification clustering deep-learning java machine-learning ml nlp regression
<p align="center"><img width="50%" alt="Tribuo Logo" src="docs/img/Tribuo_Logo_Colour.png" /></p> # Tribuo - A Java prediction library (v4.3) [Tribuo](https://tribuo.org) is a machine learning library in Java that provides multi-class classification, regression, clustering, anomaly detection and multi-label classification. Tribuo provides implementations of popular ML algorithms and also wraps other libraries to provide a unified interface. Tribuo contains all the code necessary to load, featurise and transform data. Additionally, it includes the evaluation classes for all supported prediction types. Development is led by [Oracle Labs](https://labs.oracle.com)' Machine Learning Research Group; we welcome community contributions. All trainers are configurable using the [OLCUT](https://github.com/oracle/olcut) configuration system. This allows a user to define a trainer in an xml or json file and repeatably build models. Example configurations for each of the supplied Trainers can be found in the config folder of each package. These configuration files can also be written in json or edn by using the appropriate OLCUT configuration dependency. Models and datasets are serializable using Java serialization. All models and evaluations include a serializable provenance object which records the creation time of the model or evaluation, the identity of the data and any transformations applied to it, as well as the hyperparameters of the trainer. In the case of evaluations, this provenance information also includes the specific model used. Provenance information can be extracted as JSON, or serialised directly using Java serialisation. For production deployments, provenance information can be redacted and replaced with a hash to provide model tracking through an external system. Many Tribuo models can be exported in ONNX format for deployment in other languages, platforms or cloud services. Tribuo runs on Java 8+, and we test on LTS versions of Java along with the latest release. Tribuo itself is a pure Java library and is supported on all Java platforms; however, some of our interfaces require native code and are thus supported only where there is native library support. We test on x86\_64 architectures on Windows 10, macOS and Linux (RHEL/OL/CentOS 7+), as these are supported platforms for the native libraries with which we interface. If you're interested in another platform and wish to use one of the native library interfaces (ONNX Runtime, TensorFlow, and XGBoost), we recommend reaching out to the developers of those libraries. Note the model card and reproducibility packages require Java 17, and as such are not part of the `tribuo-all` Maven Central deployment. ## Documentation * [Library Architecture](docs/Architecture.md) * [Package Overview](docs/PackageOverview.md) * Javadoc [4.3](https://tribuo.org/learn/4.3/javadoc), [4.2](https://tribuo.org/learn/4.2/javadoc), [4.1](https://tribuo.org/learn/4.1/javadoc/), [4.0](https://tribuo.org/learn/4.0/javadoc/) * [Helper Programs](docs/HelperPrograms.md) * [Developer Documentation](docs/Internals.md) * [Roadmap](docs/Roadmap.md) * [Frequently Asked Questions](docs/FAQs.md) ## Tutorials Tutorial notebooks, including examples of Classification, Clustering, Regression, Anomaly Detection, TensorFlow, document classification, columnar data loading, working with externally trained models, and the configuration system, can be found in the [tutorials](tutorials). These use the [IJava](https://github.com/SpencerPark/IJava) Jupyter notebook kernel, and work with Java 10+, except the model card & reproducibility tutorials which require Java 17. To convert the tutorials' code back to Java 8, in most cases simply replace the `var` keyword with the appropriate types. ## Algorithms ### General predictors Tribuo includes implementations of several algorithms suitable for a wide range of prediction tasks: |Algorithm|Implementation|Notes| |---|---|---| |Bagging|Tribuo|Can use any Tribuo trainer as the base learner| |Random Forest|Tribuo|For both classification and regression| |Extra Trees|Tribuo|For both classification and regression| |K-NN|Tribuo|Includes options for several parallel backends, as well as a single threaded backend| |Neural Networks|TensorFlow|Train a neural network in TensorFlow via the Tribuo wrapper. Models can be deployed using the ONNX interface or the TF interface| The ensembles and K-NN use a combination function to produce their output. These combiners are prediction task specific, but the ensemble & K-NN implementations are task agnostic. We provide voting and averaging combiners for multi-class classification, multi-label classification and regression tasks. ### Classification Tribuo has implementations or interfaces for: |Algorithm|Implementation|Notes| |---|---|---| |Linear models|Tribuo|Uses SGD and allows any gradient optimizer| |Factorization Machines|Tribuo|Uses SGD and allows any gradient optimizer| |CART|Tribuo|| |SVM-SGD|Tribuo|An implementation of the Pegasos algorithm| |Adaboost.SAMME|Tribuo|Can use any Tribuo classification trainer as the base learner| |Multinomial Naive Bayes|Tribuo|| |Regularised Linear Models|LibLinear|| |SVM|LibSVM or LibLinear|LibLinear only supports linear SVMs| |Gradient Boosted Decision Trees|XGBoost|| Tribuo also supplies a linear chain CRF for sequence classification tasks. This CRF is trained via SGD using any of Tribuo's gradient optimizers. Tribuo has a set of information theoretic feature selection algorithms which can be applied to classification tasks. Feature inputs are automatically discretised into equal width bins. At the moment this includes implementations of mutual information maximisation (MIM), Conditional Mutual Information Maximisation (CMIM), minimum Redundancy Maximum Relevancy (mRMR) and Joint Mutual Information (JMI). To explain classifier predictions there is an implementation of the LIME algorithm. Tribuo's implementation allows the mixing of text and tabular data, along with the use of any sparse model as an explainer (e.g., regression trees, lasso etc), however it does not support images. ### Regression Tribuo's regression algorithms are multidimensional by default. Single dimensional implementations are wrapped in order to produce multidimensional output. |Algorithm|Implementation|Notes| |---|---|---| |Linear models|Tribuo|Uses SGD and allows any gradient optimizer| |Factorization Machines|Tribuo|Uses SGD and allows any gradient optimizer| |CART|Tribuo|| |Lasso|Tribuo|Using the LARS algorithm| |Elastic Net|Tribuo|Using the co-ordinate descent algorithm| |Regularised Linear Models|LibLinear|| |SVM|LibSVM or LibLinear|LibLinear only supports linear SVMs| |Gradient Boosted Decision Trees|XGBoost|| ### Clustering Tribuo includes infrastructure for clustering and also supplies two clustering algorithm implementations. We expect to implement additional algorithms over time. |Algorithm|Implementation|Notes| |---|---|---| |HDBSCAN\*|Tribuo|A density-based algorithm which discovers clusters and outliers| |K-Means|Tribuo|Includes both sequential and parallel backends, and the K-Means++ initialisation algorithm| ### Anomaly Detection Tribuo offers infrastructure for anomaly detection tasks. We expect to add new implementations over time. |Algorithm|Implementation|Notes| |---|---|---| |One-class SVM|LibSVM|| |One-class linear SVM|LibLinear|| ### Multi-label classification Tribuo offers infrastructure for multi-label classification, along with a wrapper which converts any of Tribuo's multi-class classification algorithms into a multi-label classification algorithm. We expect to add more multi-label specific implementations over time. |Algorithm|Implementation|Notes| |---|---|---| |Independent wrapper|Tribuo|Converts a multi-class classification algorithm into a multi-label one by producing a separate classifier for each label| |Classifier Chains|Tribuo|Provides classifier chains and randomized classifier chain ensembles using any of Tribuo's multi-class classification algorithms| |Linear models|Tribuo|Uses SGD and allows any gradient optimizer| |Factorization Machines|Tribuo|Uses SGD and allows any gradient optimizer| ### Interfaces In addition to our own implementations of Machine Learning algorithms, Tribuo also provides a common interface to popular ML tools on the JVM. If you're interested in contributing a new interface, open a GitHub Issue, and we can discuss how it would fit into Tribuo. Currently we have interfaces to: * [LibLinear](https://github.com/bwaldvogel/liblinear-java) - via the LibLinear-java port of the original [LibLinear](https://www.csie.ntu.edu.tw/~cjlin/liblinear/) (v2.44). * [LibSVM](https://www.csie.ntu.edu.tw/~cjlin/libsvm/) - using the pure Java transformed version of the C++ implementation (v3.25). * [ONNX Runtime](https://onnxruntime.ai) - via the Java API contributed by our group (v1.12.1). * [TensorFlow](https://tensorflow.org) - Using [TensorFlow Java](https://github.com/tensorflow/java) v0.4.2 (based on TensorFlow v2.7.4). This allows the training and deployment of TensorFlow models entirely in Java. * [XGBoost](https://xgboost.ai) - via the built in XGBoost4J API (v1.6.2). ## Binaries Binaries are available on Maven Central, using groupId `org.tribuo`. To pull all the Java 8 compatible components of Tribuo, including the bindings for TensorFlow, ONNX Runtime and XGBoost (which are native libraries), use: Maven: ```xml <dependency> <groupId>org.tribuo</groupId> <artifactId>tribuo-all</artifactId> <version>4.3.1</version> <type>pom</type> </dependency> ``` or from Gradle: ```groovy implementation ("org.tribuo:tribuo-all:4.3.1@pom") { transitive = true // for build.gradle (i.e., Groovy) // isTransitive = true // for build.gradle.kts (i.e., Kotlin) } ``` The `tribuo-all` dependency is a pom which depends on all the Tribuo subprojects except for the model card and reproducibility projects which require Java 17. Most of Tribuo is pure Java and thus cross-platform, however some of the interfaces link to libraries which use native code. Those interfaces (TensorFlow, ONNX Runtime and XGBoost) only run on supported platforms for the respective published binaries, and Tribuo has no control over which binaries are supplied. If you need support for a specific platform, reach out to the maintainers of those projects. As of the 4.1 release these native packages all provide x86\_64 binaries for Windows, macOS and Linux. It is also possible to compile each package for macOS ARM64 (i.e., Apple Silicon), though there are no binaries available on Maven Central for that platform for TensorFlow or XGBoost. As of the 4.3 release Tribuo now depends on a version of ONNX Runtime which includes support for macOS ARM64 and Linux aarch64 platforms. When developing on an ARM platform you can select the `arm` profile in Tribuo's `pom.xml` to disable the native library tests. Individual jars are published for each Tribuo module. It is preferable to depend only on the modules necessary for the specific project. This prevents your code from unnecessarily pulling in large dependencies like TensorFlow. ## Compiling from source Tribuo uses [Apache Maven](https://maven.apache.org/) v3.5 or higher to build. Tribuo is compatible with Java 8+, and we test on LTS versions of Java along with the latest release. To build, simply run `mvn clean package`. All Tribuo's dependencies should be available on Maven Central. Please file an issue for build-related issues if you're having trouble (though do check if you're missing proxy settings for Maven first, as that's a common cause of build failures, and out of our control). Note if you're building using Java 16 or earlier the model card and reproducibility packages will be disabled. ## Repository Layout Development happens on the `main` branch, which has the version number of the next Tribuo release with "-SNAPSHOT" appended to it. Tribuo major and minor releases will be tagged on the `main` branch, and then have a branch named `vA.B.X-release-branch` (for release `vA.B.0`) branched from the tagged release commit for any point releases (i.e., `vA.B.1`, `vA.B.2` etc) following from that major/minor release. Those point releases are tagged on the specific release branch e.g., `v4.0.2` is tagged on the `v4.0.X-release-branch`. ## Contributing We welcome contributions! See our [contribution guidelines](./CONTRIBUTING.md). We have a discussion mailing list [tribuo-devel@oss.oracle.com](mailto:tribuo-devel@oss.oracle.com), archived [here](https://oss.oracle.com/pipermail/tribuo-devel/). We're investigating different options for real time chat, check back in the future. For bug reports, feature requests or other issues, please file a [Github Issue](https://github.com/oracle/tribuo/issues). ## Security Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process. ## License Tribuo is licensed under the [Apache 2.0 License](./LICENSE.txt). ## Release Notes: - [v4.3.1](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-3-1-release-notes.md) - Small bug fixes, notably to CART trees and Example.densify, bumps dependencies to more secure versions. - [v4.3.0](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-3-release-notes.md) - Model card support, feature selection for classification, protobuf serialization format, kd-tree for distance computations, speed improvements for sparse linear models. Version bumps for most dependencies, and various other small fixes and improvements. - [v4.2.2](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-2-2-release-notes.md) - Small bug fixes, bump TF-Java to 0.4.2, jackson to 2.13.4, protobuf-java to 3.19.6, OpenCSV to 5.7.1. - [v4.2.1](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-2-1-release-notes.md) - Bug fixes for KMeans' multithreading, nondeterministic iteration orders affecting ONNX export and K-Means initialization, and upgraded TF-Java to 0.4.1. - [v4.2.0](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-2-release-notes.md) - Added factorization machines, classifier chains, HDBSCAN. Added ONNX export and OCI Data Science integration. Added reproducibility framework. Various other small fixes and improvements, including the regression fixes from v4.1.1. Filled out the remaining javadoc, added 4 new tutorials (onnx export, multi-label classification, reproducibility, hdbscan), expanded existing tutorials. - [v4.1.1](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-1-1-release-notes.md) - Bug fixes for multi-output regression, multi-label evaluation, KMeans & KNN with SecurityManager, and update TF-Java 0.4.0. - [v4.1.0](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-1-release-notes.md) - Added TensorFlow training support, a BERT feature extractor, ExtraTrees, K-Means++, many linear model & CRF performance improvements, new tutorials on TF and document classification. Many bug fixes & documentation improvements. - [v4.0.2](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-0-2-release-notes.md) - Many bug fixes (CSVDataSource, JsonDataSource, RowProcessor, LibSVMTrainer, Evaluations, Regressor serialization). Improved javadoc and documentation. Added two new tutorials (columnar data and external models). - [v4.0.1](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-0-1-release-notes.md) - Bugfix for CSVReader to cope with blank lines, added IDXDataSource to allow loading of native MNIST format data. - [v4.0.0](https://github.com/oracle/tribuo/blob/main/docs/release-notes/tribuo-v4-0-release-notes.md) - Initial public release. - v3 - Added provenance system, the external model support and onnx integrations. - v2 - Expanded beyond a classification system, to support regression, clustering and multi-label classification. - v1 - Initial internal release. This release only supported multi-class classification.
0
Netflix/curator
ZooKeeper client wrapper and rich ZooKeeper framework
null
http://netflix.github.com/curator/curator.png # IMPORTANT NOTE!!! Curator has moved to Apache. The Netflix Curator project will remain to hold Netflix extensions to Curator. http://curator.apache.org The previous Netflix branch is now in a branch named "archive". # ZKCLIENT BRIDGE Please see the doc at https://github.com/Netflix/curator/wiki/ZKClient-Bridge Jordan Zimmerman (mailto:jzimmerman@netflix.com) # LICENSE Copyright 2011 Netflix, 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.
0
jayZheng87/Thusy
Java 工具类库;在全面集成 Hutool 上进行工具类二次收集的一个类库
null
**依赖与ApacheCommon的 Java 通用工具** **工程类概览:** `ArrayUtil` ----->数组通用工具类 `BrowserUtil` ----->浏览器通用工具类 `ClassLoaderUtil` ----->类加载通用工具类 `ClassUtil` ----->类通用工具类 `CollectionUtil` ----->依赖与 commons.lang 集合通用工具类 `DateUtil` ----->依赖与 commons.lang 的日期通用工具类 `FileUtil` ----->文件通用工具类 `IOUtil` ----->输入输出通用工具类 `JVMRandom` ----->随机数通用工具类 `NumberUtil` ----->数值通用工具类 `ObjectUtil` ----->对象通用工具类 `PropertiesLoader` ----->配置文件加载读取通用工具类 `ReflectionUtils` ----->反射通用工具类 `RMButil` ----->人民币通用工具类 `SecurityUtil` ----->依赖于 commons.codec 的安全通用工具类 `StringUtil` ----->字符串通用工具类 `WebContainerUtil` ----->容器通用工具类 `ZipUtil` ----->压缩通用工具类 `JsonUtil` ----> 依赖于 jackson 的 Json 工具类 `XmlUtil` -----> 依赖于 Xstream 的XML工具类 `HttpClientUtil` ----> 依赖与 apache.httpcomponents 的http 客户端工具类
0
yahoo/egads
A Java package to automatically detect anomalies in large scale time-series data
anomaly-detection-models big-data java time-series
[![Build Status](https://travis-ci.org/yahoo/egads.svg?branch=master)](https://travis-ci.org/yahoo/egads) EGADS Java Library ========================================================== EGADS (Extensible Generic Anomaly Detection System) is an open-source Java package to automatically detect anomalies in large scale time-series data. EGADS is meant to be a library that contains a number of anomaly detection techniques applicable to many use-cases in a single package with the only dependency being Java. EGADS works by first building a time-series model which is used to compute the expected value at time *t*. Then a number of errors *E* are computed by comparing the expected value with the actual value at time *t*. EGADS automatically determines thresholds on *E* and outputs the most probable anomalies. EGADS library can be used in a wide variety of contexts to detect outliers and change points in time-series that can have a various seasonal, trend and noise components. How to get started =========================== EGADS was designed as a self contained library that has a collection of time-series and anomaly detection models that are applicable to a wide-range of use cases. To compile the library into a single jar, clone the repo and type the following: ```shell mvn clean compile assembly:single ``` You may have to set your `JAVA_HOME` variable to the appropriate JVM. To do this run: ```shell export JAVA_HOME=/usr/lib/jvm/{JVM directory for desired version} ``` Usage ========================== To run a simple example type: ```shell java -Dlog4j.configurationFile=src/test/resources/log4j2.xml -cp target/egads-*-jar-with-dependencies.jar com.yahoo.egads.Egads src/test/resources/sample_config.ini src/test/resources/sample_input.csv ``` which produces the following picture (Note that you can enable this UI by setting `OUTPUT` config key to `GUI` in `sample_config.ini`). ![gui](doc/ui.png "EGADS GUI") One can also specify config parameters on a command line. For example to do anomaly detection using Olympic Scoring as a time-series model and a density based method as an anomaly detection model use the following. ```shell java -Dlog4j.configurationFile=src/test/resources/log4j2.xml -cp target/egads-*-jar-with-dependencies.jar com.yahoo.egads.Egads "MAX_ANOMALY_TIME_AGO:999999999;AGGREGATION:1;OP_TYPE:DETECT_ANOMALY;TS_MODEL:OlympicModel;AD_MODEL:ExtremeLowDensityModel;INPUT:CSV;OUTPUT:STD_OUT;BASE_WINDOWS:168;PERIOD:-1;NUM_WEEKS:3;NUM_TO_DROP:0;DYNAMIC_PARAMETERS:0;TIME_SHIFTS:0" src/test/resources/sample_input.csv ``` To run anomaly detection using no time-series model with an auto static threshold for anomaly detection, use the following: ```shell java -Dlog4j.configurationFile=src/test/resources/log4j2.xml -cp target/egads-*-jar-with-dependencies.jar com.yahoo.egads.Egads "MAX_ANOMALY_TIME_AGO:999999999;AGGREGATION:1;OP_TYPE:DETECT_ANOMALY;TS_MODEL:NullModel;AD_MODEL:SimpleThresholdModel;SIMPLE_THRESHOLD_TYPE:AdaptiveMaxMinSigmaSensitivity;INPUT:CSV;OUTPUT:STD_OUT;AUTO_SENSITIVITY_ANOMALY_PCNT:0.2;AUTO_SENSITIVITY_SD:2.0" src/test/resources/sample_input.csv ``` To embed the EGADs library in an application, pull the compiled JAR from JCenter by adding the proper repository. For example in a Maven POM file add: ``` <repositories> <repository> <id>jcenter</id> <url>https://jcenter.bintray.com/</url> </repository> </repositories> ``` Then import the dependency, e.g.: ``` <dependency> <groupId>com.yahoo.egads</groupId> <artifactId>egads</artifactId> <version>0.4.0</version> </dependency> ``` Overview ======== While rapid advances in computing hardware and software have led to powerful applications, still hundreds of software bugs and hardware failures continue to happen in a large cluster compromising user experience and subsequently revenue. Non-stop systems have a strict uptime requirement and continuous monitoring of these systems is critical. From the data analysis point of view, this means non-stop monitoring of large volume of time-series data in order to detect potential faults or anomalies. Due to the large scale of the problem, human monitoring of this data is practically infeasible which leads us to automated anomaly detection. An anomaly, or an outlier, is a data point which is significantly different from the rest of the data. Generally, the data in most applications is created by one or more generating processes that reflect the functionality of a system. When the underlying generating process behaves in an unusual way, it creates outliers. Fast and efficient identification of these outliers is useful for many applications including: intrusion detection, credit card fraud, sensor events, medical diagnoses, law enforcement and others. Current approaches in automated anomaly detection suffer from a large number of false positives which prohibit the usefulness of these systems in practice. Use-case, or category specific, anomaly detection models may enjoy a low false positive rate for a specific application, but when the characteristics of the time-series change, these techniques perform poorly without proper retraining. EGADS (Extensible Generic Anomaly Detection System) enables the accurate and scalable detection of time-series anomalies. EGADS separates forecasting and anomaly detection two separate components which allows the person to add her own models into any of the components. Architecture =========== The EGADS framework consists of two main components: the time-series modeling module (TMM), the anomaly detection module (ADM). Given a time-series the TMM component models the time-series producing an expected value later consumed by the ADM that computes anomaly scores. EGADS was built as a framework to be easily integrated into an existing monitoring infrastructure. At Yahoo, our internal Yahoo Monitoring Service (YMS) processes millions of data-points every second. Therefore, having a scalable, accurate and automated anomaly detection for YMS is critical. For this reason, EGADS can be compiled into a single light-weight jar and deployed easily at scale. The TMM and ADM can be found under `main/java/com/yahoo/egads/models`. The example of the models supported by TMM and ADM can be found in in the two table below. We expect this collection of models to grow as more contribution is put forward by the community. ###### List of current TimeSeries Models ![models](doc/egadstsmd.png "Supported Time-Series Models") ###### List of current Anomaly Detection Models ![admodels](doc/egadsadm.png "Supported Anomaly Detection Models") Configuration ============= Below are the various configuration parameters supported by EGADS. ``` # Only show anomalies no older than this. # If this is set to 0, then only output an anomaly # if it occurs on the last time-stamp. MAX_ANOMALY_TIME_AGO 99999 # Denotes how much should the time-series be aggregated by. # If set to 1 or less, this setting is ignored. AGGREGATION 1 # OP_TYPE specifies the operation type. # Options: DETECT_ANOMALY, # UPDATE_MODEL, # TRANSFORM_INPUT OP_TYPE DETECT_ANOMALY # TS_MODEL specifies the time-series # model type. # Options: AutoForecastModel # DoubleExponentialSmoothingModel # MovingAverageModel # MultipleLinearRegressionModel # NaiveForecastingModel # OlympicModel # PolynomialRegressionModel # RegressionModel # SimpleExponentialSmoothingModel # TripleExponentialSmoothingModel # WeightedMovingAverageModel # SpectralSmoother # NullModel TS_MODEL OlympicModel # AD_MODEL specifies the anomaly-detection # model type. # Options: ExtremeLowDensityModel # AdaptiveKernelDensityChangePointDetector # KSigmaModel # NaiveModel # DBScanModel # SimpleThresholdModel AD_MODEL ExtremeLowDensityModel # Type of the simple threshold model. # Options: AdaptiveMaxMinSigmaSensitivity # AdaptiveKSigmaSensitivity # SIMPLE_THRESHOLD_TYPE # Specifies the input src. # Options: STDIN # CSV INPUT CSV # Specifies the output src. # Options: STD_OUT, # ANOMALY_DB # GUI # PLOT OUTPUT STD_OUT # THRESHOLD specifies the threshold for the # anomaly detection model. # Comment to auto-detect all thresholds. # Options: mapee,mae,smape,mape,mase. # THRESHOLD mape#10,mase#15 ##################################### ### Olympic Forecast Model Config ### ##################################### # The possible time-shifts for Olympic Scoring. TIME_SHIFTS 0,1 # The possible base windows for Olympic Scoring. BASE_WINDOWS 24,168 # Period specifies the periodicity of the # time-series (e.g., the difference between successive time-stamps). # Options: (numeric) # 0 - auto detect. # -1 - disable. PERIOD -1 # NUM_WEEKS specifies the number of weeks # to use in OlympicScoring. NUM_WEEKS 8 # NUM_TO_DROP specifies the number of # highest and lowest points to drop. NUM_TO_DROP 0 # If dynamic parameters is set to 1, then # EGADS will dynamically vary parameters (NUM_WEEKS) # to produce the best fit. DYNAMIC_PARAMETERS 0 ################################################### ### ExtremeLowDensityModel & DBScanModel Config ### ################################################### # Denotes the expected % of anomalies # in your data. AUTO_SENSITIVITY_ANOMALY_PCNT 0.01 # Refers to the cluster standard deviation. AUTO_SENSITIVITY_SD 3.0 ############################ ### NaiveModel Config ### ############################ # Window size where the spike is to be found. WINDOW_SIZE 0.1 ####################################################### ### AdaptiveKernelDensityChangePointDetector Config ### ####################################################### # Change point detection parameters PRE_WINDOW_SIZE 48 POST_WINDOW_SIZE 48 CONFIDENCE 0.8 ############################### ### SpectralSmoother Config ### ############################### # WINDOW_SIZE should be greater than the size of longest important seasonality. # By default it is set to 192 = 8 * 24 which is worth of 8 days (> 1 week) for hourly time-series. WINDOW_SIZE 192 # FILTERING_METHOD specifies the filtering method for Spectral Smoothing # Options: GAP_RATIO (Recommended: FILTERING_PARAM = 0.01) # EIGEN_RATIO (Recommended: FILTERING_PARAM = 0.1) # EXPLICIT (Recommended: FILTERING_PARAM = 10) # K_GAP (Recommended: FILTERING_PARAM = 8) # VARIANCE (Recommended: FILTERING_PARAM = 0.99) # SMOOTHNESS (Recommended: FILTERING_PARAM = 0.97) FILTERING_METHOD GAP_RATIO FILTERING_PARAM 0.01 ``` Contributions ================ 1. Clone your fork 2. Hack away 3. If you are adding new functionality, document it in the README 4. Verify your code by running `mvn package` and adding additional tests. 5. Push the branch up to GitHub 6. Send a pull request to the yahoo/egads project. We actively welcome contributions. If you don't know where to start, try checking out the [issue list](https://github.com/yahoo/egads/issues) and fixing up the place. Or, you can add a model - a goal of this project is to have a robust, lightweight and dependency-free set of models to choose from that are ready to be deployed in production. References ============ <a href="https://s.yimg.com/ge/labs/v2/uploads/kdd2015.pdf">Generic and Scalable Framework for Automated Time-series Anomaly Detection</a> by Nikolay Laptev, Saeed Amizadeh, Ian Flint , KDD 2015 (August 10, 2015) Citation ============ If you use EGADS in your projects, please cite: <a href="https://s.yimg.com/ge/labs/v2/uploads/kdd2015.pdf">Generic and Scalable Framework for Automated Time-series Anomaly Detection</a> by Nikolay Laptev, Saeed Amizadeh, Ian Flint , KDD 2015 BibTeX: ```tex @inproceedings{laptev2015generic, title={Generic and Scalable Framework for Automated Time-series Anomaly Detection}, author={Laptev, Nikolay and Amizadeh, Saeed and Flint, Ian}, booktitle={Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining}, pages={1939--1947}, year={2015}, organization={ACM} } ``` License ======= Code licensed under the GPL License. See LICENSE file for terms.
0
itmuch/spring-cloud-docker-microservice-book-code
《Spring Cloud与Docker微服务架构实战》配套代码。讨论QQ群:731548893
cloud microservice sping spring-cloud
# 《Spring Cloud与Docker微服务架构实战 第二版》1-11章配套代码 * 本仓库是《Spring Cloud与Docker微服务架构实战 **第二版**》的配套代码,第一版的配套源码详见Camden分支。 * 包含60+个DEMO * 覆盖了 * Eureka * Ribbon * Feign * Hystrix * Zuul * Spring Cloud Config * Spring Cloud Bus * Spring Cloud Sleuth等学习示例,**其中,Sleuth一章的配套代码详见trace目录。其他代码都在根目录** * 12-14章配套代码详见:<http://git.oschina.net/itmuch/spring-cloud-docker-microservice-book-code-docker> ## 交流 * QQ群:731548893,欢迎加入 * 个人博客:[http://www.itmuch.com](http://www.itmuch.com) * Spring For All 社区:<http://www.spring4all.com> * 微信:![微信公众号](wx.jpg) **持续更新Spring Cloud、Docker相关知识**,敬请关注!! **持续更新Spring Cloud、Docker相关知识**,敬请关注!! **持续更新Spring Cloud、Docker相关知识**,敬请关注!!
0
sonyxperiadev/ApkAnalyser
null
null
null
0
dromara/myth
Reliable messages resolve distributed transactions
activemq aop dubbo kafka kryo motan protobuf rabbitmq rocketmq soa spring springboot springcloud translation
myth ================ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d0dd634df7854d27add47fcfaea0e9d5)](https://www.codacy.com/app/yu199195/myth?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=yu199195/myth&amp;utm_campaign=Badge_Grade) [![Total lines](https://tokei.rs/b1/github/yu199195/myth?category=lines)](https://github.com/yu199195/myth) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?label=license)](https://github.com/yu199195/myth/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/org.dromara/myth.svg?label=maven%20central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.dromara%22%20AND%20myth) [![QQ群](https://img.shields.io/badge/chat-on%20QQ-ff69b4.svg?style=flat-square)](https://shang.qq.com/wpa/qunwpa?idkey=2e9e353fa10924812bc58c10ab46de0ca6bef80e34168bccde275f7ca0cafd85) ### Reliable messages resolve distributed transactions # Modules * myth-admin: Transaction log management background * myth-annotation : Framework common annotations * myth-common : Framework common class * myth-core : Framework core package (annotation processing, log storage...) * myth-dashboard : Management background front-end * myth-dubbo : Support for the dubbo framework Less than 2.7 version * myth-motan : Support for the motan rpc framework * myth-springcloud : Support for the spring cloud rpc framework * myth-spring-boot-starter : Support for the spring boot starter * myth-aliyunmq: Support for aliyunmq * myth-jms : support for Mq for the JMS protocol(amq...) * myth-kafka : support for kafka * myth-rabbitmq : support for rabbitmq * myth-rocketmq : support for rocketmq * hmily-demo : Examples using the hmily framework # Features * All spring versions are supported and Seamless integration * Provides support for the springcloud dubbo motan RPC framework * Provides integration of the spring boot starter approach * Support for a lot of messaging middleware (rabbitmq jms kafka rabbitmq rocketmq) * Local transaction storage support : redis mongodb zookeeper file mysql * Transaction log serialization support : java hessian kryo protostuff * Spi extension : Users can customize the storage of serialization and transaction logs # Prerequisite * You must use jdk1.8 + * You must be a user of the spring framework * You must use messaging middleware * You must use one of the dubbo, motan, and springcloud RPC frameworks # About Myth is a Reliable messages solution for distributed transactions, Its rapid integration, zero penetration high performance has been run by a number of companies in the production environment. Myth is not a framework for exception rollbacks . Myth To ensure that your RPC interface can be executed, use mq to execute the RPC you need to call when your RPC interface is down If you want to use it or get a quick look at it. [Quick Start](http://dromara.org/website/zh-cn/docs/myth/index.html) # Quick Start * #### Clone & Build ``` > git clone https://github.com/yu199195/myth.git > cd myth > mvn -DskipTests clean install -U ``` * #### execute this sql https://github.com/yu199195/myth/tree/master/myth-demo/sql/myth-mysql-demo.sql * #### Find the RPC framework that works for you https://github.com/yu199195/myth/tree/master/myth-demo # Stargazers [![Stargazers over time](https://starchart.cc/yu199195/myth.svg)](https://starchart.cc/yu199195/myth) # Support ![](https://yu199195.github.io/images/qq.png) ![](https://yu199195.github.io/images/public.jpg)
0
aNNiMON/Lightweight-Stream-API
Stream API from Java 8 rewritten on iterators for Java 7 and below
backports functional-programming java stream-api
Lightweight-Stream-API ====================== [![Coverage Status](https://coveralls.io/repos/aNNiMON/Lightweight-Stream-API/badge.svg?branch=master&service=github)](https://coveralls.io/github/aNNiMON/Lightweight-Stream-API?branch=master) [![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=lightweight-stream-api&metric=alert_status)](https://sonarcloud.io/dashboard?id=lightweight-stream-api) [![SonarCloud Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=lightweight-stream-api&metric=sqale_rating)](https://sonarcloud.io/dashboard/?id=lightweight-stream-api) [![Build Status](https://travis-ci.org/aNNiMON/Lightweight-Stream-API.svg?branch=master)](https://travis-ci.org/aNNiMON/Lightweight-Stream-API) [![Maven Central](https://img.shields.io/maven-central/v/com.annimon/stream.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.annimon%22%20AND%20a%3A%22stream%22) [![javadoc](https://javadoc.io/badge2/com.annimon/stream/javadoc.svg)](https://javadoc.io/doc/com.annimon/stream) Stream API from Java 8 rewritten on iterators for Java 7 and below. ### Includes + Functional interfaces (`Supplier`, `Function`, `Consumer` etc); + `Stream`/`IntStream`/`LongStream`/`DoubleStream` (without parallel processing, but with a variety of additional methods and with custom operators); + `Optional`/`OptionalBoolean`/`OptionalInt`/`OptionalLong`/`OptionalDouble` classes; + `Exceptional` class - functional way to deal with exceptions; + `Objects` from Java 7. ### Usage ```java Stream.of(/* array | list | set | map | anything based on Iterator/Iterable interface */) .filter(..) .map(..) ... .sorted() .forEach(..); Stream.of(value1, value2, value3)... IntStream.range(0, 10)... ``` Example project: https://github.com/aNNiMON/Android-Java-8-Stream-Example ## Key features ### Custom operators Unlike Java 8 streams, Lightweight-Stream-API provides the ability to apply custom operators. ```java Stream.of(...) .custom(new Reverse<>()) .forEach(...); public final class Reverse<T> implements UnaryOperator<Stream<T>> { @Override public Stream<T> apply(Stream<T> stream) { final Iterator<? extends T> iterator = stream.getIterator(); final ArrayDeque<T> deque = new ArrayDeque<T>(); while (iterator.hasNext()) { deque.addFirst(iterator.next()); } return Stream.of(deque.iterator()); } } ``` You can find more examples [here](https://github.com/aNNiMON/Lightweight-Stream-API/blob/master/stream/src/test/java/com/annimon/stream/CustomOperators.java). ### Additional operators In addition to backported Java 8 Stream operators, the library provides: - `filterNot` - negated `filter` operator ```java // Java 8 stream.filter(((Predicate<String>) String::isEmpty).negate()) // LSA stream.filterNot(String::isEmpty) ``` - `select` - filters instances of the given class ```java // Java 8 stream.filter(Integer.class::isInstance) // LSA stream.select(Integer.class) ``` - `withoutNulls` - filters only not null elements ```java Stream.of("a", null, "c", "d", null) .withoutNulls() // [a, c, d] ``` - `sortBy` - sorts by extractor function ```java // Java 8 stream.sorted(Comparator.comparing(Person::getName)) // LSA stream.sortBy(Person::getName) ``` - `groupBy` - groups by extractor function ```java // Java 8 stream.collect(Collectors.groupingBy(Person::getName)).entrySet().stream() // LSA stream.groupBy(Person::getName) ``` - `chunkBy` - partitions sorted stream by classifier function ```java Stream.of("a", "b", "cd", "ef", "gh", "ij", "klmnn") .chunkBy(String::length) // [[a, b], [cd, ef, gh, ij], [klmnn]] ``` - `sample` - emits every n-th elements ```java Stream.rangeClosed(0, 10) .sample(2) // [0, 2, 4, 6, 8, 10] ``` - `slidingWindow` - partitions stream into fixed-sized list and sliding over the elements ```java Stream.rangeClosed(0, 10) .slidingWindow(4, 6) // [[0, 1, 2, 3], [6, 7, 8, 9]] ``` - `takeWhile` / `dropWhile` - introduced in Java 9, limits/skips stream by predicate function ```java Stream.of("a", "b", "cd", "ef", "g") .takeWhile(s -> s.length() == 1) // [a, b] Stream.of("a", "b", "cd", "ef", "g") .dropWhile(s -> s.length() == 1) // [cd, ef, g] ``` - `scan` - iteratively applies accumulation function and returns Stream ```java IntStream.range(1, 6) .scan((a, b) -> a + b) // [1, 3, 6, 10, 15] ``` - `indexed` - adds an index to every element, result is `IntPair` ```java Stream.of("a", "b", "c") .indexed() // [(0 : "a"), (1 : "b"), (2 : "c")] ``` - `filterIndexed` / `mapIndexed` / `takeWhileIndexed` / `takeUntilIndexed` / `dropWhileIndexed` / `reduceIndexed` / `forEachIndexed` - indexed specialization of operators ```java Stream.of("a", "b", "c") .mapIndexed((i, s) -> s + Integer.toString(i)) // [a0, b1, c2] ``` ### Throwable functions No more ugly try/catch in lambda expressions. ```java // Java 8 stream.map(file -> { try { return new FileInputStream(file); } catch (IOException ioe) { return null; } }) // LSA stream.map(Function.Util.safe(FileInputStream::new)) ``` ## Download Download [latest release](https://github.com/aNNiMON/Lightweight-Stream-API/releases) or grab via Maven: ```xml <dependency> <groupId>com.annimon</groupId> <artifactId>stream</artifactId> <version>1.2.2</version> </dependency> ``` or Gradle: ```groovy dependencies { ... implementation 'com.annimon:stream:1.2.2' ... } ``` or use latest unrealeased features with [JitPack](https://jitpack.io/#aNNiMON/Lightweight-Stream-API). Also included version for **Java ME**. Checkout [javame branch](https://github.com/aNNiMON/Lightweight-Stream-API/tree/javame).
0
CNSRE/HTTPDNSLib
null
null
该项目是手机微博研发团队和手机微博技术保障部共同努力的成果。 在此特别感谢: - 张杰 微博:[@木泽水](http://weibo.com/klans) - 王春生 微博:[@平凡的香草](http://weibo.com/chunshengster) - 胡波 微博:[@胡波_](http://weibo.com/coolbor) - 韩超 微博:[@超朝炒觘](http://weibo.com/weibochao) - 赵星宇 微博:[@淘淘不逃008 ](http://weibo.com/5251978872) - 聂钰 微博:[@古夜](http://weibo.com/206541012) - 冯磊 微博:[@冯磊424](http://weibo.com/myfenglei) 等同学的支持。 感谢大家提出的宝贵意见,感谢大家为该项目付出的努力! 项目中有任何问题欢迎大家来吐槽,一起完善、一起提高、一起使用! email: xingyu10@staff.weibo.com fenglei1@staff.sina.com.cn 接入说明 ----------------------------------- 由于该工程需要用户自定义部分配置文件,所以建议以源码方式使用。(同时也支持项目中设定`Lib`库的参数) `Lib`库目前还没有打包成`jar`文件, 大家测试使用的话可以直接将工程包含到自己的工程内即可。 `apk`文件夹下内有打包好的对`httpDNS`库进行测试的程序。 该测试程序模拟了用户使用的场景,并且记录了相关统计数据,以及`Lib`库的时时的状态信息。 ###以下配置请按照顺序进行: 1.配置清单文件 - AndroidManifest.xml ```xml <!-- 权限信息 --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> ``` 2.初始化调用 - 【建议放在Application中处理】 ```java DNSCache.Init(context); ``` 3.预加载域名解析(可选) - 【建议放在Application中处理】 可提前预加载需要解析的域名,并将解析数据缓存到内存中。 ```java DNSCache.getInstance().preLoadDomains(new String[]{"api.camera.weibo.com","domain2","domain3"}); ``` 4.开始使用 直接调用该方法获取 A记录对象 ```java DomainInfo[] infoList = DNSCache.getInstance().getDomainServerIp( "http://api.camera.weibo.com/index.html" ) ; //DomainInfo 返回有可能为null,如果为空则使用域名直接请求数据吧~ 因为在http server 故障的时候会出现这个问题。 if( infoList != null ) { //A记录可能会返回多个, 没有特殊需求直接使用第一个即可。 这个数组是经过排序的。 DomainInfo domainModel = infoList[0] ; //这里是 android 请求网络。 只需要在http头里添加一个数据即可。 省下的请求数据和原先一样。 HttpGet getMethod = new HttpGet( domainModel.url ); getMethod.setHeader("host", domainModel.host); HttpClient httpClient = new DefaultHttpClient(); HttpResponse response = httpClient.execute(getMethod); } ``` ### 更多配置 你可以创建一个`com.sina.util.dnscache.DNSCacheConfig.Data`对象分别设置下面属性。 然后调用`DNSCacheConfig.saveLocalConfigAndSync`方法传入设定好的配置选项。 ```java /** * 是否启用udpdns服务器 默认不启用 | 1启用 0不启用 */ public String IS_UDPDNS_SERVER = ""; /** * udp dnsserver的地址,如8.8.8.8 */ public String UDPDNS_SERVER_API = ""; /** * 日志采样率。如设为50,则为50次数据采样一次 */ public String HTTPDNS_LOG_SAMPLE_RATE = ""; /** * lib库开关,“1”启用,“0”不启用。默认启用 */ public String HTTPDNS_SWITCH = ""; /** * 测速间隔时间 */ public String SCHEDULE_SPEED_INTERVAL = ""; /** * timer轮询器的间隔时间 */ public String SCHEDULE_TIMER_INTERVAL = ""; /** * ip数据过期延迟差值 */ public String IP_OVERDUE_DELAY = ""; /** * 是否启用自己家的HTTP_DNS服务器 默认不启用 | 1启用 0不启用 */ public String IS_MY_HTTP_SERVER = null; /** * 自己家HTTP_DNS服务API地址 使用时直接在字符串后面拼接domain地址 | * 示例(http://202.108.7.153/dns?domain=)+ domain */ public ArrayList<String> HTTPDNS_SERVER_API = new ArrayList<String>(); /** * 是否启用dnspod服务器 默认不启用 | 1启用 0不启用 */ public String IS_DNSPOD_SERVER = null; /** * DNSPOD HTTP_DNS 服务器API地址 | 默认(http://119.29.29.29/d?ttl=1&dn=) */ public String DNSPOD_SERVER_API = null; /** * DNSPOD 企业级ID配置选项 */ public String DNSPOD_ID = null; /** * DNSPOD 企业级KEY配置选项 */ public String DNSPOD_KEY = null; /** * 是否开启 本地排序插件算法 默认开启 | 1开启 0不开启 */ public String IS_SORT = null; /** * 速度插件 比重分配值:默认40% */ public String SPEEDTEST_PLUGIN_NUM = null; /** * 服务器推荐优先级插件 比重分配:默认30% (需要自家HTTP_DNS服务器支持) */ public String PRIORITY_PLUGIN_NUM = null; /** * 历史成功次数计算插件 比重分配:默认10% */ public String SUCCESSNUM_PLUGIN_NUM = null; /** * 历史错误次数计算插件 比重分配:默认10% */ public String ERRNUM_PLUGIN_NUM = null; /** * 最后一次成功时间计算插件 比重分配:默认10% */ public String SUCCESSTIME_PLUGIN_NUM = null; ``` ### 动态更新参数 `DNSCacheConfig`类下的`ConfigText_API`字段可以配置成自动更新配置参数的接口。该接口返回`json`数据类型 具体数据格式详见`DNSCacheConfig.Data toJson()`方法。 ### 自己家HttpDNS服务接入 1. 开启`DNSCacheConfig.Data.IS_MY_HTTP_SERVER = 1;` 2. 设定 `DNSCacheConfig.Data.HTTPDNS_SERVER_API`接口地址(示例`http://XXX.XXX.XXX.XXX/dns?domain=`)+ `domain`,该接口返回格式。 (重载`com.sina.util.dnscache.httpdns.IJsonParser`类可以自定义格式) ```javascript { "domain": "api.weibo.cn", "device_ip": "10.209.70.192", "device_sp": "0", "dns": [ { "priority": "0", "ip": "123.125.105.231", "ttl": "60" }, { "priority": "0", "ip": "123.125.105.246", "ttl": "60" }, { "priority": "0", "ip": "202.108.7.133", "ttl": "60" } ] } ``` PS: `priority`字段是服务器推荐优先级。`device_sp`字段是该设备出口运营商。 HttpDns是什么? ----------------------------------- 如果你对 httpdns 还不了解他是什么! 你可以阅读:[【鹅厂网事】全局精确流量调度新思路-HttpDNS服务详解](http://mp.weixin.qq.com/s?__biz=MzA3ODgyNzcwMw==&mid=201837080&idx=1&sn=b2a152b84df1c7dbd294ea66037cf262&scene=2&from=timeline&isappinstalled=0&utm_source=tuicool) 传统DNS解析 和 HTTPDNS解析 本质的区别 ----------------------------------- ### 传统DNS解析 客户端发送udp数据包到dns服务器,dns服务器返回该域名的相关A记录信息。 ### HTTPDNS解析 客户端发起http请求携带需要查询的域名,通过IP直接访问服务器,该Http服务器接倒请求后返回域名对应的A记录。 HttpDns sdk (android版本) ----------------------------------- ### 希望解决的问题: 1. LocalDNS劫持 2. 平均访问延迟下降 3. 用户连接失败率下降 ### 目录结构说明: HttpDns/src/DNSCache --- HttpDns lib库主工程。 HttpDns/src/DNSCacheTest --- HttpDns库测试工程。 HttpDns/doc --- 项目相关的一些文档、流程图、结构图等。 HttpDns/ui/DNSCacheTest --- 存放HttpDns测试项目UI源文件以及切图文件。 ### HttpDns 交互流程 ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/httpdns%20lib%E5%BA%93%E4%BA%A4%E4%BA%92%E6%B5%81%E7%A8%8B.png) ### HttpDns Lib库交互流程 ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/DNSLib%E5%BA%93%E4%BA%A4%E4%BA%92%E6%B5%81%E7%A8%8B%E5%9B%BE.png) <br> <br> ### 查询模块 检测本地是否有相应的域名缓存 没有记录则根据当前运营商返回内置的ip节点 从httpdns查询域名相应A记录,缓存域名信息 查询模块必须保证响应速度,基于已有设备测试平均在5毫秒左右 ### 数据缓存模块 根据sp(或wifi名)缓存域名信息 根据sp(或wifi名)缓存服务器ip信息、优先级 记录服务器ip每次请求成功数、错误数 记录服务器ip最后成功访问时间、最后测速 添加 内存 -》数据库 之间的缓存层 ### 评估模块 根据本地数据,对一组ip排序 处理用户反馈回来的请求明细,入库 针对用户反馈是失败请求,进行分析上报预警 给HttpDns服务端智能分配A记录提供数据依据 ### 评估算法插件 本次测速 - 对ip组的每个ip测速打分 官方推荐 - HttpDns接口 A记录中返回的优先级 历史成功 - 该ip7天内成功访问次数 历史错误 - 该ip7天内访问错误次数 最后成功时间 - 该ip最后一次成功时间,阈值24 ### 打分比重权值分配 对每个IP打分,总分100分。 本次测速 - 40分 官方推荐 - 30分 历史成功 - 10分 历史错误 - 10分 最后成功时间 - 10分 总分=本次测速+官方推荐+历史成功次数+历史错误次数+最后成功时间 目前权重分配完全基于主观认识,后期会根据建立的相应基线进行权重分配调整。 <br> > 使用者需要自己权衡,有可能随机的ip速度都好于权重打分的ip。 <br> <br> PS:给出一副算法计算分数时的细节图,有兴趣的朋友可以一起探讨研究。 <br><br> ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/%E7%AE%97%E6%B3%95%E6%8F%92%E4%BB%B6%E8%AE%A1%E7%AE%97%E5%9B%BE.png) <br><br> <br><br> HttpDns Test (android版本) ----------------------------------- 测试工程主要最初为了模拟用户使用APP发出的网络请求,进行数据记录和对比。<br> 在页面中能很直观的看到每个任务的相关信息。<br> 比如:任务总耗时,httpdns lib库耗时、http请求耗时、以及设备当前环境信息 等。。<br> 由于UE,UI都是自己设计,对于表达信息的布局和美观可能还有欠缺,本程序猿的能力有限,大家多多包涵。 <br><br> 你未必会需要“它”,上传几张测试工程的截图,提供参考。<br> ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/img/1.png) <br><br> ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/img/2.png) <br><br> ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/img/3.png) <br><br> ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/img/4.png) <br><br> ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/img/5.png) <br><br> ![image](https://github.com/SinaMSRE/HTTPDNSLib/raw/master/doc/img/6.png) <br><br>
0
Froussios/Intro-To-RxJava
An extensive tutorial on RxJava
null
# Intro to RxJava This guide aims to introduce a beginner reactive programmer to the complete power of the [RxJava](https://github.com/ReactiveX/RxJava) implementation of reactive programming for the JVM. It is based on the [IntroToRx](http://www.introtorx.com) guide for Rx.NET. No experience with either reactive or functional programming is needed to follow the book. Familiarity with the basics of Java is required. [Begin learning](/Part%201%20-%20Getting%20Started/1.%20Why%20Rx.md) ### Structure The content of this book is meant to be read from start to finish. It is bigger than your average tutorial and smaller than an actual book. It begins with the basics and every subsequent chapter introduces increasingly advanced features and concepts. Sections of the book are intended to be self-containing and to-the-point, so that the book can be referred back to by non-beginners. The examples used in the book are also [available in compilable java files](/tests/java/itrx) in two formats: * Examples that print to standard output (recommended for first-time readers) * Silent, self-checking examples in the form of [JUnit](http://junit.org/) tests. The readers are invited to study whichever style suits them best.
1
spring-projects/spring-restdocs
Test-driven documentation for RESTful services
null
# Spring REST Docs [![Build status][1]][2] [![Revved up by Develocity][24]][25] ## Overview The primary goal of this project is to make it easy to document RESTful services by combining content that's been hand-written using [Asciidoctor][3] with auto-generated examples produced with the [Spring MVC Test][4] framework. The result is intended to be an easy-to-read user guide, akin to [GitHub's API documentation][5] for example, rather than the fully automated, dense API documentation produced by tools like [Swagger][6]. For a broader introduction see the Documenting RESTful APIs presentation. Both the [slides][7] and a [video recording][8] are available. ## Learning more To learn more about Spring REST Docs, please consult the [reference documentation][9]. ## Building from source You will need Java 17 or later to build Spring REST Docs. It is built using [Gradle][10]: ``` ./gradlew build ``` ## Contributing Contributors to this project agree to uphold its [code of conduct][11]. There are several that you can contribute to Spring REST Docs: - Open a [pull request][12]. Please see the [contributor guidelines][13] for details - Ask and answer questions on Stack Overflow using the [`spring-restdocs`][15] tag - Chat with fellow users [on Gitter][16] ## Third-party extensions | Name | Description | | ---- | ----------- | | [restdocs-wiremock][17] | Auto-generate WireMock stubs as part of documenting your RESTful API | | [restdocsext-jersey][18] | Enables Spring REST Docs to be used with [Jersey's test framework][19] | | [spring-auto-restdocs][20] | Uses introspection and Javadoc to automatically document request and response parameters | | [restdocs-api-spec][21] | A Spring REST Docs extension that adds API specification support. It currently supports [OpenAPI 2][22] and [OpenAPI 3][23] | ## Licence Spring REST Docs is open source software released under the [Apache 2.0 license][14]. [1]: https://ci.spring.io/api/v1/teams/spring-restdocs/pipelines/spring-restdocs-2.0.x/jobs/build/badge (Build status) [2]: https://ci.spring.io/teams/spring-restdocs/pipelines/spring-restdocs-2.0.x?groups=build [3]: https://asciidoctor.org [4]: https://docs.spring.io/spring-framework/docs/4.1.x/spring-framework-reference/htmlsingle/#spring-mvc-test-framework [5]: https://developer.github.com/v3/ [6]: https://swagger.io [7]: https://speakerdeck.com/ankinson/documenting-restful-apis-webinar [8]: https://www.youtube.com/watch?v=knH5ihPNiUs&feature=youtu.be [9]: https://docs.spring.io/spring-restdocs/docs/ [10]: https://gradle.org [11]: CODE_OF_CONDUCT.md [12]: https://help.github.com/articles/using-pull-requests/ [13]: CONTRIBUTING.md [14]: https://www.apache.org/licenses/LICENSE-2.0.html [15]: https://stackoverflow.com/tags/spring-restdocs [16]: https://gitter.im/spring-projects/spring-restdocs [17]: https://github.com/ePages-de/restdocs-wiremock [18]: https://github.com/RESTDocsEXT/restdocsext-jersey [19]: https://jersey.java.net/documentation/latest/test-framework.html [20]: https://github.com/ScaCap/spring-auto-restdocs [21]: https://github.com/ePages-de/restdocs-api-spec [22]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md [23]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md [24]: https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A [25]: https://ge.spring.io/scans?search.rootProjectNames=spring-restdocs
0
cheese10yun/spring-guide
:octocat: Spring 실전 가이드
exception-handling guide spring test
[![CircleCI](https://circleci.com/gh/cheese10yun/spring-guide.svg?style=svg)](https://circleci.com/gh/cheese10yun/spring-guide) [![Coverage Status](https://coveralls.io/repos/github/cheese10yun/spring-guide/badge.svg?branch=master)](https://coveralls.io/github/cheese10yun/spring-guide?branch=master) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fcheese10yun%2Fspring-guide&count_bg=%2379C83D&title_bg=%23555555&icon=github.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) # Spring Guide # 소개 Spring Boot 기반 Rest API를 개발할 때 유지 보수하기 좋은 코드를 만들기 위해서 평소 생각했던 가이드를 연하고 있습니다. 테스트 코드, 예외처리, 올바른 서비스의 크기, 프로젝트 구조 등에 대해서 주로 다룰 예정입니다. Start, Watching 버튼을 누르시면 구독 신청받으실 수 있습니다. 저의 경험이 여러분에게 조금이라도 도움이 되기를 기원합니다. # 프로젝트 실행 방법 ```bash $ git clone git@github.com:cheese10yun/spring-guide.git $ cd spring-guide $ docker-compose up -d $ ./mvnw clean package $ java -jar -Dspring.profiles.active=local api-service/target/api-service-0.0.1-SNAPSHOT.jar ``` # 목차 1. [Test 전략 가이드](https://github.com/cheese10yun/spring-guide/blob/master/docs/test-guide.md) 2. [Exception 전략 가이드](https://github.com/cheese10yun/spring-guide/blob/master/docs/exception-guide.md) 3. [Domain 객체 가이드](https://github.com/cheese10yun/spring-guide/blob/master/docs/domain-guide.md) 4. [외부 API 가이드](https://github.com/cheese10yun/spring-guide/blob/master/docs/api-call-guide.md) 5. [Service 적절한 크기 가이드](https://github.com/cheese10yun/spring-guide/blob/master/docs/service-guide.md) 6. [Directory 가이드](https://github.com/cheese10yun/spring-guide/blob/master/docs/directory-guide.md)
0
JaceyRx/Examination_System
一个简单的教务查询系统(主要技术SpringMVC + Spring + Mybatis + Shiro + Bootstrap)
java javaee javaweb ssm
# 简介 这个项目是一个简单的教务查询系统,该练手小项目希望能帮助到大家,熟悉SSM的整合开发 # 使用技术 IOC容器:Spring Web框架:SpringMVC ORM框架:Mybatis 安全框架:Shiro 数据源:C3P0 日志:log4j 前端框架:Bootstrap # 快速上手 ### 1、运行环境和所需工具 * 编译器:IntelliJ IDEA * 项目构建工具:Maven * 数据库:Mysql * JDK版本:jdk1.8 * Tomcat版本:Tomcat8.x ### 2、初始化项目 * 在你的Mysql中,创建一个数据库名称为 examination_system 的数据库,并导入我提供的 .sql 文件, * 进入src/main/resources修改mysql.properties配置文件,把数据库登录名和密码,改为你本地的 * 使用 IntelliJ IDEA 导入项目,选择Maven项目选项,一路点击next就行,导入项目后,如果src目录等,都没显示出来,别急先使用Maven构建该项目 * 在 IntelliJ IDEA 中,配置我们的 Tomcat, 然后把使用Maven构建好的项目添加到Tomcat中 * 运行 ![image](http://imgsrc.baidu.com/forum/pic/item/5a8d9e1c8701a18b1ea553e4942f07082938fead.jpg) * 登录账户 * 管理员账户:admin * 老师账户:1001 * 学生账户:10001 * 密码均为:123 # 功能模块介绍 ### 1、登录模块功能 使用Shiro权限管理框架,实现登录验证和登录信息的储存,根据不同的登录账户,分发权限角色,对不同页面url进行角色设置 ### 2、管理员模块功能 管理员可对 教师信息、学生信息、课程信息 进行 增删改查 操作,管理员账户,可以重置非管理员账户的密码 * 课程管理:当课程已经有学生选课成功时,将不能删除 * 学生管理:添加学生信息时,其信息也会添加到登录表中 * 教师管理:同上 * 账户密码重置: * 修改密码: ![image](http://imgsrc.baidu.com/forum/pic/item/96499412c8fcc3ce82d37e989845d688d53f20e7.jpg) ![image](http://imgsrc.baidu.com/forum/pic/item/e8829bfd5266d0165ce22a839d2bd40734fa357f.jpg) ![image](http://imgsrc.baidu.com/forum/pic/item/004a5ef082025aafccfdca60f1edab64024f1a23.jpg) ### 3、教师模块功能 教师登陆后,可以获取其,教授的课程列表,并可以给已经选择该课程的同学打分,无法对已经给完分的同学进行二次操作 * 我的课程 * 修改密码 ![image](http://imgsrc.baidu.com/forum/pic/item/db884fd9f2d3572c8f662b778013632763d0c36b.jpg) ![image](http://imgsrc.baidu.com/forum/pic/item/7e08dedeb48f8c549e49728430292df5e1fe7f58.jpg) ![image](http://imgsrc.baidu.com/forum/pic/item/7c6d7482b2b7d0a2eb88b336c1ef76094a369ab6.jpg) ### 4、学生模块功能 学生登录后,根据学生信息,获取其已经选择的课程,和已经修完的课程 * 所有课程: 在这里选修课程,选好后,将会自动跳转到已选课程选项 * 已选课程: 这里显示的是,还没修完的课程,也就是老师还没给成绩,由于还没有给成绩,所以这里可以进行退课操作 * 已修课程: 显示已经修完,老师已经给成绩的课程 * 修改密码: ![image](http://imgsrc.baidu.com/forum/pic/item/8f86a0b1cb1349541f345ecf5c4e9258d0094ac8.jpg) ![image](http://imgsrc.baidu.com/forum/pic/item/4f0822b30f2442a7871a4b0edb43ad4bd01302da.jpg) ![image](http://imgsrc.baidu.com/forum/pic/item/821ad6f2b21193136cb8481b6f380cd790238d78.jpg)
0
WuKongOpenSource/Wukong_nocode
悟空无代码平台正式开源,通过悟空无代码平台开发工具,企业可自主地快速开发出适合企业需要的信息化系统,开发过程只需要业务人员参与,开发效率极高,维护性很强。
nocode
# 悟空无代码平台 体验地址:[https://www.72crm.com](http://www.72crm.com) ## 悟空无代码平台介绍 悟空无代码平台正式开源,通过悟空无代码平台开发工具,企业可自主地快速开发出适合企业需要的信息化系统,开发过程只需要业务人员参与,开发效率极高,维护性很强。 开发人员可以通过无码的形式,在可视化设计器中,用鼠标拖拽和点选的开发方式,快速搭建企业应用软件。开发人员利用开发平台,可以跳过基础架构,直接进入与业务需求相关的工作。 悟空无代码平台与传统的通过代码的开发方式相比,这种面向业务的开发方式,开发迅速,调整极快,能够快速适应企业需求,也能够快速应对企业变化。 官网地址:[http://www.5kcrm.com](http://www.5kcrm.com/) QQ群交流群群:[259359511](https://qm.qq.com/cgi-bin/qm/qr?k=G9T2audQqbZBR_HG0aTP9E-8fE7oMeb8&jump_from=webapi) 扫码添加小悟官方客服微信,邀您加入千人微信交流群: <img src="https://images.gitee.com/uploads/images/2019/1231/115927_f9c580c8_345098.png" width="120"> 关注悟空CRM公众号,了解更多悟空资讯 <img src="https://images.gitee.com/uploads/images/2019/1202/135713_d3566c6a_345098.jpeg" width="120"> :boom: :boom: :boom: 注:悟空无代码平台采用全新的前后端分离模式,本仓库代码中已集成前端vue打包后文件, **可免去打包操作,无需运行前端** # 悟空CRM目录结构 ``` lua wk_modules ├── module -- 无代码模块 ├── common -- 基础模块(暂时无用) ``` # 核心功能模块 **字段组件丰富:** 支持多行文本、网址、数字、下拉列表、百分比、时间、多选等丰富控件<br/> **布局样式多样:** 可调整表单内容大小与形式、平铺或下拉等格式,满足表单元素多样化。<br/> **跨应用关联:** 不同应用之间数据关联以实现跨应用数据调取,同时支持对不同应用数据间的筛选与聚合。<br/> **多维权限设置:** 对于表单内容,可对其权限设为必填、设为唯一或选择隐藏。<br/> **节点类型多样:** 审批节点、填写节点、抄送节点等,根据节点任务选择对应类型。<br/> **分支规则设定:** 数据筛选标准的数据才能进入对应的分支,实现对数据的筛选与分流。<br/> **节点权限控制:** 不同应用之间数据关联以实现跨应用数据调取。<br/> **操作简单灵活:** 通过拖拽方式,将各类组件进行添加<br/> **支持多元组件:** 丰富多样的组件库,按需整合信息。筛选/文本/报表等多种组件<br/><br/> **多类型图标样式:** 数据表、汇总表、指标卡等数十种图标类型,涵盖广泛的应用场景。<br/> # 悟空无代码平台使用的主要技术栈 |名称 | 版本 | 说明 | |---------------------|---------------------------|---- | | spring-cloud-alibaba| 2021.0.4 | 核心框架 | | spring-boot | 2.6.11 | spring版本 | | mybatis-plus | 3.5.2 | ORM框架 | | nacos | 2.1.0 | 注册中心以及配置管理 | | seata | 1.2.0 | 分布式事务 | | elasticsearch | 7.15.2 | 搜索引擎中间件 | | jetcache | 2.7.1 | 分布式缓存框架 | | feign | 3.1.4 | 服务调用 | | rocketmq | 4.9.4 | 消息队列 | # 使用说明 ### 一、前置环境 - Jdk1.8 - Maven3.5^ - Mysql5.7^ - Redis(版本不限) - Elasticsearch 7.15.2 - Nacos(1.4^) - RocketMq(4.9.4) # 安装 安装说明:[安装说明](https://gitee.com/wukongcrm_admin/wukong-nocode/wikis/%E5%AE%89%E8%A3%85%E8%AF%B4%E6%98%8E) ### 安装说明 #### 一、依赖环境安装 ###### 1. 安装jdk ``` yum -y install java-1.8.0-openjdk-devel; ``` ###### 2. 安装redis ``` yum -y install epel-release; yum -y install redis; chkconfig redis on; #-- 修改redis密码为123456 yum -y install vim; vim /etc/redis.conf; #-- 在文件最下面追加一行 requirepass 123456 #-- 或者输入 / 搜索 # requirepass foobared #-- 将前面的#删除,将foobared改为123456 #-- 修改完成之后 :wq 保存并退出,重启redis service redis restart; ``` ###### 3.安装nacos [官方文档](https://nacos.io/zh-cn/docs/v2/quickstart/quick-start.html) ``` # 保存到/opt目录下 wget https://github.com/alibaba/nacos/releases/download/2.0.3/nacos-server-2.0.3.zip -P /opt yum install unzip unzip /opt/nacos-server-2.0.3.zip -d /opt/nacos cd /opt/nacos/bin sh startup.sh -m standalone ``` ###### 4.安装elasticsearch ``` -- 推荐使用docker安装 yum install docker docker run -d --name es --restart=always -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.15.2 docker exec -it elastic /bin/bash bin/elasticsearch-plugin install analysis-icu exit -- 重启es docker restart es ``` ###### 5.安装rocketmq ``` cd /opt wget https://archive.apache.org/dist/rocketmq/4.9.2/rocketmq-all-4.9.2-bin-release.zip unzip rocketmq-all-4.9.2-bin-release.zip cd rocketmq-4.9.2/ nohup sh bin/mqnamesrv >/dev/null 2>&1 & nohup sh bin/mqbroker -n localhost:9876 >/dev/null 2>&1 & ``` ###### 6.安装mysql ``` wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm yum -y install mysql80-community-release-el7-3.noarch.rpm yum -y install mysql-community-server --nogpgcheck sudo systemctl start mysqld.service; sudo systemctl enable mysqld.service; --查看安装的mysql默认密码 grep "password" /var/log/mysqld.log --进入mysql 例:mysql -u root -p"GXOO%eiI/7o>" mysql - u root -p"此处为上一步的默认密码" --修改mysql密码,如下图所示 set global validate_password_policy=LOW; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; --退出mysql exit --修改mysql配置 vim /etc/my.cnf; --输入 i 进入编辑模式,修改sql_mode设置,将下面sql_mode配置复制,到 [mysqld]下使用 shift+insert 粘贴 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION --修改完毕,按esc按键,然后 :wq 保存并退出,重启mysql service mysqld restart; ``` #### 一、项目配置与启动 ###### 1. 导入DB目录下数据库 ###### 2.在项目根目录执行`mvn install` ###### 3.在module模块下resource目录配置数据库帐号信息以及redis帐号信息,MQ配置地址,elasticsearch配置地址` ###### 4. 访问[悟空ID](https://id.72crm.com/)获取账号 ###### 注册之后点击默认企业 ![默认企业](https://foruda.gitee.com/images/1673774011290861301/5bdc4983_8065912.png "img1.png") ###### 点击无代码管理 ![无代码管理](https://foruda.gitee.com/images/1673774098067066785/3a905bfb_8065912.png "img2.png") ##### 将App ID,accessKey,secretKey复制到 module\src\main\resources\application-dev.yml,分别对应appId,clientId,clientSecret 如下图所示 ![代码配置](https://foruda.gitee.com/images/1673774280708048007/6d5b6fc7_8065912.png "img4.png") 将appId复制到module\src\main\webapp\public\APPLICATION_ID.txt内,替换里面内容 ###### 5. 项目打包部署 ``` --项目打包 mkdir /opt/package mvn clean -Dmaven.test.skip=true package cp module/target/module.zip /opt/package cd /opt/package unzip module.zip -d module cd module sh 72crm.sh start ``` ### 三、其他说明 #### 1.接口文档<br/> ``` 接口文档地址:http://localhost:46923/doc.html ``` #### 2.docker镜像<br/> ``` 敬请期待 ``` ### 四、悟空无代码平台功能模块预览 ![输入图片说明](img/001.png) ![输入图片说明](img/002.png) ![输入图片说明](img/006.png) ![输入图片说明](img/007.png) ![输入图片说明](img/005.png) ![输入图片说明](img/004.png)
0
spring-cloud/spring-cloud-function
null
null
null
0
SpongePowered/SpongeAPI
A Minecraft plugin API
api gradle hacktoberfest java minecraft sponge spongeapi spongepowered
SpongeAPI ![Build Status](https://github.com/SpongePowered/SpongeAPI/actions/workflows/ci.yaml/badge.svg?branch=api-10) ============= A mature Minecraft plugin API (not including an implementation), licensed under the [MIT License]. * [Homepage] * [Source] * [Issues] * [Documentation] * [Preparing for Development] * [Javadocs] * [Discord] `#plugins` ## Prerequisites * [Java] 17 ## Clone The following steps will ensure your project is cloned properly. 1. `git clone https://github.com/SpongePowered/SpongeAPI.git` 2. `cd SpongeAPI` 3. `cp scripts/pre-commit .git/hooks` ## Building __Note:__ If you do not have [Gradle] installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command. In order to build SpongeAPI you simply need to run the `gradle` command. You can find the compiled JAR file in `./build/libs` labeled similarly to 'spongeapi-x.x.x-SNAPSHOT.jar'. Sponge will use a javac version of *at least* 17. If an older JDK is used to launch Gradle, JDK 17 will be downloaded automatically. ## Contributing Are you a talented programmer looking to contribute some code? We'd love the help! * Open a pull request with your changes, following our [guidelines](CONTRIBUTING.md). * Please follow the above guidelines and requirements for your pull request(s) to be accepted. [Eclipse]: https://www.eclipse.org/ [Gradle]: https://www.gradle.org/ [Homepage]: https://spongepowered.org/ [IntelliJ]: https://www.jetbrains.com/idea/ [Issues]: https://github.com/SpongePowered/SpongeAPI/issues [Documentation]: https://docs.spongepowered.org/ [Java]: https://adoptium.net/temurin/releases/ [Source]: https://github.com/SpongePowered/SpongeAPI/ [MIT License]: https://www.tldrlegal.com/license/mit-license [Discord]: https://discord.gg/sponge [Preparing for Development]: https://docs.spongepowered.org/stable/en/preparing/ [Javadocs]: https://jd.spongepowered.org
0
Mojang/DataFixerUpper
A set of utilities designed for incremental building, merging and optimization of data transformations.
null
# DataFixerUpper [![Latest release](https://img.shields.io/github/release/Mojang/DataFixerUpper.svg)](https://github.com/Mojang/DataFixerUpper/releases/latest) [![License](https://img.shields.io/github/license/Mojang/DataFixerUpper.svg)](https://github.com/Mojang/DataFixerUpper/blob/master/LICENSE) A set of utilities designed for incremental building, merging, and optimization of data transformations. Created for converting the game data for Minecraft: Java Edition between different versions of the game. ## Gradle First include our repository: ```groovy maven { url "https://libraries.minecraft.net" } ``` And then use this library (change `(the latest version)` to the latest version!): ```groovy compile 'com.mojang:datafixerupper:(the latest version)' ``` ## Maven First include our repository: ```xml <repository> <id>minecraft-libraries</id> <name>Minecraft Libraries</name> <url>https://libraries.minecraft.net</url> </repository> ``` And then use this library (change `(the latest version)` to the latest version!): ```xml <dependency> <groupId>com.mojang</groupId> <artifactId>datafixerupper</artifactId> <version>(the latest version)</version> </dependency> ``` # Usage Core data types are Schema and DataFix. Schema is a set of type definitions specifying what data types the system is interested in and how they relate to each other. DataFix is a rewrite rule between types (see [references](#references) below). DataFixerBuilder takes a list of schemas and fixes converting between those schemas, and creates an optimized converter between the types describes in those schemas. DSL is a class with building blocks used to create schemas and fixes. # Contributing Contributions are welcome! Most contributions will require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. # References ## Optimizing functions - [Cunha, A., & Pinto, J. S. (2005). Point-free program transformation](https://scholar.google.com/scholar?q=Cunha%2C%20A.%2C%20%26%20Pinto%2C%20J.%20S.%20%282005%29.%20Point-free%20program%20transformation) - [Lämmel, R., Visser, E., & Visser, J. (2002). The essence of strategic programming](https://scholar.google.com/scholar?q=L%C3%A4mmel%2C%20R.%2C%20Visser%2C%20E.%2C%20%26%20Visser%2C%20J.%20%282002%29.%20The%20essence%20of%20strategic%20programming) ## How to handle recursive types - [Cunha, A., & Pacheco, H. (2011). Algebraic specialization of generic functions for recursive types](https://scholar.google.com/scholar?q=Cunha%2C%20A.%2C%20%26%20Pacheco%2C%20H.%20%282011%29.%20Algebraic%20specialization%20of%20generic%20functions%20for%20recursive%20types) - [Yakushev, A. R., Holdermans, S., Löh, A., & Jeuring, J. (2009, August). Generic programming with fixed points for mutually recursive datatypes](https://scholar.google.com/scholar?q=Yakushev%2C%20A.%20R.%2C%20Holdermans%2C%20S.%2C%20L%C3%B6h%2C%20A.%2C%20%26%20Jeuring%2C%20J.%20%282009%2C%20August%29.%20Generic%20programming%20with%20fixed%20points%20for%20mutually%20recursive%20datatypes) - [Magalhães, J. P., & Löh, A. (2012). A formal comparison of approaches to datatype-generic programming](https://scholar.google.com/scholar?q=Magalh%C3%A3es%2C%20J.%20P.%2C%20%26%20L%C3%B6h%2C%20A.%20%282012%29.%20A%20formal%20comparison%20of%20approaches%20to%20datatype-generic%20programming) ## Optics - [Pickering, M., Gibbons, J., & Wu, N. (2017). Profunctor Optics: Modular Data Accessors](https://scholar.google.com/scholar?q=Pickering%2C%20M.%2C%20Gibbons%2C%20J.%2C%20%26%20Wu%2C%20N.%20%282017%29.%20Profunctor%20Optics%3A%20Modular%20Data%20Accessors) - [Pacheco, H., & Cunha, A. (2010, June). Generic point-free lenses](https://scholar.google.com/scholar?q=Pacheco%2C%20H.%2C%20%26%20Cunha%2C%20A.%20%282010%2C%20June%29.%20Generic%20point-free%20lenses) ## Tying it together - [Cunha, A., Oliveira, J. N., & Visser, J. (2006, August). Type-safe two-level data transformation](https://scholar.google.com/scholar?q=Cunha%2C%20A.%2C%20Oliveira%2C%20J.%20N.%2C%20%26%20Visser%2C%20J.%20%282006%2C%20August%29.%20Type-safe%20two-level%20data%20transformation) - [Cunha, A., & Visser, J. (2011). Transformation of structure-shy programs with application to XPath queries and strategic functions](https://scholar.google.com/scholar?q=Cunha%2C%20A.%2C%20%26%20Visser%2C%20J.%20%282011%29.%20Transformation%20of%20structure-shy%20programs%20with%20application%20to%20XPath%20queries%20and%20strategic%20functions) - [Pacheco, H., & Cunha, A. (2011, January). Calculating with lenses: optimising bidirectional transformations](https://scholar.google.com/scholar?q=Pacheco%2C%20H.%2C%20%26%20Cunha%2C%20A.%20%282011%2C%20January%29.%20Calculating%20with%20lenses%3A%20optimising%20bidirectional%20transformations) ![GitHub forks](https://img.shields.io/github/forks/Mojang/DataFixerUpper.svg?style=social&label=Fork) ![GitHub stars](https://img.shields.io/github/stars/Mojang/DataFixerUpper.svg?style=social&label=Stars)
0
ethanhua/Skeleton
A library provides an easy way to show skeleton loading view like Facebook and Alipay
android-library android-ui loadingview placeholder shimmer skeleton-loading stateview
# Skeleton(Deprecated) [![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) The library provides an easy way to show skeleton loading view like Facebook and Alipay. It now uses a memory optimised version of shimmer animation so it is even faster and you can animate bigger layouts as well. # Preview ![img](screenshots/01.gif) ![img](screenshots/02.gif) ![img](screenshots/03.gif) ![img](screenshots/04.gif) # Demo Apk you can scan the qrcode for download demo apk ![](screenshots/qrcode.png) # Feature - Light - Noninvasive, you don't need to make changes to existing code. - Wide applicability,it is available for all views - Memory optimised # Getting started In your build.gradle: ``` dependencies { implementation 'com.ethanhua:skeleton:1.1.2' implementation 'io.supercharge:shimmerlayout:2.1.0' } ``` # Usage For RecyclerView: ```java skeletonScreen = Skeleton.bind(recyclerView) .adapter(adapter) .load(R.layout.item_skeleton_news) .show(); ```  For View: ```java skeletonScreen = Skeleton.bind(rootView) .load(R.layout.layout_img_skeleton) .show(); ``` More Config: ```java .shimmer(true) // whether show shimmer animation. default is true .count(10) // the recycler view item count. default is 10 .color(color) // the shimmer color. default is #a2878787 .angle(20) // the shimmer angle. default is 20; .duration(1000) // the shimmer animation duration. default is 1000; .frozen(false) // whether frozen recyclerView during skeleton showing default is true; ``` when data return you can call the method to hide skeleton loading view ```java skeletonScreen.hide() ``` # Thanks https://github.com/team-supercharge/ShimmerLayout
0
xmuSistone/VegaLayoutManager
√A customized LayoutManager - fade and shrink the head itemView when scrolling.
null
# VegaLayoutManager a customized LayoutManager - fade and shrink the head itemView when scrolling. ### 实现效果 <img src="capture.gif" width="373" height="532"/><img style width="2px" /><img src="capture2.png" width="480" height="532"/> Dribbble设计:[链接](https://dribbble.com/shots/3793079-iPhone-8-iOS-11)<br> IOS实现:[VegaScroll](https://github.com/AppliKeySolutions/VegaScroll) ### 代码思路 RecyclerView最顶部的itemView,会随着手指滑动实现收缩隐藏与放大显示,并伴随recycler的回收与复用。<br><br> 代码比较简单粗暴,使用自定义的LayoutManger,内置SnapHelper。<br> 由于想要在任意时刻都能snap到第一个子View,所以在LayoutManager中用了比较讨巧的方法去设定scroll的最大值。 ### 使用方法 1. gradle引入 ```gradle compile 'com.stone.vega.library:VegaLayoutManager:1.0.6' ``` 2. java文件中设定LayoutManager ```java recyclerView.setLayoutManager(new VegaLayoutManager()); ``` ### demo下载 [点击下载](https://github.com/xmuSistone/VegaLayoutManager/blob/master/app-debug.apk?raw=true) ### License Copyright 2017, xmuSistone 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
ViaVersion/ViaVersion
Allows the connection of newer clients to older server versions for Minecraft servers.
bukkit bungeecord fabric hacktoberfest java minecraft paper plugin spigot sponge sponge-plugin velocity viaversion
# ViaVersion [![Latest Release](https://img.shields.io/github/v/release/ViaVersion/ViaVersion)](https://viaversion.com) [![Build Status](https://github.com/ViaVersion/ViaVersion/actions/workflows/gradle.yml/badge.svg?branch=master)](https://github.com/ViaVersion/ViaVersion/actions) [![Discord](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://viaversion.com/discord) **Allows the connection of higher client versions to lower server versions - it works on any platform you can think of.** The base ViaVersion jar runs on Paper, Velocity, Bungee, and Sponge. We also have projects integrating ViaVersion to run on Fabric, Forge, or as a standalone proxy to join from basically any client version on any server version from the past decade. **See [HERE](https://github.com/ViaVersion) for an overview of the different Via\* projects.** Supported Versions: ![Table (https://i.imgur.com/sTrVnC2.png)](https://i.imgur.com/sTrVnC2.png) **User Docs:** https://docs.viaversion.com/display/VIAVERSION/ Releases/Dev Builds -------- You can find official releases in the following places: - **Hangar (for our plugins)**: https://hangar.papermc.io/ViaVersion/ViaVersion - **Modrinth (for our mods)**: https://modrinth.com/mod/viaversion - **GitHub**: https://github.com/ViaVersion/ViaVersion/releases Dev builds for **all** of our projects are on our Jenkins server: - **Jenkins**: https://ci.viaversion.com ViaVersion as a Dependency ---------- **JavaDocs:** https://jd.viaversion.com **Maven:** ```xml <repository> <id>viaversion-repo</id> <url>https://repo.viaversion.com</url> </repository> ``` ```xml <dependency> <groupId>com.viaversion</groupId> <artifactId>viaversion-api</artifactId> <version>[4.0.0,5.0.0)</version> <scope>provided</scope> </dependency> ``` **Gradle:** ```kotlin repositories { maven("https://repo.viaversion.com") } dependencies { compileOnly("com.viaversion:viaversion-api:VERSION") // Replace the version } ``` If you need access to the existing protocol or platform implementations, use the parent artifact `viaversion`. Please note the [differences in licensing](#license). Building -------- After cloning this repository, build the project with Gradle by running `./gradlew build` and take the created jar out of the `build/libs` directory. Mapping Files -------------- Mapping files are generated and managed in our [Mappings repository](https://github.com/ViaVersion/Mappings). Resources -------- - **[Via Mappings Generator](https://github.com/ViaVersion/Mappings)** - **[Mojang mappings](https://minecraft.wiki/w/Obfuscation_map)** (Thank you, Mojang, very cool) - **[wiki.vg](https://wiki.vg)** (Used for historic information regarding packet structure, we also contribute back) - **[Burger](https://github.com/Pokechu22/Burger)** (See [PAaaS](https://github.com/Matsv/Paaas)) License -------- The entirety of the [API directory](api) (including the legacy API directory) is licensed under the MIT License; see [licenses/MIT.md](licenses/MIT.md) for details. Everything else, unless explicitly stated otherwise, is licensed under the GNU General Public License v3, including the end-product as a whole; see [licenses/GPL.md](licenses/GPL.md) for details. Special thanks to all our [Contributors](https://github.com/ViaVersion/ViaVersion/graphs/contributors).
0
YeDaxia/JApiDocs
A magical api documentation generator without annotation for springboot. [No Time Maintain]
api api-documentation apidocs springboot
# Getting Started Supported JDK:1.8+ ## Quick Start ### Step One:Add Dependency maven: ``` <dependency> <groupId>io.github.yedaxia</groupId> <artifactId>japidocs</artifactId> <version>1.4.4</version> </dependency> ``` gradle: ``` compile 'io.github.yedaxia:japidocs:1.4.4' ``` ### Step Two:Configuration You can run code below at any main(): ```java DocsConfig config = new DocsConfig(); config.setProjectPath("your springboot project path"); // root project path config.setProjectName("ProjectName"); // project name config.setApiVersion("V1.0"); // api version config.setDocsPath("your api docs path"); // api docs target path config.setAutoGenerate(Boolean.TRUE); // auto generate Docs.buildHtmlDocs(config); // execute to generate ``` If there is no accident, after executing the above code, you can see the generated documents in the configured directory. ## Code Style Requirements JApiDocs is implemented by parsing Java source code. To make JApiDocs work correctly, you need to follow certain coding standards in the writing of `Controller` in the project. You can refer the `SpringDemo` module in the source code for comparison and understanding. ### 1. Add Necessary Code Comments The class comment will correspond to the first-level grouping. You can also specify the group name through `@description`; JApiDocs will use `@param` to find parameters for further analyze. ```java /** * User API */ @RequestMapping("/api/user/") @RestController public class UserController { /** * Get User List * @param listForm */ @RequestMapping(path = "list", method = {RequestMethod.GET, RequestMethod.POST} ) public ApiResult<PageResult<UserVO>> list(UserListForm listForm){ return null; } /** * Save User * @param userForm */ @PostMapping(path = "save") public ApiResult<UserVO> saveUser(@RequestBody UserForm userForm){ return null; } /** * Delete User * @param userId user id */ @PostMapping("delete") public ApiResult deleteUser(@RequestParam Long userId){ return null; } } ``` If the submitted form is `application/x-www-form-urlencoded` type, you can add a description after `@param` or add an comment in JavaBean object : ```java // in @param @param userId user id ``` ```java // at FormBean public class UserListForm extends PageForm{ private Integer status; //user status private String name; //user name } ``` This form type would show as table in the document: parameter name|parameter type|must|description --|--|--|-- status|int|N|user status name|string|N|user name If the submitted form is `application/json` type, corresponding to the `@RequestBody` annotation in SpringBoot, it will display as `json` format in the document: ```java { "id": "long //user id", "name": "string //user name", "phone": "long // user phone", "avatar": "string // user avatar url", "gender": "byte //use gender" } ``` ### 2. Return Specific Class Type We know that if a Controller Class declares @RestController, SpringBoot will return json data to the front end. JApiDocs also uses this feature to parse the result in the api method, but since JApiDocs parses the source code statically, you must clearly return a specific class type. JApiDocs supports complex class analysis such as inheritance, generics, and loop nesting. Such as `saveUser` : ```java /** * save user * @param userForm */ @PostMapping(path = "save") public ApiResult<UserVO> saveUser(@RequestBody UserForm userForm){ return null; } ``` `ApiResult<UserVO>` shows the data structure of response,after processing by JApiDocs,it's like this: ```json { "code": "int", "errMsg": "string", "data": { "userId": "string //user id", "userName": "string //user name", "friends": [ { "userId": "string //user id", "userName": "string //user name" } ], "readBooks": [ { "bookId": "long //book id", "bookName": "string //book name" } ], "isFollow": "boolean //is follow" } } ``` If you don't like the *return* type, you can also use `@ApiDoc` in JApiDoc to declare the response type,you can refer the `@ApiDoc` chapter below. ### 3. Api Java Beans Should In Source Code We know that there is no comment information in the compiled class bytecode. For JApiDcos to work better, your Form bean Class and return Class should be in the source code, otherwise the generated document will be missing description information. Anyway, in version 1.4.2, JApiDocs will try to parse the field information by reflection when can't find the source code (the dependent class is in the jar package). # Advanced Configuration ## @ApiDoc By default, JApiDocs only exports the api that declares `@ApiDoc`. We previously removed this restriction by setting `config.setAutoGenerate(Boolean.TRUE)`. If you don't want to export all apis, you can turn off the `autoGenerate` and add `@ApiDoc` to the `Controller` class or api method to determine which api need to be exported. Let's see how the `@ApiDoc` works on api method: - result: the returned object type, it will override the returned object of SpringBoot - url: request url,extended field, used to support non-SpringBoot projects - method: request method,extended field, used to support non-SpringBoot projects ex: ```java @ApiDoc(result = AdminVO.class, url = "/api/v1/admin/login2", method = "post") ``` ## @Ignore ### Ignore Controller Class Add `@Ignore` at Controller, all of its method would ignore. ```java @Ignore public class UserController { } ``` ### Ignore Method ```java @Ignore @PostMapping("save") public ApiResult saveUser(){ return null; } ``` ### Ignore Field If you don’t want to export a field in the object, you can add `@Ignore` annotation to this field, so that JApiDocs will automatically ignore it when exporting the document: ex: ```java public class UserForm{ @Ignore private Byte gender; } ``` ## Export More Format ### Export Markdown ```java config.addPlugin(new MarkdownDocPlugin()); ``` ### Export Pdf Or Word You can use [pandoc](https://pandoc.org/) convert markdown to pdf or word. ## Custom Code Templates In addition to supporting api document export, JApiDocs currently also supports the generation of return object codes for Android and iOS, corresponding to Java and Object-C languages, If you want to modify the code template, you can use the following steps: ### Step One:Modify Code Templates Copy the code templates in the `library` project `resources` directory of the source code, where `IOS_` means Object-C code template, and `JAVA_` starts with Java code, The symbol similar to "${CLASS_NAME}" in the template is a substitution variable. You will understand the meaning compare to the generated code, and try to modify it according to the code template you want. ### Step Two:Use The New Code Templates Use `DocsConfig` to replace with new template: ```java docsConfig.setResourcePath("your new tempalte path"); ``` ## More Custom Features JApiDocs provides a plug-in interface. You can implement more rich features through the plug-in interface. The following describes how to make this: ### Step One:Implements *IPluginSupport* Interface ```java public class CustomPlugin implements IPluginSupport{ @Override public void execute(List<ControllerNode> controllerNodeList){ // do something you want } } ``` ### Step Two:Add Your Plugin ```java config.addPlugin(new CustomPlugin()); ```
0
apache/rocketmq-externals
Mirror of Apache RocketMQ (Incubating)
rocketmq
# [Apache RocketMQ](https://github.com/apache/rocketmq) Community Projects Home There are many of the Apache RocketMQ external projects, which is born from [Apache RocketMQ Improvement Proposal](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal) and contributed and maintained by community. The PMC will lean towards developer community support, to help discovery and initial steps towards incubation in the external repository. Incubator Projects could graduate if they meet the following requirements. * Require 3+1 vote from the PMC. * Used successfully in production by at least three independent end users which, in the PMC judgement, are of adequate quality and scope. * Have a healthy number of committers. # Docs [User Guide for Connect 中文版](./docs/connect/cn/README.md) # Graduated Projects ### [RocketMQ Client CPP](https://github.com/apache/rocketmq-client-cpp) ### [RocketMQ Client Python](https://github.com/apache/rocketmq-client-python) ### [RocketMQ Spring](https://github.com/apache/rocketmq-spring) ### [RocketMQ Client Go](https://github.com/apache/rocketmq-client-go) # Incubator Projects ## [RocketMQ Dashboard](https://github.com/apache/rocketmq-dashboard) **Notice**: Console has renamed to dashboard and transfered the new repo, it will graduate in the near future, and welcome you to fill in the user due diligence. ## [RocketMQ MQTT](https://github.com/apache/rocketmq-mqtt) A new MQTT protocol architecture model, based on which RocketMQ can better support messages from terminals such as IoT devices and Mobile APP. Based on the RocketMQ message unified storage engine, it supports both MQTT terminal and server message sending and receiving. ## [RocketMQ-Flink](https://github.com/apache/rocketmq-flink) **Notice**: The project has transfered the new repo and will be removed from this repo, it will graduate in the near future, and welcome you to fill in the user due diligence. ## [RocketMQ Streams](https://github.com/apache/rocketmq-streams) ## [RocketMQ Operator](https://github.com/apache/rocketmq-operator) Deploys RocketMQ on Kubernetes. it is built using the Operator SDK, which is part of the Operator Framework and hosted on [OperatorHub](https://operatorhub.io/operator/rocketmq-operator) ## [RocketMQ Client Nodejs](https://github.com/apache/rocketmq-client-nodejs) ## [RocketMQ-Docker](https://github.com/apache/rocketmq-docker) Provides Dockerfile and bash scripts for building and running docker image. ## [RocketMQ-Exporter](https://github.com/apache/rocketmq-exporter) Exports metrics from RocketMQ servers for consumption by Prometheus. ## [RocketMQ-Connect](https://github.com/apache/rocketmq-connect) RocketMQ connector, connect everything. ## RocketMQ-Flume Flume RocketMQ source and sink implementation. ## RocketMQ-Spark Integration of Apache Spark and Apache RocketMQ. Both push & pull consumers are provided. For more details please refer to [README](https://github.com/apache/rocketmq-externals/tree/master/rocketmq-spark). ## RocketMQ-JMS RocketMQ's JMS 1.1 spec. implementation. ## RocketMQ-MySQL This project is a data replicator between MySQL and other systems. For more details please refer to [README](https://github.com/apache/rocketmq-externals/tree/master/rocketmq-mysql). ## Others [RocketMQ-OpenTelemetry](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/rocketmq), [RocketMQ-Ignite](https://github.com/apache/ignite-extensions/tree/master/modules/rocketmq-ext) and [RocketMQ-Storm](https://github.com/apache/storm/tree/master/external/storm-rocketmq) integration can be found in those repositories. ## Contribution We are always very happy to have contributions, whether for trivial cleanups or big new features. We want to have high quality, well documented codes for each programming language, as well as the surrounding ecosystem of integration tools that people use with RocketMQ. Nor is code the only way to contribute to the project. We strongly value documentation, integration with other project, and gladly accept improvements for these aspects. More info please refer to [How To Contribute](http://rocketmq.apache.org/docs/how-to-contribute/).
0
tinkerpop/blueprints
A Property Graph Model Interface (no longer active - see Apache TinkerPop)
null
null
0
ixrjog/opscloud4
云上运维
aws cicd devops ed25519 kubernetes ldap springboot ssh web-terminal
Welcome to the opscloud wiki! ## Thanks to JetBrains <a href="https://www.jetbrains.com" target="_blank"> <img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/jetbrains-logos/jetbrains-variant-2.svg" alt=""/> </a> > Thanks JetBrains to support the project providing such great IDE. ![GitHub Stats Card](https://github-readme-stats.vercel.app/api?username=ixrjog&show_icons=true&theme=onedark) ## OpsCloud4 云上运维 <img src="https://img.shields.io/badge/Version-4.6.0-brightgreen.svg"></img> <img src="https://img.shields.io/badge/OpenJDK-21-brightgreen.svg"></img> <img src="https://img.shields.io/badge/SpringBoot-3.2.0-brightgreen.svg"></img> <img src="https://img.shields.io/badge/MySQL-8-brightgreen.svg"></img> <br/> [![Security Status](https://www.murphysec.com/platform3/v31/badge/1683749365419687936.svg)](https://www.murphysec.com/console/report/1656107048332996608/1683749365419687936) <br/> ## 架构图 <img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/github/4.5.0/opscloud4_2.svg" width="600" alt=""/> ## Code repository + Backend + [https://github.com/ixrjog/opscloud4](https://github.com/ixrjog/opscloud4) + Frontend + [https://github.com/ixrjog/opscloud4-web](https://github.com/ixrjog/opscloud4-web) ## Database + [v4.6.0 opscloud4-github.sql](https://opscloud4-web.oss-eu-west-1.aliyuncs.com/package/4.6.0/opscloud4-github.sql) ## 登录信息 + username:baiyi + password:空密码 ## 开发环境 + OpenJDK 21 + node-v16.13.0 + MacBook M1 + IntelliJ IDEA 2023 + WebStorm 2023 ## Leo持续交付 + 构建 <img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/leo/leo-8.png" width="830"></img> + 部署 <img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/leo/leo-9.png" width="830"></img> <img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/leo/leo-6.png" width="830"></img> + 规则配置(封网) <img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/leo/leo-10.png" width="830"></img> + 任务配置 <img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/leo/leo-5.png" width="830"></img> ## 容器堡垒机(集成:Leo持续交付版本信息,多可用区部署可视化) <img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/github/4.5.1/kt-1.png" width="830"></img> ## 主要功能 + Leo持续交付(Kubernetes) + 全冗余架构,多Jenkins引擎且无状态 + 权限控制/封网策略 + 分组(蓝/绿),金丝雀部署;可视化发布过程 + 多实例动态数据源,万物皆资产 + 堡垒机 + 服务器Web终端 + 多服务器同时连接+命令同步、会话复制、会话心跳 + 支持ED25519、RSA密钥 + KubernetesWeb终端 + 多容器同时登录+命令同步、容器日志、会话心跳 + SSH-Server + 原生SSH协议实现,支持ED25519密钥 + 简化用户登录,自动关联用户GitLab账户公钥 + 支持服务器、容器登录 ```mermaid flowchart LR A[User] -->|SSH:22| B{SLB} B-->|TCP:2222| C[Opscloud Server] B-->|TCP:2222| D[Opscloud Server] E[User] -->|ssh ed25519 | F{{SSH-Server}} F-->|ssh ed25519| G[Linux] ``` + 服务器批量任务 + Ansible Playbook + 单服务器多线程实现,任务日志更加清晰 + RBAC,MFA(OTP) + 集群架构 + 实例健康检查接口 /api/instance/health/lb-check (GET) + 分布式调度任务(Quartz)、定时任务分布式锁(Shedlock)、任务并发锁(Redis) + 高性能、可伸缩、高可用性 + 标签驱动、事件驱动 + API文档 + example.com/doc.html + API Token ## Services & Ports | service | protocol | port | startup parameter | |------------|----------|------|-----------------------| | web | http | 8080 | --server.port=8080 | | ssh-server | ssh | 2222 | --ssh.shell.port=2222 | ## 功能截图 <table> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/sys/env.png" alt="系统环境"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/sys/tag.png" alt="标签管理"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/sys/instance.png" alt="集群管理"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/oc4-6.png" alt="服务器管理"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/oc4-10.png" alt="远程控制(RDP/VNC)"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/terminal/terminal-server.png" alt="服务器(批量操作,会话复制,高低权限,布局切换)"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/terminal/terminal-server-2.png" alt="服务器(批量操作,会话复制,高低权限,布局切换)"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/terminal/terminal-server-3.png" alt="服务器(批量操作,会话复制,高低权限,布局切换)"></td> </tr> <tr> <td><img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/terminal/terminal-pod.png" alt="容器(支持登录操作或只读查看日志)"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/terminal/terminal-k8s-pod-2.png" alt="容器(支持登录操作或只读查看日志)"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/ssh-server/ssh-server-help.png" alt="SSH-Server"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/ssh-server/ssh-server-help-2.png" alt="SSH-Server"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/ssh-server/ssh-server-event.png" alt="SSH-Server"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/ssh-server/ssh-server-list.png" alt="SSH-Server"></td> </tr> <tr> <td><img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/ssh-server/ssh-server-list-k8s-pod.png" alt="SSH-Server"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/terminal/terminal-audit.png" alt="审计"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/playbook/playbook.png" alt="剧本"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/playbook/playbook-2.png" alt="剧本"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/playbook/playbook-3.png" alt="剧本"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/playbook/playbook_log.png" alt="剧本"></td> </tr> <tr> <td><img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/user/user.png" alt="用户"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/user/user-details.png" alt="用户"></td> </tr> <tr> <td><img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/user/user_mfa.png" alt="MFA"></td> <td><img src="https://opscloud4-res.oss-cn-hangzhou.aliyuncs.com/help/datasource/instance.png" alt="数据源"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/datasource/datasource-aliyun.png" alt="数据源"></td> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/datasource/datasource-aliyun-log.png" alt="数据源"></td> </tr> <tr> <td><img src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/github/datasource/datasource-zabbix-host.png" alt="数据源"></td> </tr> </table> ## <span style="color:green">平台演示视频1</span> <video src="https://opscloud-res.oss-cn-hangzhou.aliyuncs.com/opscloud4/video/opscloud4-1.mov" width="400px" height="300px" controls="controls"></video> ## 帮助文档 <a style="color:#2b669a" href="https://www.kancloud.cn/ixrjog/opscloud4/2361886" target="_blank">传送门:https://www.kancloud.cn/ixrjog/opscloud4/2361886</a> ## 交流群 Q群: 630913972
0
glomadrian/material-animated-switch
A material Switch with icon animations and color transitions
null
Material Animated Switch ----------------- [![Download](https://api.bintray.com/packages/glomadrian/maven/MaterialAnimatedSwitch/images/download.svg) ](https://bintray.com/glomadrian/maven/MaterialAnimatedSwitch/_latestVersion) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Material%20Animated%20Switch-green.svg?style=flat)](https://android-arsenal.com/details/1/1985) A material Switch with icon animations and color transitions ![Demo Screenshot][1] ![Demo Screenshot][2] ### Sample video: [Youtube Material Animated Switch video](https://youtu.be/MBJpCfXuVuU) ### Sample app: <a href="https://play.google.com/store/apps/details?id=com.github.glomadrian.materialanimatedswitch.sample"> <img alt="Get it on Google Play" src="https://developer.android.com/images/brand/en_generic_rgb_wo_60.png" /> </a> Based on ---------- [Inbox Pinned](https://dribbble.com/shots/2098916-Inbox-Pinned) by [Derek Torsani](https://dribbble.com/dmtors) How to use ---------- By default show the inbox pinned switch ```xml <com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch android:id="@+id/pin" android:layout_width="wrap_content" android:layout_height="wrap_content" /> ``` With custom colors and icons attributes ```xml <com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch android:id="@+id/pin" android:layout_width="wrap_content" android:layout_height="wrap_content" app:base_release_color="@color/md_deep_orange_900" app:base_press_color="@color/md_deep_orange_50" app:ball_release_color="@color/md_deep_orange_500" app:ball_press_color="@color/md_white_1000" app:icon_release="@drawable/ic_play_arrow_white_36dp" app:icon_press="@drawable/ic_stop_deep_orange_500_36dp" /> ``` Remember put this for custom attribute usage ```java xmlns:app="http://schemas.android.com/apk/res-auto" ``` For Gradle --------------------- Add repository ```groovy repositories { maven { url "http://dl.bintray.com/glomadrian/maven" } } ``` Add dependency ```groovy compile 'com.github.glomadrian:MaterialAnimatedSwitch:1.1@aar' ``` Changelog --------------------- V 1.1 * Fixed bug that cut the ball at the start * Added isChecked() method * fix toggle() method Developed By ------------ Adrián García Lomas - <glomadrian@gmail.com> * [Twitter](https://twitter.com/glomadrian) * [LinkedIn](https://es.linkedin.com/in/glomadrian ) License ------- Copyright 2015 Adrián García Lomas 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]: ./art/swtich.gif [2]: ./art/all.png
0