full_name
stringlengths
7
104
description
stringlengths
4
725
topics
stringlengths
3
468
readme
stringlengths
13
565k
label
int64
0
1
apache/servicecomb-samples
Apache servicecomb
servicecomb
# ServiceComb samples This project is samples for java-chassis 3.x.x. You can switch to other branches to see different samples. ## basic A sample shows a provider, a consumer and a gateway using java chassis. ## porter_lightweight A sample shows an application with basic login, download file, delete file functions. Read this [document](https://servicecomb.apache.org/references/java-chassis/zh_CN/featured-topics/application-porter.html) for details. ## porter_springboot A sample shows an application with basic login, download file, delete file functions. Read this [document](https://servicecomb.apache.org/references/java-chassis/zh_CN/featured-topics/application-porter.html) for details. ## java-chassis-samples Featured samples for java-chassis modules. Each module contains 10 minutes guides. ## java-chassis-integration-tests java-chassis integration tests。 ## Precondition Before running the samples,install [service center](https://github.com/apache/servicecomb-service-center) and [kie](https://github.com/apache/servicecomb-kie). Or download [Lightweight Cloud Service Engine](https://support.huaweicloud.com/devg-cse/cse_devg_0036.html) which integrates both service center and kie for ease of use. # 使用ServiceComb开发微服务的示例项目 这个项目使用java-chassis 2.0.x版本。可以切换分支,查看其他版本的例子。 ## basic 该项目展示了Java Chassis开发的一个provider, 一个consumer和一个网关服务。 ## porter_lightweight 该项目演示了一个包括网关、文件下载、认证鉴权等功能的简单应用系统,同时演示了ServiceComb推荐的先写接口声明,再写业务代码的软件工程实践。可以阅读[文章](https://servicecomb.apache.org/references/java-chassis/zh_CN/featured-topics/application-porter.html)了解项目的细节。这个例子的运行环境采用vert.x作为HTTP服务器,即 REST over Vert.x transport。 ## porter_springboot 该项目演示了一个包括网关、文件下载、认证鉴权等功能的简单应用系统,同时演示了ServiceComb推荐的先写接口声明,再写业务代码的软件工程实践。可以阅读[文章](https://servicecomb.apache.org/references/java-chassis/zh_CN/featured-topics/application-porter.html)了解项目的细节。这个例子的运行环境采用Spring Boot及其Embeded Tomcat,即 REST over Servlet。 ## java-chassis-samples java-chassis 各个模块功能的例子。每个子项目包含了10分钟可以学习完成的简单示例。 ## java-chassis-integration-tests java-chassis 的集成测试用例。 ## 前提条件 运行这些例子之前,需要先安装[注册中心](https://github.com/apache/servicecomb-service-center) 和[配置中心](https://github.com/apache/servicecomb-kie) 。华为云提供一个出色的[本地轻量化微服务引擎](https://support.huaweicloud.com/devg-cse/cse_devg_0036.html) ,可以直接下载安装使用。
0
pinguo-zhouwei/MaterialDesignSamples
Material Design 系列控件samples,讲了Material Design 系列新控件的使用方法和一些场景示例,使用详情请看对应博客,持续更新中...
appbarlayout behavior cardview coordinatorlayout material material-design tablayout textinputlayout toolbar
null
0
habuma/spring-in-action-4-samples
null
null
SpringInActionExamples ====================== These are the examples from Spring in Action, Fourth Edition.
0
gluonhq/gluon-samples
Gluon sample projects
null
# Gluon Samples Java, JavaFX and Gluon Mobile samples to run with Java 11+, GraalVM and the GluonFX plugin for [Maven](https://github.com/gluonhq/gluonfx-maven-plugin/). The following platforms are currently supported: * Linux * Mac OS X * Windows * iOS * Android * Embedded ## Documentation Before getting started with this samples, read the GluonFX plugin [documentation](https://docs.gluonhq.com/). ## Build and run the samples Visit each sample's README for further instructions. ## Issues and Contributions ## Issues can be reported to the [Issue tracker](https://github.com/gluonhq/gluon-samples/issues) Contributions can be submitted via [Pull requests](https://github.com/gluonhq/gluon-samples/pulls), providing you have signed the [Gluon Individual Contributor License Agreement (CLA)](https://cla.gluonhq.com).
1
googleads/googleads-shopping-samples
Samples for the Content API for Shopping and the Manufacturer Center API
null
# Samples for the Content API for Shopping and Manufacturer Center API These code samples are organized by platform or language. Each language directory contains a `README` with more information about how to run the samples for that particular language. Here, we cover setting up authentication and the common configuration file used by all the samples. For more information on the APIs, please refer to the documentation for the [Content API for Shopping](https://developers.google.com/shopping-content/) and the [Manufacturer Center API](https://developers.google.com/manufacturers/). ## Choose Your Method of Authentication Before getting started, check the Getting Started section of the [Content API for Shopping documentation](https://developers.google.com/shopping-content/v2/quickstart). You may want to use [service accounts](https://developers.google.com/shopping-content/guides/how-tos/service-accounts) instead to simplify the authentication flow. These samples also support using [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). Setting up authentication for the Manufacturer Center API is similar to the Content API. Just make sure to select the Manufacturer Center API in the API Console. Both APIs can be selected if you wish to try samples for both APIs. ## Setting up Authentication and Sample Configuration 1. Create the directory `$(HOME)/shopping-samples` to store the configuration. If you are unsure where this will be located in your particular setup, then run the samples (following the language-specific `README`). Errors from the samples related to either this directory or necessary files not existing will provide the full path to the expected directory/files. Within this directory, also create the following subdirectories, depending on which API you would like to try: * `content` for the Content API for Shopping * `manufacturers` for the Manufacturer Center API Place the files described below in the appropriate subdirectory for the API you want to try. 2. Set up your desired authentication method. If you are using Google Application Default Credentials: * Follow the directions on the [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials) page. If you are using a service account: * Put the JSON file you downloaded when creating the service account to the file `service-account.json` in the appropriate API configuration subdirectories. If you are using an OAuth2 client ID: * Download your [OAuth2 client credentials](https://console.developers.google.com/apis/credentials) to the file `client-secrets.json` in the appropriate API configuration subdirectories. **Note:** The samples assume that you are using an OAuth2 client ID that can use a loopback IP address to retrieve tokens. If you are not or are unsure that you are, please visit the [OAuth2.0 for Mobile & Desktop Apps] (https://developers.google.com/identity/protocols/OAuth2InstalledApp) page and follow the instructions there to create a new OAuth2 client ID to use with the samples. You can set up multiple authentication methods to try out different flows, but note that the samples will always use the first credentials that can be loaded, in the order: 1. [Google Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials) 2. [Service accounts](https://developers.google.com/shopping-content/v2/how-tos/service-accounts) credentials 3. [OAuth2 client](https://developers.google.com/shopping-content/v2/how-tos/authorizing) credentials 3. Each set of samples uses a different configuration file. For the Content API for Shopping, take the example `merchant-info.json` from the repository root and copy it into `$(HOME)/shopping-samples/content`. Next, change its contents appropriately. It contains a JSON object with the following fields: | Field | Type | Description | |---------------------------|--------|------------------------------------------------| | `merchantId` | number | The Merchant Center ID to run samples against. | | `accountSampleUser` | string | If non-empty, the email address for the user to add/remove in samples for the `Accounts` service. | | `accountSampleAdWordsCID` | number | If non-zero, the AdWords Customer ID to link/unlink in samples for the `Accounts` service. | For the Manufacturer Center API, take the example `manufacturer-info.json` from the repository root and copy it into `$(HOME)/shopping-samples/manufacturers`. Next, change its contents appropriately. It contains a JSON object with the following fields: | Field | Type | Description | |---------------------------|--------|------------------------------------------------| | `manufacturerId` | number | The Manufacturer Center ID to run samples against. | | `websiteUrl` | string | The URL (without trailing slash) associated with the Manufacturer Center account. | If using OAuth2 client credentials, once you have authorized access, your token details will be stored in the `stored-token.json` file in the samples configuration directory. If you have any issues authenticating, remove this file and you will be asked to re-authorize access. ## Try Out the Samples Now that you've configured both the common sample configuration file and set up your authentication credentials, it's time to build and run any of the included samples. As mentioned before, there are language-specific instructions in the `README`s located in each language subdirectory. Have fun! ## Possible Issues * When using the Content API for Shopping, if you haven't set up tax settings on your account, you may get an error when running certain samples. If you receive a "missing tax settings" error, set your tax settings in the Merchant Center before trying these samples. Selecting the "Don't charge taxes in the United States" setting is sufficient.
0
GoogleCloudPlatform/cloud-code-samples
Code templates to make working with Kubernetes feel like editing and debugging local code.
code-template debugger dotnet gcloud golang java kubernetes nodejs python samples yaml
# Code Templates for Google Cloud Code ## What is Google Cloud Code Cloud Code brings the power and convenience of IDEs to cloud-native application development. Cloud Code integrates with Google Cloud services like Google Kubernetes Engine, Cloud Run, Cloud APIs and Secret Manager, and makes you feel like you are working with local code. Cloud Code works with Google’s command-line container tools like skaffold, minikube, and kubectl under the hood, providing local, continuous feedback on your project as you build, edit, run, and deploy your applications locally or in the cloud. Cloud Code also deeply integrates with Cloud SDK to provide a unified authentication experience when you develop with Google Cloud Services. ## What's in this repo Code templates for easy Getting-Started experience with Google Cloud Code in Python, Java, Nodejs, Go and .NET Core. We support two IDEs: Visual Studio Code and IntelliJ (and other JetBrains IDEs). VS Code: ![Create New Application VS Code](https://cloud.google.com/code/docs/vscode/images/create-new-app.gif) IntelliJ: ![Create New Application IntelliJ](https://cloud.google.com/code/docs/intellij/images/intellij-quickstart-runthrough.gif) ## Useful Links - [Cloud Code for VS Code](https://marketplace.visualstudio.com/items?itemName=GoogleCloudTools.cloudcode) - [Cloud Code for IntelliJ](https://plugins.jetbrains.com/plugin/8079-cloud-code) - [Cloud Code Docs](https://cloud.google.com/code/docs/) - [Cloud Code for VS Code Repo](https://github.com/GoogleCloudPlatform/cloud-code-vscode) - [Cloud Code for IntelliJ Repo](https://github.com/GoogleCloudPlatform/cloud-code-intellij)
0
bitbar/test-samples
Sample test scripts and applications for Bitbar Cloud
appium bitbar-cloud bitbar-samples detox ios java javascript robot-framework testdroid
# Bitbar Test Samples This repository contains Bitbar Cloud sample test scripts and applications. ## Repository Structure * [apps](apps/) - Prebuilt sample applications that you can use to start testing if you don't have your own * [samples](samples/) - Test samples for using different testing frameworks and some other examples ## FAQ ### iOS * [How to package a native iOS app for Bitbar Cloud](http://docs.bitbar.com/testing/xcode/ipa/index.html) * [How to run XCTests on Bitbar Cloud](http://docs.bitbar.com/testing/xcode/xctest/index.html) * [How to run XCUITests on Bitbar Cloud](http://docs.bitbar.com/testing/xcode/xcuitest/index.html) ### Android * [How to run Espresso tests on Bitbar Cloud](http://docs.bitbar.com/testing/espresso/index.html) ### Appium * [How to run client side Appium tests on Bitbar Cloud](http://docs.bitbar.com/testing/appium/client-side/index.html) * [How to run server side Appium tests on Bitbar Cloud](http://docs.bitbar.com/testing/appium/server-side/index.html) ### Custom Frameworks * [How to use a custom testing framework on Bitbar Cloud](http://docs.bitbar.com/testing/scripted-run/index.html) ## License This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
1
ipipman/JavaSpringBootSamples
SpringBoot、Dubbo、SpringCloud的各种集成例子:Atomikos、gRPC、Thrift、Seata、ShardingSphere、Dubbo、Hmily、Nacos、Consul、Ribbon、Jedis、Lettuce、Redisson等框架
atomikos consul dubbo dubbo-http grpc jedis nacos ribbon rpc seata sharding-jdbc springboot springcloud tcc thrift
# 目录 ### SpringBoot相关实例 - ##### [SpringBoot集成Atomikos框架-实现分布式数据库XA事务;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-atomikos-xa-sample "SpringBoot集成Atomikos框架,实现分布式数据库XA事务;") - ##### [SpringBoot集成Seata框架-实现TCC模式柔性事务;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-seata-tcc-sample "SpringBoot集成Seata框架,实现TCC模式柔性事务;") - ##### [SpringBoot集成Seata框架-实现AT模式柔性事务;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-seata-at-sample "SpringBoot集成Seata框架,实现AT模式柔性事务;") - ##### [SpringBoot集成Sharding-JDBC框架-实现数据库读写分离;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-shardingsphere-jdbc-sample "SpringBoot集成Sharding-JDBC框架,实现数据库读写分离;") - ##### [SpringBoot集成gRPC框架-实现RPC服务;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-rpc-grpc-sample "SpringBoot集成gRPC框架,实现RPC服务;") - ##### [SpringBoot集成Thrift框架-实现RPC服务;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-rpc-thrift-sample "SpringBoot集成Thrift框架,实现RPC服务;") - ##### [SpringBoot集成Nacos框架-实现配置中心;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-nacos-sample "SpringBoot集成Nacos框架-实现配置中心;") - ##### [SpringBoot集成Jedis框架-实现Redis调用;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-jedis-sample "SpringBoot集成Jedis框架-实现Redis调用;") - ##### [SpringBoot集成Lettuce框架-实现Redis调用;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-lettuce-sample "SpringBoot集成Lettuce框架-实现Redis调用;") - ##### [SpringBoot集成Redisson框架-实现Redis调用;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springboot-redisson-sample "SpringBoot集成Redisson框架-实现Redis调用;") ### Dubbo相关实例 - ##### [分布式服务框架Dubbo-基于注解配置的方式;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-annotation-sample "分布式服务框架Dubbo(基于注解配置的方式)") - ##### [分布式服务框架Dubbo-基于XML配置的方式;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-xml-sample "分布式服务框架Dubbo(基于XML配置的方式") - ##### [分布式服务框架Dubbo-事件通知;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-notify-sample "分布式服务框架Dubbo(事件通知);") - ##### [分布式服务框架Dubbo-异步调用;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-async-sample "分布式服务框架Dubbo(异步调用)") - ##### [分布式服务框架Dubbo-缓存策略;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-cache-sample "分布式服务框架Dubbo(缓存策略)") - ##### [分布式服务框架Dubbo-参数回调;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-callback-sample "分布式服务框架Dubbo(参数回调)") - ##### [分布式服务框架Dubbo-基于HTTP传输协议;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-http-sample "分布式服务框架Dubbo(基于HTTP传输协议)") - ##### [分布式服务框架Dubbo-本地调用;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-local-sample "分布式服务框架Dubbo(本地调用)") - ##### [分布式服务框架Dubbo-隐式参数;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-attachment-sample "分布式服务框架Dubbo(隐式参数)") - ##### [分布式服务框架Dubbo-Mock功能;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-mock-sample "分布式服务框架Dubbo(mock功能)") - ##### [分布式服务框架Dubbo-SPI机制;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-spi-sample "分布式服务框架Dubbo(SPI机制)") - ##### [分布式服务框架Dubbo集成Nacos框架-实现注册中心;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-nacos-sample "分布式服务框架Dubbo集成Nacos框架-实现注册中心") - ##### [分布式服务框架Dubbo集成Consul框架-实现注册中心;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/dubbo-consul-sample "分布式服务框架Dubbo集成Consul框架-实现注册中心") ### SpringCloud相关实例 - ##### [SpringCloud集成Consul框架-实现配置中心;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springcloud-consul-config-sample "SpringCloud集成Consul框架-实现配置中心") - ##### [SpringCloud集成Consul框架-实现注册中心;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springcloud-consul-register-sample "SpringCloud集成Consul框架-实现注册中心") - ##### [SpringCloud集成Consul+Ribbon框架-实现注册中心和负载均衡;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springcloud-consul-ribbon-sample "SpringCloud集成Consul+Ribbon框架-实现注册中心和负载均衡") - ##### [SpringCloud集成Nacos框架-实现配置中心;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springcloud-nacos-config-sample "SpringCloud集成Nacos框架-实现配置中心") - ##### [SpringCloud集成Nacos框架-实现注册中心;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springcloud-nacos-register-sample "SpringCloud集成Nacos框架-实现注册中心") - ##### [SpringCloud集成Nacos+Ribbon框架-实现注册中心和负载均衡;](https://github.com/ipipman/JavaSpringBootSamples/tree/master/springcloud-nacos-ribbon-sample "SpringCloud集成Nacos+Ribbon框架-实现注册中心和负载均衡") ### 关于作者
0
habuma/spring-in-action-6-samples
Sample code from Spring in Action 6
null
# Spring in Action, 6th Edition Sample Code This repo will hold the sample code from [Spring in Action, 6th edition](https://www.manning.com/books/spring-in-action-sixth-edition). ## What are all of the weird comments with "tag::" and "end::" about??? (Note: In the most recent commit, I've removed these comments. But they may come back, so I'll leave this mention of them here.) The source code will have several weird comments, many starting with "tag::" and some with "end::". There may also be large chunks of code commented out. The "tag::" and "end::" comments are there for the sake of building the book itself. The code in between those comments are pulled into the manuscript so that (as much as possible) code you see in the book comes straight from code that was built and tested. Sometimes, though, code evolves throughout the course of a chapter. It's impractical to have multiple copies of the same project just for a few lines that are different. In those cases, the variant code is commented out, but still has the "tag::" and "end::" markers around it. The danger of doing that is that it's entirely possible that the commented out variant isn't correct--after all, it hasn't been compiled or run through a test suite. If you find something out of sorts, please let me know and I'll try to fix it. ## Shouldn't there be a test for ... ? I'll readily admit that there could be more tests around certain parts of the code. When I find time, I will add these tests. In the meantime, please feel free to open a pull request with any suggested tests you think should be merged in.
1
dynamic-datasource/dynamic-datasource-samples
null
null
# 演示例子 大部分数据库连接为 H2Database,仅供测试。 除开 `com.baomidou:springboot3-sample`, 其他子模块均可在 [OpenJDK 8, OpenJDK 21] 的 JDK 范围及其下游发行版下执行单元测试。 所有单元测试在 Github Actions 完成验证。你可能希望参考 [位于 Github Actions 的 CI 文件](./.github/workflows/ci.yml)。 - add-remove-datasource 动态添加删除数据源的使用示例 - all-datasource-sample 所有不同连接池使用示例(大乱炖,实际不建议) - druid-sample 集成mybatis和druid的使用示例 - jdbc-template-sample 集成原生jdbcTemplate的使用示例 - load-datasource-from-jdbc 通过数据库配置来启动数据源示例 - mybatis-sample 集成原生mybatis的使用示例 - mybatisplus2-sample 集成mybatisPlus2的使用示例 - mybatisplus3-sample 集成mybatisPlus3的使用示例 - name-pattern-sample 自定义切面的使用示例 - nest-sample 嵌套切换数据源使用示例 - quartz-sample 多数据源集成quartz示例 - shardingsphere-jdbc-4.x-spring-sample 集成 ShardingSphere JDBC Spring Boot Starter 4.1.1 使用示例, 不再维护, 参考 https://github.com/apache/shardingsphere/releases/tag/5.0.0-alpha - shardingsphere-jdbc-5.x-core-sample 集成 ShardingSphere JDBC Driver 5.4.1 使用示例 - shardingsphere-jdbc-5.x-spring-sample 集成 ShardingSphere JDBC Spring Boot Starter 5.2.1 使用示例, 不再维护, 参考 https://github.com/apache/shardingsphere/issues/22469 - spel-sample 动态从外部参数spel来切换数据源的使用示例 - tx-local-sample 本地事务示例项目★★★★★★必看★★★★★★ - tx-seata-sample 基于seata的分布式事务集成使用示例 ## Contributing 我们欢迎社区的贡献。 针对 IDE,项目的语言级别应设置为 JDK 8,对于单独的 `com.baomidou:springboot3-sample` 子模块,语言级别应设置为 JDK 17 。 在提交 Pull Request 之前, 请在本地通过 [OpenJDK 17, OpenJDK 21] 的 JDK 范围下完成此命令的验证。 我们鼓励通过 `SDKMAN!` 切换到 `21.0.1-graalce` 来验证。 ```shell ./mvnw -T1C clean test ```
0
thingsboard/samples
Thingboard sample applications
null
# samples Thingboard sample applications
1
GoogleCloudPlatform/point-of-sale
Anthos Edge Use Cases for bringing apps and computation closer to the location where the action is, to improve response times and save bandwidth.
samples
# Point of Sale (PoS) **Point of Sale** is a sample application that simulates a retail store kiosk used to submit and track orders and payments. This application is used by Google to demonstrate use cases where [Anthos](https://cloud.google.com/anthos) clusters are installed and run outside of Google Cloud Platform _(i.e. on premise bare metal infrastructure)_. The application is representative of **edge deployments** like that of retail store-front devices. This repository also hosts a collection of samples and walkthroughs that enables learning and experimenting with [Anthos](https://cloud.google.com/anthos) for edge use cases. All of the samples and walkthroughs are built around the **Point of Sale** application. > 👓 **Note:** Anthos clusters means Kubernetes clusters that are managed by Anthos. If you’re using this app, please ★Star the repository to show your interest! > 👓 **Note to Googlers:** Please fill out the form at [go/using-pos](http://go/using-pos) if you are using this application. <p align="center"> <img src="docs/images/pos.png"> </p> ### Play with it: - Latest release: [point-of-sale.retail.cymbal.dev](http://point-of-sale.retail.cymbal.dev) - Build from **main** branch: [staging.point-of-sale.retail.cymbal.dev](http://staging.point-of-sale.retail.cymbal.dev) --- ### Edge computing Edge computing is a distributed computing paradigm that brings computation and data storage closer to the location where the action is, to improve response times and save bandwidth. Multiple industries _(e.g. Retail, Telecommunication, Manufacturing and Energy)_ are facing a growing demand to provide localized, consistent, low latency services that expose compute services. Workloads range from order management, ML for images/traffic analysis/safety, device management like refrigeration, fryers, etc. [Anthos clusters on Bare Metal](https://cloud.google.com/anthos/clusters/docs/bare-metal) and [Anthos cluster on VMware](https://cloud.google.com/anthos/clusters/docs/on-prem) are unique solutions for deploying and managing workloads on clusters distributed across customer data centers and device fleets. --- ### Resources - _(Quickstart)_ [Deploy this application to a cluster](/docs/quickstart.md) - _(Anthos VMRuntime)_ [Run the entire application in a VM](/extras/anthos-vmruntime) #### External use cases of this application - _(Solution guide)_ [VM based PoS deployed in an Anthos cluster using Anthos VMRuntime](https://github.com/GoogleCloudPlatform/anthos-samples/tree/main/anthos-vmruntime) - _(Solution guide)_ [Edge deployment of PoS using Anthos on bare metal](https://cloud.google.com/anthos/clusters/docs/bare-metal/latest/installing/install-edge-profile) - _(Tutorial)_ [PoS deployed in an Anthos bare metal cluster inside Openstack](https://cloud.google.com/anthos/clusters/docs/bare-metal/latest/installing/openstack-abm-install) --- ### Development and Contributing - Read the [CONTRIBUTING guide](/CONTRIBUTING.md) for instructions on how to contribute - Follow the [local development guide](/docs/local-dev.md) to learn how to run and develop this app locally --- ### Releases This repository follows [semantic-versioning](https://semver.org/) to version its files. Please read [`Releasing a new version of the Point of Sale Application`](/docs/release.md) for detailed explanation on how to cut a release for this repository. See the [domain mapping](/docs/domain-mapping.md) guide for information on how to expose the application using a public domain.
0
Adobe-Consulting-Services/acs-aem-samples
AEM Code Samples repository
adobe-experience-manager aem code-samples cq java jcr oak osgi sling
# ACS AEM Samples #### Samples index: [http://adobe-consulting-services.github.io/acs-aem-samples/#samples](http://adobe-consulting-services.github.io/acs-aem-samples/#samples) This project is a collection of sample implementation of the various, common building blocks for AEM-based applications. The samples in this project are not intended and should never be installed on AEM instance directly and only used for reference purposes. These samples have not been tested for functionality; please report and bugs/incorrectness to the ACS AEM Samples GitHub Issues project.
0
lenve/javaboy-video-samples
null
null
## Spring Boot 实战系列视频教程,配套案例 扫码加微信(微信ID:**a_java_boy2**),备注 SpringBoot,进群讨论。 ![微信ID:a_java_boy2](https://user-images.githubusercontent.com/6023444/75459026-ba70d500-59b9-11ea-8cbd-3d5889f356c4.png) 本仓库是 Spring Boot 实战系列视频教程官方配套案例,有用的话,欢迎给个 star。(*^_^*)。 案例对应的视频下载地址(付费):链接:https://pan.baidu.com/s/1wbZ4JreJq_D0t29TwDm-1Q 提取码:e5wu <!--扫码关注公众号【江南一点雨】,回复 Java 获取更多教程。--> <!--![](https://www.javaboy.org/images/sb/javaboy.jpg)-->
0
kunny/blog_samples
Sample projects provided on blog article
null
# Blog samples [![Build Status](https://travis-ci.org/kunny/blog_samples.svg?branch=master)](https://travis-ci.org/kunny/blog_samples) 블로그 [커니의 안드로이드 이야기](http://androidhuman.com)에 게재되는 포스트에서 사용한 예제를 제공합니다. ## 예제 프로젝트를 다운로드 하려면? ### git을 사용하여 전체 저장소 다운로드 `Github` 애플리케이션을 사용거나, 터미널에서 다음 명령어를 사용하면 전체 저장소를 다운로드 할 수 있습니다. $ git clone https://github.com/kunny/blog_samples ### 개별 프로젝트 다운로드 [파이썬 스크립트](https://raw.githubusercontent.com/kunny/blog_samples/master/Android/get_project.py)를 사용하면 일부 프로젝트만 선택하여 다운로드 할 수 있습니다. 스크립트 사용을 위해 미리 설치되어 있어야 하는 구성요소는 다음과 같습니다. - Python 2.7.5 이상 - Subversion #### 다운로드 가능한 프로젝트 조회 `python get_project.py` 를 실행하면 스크립트 사용 방법과 함께 다운로드 가능한 프로젝트 정보가 표시됩니다. $ python get_project.py Usage : python get_project.py [projectName ...] Example : $ python get_project.py HelloWorld // Download one project $ python get_project.py HelloWorld StudioTesting // Download multiple project Available projects : Name Post URL ----------------------------------------------------------- HelloWorld None NavigationDrawerExample_Studio http://androidhuman.com/524 AndroidStudioLibApp http://androidhuman.com/530 StudioTesting http://androidhuman.com/536 SigningWithStudio http://androidhuman.com/544 BasicFragments http://androidhuman.com/546 BasicFragments_withActionItem http://androidhuman.com/547 BasicFragments_PersistState http://androidhuman.com/549 #### 프로젝트 다운로드 원하는 프로젝트를 한 개 혹은 여러 개 동시에 다운로드 할 수 있습니다. 한 개의 프로젝트를 다운로드하려면 다음과 같이 프로젝트 이름을 인자로 적어주면 됩니다. $ python get_project.py HelloWorld 여러 프로젝트를 동시에 다운로드 하려는 경우, 인자에 프로젝트 이름들을 연달아 입력하면 됩니다. 아래는 `HelloWorld` 예제와 `BasicFragments` 예제를 다운로드 하는 예를 보여줍니다. $ python get_project.py HelloWorld BasicFragments
1
temporalio/samples-java
Temporal Java SDK samples
java java-samples workflow-au workflow-engine
# Temporal Java SDK Samples This repository contains samples that demonstrate various capabilities of Temporal using the [Java SDK](https://github.com/temporalio/sdk-java). It contains two modules: * [Core](/core): showcases many different SDK features. * [SpringBoot](/springboot): showcases SpringBoot autoconfig integration. * [SpringBoot Basic](/springboot-basic): Minimal sample showing SpringBoot autoconfig integration without any extra external dependencies. ## Learn more about Temporal and Java SDK - [Temporal Server repo](https://github.com/temporalio/temporal) - [Java SDK repo](https://github.com/temporalio/sdk-java) - [Java SDK Guide](https://docs.temporal.io/dev-guide/java) ## Requirements - Java 1.8+ for build and runtime of core samples - Java 1.8+ for build and runtime of SpringBoot samples when using SpringBoot 2 - Java 1.17+ for build and runtime of Spring Boot samples when using SpringBoot 3 - Local Temporal Server, easiest to get started would be using [Temporal CLI](https://github.com/temporalio/cli). For more options see docs [here](https://docs.temporal.io/kb/all-the-ways-to-run-a-cluster). ## Build and run tests 1. Clone this repository: git clone https://github.com/temporalio/samples-java cd samples-java 2. Build and run Tests ./gradlew build ## Running Samples: You can run both "Core" and "SpringBoot" samples from the main samples project directory. Details on how to run each sample can be found in following two sections. To skip to SpringBoot samples click [here](#Running-SpringBoot-Samples). ### Running "Core" samples See the README.md file in each main sample directory for cut/paste Gradle command to run specific example. <!-- @@@SNIPSTART samples-java-readme-samples-directory --> #### Hello samples - [**Hello**](/core/src/main/java/io/temporal/samples/hello): This sample includes a number of individual Workflows that can be executed independently. Each one demonstrates something specific. - [**HelloActivity**](/core/src/main/java/io/temporal/samples/hello/HelloActivity.java): Demonstrates a Workflow Definition that executes a single Activity. - [**HelloActivityRetry**](/core/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java): Demonstrates how to Retry an Activity Execution. - [**HelloActivityExclusiveChoice**](/core/src/main/java/io/temporal/samples/hello/HelloActivityExclusiveChoice.java): Demonstrates how to execute Activities based on dynamic input. - [**HelloAsync**](/core/src/main/java/io/temporal/samples/hello/HelloAsync.java): Demonstrates how to execute Activities asynchronously and wait for them using Promises. - [**HelloAwait**](/core/src/main/java/io/temporal/samples/hello/HelloAwait.java): Demonstrates how to use Await statement to wait for a condition. - [**HelloParallelActivity**](/core/src/main/java/io/temporal/samples/hello/HelloParallelActivity.java): Demonstrates how to execute multiple Activities in parallel, asynchronously, and wait for them using `Promise.allOf`. - [**HelloAsyncActivityCompletion**](/core/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java): Demonstrates how to complete an Activity Execution asynchronously. - [**HelloAsyncLambda**](/core/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java): Demonstrates how to execute part of a Workflow asynchronously in a separate task (thread). - [**HelloCancellationScope**](/core/src/main/java/io/temporal/samples/hello/HelloCancellationScope.java): Demonstrates how to explicitly cancel parts of a Workflow Execution. - [**HelloCancellationScopeWithTimer**](/core/src/main/java/io/temporal/samples/hello/HelloCancellationScopeWithTimer.java): Demonstrates how to cancel activity when workflow timer fires and complete execution. This can prefered over using workflow run/execution timeouts. - [**HelloDetachedCancellationScope**](/core/src/main/java/io/temporal/samples/hello/HelloDetachedCancellationScope.java): Demonstrates how to execute cleanup code after a Workflow Execution has been explicitly cancelled. - [**HelloChild**](/core/src/main/java/io/temporal/samples/hello/HelloChild.java): Demonstrates how to execute a simple Child Workflow. - [**HelloCron**](/core/src/main/java/io/temporal/samples/hello/HelloCron.java): Demonstrates how to execute a Workflow according to a cron schedule. - [**HelloDynamic**](/core/src/main/java/io/temporal/samples/hello/HelloDynamic.java): Demonstrates how to use `DynamicWorkflow` and `DynamicActivity` interfaces. - [**HelloPeriodic**](/core/src/main/java/io/temporal/samples/hello/HelloPeriodic.java): Demonstrates the use of the Continue-As-New feature. - [**HelloException**](/core/src/main/java/io/temporal/samples/hello/HelloException.java): Demonstrates how to handle exception propagation and wrapping. - [**HelloLocalActivity**](/core/src/main/java/io/temporal/samples/hello/HelloLocalActivity.java): Demonstrates the use of a [Local Activity](https://docs.temporal.io/docs/jargon/mesh/#local-activity). - [**HelloPolymorphicActivity**](/core/src/main/java/io/temporal/samples/hello/HelloPolymorphicActivity.java): Demonstrates Activity Definitions that extend a common interface. - [**HelloQuery**](/core/src/main/java/io/temporal/samples/hello/HelloQuery.java): Demonstrates how to Query the state of a Workflow Execution. - [**HelloSchedules**](/core/src/main/java/io/temporal/samples/hello/HelloSchedules.java): Demonstrates how to create and interact with a Schedule. - [**HelloSignal**](/core/src/main/java/io/temporal/samples/hello/HelloSignal.java): Demonstrates how to send and handle a Signal. - [**HelloSaga**](/core/src/main/java/io/temporal/samples/hello/HelloSaga.java): Demonstrates how to use the SAGA feature. - [**HelloSearchAttributes**](/core/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java): Demonstrates how to add custom Search Attributes to Workflow Executions. - [**HelloSideEffect**](/core/src/main/java/io/temporal/samples/hello/HelloSideEffect.java)**: Demonstrates how to implement a Side Effect. - [**HelloUpdate**](/core/src/main/java/io/temporal/samples/hello/HelloUpdate.java): Demonstrates how to create and interact with an Update. - [**HelloDelayedStart**](/core/src/main/java/io/temporal/samples/hello/HelloDelayedStart.java): Demonstrates how to use delayed start config option when starting a Workflow Executions. - [**HelloSignalWithTimer**](/core/src/main/java/io/temporal/samples/hello/HelloSignalWithTimer.java): Demonstrates how to use collect signals for certain amount of time and then process last one. #### Scenario-based samples - [**File Processing Sample**](/core/src/main/java/io/temporal/samples/fileprocessing): Demonstrates how to route tasks to specific Workers. This sample has a set of Activities that download a file, processes it, and uploads the result to a destination. Any Worker can execute the first Activity. However, the second and third Activities must be executed on the same host as the first one. - [**Booking SAGA**](/core/src/main/java/io/temporal/samples/bookingsaga): Demonstrates Temporals take on the Camunda BPMN "trip booking" example. - [**Money Transfer**](/core/src/main/java/io/temporal/samples/moneytransfer): Demonstrates the use of a dedicated Activity Worker. - [**Money Batch**](/core/src/main/java/io/temporal/samples/moneybatch): Demonstrates a situation where a single deposit should be initiated for multiple withdrawals. For example, a seller might want to be paid once per fixed number of transactions. This sample can be easily extended to perform a payment based on more complex criteria, such as at a specific time or an accumulated amount. The sample also demonstrates how to Signal the Workflow when it executes (*Signal with start*). If the Workflow is already executing, it just receives the Signal. If it is not executing, then the Workflow executes first, and then the Signal is delivered to it. *Signal with start* is a "lazy" way to execute Workflows when Signaling them. - [**Customer Application Approval DSL**](/core/src/main/java/io/temporal/samples/dsl): Demonstrates execution of a customer application approval workflow defined in a DSL (like JSON or YAML) - [**Polling Services**](/core/src/main/java/io/temporal/samples/polling): Recommended implementation of an activity that needs to periodically poll an external resource waiting its successful completion - [**Heartbeating Activity Batch**](/core/src/main/java/io/temporal/samples/batch/heartbeatingactivity): Batch job implementation using a heartbeating activity. - [**Iterator Batch**](/core/src/main/java/io/temporal/samples/batch/iterator): Batch job implementation using the workflow iterator pattern. - [**Sliding Window Batch**](/core/src/main/java/io/temporal/samples/batch/slidingwindow): A batch implementation that maintains a configured number of child workflows during processing. #### API demonstrations - [**Async Untyped Child Workflow**](/core/src/main/java/io/temporal/samples/asyncuntypedchild): Demonstrates how to invoke an untyped child workflow async, that can complete after parent workflow is already completed. - [**Updatable Timer**](/core/src/main/java/io/temporal/samples/updatabletimer): Demonstrates the use of a helper class which relies on `Workflow.await` to implement a blocking sleep that can be updated at any moment. - [**Workflow Count Interceptor**](/core/src/main/java/io/temporal/samples/countinterceptor): Demonstrates how to create and register a simple Workflow Count Interceptor. - - [**Workflow Retry On Signal Interceptor**](/core/src/main/java/io/temporal/samples/retryonsignalinterceptor): Demonstrates how to create and register an interceptor that retries an activity on a signal. - [**List Workflows**](/core/src/main/java/io/temporal/samples/listworkflows): Demonstrates the use of custom search attributes and ListWorkflowExecutionsRequest with custom queries. - [**Payload Converter - CloudEvents**](/core/src/main/java/io/temporal/samples/payloadconverter/cloudevents): Demonstrates the use of a custom payload converter for CloudEvents. - [**Payload Converter - Crypto**](/core/src/main/java/io/temporal/samples/payloadconverter/crypto): Demonstrates the use of a custom payload converter using jackson-json-crypto. - [**Async Child Workflow**](/core/src/main/java/io/temporal/samples/asyncchild): Demonstrates how to invoke a child workflow async, that can complete after parent workflow is already completed. - [**Terminate Workflow**](/core/src/main/java/io/temporal/samples/terminateworkflow): Demonstrates how to terminate a workflow using client API. - [**Get Workflow Results Async**](/core/src/main/java/io/temporal/samples/getresultsasync): Demonstrates how to start and get workflow results in async manner. - [**Per Activity Type Options**](/core/src/main/java/io/temporal/samples/peractivityoptions): Demonstrates how to set per Activity type options. - [**Configure WorkflowClient to use mTLS**](/core/src/main/java/io/temporal/samples/ssl): Demonstrates how to configure WorkflowClient when using mTLS. - [**Payload Codec**](/core/src/main/java/io/temporal/samples/encodefailures): Demonstrates how to use simple codec to encode/decode failure messages. #### SDK Metrics - [**Set up SDK metrics**](/core/src/main/java/io/temporal/samples/metrics): Demonstrates how to set up and scrape SDK metrics. #### Tracing Support - [**Set up OpenTracing and/or OpenTelemetry with Jaeger**](/core/src/main/java/io/temporal/samples/tracing): Demonstrates how to set up OpenTracing and/or OpenTelemetry and view traces using Jaeger. <!-- @@@SNIPEND --> ### Running SpringBoot Samples These samples use SpringBoot 2 by default. To switch to using SpringBoot 3 look at the [gradle.properties](gradle.properties) file and follow simple instructions there. 1. Start SpringBoot from main repo dir: ./gradlew :springboot:bootRun To run the basic sample run ./gradlew :springboot-basic:bootRun 2. Navigate to [localhost:3030](http://localhost:3030) 3. Select which sample you want to run More info on each sample: - [**Hello**](/springboot/src/main/java/io/temporal/samples/springboot/hello): Invoke simple "Hello" workflow from a GET endpoint - [**SDK Metrics**](/springboot/src/main/java/io/temporal/samples/springboot/metrics): Learn how to set up SDK Metrics - [**Synchronous Update**](/springboot/src/main/java/io/temporal/samples/springboot/update): Learn how to use Synchronous Update feature with this purchase sample - [**Kafka Request / Reply**](/springboot/src/main/java/io/temporal/samples/springboot/kafka): Sample showing possible integration with event streaming platforms such as Kafka - [**Customize Options**](/springboot/src/main/java/io/temporal/samples/springboot/customize): Sample showing how to customize options such as WorkerOptions, WorkerFactoryOptions, etc (see options config [here](springboot/src/main/java/io/temporal/samples/springboot/customize/TemporalOptionsConfig.java)) - [**Apache Camel Route**](/springboot/src/main/java/io/temporal/samples/springboot/camel): Sample showing how to start Workflow execution from a Camel Route #### Temporal Cloud To run any of the SpringBoot samples in your Temporal Cloud namespace: 1. Edit the [application-tc.yaml](/springboot/src/main/resources/application-tc.yaml) to set your namespace and client certificates. 2. Start SpringBoot from main repo dir with the `tc` profile: ./gradlew bootRun --args='--spring.profiles.active=tc' 3. Follow the previous section from step 2
0
Coder-EdisonZhou/EDT.SpringCloud.Samples
Spring Cloud作为第二代微服务的代表性框架,已经在国内众多大中小型的公司有实际应用案例。许多公司的业务线全部拥抱Spring Cloud,部分公司选择部分拥抱Spring Cloud。此示例基于Spring Boot 1.5.x编写,展示了Spring Cloud的核心组件的基本使用方式,在学习Spring Cloud时可以参考本示例。
eureka java spring-boot spring-cloud
# EDC.SpringCloud.Samples ## 温馨提示 本示例基于Spring Boot 1.5.x实现,如对Spring Boot不熟悉,可以先学习我的这一篇:《[Spring Boot 1.5.x 基础学习示例](https://www.cnblogs.com/edisonchou/p/java_spring_boot_foundation_demos.html)》。关于微服务基本概念不了解的童鞋,可以先阅读下始祖Martin Fowler的《[Microservice](https://mp.weixin.qq.com/s/fzk-kENu0I22P3F2Vu7KBA)》,本文不做介绍和描述。 本示例配套介绍博文请[点击这里](https://www.cnblogs.com/edisonchou/p/java_spring_cloud_foundation_sample_list.html)。 ## Spring Cloud基本介绍 <img src="https://images2018.cnblogs.com/blog/381412/201808/381412-20180822202553841-1217264857.jpg" style="border: 1px solid #ddd; border-radius: 5px;" alt="Spring Cloud微服务实战"/> 首先,尽管Spring Cloud带有“Cloud”这个单词,但它并不是云计算解决方案,而是在Spring Boot基础之上构建的,用于快速构建分布式系统的通用模式的工具集。<br/> 其次,使用Spring Cloud开发的应用程序非常适合在Docker和PaaS(比如Pivotal Cloud Foundry)上部署,所以又叫做云原生应用(Cloud Native Application)。云原生可以简单地理解为面向云环境的软件架构。<br/> 总结,***Spring Cloud是一个基于Spring Boot实现的云原生应用开发工具,它为基于JVM的云原生应用开发中涉及的配置管理、服务发现、熔断器、智能路由、微代理、控制总线、分布式会话和集群状态管理等操作提供了一种简单的开发方式***。 ## Spring Cloud核心子项目 - Spring Cloud Netflix:核心组件,可以对多个Netflix OSS开源套件进行整合,包括以下几个组件: - Eureka:服务治理组件,包含服务注册与发现 - Hystrix:容错管理组件,实现了熔断器 - Ribbon:客户端负载均衡的服务调用组件 - Feign:基于Ribbon和Hystrix的声明式服务调用组件 - Zuul:网关组件,提供智能路由、访问过滤等功能 - Archaius:外部化配置组件 - Spring Cloud Config:配置管理工具,实现应用配置的外部化存储,支持客户端配置信息刷新、加密/解密配置内容等。 - Spring Cloud Bus:事件、消息总线,用于传播集群中的状态变化或事件,以及触发后续的处理 - Spring Cloud Security:基于spring security的安全工具包,为我们的应用程序添加安全控制 - Spring Cloud Consul : 封装了Consul操作,Consul是一个服务发现与配置工具(与Eureka作用类似),与Docker容器可以无缝集成 - ...... ## 示例环境版本 - **Java** : JDK & JRE 1.8 8u151 - **Spring Boot** : 1.5.15.RELEASE - **Spring Cloud** : Edgware.SR3 (`PS`:Spring Cloud的版本命名是以伦敦地铁站的名字来命名的) ## 示例简要说明 - 服务注册与发现(基于Eureka) : [part1_service-register-discovery](https://github.com/EdisonChou/EDC.SpringCloud.Samples/tree/master/src/part1_service-register-discovery) - 客户端负载均衡(基于Ribbon) : [part2_client-load-balance](https://github.com/EdisonChou/EDC.SpringCloud.Samples/tree/master/src/part2_client-load-balance) - 声明式REST调用(基于Feign) : [part3_feign](https://github.com/EdisonChou/EDC.SpringCloud.Samples/tree/master/src/part3_feign) - 容错处理(基于Hystrix) : [part4_hystrix](https://github.com/EdisonChou/EDC.SpringCloud.Samples/tree/master/src/part4_hystrix) - API网关(基于Zuul) : [part5_zuul](https://github.com/EdisonChou/EDC.SpringCloud.Samples/tree/master/src/part5_zuul) - 统一配置管理(基于Spring Cloud Config) : [part6_config](https://github.com/EdisonChou/EDC.SpringCloud.Samples/tree/master/src/part6_config) - 微服务跟踪(基于Spring Cloud Sleuth) : [part7_sleuth](https://github.com/EdisonChou/EDC.SpringCloud.Samples/tree/master/src/part7_sleuth) - Spring Cloud on Docker与Docker Compose编排微服务 : [Java微服务之Spring Boot on Docker(Docker Compose编排Spring Cloud微服务)](https://www.cnblogs.com/edisonchou/p/springboot_on_docker_foundation.html) ## 推荐学习资料 `PS`:下面资料都是我们项目组新同事以及老同事(.Net技术背景)所采用的学习资料,并不保证适合于所有人。本示例主要也主要是基于下面的资料而写的sample code。<br/> <img src="https://www.cnblogs.com/images/cnblogs_com/edisonchou/1288702/o_eBook2.jpg" style="border: 1px solid #ddd; border-radius: 5px;" alt="Spring Cloud与Docker微服务架构实战"/> <img src="https://www.cnblogs.com/images/cnblogs_com/edisonchou/1288702/o_eBook1.jpg" style="border: 1px solid #ddd; border-radius: 5px;" alt="Spring Cloud微服务实战"/> > 周立 Spring Cloud与Docker微服务架构实战:https://book.douban.com/subject/30278673/<br/> > 程序猿DD SpringCloud基础教程(Dalston版本),Spring Cloud微服务实战:http://blog.didispace.com/Spring-Cloud%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/<br/> > 纯洁的微笑 SpringCloud系列教程:http://www.ityouknow.com/spring-cloud ## 推荐开发环境 <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1533644040260&di=f5ef1cf27c43f744cc8fbac384bfd0e9&imgtype=0&src=http%3A%2F%2Fimage.bubuko.com%2Finfo%2F201808%2F20180801214347937731.png" style="border: 1px solid #ddd; border-radius: 5px;" alt="Intellij Idea 2018"/> > Intellij Idea Community 2018版本<br/> <br/> <img src="https://www.cnblogs.com/images/cnblogs_com/edisonchou/1288702/o_alibaba_plugin.jpg" style="border: 1px solid #ddd; border-radius: 5px;" alt="阿里巴巴代码规约"/> > 阿里巴巴代码规约插件<br/> ## 参考博文 [Spring Cloud微服务架构基础学习与示例](https://www.cnblogs.com/edisonchou/p/java_spring_cloud_foundation_sample_list.html)<br/> [Java微服务之Spring Boot on Docker(Docker Compose编排Spring Cloud微服务)](https://www.cnblogs.com/edisonchou/p/springboot_on_docker_foundation.html)
0
corda/samples-java
This repository contains multiple sample apps, from CorDapps that help you get started, all the way to demonstrating specific features and advanced usage.
null
# CorDapp Samples - Java <p align="center"> <img src="https://www.corda.net/wp-content/uploads/2016/11/fg005_corda_b.png" alt="Corda" width="500"> </p> ## Introduction This repository contains multiple sample apps, from CorDapps that help you get started, all the way to demonstrating specific features and advanced usage. If you are new to Corda and/or would like to learn all of the fundamentals in a guided and incremental manner please visit the Corda [documentation](https://docs.r3.com/) site. To get started explore the [Basic](./Basic) folder, or navigate to the [Advanced](./Advanced) and [Features](./Features) folders to see a description of whats available. You can find the exact same set of CorDapp demonstration in Kotlin language at [link](https://github.com/corda/samples-kotlin). ## Directories The samples are divided into 5 sections with the following desciption: * [Accounts](./Accounts): These samples showcases how to utilize Corda Accounts Libray to build CorDapps which aim to have massive user volume * [Advanced](./Advanced): In these samples, we demonstrate more complex and sophisticated features of Corda. * [Basic](./Basic): They demonstrate fundamental and useful techniques for CorDapp development. * [BusinessNetworks](./BusinessNetworks): These include Business Network Extension related samples. Learn more at [bn-extension](https://github.com/corda/bn-extension). * [Features](./Features): These samples demonstrate specific Corda functionalities. * [Tokens](./Tokens): These include TokenSDK related samples. Learn more at TokenSDK.
1
okta/samples-java-spring
Spring Boot samples
null
# Spring Security OAuth Sample Applications for Okta This repository contains several sample applications that show you how to integrate various Okta use-cases into your Java application that uses the Spring framework. Note: Samples would need minimum JDK 17 or above. Please find the sample that fits your use-case from the table below. | Sample | Description | Use-Case | |--------|-------------|----------| | [Okta-Hosted Login](/okta-hosted-login) | An application server that uses the hosted login page on your Okta org, then creates a cookie session for the user in the Spring application. | Traditional web applications with server-side rendered pages. | | [Custom Login Page](/custom-login) | An application server that uses the Okta Sign-In Widget on a custom login page within the application, then creates a cookie session for the user in the Spring application. | Traditional web applications with a custom login page and server-side rendered pages. | | [Resource Server](/resource-server) | This is a sample API resource server that shows you how to authenticate requests with access tokens that have been issued by Okta. | Single-Page applications. | | [Front End](/front-end) (bonus) | A simple static Single-Page application that can be used with the resource-server | Test the above resource server |
0
JetBrains/intellij-samples
Code that demonstrates various IntelliJ IDEA features
null
[![official project](http://jb.gg/badges/official-plastic.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) # IntelliJ IDEA Samples for Tips and Tricks, Features, etc. This repository contains code that demonstrates IntelliJIDEA features. The classes and methods are largely named after the functionality that they're supposed to demonstrate. This code can be updated or added to as features in IntelliJ IDEA are added or updated. A large number of the features are demoed in this presentation: https://youtu.be/9AMcN-wkspU The code has been used in a number of shorter tip videos: http://youtube.com/Intellijidea These examples currently show features all the way up to IntelliJ IDEA 2020.1, and Java 15. There are also some basic samples for Spring and for Web/JavaScript features. See also: https://github.com/trishagee/groovy-samples
0
agoncal/agoncal-sample-cdi
Samples about CDI
cdi samples
# Samples - CDI Several samples about EJBs : * 01-Bootstrapping : Bootstrap CDI in several environments * 02-JavaEE6 : Differences between Java EE inection (@Resource…) and CDI @Inject * 03-Injection : CDI injection with qualifiers * 04-Injection : Different injection points (attributes, setter, constructor) * 05-Producers : CDI producers # Licensing <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>. <div class="footer"> <span class="footerTitle"><span class="uc">a</span>ntonio <span class="uc">g</span>oncalves</span> </div>
0
gradescope/autograder_samples
Examples of autograders for running on Gradescope
autograder autograding computer-science course-management gradescope
docs/README.md
0
roghughe/captaindebug
Samples from Captain Debug's Blog
null
null
0
FirebaseExtended/custom-auth-samples
Samples showcasing how to sign in Firebase using additional Identity Providers
null
# Samples: Sign In Firebase with additional auth providers using Custom auth tokens This repo contains samples that demonstrate how to use Custom auth tokens to Sign In Firebase with Identity Providers other than the ones with build-in support (Google, Facebook, Twitter and GitHub). We currently have the following samples: - [Instagram](instagram) for Web - [LINE Login](Line) for iOS & Android - [Kakao Login](kakao) for iOS & Android You can find [additional examples for Web](https://github.com/firebase/functions-samples#authorize-with-linkedin-spotify-instagram-line-or-basic-auth) in another repository. ## Status ![Status: Archived](https://img.shields.io/badge/Status-Archived-red) This sample is no longer actively maintained and is left here for reference only. ## Contributing We'd love that you contribute to the project. Before doing so please read our [Contributor guide](CONTRIBUTING.md). ## License © Google, 2016. Licensed under an [Apache-2](LICENSE) license.
0
octo-technology/RoboSpice-samples
All samples of the RoboSpice library.
null
# RoboSpice-samples All samples of the RoboSpice library. ## Convert samples to Ant projects ```bash #go to the sample of your choice. cd samples/robospice-sample-core #1. create ant files for current project android update project -p . #2. use maven to copy dependencies to the libs-for-ant folder mvn clean install -Pant #3. move all maven dependencies to the libs folder for ant mv libs-for-ant libs #build the project with ant ant clean debug install ``` your project is now ant-ready, the libs folder contains all needed dependencies to add robospice and extensions modules to your project. This method works for every sample project. Once you got all the needed jar files, you can move them to your own projects. **Note** : you will need to define the `ANDROID_HOME` environment variable to point to you android SDK home folder for maven to work.
0
ibm-messaging/event-streams-samples
null
null
# event-streams-samples IBM Event Streams for IBM Cloud is a scalable, distributed, high throughput message bus to unite your on-premise and off-premise cloud technologies. You can wire micro-services together using open protocols, connect stream data to analytics to realize powerful insight and feed event data to multiple applications to react in real time. This repository is for samples which interact with the Event Streams for IBM Cloud service. Currently, there are samples for the Kafka and MQ Light APIs. Information and instructions regarding the use of these samples can be found in their respective directories. ## Aim of the Samples The aim of the samples is to help you get started with Event Streams for IBM Cloud within minutes. They are not production-ready applications but should give you useful pointers at how to build, package and deploy applications as well as how to make basic API calls against us with error handling. We did all the heavy lifting so you can focus on developing exciting code with value! ## Provisioning your Event Streams for IBM Cloud Cluster In order to provision an Event Streams for IBM Cloud cluster, please visit the [IBM Cloud® catalog](https://cloud.ibm.com/catalog/). Please also familiarise yourself with Event Streams for IBM Cloud and Apache Kafka basics and terminology. [Our documentation](https://cloud.ibm.com/docs/services/EventStreams?topic=eventstreams-getting_started) is a good starting point. ### Pricing plans IBM Event Streams can be provisioned on IBM Cloud® in various pricing plans. Please refer to our [documentation](https://cloud.ibm.com/docs/services/EventStreams?topic=eventstreams-plan_choose#plan_choose) to help choose a plan that works for you. __Important Note__: Provisioning an Event Streams service in IBM Cloud® incurs a fee. Please review pricing before provisioning. The samples in this repository will create topic(s) on your behalf - creating a topic might also incur a fee. For more information, please consult the IBM Cloud® documentation if necessary. ## Connecting to your Event Streams for IBM Cloud Cluster In each sample, we demonstrate a single connection path for our Standard/Enterprise plans respectively. The aim was to get you started quickly. However your client's needs might be different. Therefore we wrote a [guide](https://cloud.ibm.com/docs/services/EventStreams?topic=eventstreams-connecting#connecting) that discusses credential generation in detail and showing you all possible ways of doing this. ## Our APIs and Sample Applications ### Kafka API (recommended): * [kafka-java-console-sample](/kafka-java-console-sample/README.md) : Sample Java console application using the Event Streams for IBM Cloud Kafka API * [kafka-java-liberty-sample](/kafka-java-liberty-sample/README.md) : Sample IBM Websphere Liberty profile application using the Event Streams for IBM Cloud Kafka API * [kafka-nodejs-console-sample](kafka-nodejs-console-sample/README.md) : Sample Node.js console application using the Event Streams for IBM Cloud Kafka API * [kafka-python-console-sample](/kafka-python-console-sample/README.md) : Sample Python console application using the Event Streams for IBM Cloud Kafka API * [kafka-connect](/kafka-connect/README.md) : Sample Docker image with Kafka Connect * [kafka-mirrormaker](/kafka-mirrormaker/README.md) : Sample Docker image with Kafka Mirror Maker ### Spring Kafka: * [spring kafka tutorial](https://developer.ibm.com/tutorials/use-spring-kafka-to-access-an-event-streams-service/) : Tutorial to quickly get you up and running using IBM Event Streams. * [spring-kafka](https://github.com/wkorando/event-stream-kafka) : Sample app to connect to Event Streams using Spring Kafka ### Utilities: * [kafka-topic-stats](/kafka-topic-stats/README.md): Utility for displaying Kafka topic usage and configuration. ## Get Further Assistance If you have any issues, just ask us a question (tagged with `ibm-eventstreams`) on [StackOverflow.com](http://stackoverflow.com/questions/tagged/ibm-eventstreams). For more information regarding IBM Event Streams for IBM Cloud, [view the documentation on IBM Cloud](https://cloud.ibm.com/docs/services/EventStreams?topic=eventstreams-getting_started).
0
gupaoedu-tom/design-samples
《设计模式就该这样学,基于经典框架源码和真实业务场景》随书代码示例工程
null
# 《设计模式就该这样学,基于经典框架源码和真实业务场景》 ### 已全面开启预售!!! ### 京东购买链接:[https://item.jd.com/12699413.html](https://item.jd.com/12699413.html) ### 当当购买链接:[http://product.dangdang.com/28994943.html](http://product.dangdang.com/28994943.html) Design Patterns: Elements of Reusable Object-Oriented Software(以下简称《设计模式》),一书由Erich Gamma、Richard Helm、Ralph Johnson和John Vlissides合著(Addison-Wesley,1995)。这四位作者常被称为“四人组(Gang of Four)”,而这本书也就被称为“四人组(或 GoF)”书。他们首次给我们总结出一套软件开发可以反复使用的经验,帮助我们提高代码的可重用性、系统的可维护性等,解决软件开发中的复杂问题。 设计模式已诞生20多年,其间相继出版的关于设计模式的经典著作不计其数。如果说GoF的《设计模式》是设计模式领域的“圣经”,那么之后出版的各种关于设计模式的书籍可称为“圣经”的“批注版”或者“白话版”。本书正是基于GoF的《设计模式》来编写的。 本书可以作为笔者对“圣经”实践的精华总结,是一本可以真正能够落地的“设计模式”之书,也是目前唯一一本结合框架源码如何落地“设计模式”这个角度来理解设计模式的书。本书会结合JDK、Spring、MyBatis、Tomcat、Netty等经典框架源码展开对设计模式的分析。当然,本书还会结合笔者多年的“踩坑填坑”经验和“教学答疑”经验,用比“圣经”更深刻、更全面、更通俗、更生动、更有趣、更接地气的方式并且结合真实的业务场景来分析每种设计模式的优缺点,治愈“设计模式选择困难症”。选择设计模式时就像相亲选对象,一旦做好了接受TA缺点的准备,那TA就一定属于你。所以,本书对于日常开发而言更具有指导意义。 书中部分观点若有不妥之处,恳请纠正,共同进步! # 关于我 ### 为什么都叫我“文艺汤”? 我自幼爱好书法和美术,长了一双能书会画的手,而且手指又长又白,因此以前的艺名叫“玉手藝人”。中学期间,曾获市级书法竞赛一等奖,校园美术竞赛一等奖,校园征文比赛二等奖。担任过学生会宣传部长,负责校园黑板报,校园刊物的编辑、排版和设计。 2008年参加工作后,我做过家具建模、平面设计等工作,亲自设计了咕泡学院的 Logo。做讲师之后,我给自己起了一个跟姓氏谐音的英文名字“Tom”,江湖人称“编程界写字写得最好的、书法界编程最牛的文艺汤”。 ### 我的技术生涯 我的 IT 技术生涯应该算是从 2009 年开始的,在此之前做过 UI 设计,做过前端网页,到2009年才真正开始参与Java后台开发。在这里要感谢所有帮助我入门编程的同事和老师。从2010年至2014年担任过项目组长、项目经理、架构师、技术总监,对很多的开源框架建立了自己的独特见解。我会习惯性地用形象思维来理解抽象世界。譬如:看到二进制数 0 和 1,我会想到《周易》中的两仪——阴和阳;看到颜色值用 RGB 表示,我会想到美术理论中的太阳光折射三原色;下班回家看到炒菜流程,我会想到模板方法模式;坐公交车看到学生卡、老人卡、爱心卡,我会想到策略模式;等等。大家看到的这本书,很多地方都融入了这种形象思维。 ### 众多图书之下为什么写此书? 首先,自《Spring 5核心原理与30个类手写实战》和《Netty 4核心原理与手写RPC框架实战》出版以来,各位“汤粉”给我带来了非常多惊喜。这些惊喜给我带来的不仅仅是个人名誉,更多的是一种更大的社会责任。非常感谢各位“汤粉”的大力支持和认可,大家也非常喜欢我的“形象思维”。 其次,我传播知识的宗旨是:将抽象的知识形象化,将枯燥的知识趣味化,将难懂的知识通俗化。而设计模式又是大家公认的最为枯燥的知识,也是很难落地的。这一次,我将压箱底多年的干货都掏空,以此奉献社会,回馈社会。我总结多年实战经验,并结合经典框架源码分析设计模式,让设计模式真正能够为我所用,真正可以用来解决实际问题。 最后,再次感谢各位“汤粉”的支持,感谢为本书手稿提出宝贵修改意见的学员,也感谢电子社责任编辑董英团队的辛勤付出。 # 技术交流 ![关注公众号Tom弹架构](https://user-images.githubusercontent.com/54272541/139790847-bbcccc8c-cd5e-4bdc-9b1b-bc923a9d4d99.png) ### 推荐《[Spring 5核心原理与30个类手写实战](https://github.com/gupaoedu-tom/spring5-samples)》,4个月销量破万,连续占据畅销榜。 ### 推荐《[Netty 4核心原理与手写RPC框架实战](https://github.com/gupaoedu-tom/netty4-samples)》,上架3个月,销量突破10000册。
0
burrsutter/9stepsawesome
The exercises/samples repo for bit.ly/9stepsawesome presentation
null
null
0
spring-projects/spring-ws-samples
null
null
null
0
citrusframework/citrus-samples
Citrus sample projects using Java DSL tests and Spring Java configuration
null
Citrus samples ![Logo][1] ============== Sample applications --------- The Citrus samples applications try to demonstrate how Citrus works in different integration test scenarios. The projects are executable with Maven and should give you a detailed picture how Citrus testing works. This repository uses the Java DSL and configuration in Citrus. In case you are not a Java developer you can also use the plain XML DSL and configuration notation. The samples using XML can be found in [samples-xml][5]. Overview --------- The Citrus samples section contains many small projects that each represents a separate system under test and some Citrus test cases. Each sample folder demonstrates a special aspect of how to use Citrus. Most of the samples use a simple todo-list application as system under test. Please find following list of samples and their primary objective: | Samples | Description | |-------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------:| | [sample-reporting](sample-reporting) | Shows how to add a custom reporter | | [sample-docker](sample-docker) | Shows how to use Citrus within Docker infrastructure | | [sample-kubernetes](sample-kubernetes) | Shows how to use Citrus within Kubernetes infrastructure | | [sample-gradle](sample-gradle) | Uses Gradle build to execute tests | | [sample-annotation-config](sample-annotation-config) | Uses annotation based endpoint configuration | | [sample-javaconfig](sample-javaconfig) | Uses pure Java POJOs for configuration | | [sample-groovy](sample-groovy) | Uses Groovy scripts to define Citrus test cases | | [sample-behaviors](sample-behaviors) | Shows how to reuse test actions in test behaviors | | [sample-dictionaries](sample-dictionaries) | Shows how to incorporate message manipulation using data dictionaries | | [sample-message-store](sample-message-store) | Shows how to access internal message store | | [sample-binary](sample-binary) | Shows binary message content handling in Citrus | | [sample-hamcrest](sample-hamcrest) | Shows Hamcrest matcher support in validation and conditions | | [sample-mail](sample-mail) | Shows mail server activities in Citrus | | [sample-selenium](sample-selenium) | Perform UI testing with Selenium and Citrus | | [sample-dynamic-endpoints](sample-dynamic-endpoints) | Shows dynamic endpoint component usage | | [sample-jms](sample-jms) | Shows JMS message broker integration | | [sample-kafka](sample-kafka) | Shows Kafka integration | | [sample-rmi](sample-rmi) | Shows how to use RMI with Citrus as a client and server | | [sample-camel-context](sample-camel-context) | Interact with Apache Camel context and routes | | Samples DB | Description | | [sample-jdbc](samples-db/sample-jdbc) | Simulates database server with JDBC | | [sample-jdbc-callable-statements](samples-db/sample-jdbc-callable-statements) | Simulates database server communication using callable statements | | [sample-jdbc-transactions](samples-db/sample-jdbc-transactions) | Simulates database server with transactional JDBC | | [sample-sql](samples-db/sample-sql) | Validates stored data in relational database | | Samples JSON | Description | | [sample-json](samples-json/sample-json) | Shows Json payload validation feature with JsonPath validation | | [sample-databind](samples-json/sample-databind) | Shows JSON object mapping feature when sending and receiving messages | | Samples XML | Description | | [sample-xml](samples-xml/sample-xml) | Shows XML validation feature with schema and Xpath validation | | [sample-oxm](samples-xml/sample-oxm) | Shows XML object marshalling feature when sending and receiving messages | | [sample-xhtml](samples-xml/sample-xhtml) | Shows XHTML validation feature | | Samples FTP/SFTP | Description | | [sample-ftp](samples-ftp/sample-ftp) | Shows FTP client and server interaction in Citrus | | [sample-sftp](samples-ftp/sample-sftp) | Shows SFTP client and server interaction in Citrus | | [sample-scp](samples-ftp/sample-scp) | Shows SCP client and server interaction in Citrus | | Samples TestNG | Description | | [sample-testng](samples-testng/sample-testng) | Shows TestNG framework support | | [sample-dataprovider](samples-testng/sample-dataprovider) | Shows TestNG data provider usage in Citrus | | Samples JUnit | Description | | [sample-junit](samples-junit/sample-junit) | Shows JUnit4 framework support | | [sample-junit5](samples-junit/sample-junit5) | Shows JUnit5 framework support | | Samples Http | Description | | [sample-swagger](samples-http/sample-swagger) | Auto generate tests from Swagger Open API | | [sample-http](samples-http/sample-http) | Shows Http REST API calls as a client | | [sample-http-loadtest](samples-http/sample-http-loadtest) | Calls REST API on Http server with multiple threads for load testing | | [sample-http-static-response](samples-http/sample-http-static-response) | Shows how to setup a static response generating Http server component | | [sample-http-query-param](samples-http/sample-http-form-data) | How to use Http form data with `x-www-form-urlencoded` Http POST | | [sample-http-form-data](samples-http/sample-http-query-param) | Exchange form data via Http GET/POST | | [sample-http-basic-auth](samples-http/sample-http-basic-auth) | Shows how to use basic authentication on client and server components | | [sample-https](samples-http/sample-https) | Shows how to use SSL connectivity as a client and server | | Samples Websockets | Description | | [sample-websocket-client](samples-websocket/sample-websocket-client) | Shows how to connect to a Websocket as a client during the test | | [sample-websocket-server](samples-websocket/sample-websocket-server) | Shows how to provide a Websocket as a server for clients to connect | | Samples SOAP | Description | | [sample-wsdl](samples-soap/sample-wsdl) | Auto generate tests from WSDL | | [sample-soap](samples-soap/sample-soap) | Shows basic SOAP web service support | | [sample-soap-mtom](samples-soap/sample-soap-mtom) | Shows how to send and receive MTOM enabled SOAP attachments | | [sample-soap-attachment](samples-soap/sample-soap-attachment) | Shows how to send SOAP attachments to server | | [sample-soap-wssecurity](samples-soap/sample-soap-wssecurity) | Shows how to configure SOAP web service client and server with WSSecurity enabled | | [sample-soap-wsaddressing](samples-soap/sample-soap-wsaddressing) | Shows how to configure SOAP web service client and server with WSAddressing enabled | | [sample-soap-ssl](samples-soap/sample-soap-ssl) | Shows how to configure SOAP web service with SSL secure connectivity | | [sample-soap-static-response](samples-soap/sample-soap-static-response) | Shows how to setup a static response generating SOAP web service server component | | Samples Cucumber BDD | Description | | [sample-cucumber](samples-cucumber/sample-cucumber) | Shows BDD integration with Cucumber | | [sample-cucumber-spring](samples-cucumber/sample-cucumber-spring) | Shows BDD integration with Cucumber using Spring Framework injection | | [sample-cucumber-spring2](samples-cucumber/sample-cucumber-spring2) | Shows BDD integration with Cucumber Spring Framework support | | Samples - Remote | Description | | [sample-test-jar](samples-remote/sample-test-jar) | Creates an executable test JAR to run all integration tests | | [sample-test-war](samples-remote/sample-test-war) | Creates a deployable test WAR to run all integration tests as part of a web deployment | Following sample projects cover message transports and technologies. Each of these samples provides a separate system under test application that demonstrates the messaging aspect. | Demo Projects | Kafka | JMS | Http | SOAP | Channel | Camel | SQL | SYNC | ASYNC | |---------------------------------------------------|:-----:|:---:|:----:|:----:|:-------:|:-----:|:---:|:----:|:-----:| | [sample-quarkus](demo/sample-quarkus) | X | | X | | | | X | X | X | | [sample-bakery](demo/sample-bakery) | | X | X | | | | | X | X | | [sample-flightbooking](demo/sample-flightbooking) | | X | X | | | | X | | X | | [sample-greeting](demo/sample-greeting) | | X | | | X | | | X | X | | [sample-bookstore](demo/sample-bookstore) | | X | | X | | | | X | | | [sample-incident](demo/sample-incident) | | X | X | X | | | | X | X | Pick your sample application for try out and got to the respective folder. Preconditions --------- See the preconditions for using the Citrus sample applications: * Installed JDK 1.8 or higher plus `JAVA_HOME` environment variable set up and pointing to your Java installation directory * Apache Maven 3.0.x or higher The sample projects are executable via Apache Maven (http://maven.apache.org/). You need ANT installed and running an your machine in order to use this way of executing the sample applications. In each of the samples folders you will find the Maven (POM) pom.xml that defines all dependencies and build plugins. Run --------- You can run all the samples locally on your machine. We are using the Maven build tool for this. All samples use some project as a system under test. These sample application has to be started before executing any Citrus tests. Many samples reuse the [todo-list](todo-app) application which is a simple web application that provides a basic REST API. You can auto start and deploy the todo-list application within the Maven build by using the following command: mvn clean install -Dsystem.under.test.mode=embedded The embedded option automatically starts an embedded Jetty Web Server Container before the integration test phase in Maven. After that the Citrus tests will be able to perform its actions in integration-test phase in Maven. After the tests are finished the embedded Jetty container is automatically stopped. You can also start the Jetty container manually by calling: mvn jetty:run-war Execute this command in the respective sample folders and you will get a running Jetty Web Server Container with the system under test deployed. Once the sample application is deployed and running you can execute the Citrus test cases in that sample folder. Open a separate command line terminal in that folder and execute the following command. mvn verify This executes all Citrus tests in that sample. You can also pick a single test by calling mvn verify -Dit.test=<testname> You should see Citrus performing several tests with lots of debugging output in both terminals (sample application server and Citrus test client). And of course green tests at the very end of the build. Please read the instructions in each sample folder for different setup options and execution commands. Information --------- For more information on Citrus see [www.citrusframework.org][2], including a complete [reference manual][3]. [1]: https://citrusframework.org/img/brand-logo.png "Citrus" [2]: https://citrusframework.org [3]: https://citrusframework.org/reference/html/ [4]: https://github.com/citrusframework/citrus [5]: https://github.com/christophd/citrus-samples-xml
1
sleberknight/zookeeper-samples
Sample code for a presentation on ZooKeeper.
null
This is code that accompanies a talk I gave on Apache ZooKeeper. The slides can be found at http://www.slideshare.net/scottleber/apache-zookeeper May 2017 Update: * Updated ZooKeeper version to 3.4.10 * Updated Curator version to 2.12.0 * Changed all System.out to SLFJ Loggers * A bunch of misc. code cleanup, e.g. converting anonymous inner classes to lambdas, using diamond operator, etc. October 2023 update: * Update Zookeeper version to 3.9.1 * Update Curator version to 5.5.0 * Update SLF4J version to 2.0.9 and remove SLF4J to Log4J bridge * Update to use JDK 17 * Update plugins and several other dependencies, clean up the POM, etc. * Switch to use JUnit 5 (Jupiter) and AssertJ assertions * Remove test support classes EmbeddedZooKeeperServer and EmbeddedZooKeeperServerRule; they cause the tests to hang, and it's better to use Curator's testing server anyway
1
GoogleCloudPlatform/bank-of-anthos
Retail banking sample application showcasing Kubernetes and Google Cloud
fsi gcp google-cloud kubernetes reference-architecture sample-app samples
# Bank of Anthos <!-- @todo: https://github.com/badges/shields/pull/7759 --> <!-- ![GitHub branch checks state](https://img.shields.io/github/checks-status/GoogleCloudPlatform/bank-of-anthos/main)--> [![Website](https://img.shields.io/website?url=https%3A%2F%2Fcymbal-bank.fsi.cymbal.dev%2F&label=live%20demo )](https://cymbal-bank.fsi.cymbal.dev) **Bank of Anthos** is a sample HTTP-based web app that simulates a bank's payment processing network, allowing users to create artificial bank accounts and complete transactions. Google uses this application to demonstrate how developers can modernize enterprise applications using Google Cloud products, including: [Google Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine), [Anthos Service Mesh (ASM)](https://cloud.google.com/anthos/service-mesh), [Anthos Config Management (ACM)](https://cloud.google.com/anthos/config-management), [Migrate to Containers](https://cloud.google.com/migrate/containers), [Spring Cloud GCP](https://spring.io/projects/spring-cloud-gcp), [Cloud Operations](https://cloud.google.com/products/operations), [Cloud SQL](https://cloud.google.com/sql/docs), [Cloud Build](https://cloud.google.com/build), and [Cloud Deploy](https://cloud.google.com/deploy). This application works on any Kubernetes cluster. If you are using Bank of Anthos, please ★Star this repository to show your interest! **Note to Googlers:** Please fill out the form at [go/bank-of-anthos-form](https://goto2.corp.google.com/bank-of-anthos-form). ## Screenshots | Sign in | Home | | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | [![Login](/docs/img/login.png)](/docs/img/login.png) | [![User Transactions](/docs/img/transactions.png)](/docs/img/transactions.png) | ## Service architecture ![Architecture Diagram](/docs/img/architecture.png) | Service | Language | Description | | ------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | [frontend](/src/frontend) | Python | Exposes an HTTP server to serve the website. Contains login page, signup page, and home page. | | [ledger-writer](/src/ledger/ledgerwriter) | Java | Accepts and validates incoming transactions before writing them to the ledger. | | [balance-reader](/src/ledger/balancereader) | Java | Provides efficient readable cache of user balances, as read from `ledger-db`. | | [transaction-history](/src/ledger/transactionhistory) | Java | Provides efficient readable cache of past transactions, as read from `ledger-db`. | | [ledger-db](/src/ledger/ledger-db) | PostgreSQL | Ledger of all transactions. Option to pre-populate with transactions for demo users. | | [user-service](/src/accounts/userservice) | Python | Manages user accounts and authentication. Signs JWTs used for authentication by other services. | | [contacts](/src/accounts/contacts) | Python | Stores list of other accounts associated with a user. Used for drop down in "Send Payment" and "Deposit" forms. | | [accounts-db](/src/accounts/accounts-db) | PostgreSQL | Database for user accounts and associated data. Option to pre-populate with demo users. | | [loadgenerator](/src/loadgenerator) | Python/Locust | Continuously sends requests imitating users to the frontend. Periodically creates new accounts and simulates transactions between them. | ## Interactive quickstart (GKE) The following button opens up an interactive tutorial showing how to deploy Bank of Anthos in GKE: [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?show=ide&cloudshell_git_repo=https://github.com/GoogleCloudPlatform/bank-of-anthos&cloudshell_workspace=.&cloudshell_tutorial=extras/cloudshell/tutorial.md) ## Quickstart (GKE) 1. Ensure you have the following requirements: - [Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project). - Shell environment with `gcloud`, `git`, and `kubectl`. 2. Clone the repository. ```sh git clone https://github.com/GoogleCloudPlatform/bank-of-anthos cd bank-of-anthos/ ``` 3. Set the Google Cloud project and region and ensure the Google Kubernetes Engine API is enabled. ```sh export PROJECT_ID=<PROJECT_ID> export REGION=us-central1 gcloud services enable container.googleapis.com \ --project=${PROJECT_ID} ``` Substitute `<PROJECT_ID>` with the ID of your Google Cloud project. 4. Create a GKE cluster and get the credentials for it. ```sh gcloud container clusters create-auto bank-of-anthos \ --project=${PROJECT_ID} --region=${REGION} ``` Creating the cluster may take a few minutes. 5. Deploy Bank of Anthos to the cluster. ```sh kubectl apply -f ./extras/jwt/jwt-secret.yaml kubectl apply -f ./kubernetes-manifests ``` 6. Wait for the pods to be ready. ```sh kubectl get pods ``` After a few minutes, you should see the Pods in a `Running` state: ``` NAME READY STATUS RESTARTS AGE accounts-db-6f589464bc-6r7b7 1/1 Running 0 99s balancereader-797bf6d7c5-8xvp6 1/1 Running 0 99s contacts-769c4fb556-25pg2 1/1 Running 0 98s frontend-7c96b54f6b-zkdbz 1/1 Running 0 98s ledger-db-5b78474d4f-p6xcb 1/1 Running 0 98s ledgerwriter-84bf44b95d-65mqf 1/1 Running 0 97s loadgenerator-559667b6ff-4zsvb 1/1 Running 0 97s transactionhistory-5569754896-z94cn 1/1 Running 0 97s userservice-78dc876bff-pdhtl 1/1 Running 0 96s ``` 7. Access the web frontend in a browser using the frontend's external IP. ```sh kubectl get service frontend | awk '{print $4}' ``` Visit `http://EXTERNAL_IP` in a web browser to access your instance of Bank of Anthos. 8. Once you are done with it, delete the GKE cluster. ```sh gcloud container clusters delete bank-of-anthos \ --project=${PROJECT_ID} --region=${REGION} ``` Deleting the cluster may take a few minutes. ## Additional deployment options - **Workload Identity**: [See these instructions.](/docs/workload-identity.md) - **Cloud SQL**: [See these instructions](/extras/cloudsql) to replace the in-cluster databases with hosted Google Cloud SQL. - **Multi Cluster with Cloud SQL**: [See these instructions](/extras/cloudsql-multicluster) to replicate the app across two regions using GKE, Multi Cluster Ingress, and Google Cloud SQL. - **Istio**: [See these instructions](/extras/istio) to configure an IngressGateway. - **Anthos Service Mesh**: ASM requires Workload Identity to be enabled in your GKE cluster. [See the workload identity instructions](/docs/workload-identity.md) to configure and deploy the app. Then, apply `extras/istio/` to your cluster to configure frontend ingress. - **Java Monolith (VM)**: We provide a version of this app where the three Java microservices are coupled together into one monolithic service, which you can deploy inside a VM (eg. Google Compute Engine). See the [ledgermonolith](/src/ledgermonolith) directory. ## Documentation <!-- This section is duplicated in the docs/ README: https://github.com/GoogleCloudPlatform/bank-of-anthos/blob/main/docs/README.md --> - [Development](/docs/development.md) to learn how to run and develop this app locally. - [Environments](/docs/environments.md) to learn how to deploy on non-GKE clusters. - [Workload Identity](/docs/workload-identity.md) to learn how to set-up Workload Identity. - [CI/CD pipeline](/docs/ci-cd-pipeline.md) to learn details about and how to set-up the CI/CD pipeline. - [Troubleshooting](/docs/troubleshooting.md) to learn how to resolve common problems. ## Demos featuring Bank of Anthos - [Tutorial: Explore Anthos (Google Cloud docs)](https://cloud.google.com/anthos/docs/tutorials/explore-anthos) - [Tutorial: Migrating a monolith VM to GKE](https://cloud.google.com/migrate/containers/docs/migrating-monolith-vm-overview-setup) - [Tutorial: Running distributed services on GKE private clusters using ASM](https://cloud.google.com/service-mesh/docs/distributed-services-private-clusters) - [Tutorial: Run full-stack workloads at scale on GKE](https://cloud.google.com/kubernetes-engine/docs/tutorials/full-stack-scale) - [Architecture: Anthos on bare metal](https://cloud.google.com/architecture/ara-anthos-on-bare-metal) - [Architecture: Creating and deploying secured applications](https://cloud.google.com/architecture/security-foundations/creating-deploying-secured-apps) - [Keynote @ Google Cloud Next '20: Building trust for speedy innovation](https://www.youtube.com/watch?v=7QR1z35h_yc) - [Workshop @ IstioCon '22: Manage and secure distributed services with ASM](https://www.youtube.com/watch?v=--mPdAxovfE)
1
lenve/spring-boot-vue-samples
《Spring Boot + Vue 全栈开发实战》官方案例,更多全栈资料请戳这里---->
null
# 《Spring Boot + Vue 全栈开发实战》官方案例 本仓库是 《Spring Boot + Vue 全栈开发实战》 一书的所有案例,欢迎大家 star 。 扫码关注松哥微信公众号,可以获取最新版本的 Spring Boot + Vue 全栈开发资料 ![](http://www.javaboy.org/images/sb/javaboy.jpg) 最新版 Spring Boot 学习资料,请移步这里:[https://github.com/lenve/javaboy-code-samples](https://github.com/lenve/javaboy-code-samples) 扫码关注微信公众号【江南一点雨】,后台回复 888,获取更多 微人事学习资料~
0
agoncal/agoncal-sample-javaee
Samples about Java EE
javaee samples
# Samples - Java EE Several samples about Java EE : * 01-Monster : A huge Java EE component * 02-JavaOne2013 : The application developped for JavaOne 2013 # Licensing <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>. <div class="footer"> <span class="footerTitle"><span class="uc">a</span>ntonio <span class="uc">g</span>oncalves</span> </div>
0
vmware-tanzu/application-accelerator-samples
Project for samples to be used with Application Accelerator for VMware Tanzu" which is part of "VMware Tanzu Application Platform"."
null
# application-accelerator-samples ## Overview Application Accelerators for VMware Tanzu helps you bootstrap developing your applications and deploying them in a discoverable and repeatable way. Enterprise Architects author and publish accelerator projects that provide developers and operators in their organization ready-made, enterprise-conformant code and configurations. Published accelerator projects are maintained in Git repositories. You can then use Application Accelerators to create new projects based on those accelerator projects. The Application Accelerators user interface(UI) enables you to discover available accelerators, configure them, and generate new projects to download. ## How does Application Accelerators work? Application Accelerators allow you to generate new projects from files in Git repositories. An accelerator.yaml file in the repository declares input options for the accelerator. This file also contains instructions for processing the files when you generate a new project. Accelerator custom resources (CRs) control which repositories appear in the Application Accelerators UI. You can maintain CRs by using Kubernetes tools such as kubectl or by using the Tanzu CLI accelerator commands. The Accelerator controller reconciles the CRs with a Flux2 Source Controller to fetch files from GitHub or GitLab. The Application Accelerators UI and IDE extension gives you a searchable list of accelerators to choose from. After you select an accelerator, the UI and IDE extension present input fields for any input options. Application Accelerators UI and IDE extension send the input values to the Accelerator Engine for processing. The Engine then returns the project in a ZIP file. You can open the project in your favorite integrated development environment (IDE) to develop further. ### Prerequisites To use these Application Accelerators samples you need to have access to an installation of [VMware Tanzu Application Platform](https://network.tanzu.vmware.com/products/tanzu-application-platform). ### Build & Run Each Accelerator is provided in a separate directory and is its own self contained project with a README file descibing how to build it. ### Testing The test suite runs in GitHub actions om each push. You can run the tests locally by setting the following environment variables: ```sh export TANZU_CLI=tanzu export CLI_PLUGIN=acc export TEST_PATTERN=tanzu-java-web-app-* # set this to a pattern that matches the tests you want to run export TEST_WORKSPACE=$PWD export ACC_SERVER_URL=<URL> # this is the URL for Tanzu Portal (TAP-GUI) in your view cluster ``` Then run the tests using: ```sh ./run-test-local.sh ``` ## Documentation _Application Accelerators for VMware Tanzu_ documentation is provided as part of the official documentation for [VMware Tanzu Application Platform](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/index.html) ## Contributing The application-accelerator-samples project team welcomes contributions from the community. Before you start working with application-accelerator-samples, please read our [Developer Certificate of Origin](https://cla.vmware.com/dco). All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch. For more detailed information, refer to [CONTRIBUTING.md](CONTRIBUTING.md). ## License [MIT No Attribution](https://opensource.org/licenses/MIT-0) (MIT-0) License
0
androidmalin/RxjavaSample
RxJava Sample
rxandroid rxjava rxjavasamples sample
## RxJava RxJava之扔物线[给Android开发者的RxJava详解](http://gank.io/post/560e15be2dca930e00da1083)文章中的例子 ### Build To build: >$ git clone https://github.com/androidmalin/RengwuxianRxjava.git<br/> >$ cd RengwuxianRxjava/<br/> >$ gradle clean --stacktrace(./gradlew clean --stacktrace )<br/> ### Bugs and Feedback For bugs, questions and discussions please use the [Github Issues](https://github.com/androidmalin/RengwuxianRxjava/issues). ### 项目依赖 项目名称 | 项目信息 ------- | ------- [android.support.*](https://developer.android.com/tools/support-library/index.html) | Android Support Library [RxJava](https://github.com/ReactiveX/RxJava) | 一个在 Java VM 上使用可观测的序列来组成异步的、基于事件的程序的库 [RxAndroid](https://github.com/ReactiveX/RxAndroid) | RxAndroid 是 RxJava 的一个针对 Android 平台的扩展 [RxBinding](https://github.com/JakeWharton/RxBinding) | JakeWharton Android函数式相应编程(FRP)框架 [logger](https://github.com/orhanobut/logger) | 一个简洁,优雅,功能强大的Android日志输出工具 ### 参考的文章 作者 | 文章| 参考的地方 ------- | -------| ------- [扔物线](https://github.com/rengwuxian) | [给Android开发者的RxJava详解](http://gank.io/post/560e15be2dca930e00da1083) | 示例代码 [胡凯](https://github.com/kesenhoo) | [ 高效加载大图](http://hukai.me/android-training-course-in-chinese/graphics/displaying-bitmaps/load-bitmap.html) | Bitmap压缩算法 [intbird](http://blog.csdn.net/intbird) | [Android OOM ,回收布局文件中ImageView占用的内存.Bitmap OOM回收解决.](http://blog.csdn.net/intbird/article/details/19905549) | Bitmap回收 [任玉刚](https://github.com/singwhatiwanna)|[Android开发艺术探索](https://item.jd.com/11760209.html) | BitmapFactory解析的配置 [徐宜生](https://github.com/xuyisheng)|[Android群英传](https://item.jd.com/11758334.html)| Canvas的使用 [shwenzhang](https://github.com/shwenzhang)|[Android内存优化杂谈](http://mp.weixin.qq.com/s?__biz=MzAwNDY1ODY2OQ==&mid=400656149&idx=1&sn=122b4f4965fafebf78ec0b4fce2ef62a&3rd=MzA3MDU4NTYzMw==&scene=6#rd)| 内存优化 ### About me [我的CSDN博客](http://blog.csdn.net/androidmalin):[http://blog.csdn.net/androidmalin](http://blog.csdn.net/androidmalin)<br/> [我的微博](http://weibo.com/androidmalin):[http://weibo.com/androidmalin](http://weibo.com/androidmalin)<br/> ### License <pre> The MIT License (MIT) Copyright (c) 2015 malin 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. </pre>
1
davinci1012/pinduoduo_backdoor_unpacker
Samples and Unpacker of malicious backdoors and exploits developed and used by Pinduoduo
null
# 详细分析报告 Detailed Analysis Report English version see [Report](https://github.com/davincifans101/pinduoduo_backdoor_detailed_report/blob/main/report_en.pdf), 中文分析报告见[分析报告](https://github.com/davincifans101/pinduoduo_backdoor_detailed_report/blob/main/report_cn.pdf) # Pinduoduo恶意代码样本和脱壳机 听说PDD今天开始发律师函删帖抵赖了![PDDNB](https://user-images.githubusercontent.com/25000885/224233765-5195f16a-f41c-482f-a664-1cf72796651e.png),那就放点新东西出来。 拼多多的两个壳,manwe和nvwa脱壳脚本。适用于样本中.mw1 .nw0文件。.nw0要用nvwa脱壳脚本,.mw1用manwe脚本。 ## 拼多多manwe一键脱壳脚本 代码在`manwe_unpacker`目录,用法如下,或自己改路径: /tmp/mw1.bin放解压出来的文件,在`/tmp/final_java/`会生成脱壳后的java class文件,压缩一下拖到jadx里看。 ```java public class ManweVmpLoader { public static void main(String[] args) throws Throwable { String firmwarePath = "/tmp/mw1.bin"; ManweVmpDataInputStream inputStream = new ManweVmpDataInputStream(Files.newInputStream(Paths.get(firmwarePath))); ManweVmpDex manweVmpDex = new ManweVmpDex(inputStream); System.out.printf("Load %d class%n", manweVmpDex.manweVmpClazzes.length); if (inputStream.available() != 0) { throw new RuntimeException(String.format("%d bytes remaining", inputStream.available())); } inputStream.close(); if (Files.notExists(Paths.get("/tmp/final_java/"))) { new File("/tmp/final_java/").mkdirs(); } manweVmpDex.writeClazzes("/tmp/final_java/"); } } ``` ## 拼多多nvwa一键脱壳脚本 代码见`nvwa_unpacker`目录 ## 提取出的恶意样本 PDD的恶意代码以加壳后的文件形式组织,APK自带AliveBaseAbility,其他的都是远程下发,以下称为“样本”。因为有些样本是动态下发,不一定全,如果有这里没有的,欢迎Pull Request补充。 样本在samples目录中,包含PDD APK自带的样本,以及其动态下发的样本。动态样本为3.2日之前从安装了PDD的手机里/data/data/com.xunmeng.pinduoduo/files/bot/, /data/data/com.xunmeng.pinduoduo/files/.components/提取出,现在新版本可能被PDD删掉了,有兴趣的可以找下装了之前的版本的手机看下,顺便看下`app_mango`目录,里面是配置文件,有惊喜。 带符号的样本为PDD 6.2.0提取出(`samples/old_alive_base_ability_with_symbol/mw1.bin`),新版本的APP携带的样本去掉了符号。 样本各个都是干货,值得看看。AliveBaseAbility是第一步,davinci仓库中提到的dex只是这个evil plan的第三步,这里其他的是第二步。 ## 其他 一视同仁,平等对待才是好的营商环境,纵容、包庇不是。 据说PDD搞这个的100多号人的团队连夜解散了,删库跑路,是吗?又听说PDD这些漏洞手段被曝光停了之后,DAU出现明显下跌,是吗? 等下,有人敲门说查水表了,我先出 ## 免责声明 仅用于研究用途,禁止和PDD一样作恶,没靠山别学
0
SAP-samples/cloud-cap-samples-java
A sample application that demonstrates the features of the Java SDK for the SAP Cloud Application Programming Model.
business-technology-platform cap sample sample-code sap-btp sap-cap sap-cloud-platform
<!-- omit in toc --> # Welcome to CAP Samples for Java ![CI status](https://github.com/SAP-samples/cloud-cap-samples-java/workflows/Java%20CI%20with%20Maven/badge.svg) [![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/cloud-cap-samples-java)](https://api.reuse.software/info/github.com/SAP-samples/cloud-cap-samples-java) Welcome to the bookshop-java project. It demonstrates how to build business applications using the [CAP Java SDK](https://cap.cloud.sap) providing a book shop web application as an example. The application in this project enables browsing books, managing books, and managing orders. ![Book Object Page](assets/readmeImages/BookPage.png) <!-- omit in toc --> ## Outline - [Overview](#overview) - [Demonstrated Features](#demonstrated-features) - [Getting Started](#getting-started) - [Prerequisites](#prerequisites) - [Clone Build & Run](#clone-build--run) - [Using Eclipse](#using-eclipse) - [Building and Running](#building-and-running) - [Using IntelliJ Idea (Community and Ultimate)](#using-intellij-idea-community-and-ultimate) - [Database Setup and Spring Profiles](#database-setup-and-spring-profiles) - [API_BUSINESS_PARTNER Remote Service and Spring Profiles](#api_business_partner-remote-service-and-spring-profiles) - [Deploy to SAP Business Technology Platform, Cloud Foundry](#deploy-to-sap-business-technology-platform-cloud-foundry) - [Deploy to SAP Business Technology Platform, Kyma Runtime](#deploy-to-sap-business-technology-platform-kyma-runtime) - [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform) - [Code Tour](#code-tour) - [Get Support](#get-support) - [License](#license) # Overview This sample application shows how to conveniently create business applications based on **CDS domain models**, persisting data with **H2**, or **SAP HANA**, and exposing an **OData V4** frontend with an **SAP Fiori** frontend on top. This sample uses Spring Boot as an **application framework**. Although a CAP Java application isn’t required to build on Spring Boot, it’s the first choice of framework, as it’s seamlessly integrated. The **domain models** are defined using [CDS entity definitions](https://cap.cloud.sap/docs/cds/cdl#entity-and-type-definitions). By default, an in-memory H2 database is used for **data persistency**. Once productively deployed to SAP Business Technology Platform, SAP HANA can be used. **Services** are defined using [CDS Service Models](https://cap.cloud.sap/docs/cds/cdl#services). The **OData V4 Protocol Adapter** translates the CDS service models into corresponding OData schemas and maps the incoming OData requests to the corresponding CDS services. Although CAP provides generic **event handlers** to serve most CRUD requests out-of-the-box, it’s possible to add business logic through [Custom Event Handlers](https://cap.cloud.sap/docs/get-started/in-a-nutshell#adding-custom-logic). A SAP Fiori UI is added using predefined SAP Fiori elements templates. **[SAP Fiori annotations](https://cap.cloud.sap/docs/advanced/fiori#fiori-annotations)** add information to the service definitions, on how to render the data. CAP provides built-in multitenancy support with out-of-the box tenant isolation. The sample application demonstrates usage of MTX sidecar based on [streamlined MTX](https://cap.cloud.sap/docs/guides/deployment/as-saas?impl-variant=java) and can be deployed as multitenant application. The [deprecated classic MTX](https://cap.cloud.sap/docs/java/multitenancy) setup is shown in the [mtx-classic branch](https://github.com/SAP-samples/cloud-cap-samples-java/tree/mtx-classic) for reference. ## Demonstrated Features Framework and Infrastructure related Features: - [Application configuration](https://cap.cloud.sap/docs/java/development#application-configuration) for Spring and CDS using [application.yaml](srv/src/main/resources/application.yaml) - [Mocking users](/srv/src/main/resources/application.yaml) for local development - [Authentication & Authorization](https://cap.cloud.sap/docs/java/security) (including user-specific restrictions with `@restrict` in the [Admin Service](/srv/admin-service.cds)) - [Cloud Foundry Deployment using MTA](https://cap.cloud.sap/docs/advanced/deploy-to-cloud#deploy-using-mta) with XSUAA [Service Bindings](mta-single-tenant.yaml) - Application Router configuration including authentication via the XSUAA Service. See [package.json](app/package.json), [xs-app.json](app/xs-app.json) and [xs-security.json](xs-security.json) - [Multitenancy configuration](https://cap.cloud.sap/docs/java/multitenancy) via [mta-multi-tenant.yaml](mta-multi-tenant.yaml), [.cdsrc.json](.cdsrc.json), [sidecar module](mtx-sidecar) - [Feature toggles](https://cap.cloud.sap/docs/guides/extensibility/feature-toggles?impl-variant=java#limitations). In CF, features can be toggled by assigning the roles `expert` or `premium-customer` to the user. - [Messaging configuration and handlers](https://cap.cloud.sap/docs/java/messaging-foundation) with local messaging and message brokers. - Consumption of [Remote services](https://cap.cloud.sap/docs/java/remote-services) in [srv/external.cds] and [srv/notes-mashup.cds] Domain Model related Features: - [CDS Query Language with a Static CDS Model](https://cap.cloud.sap/docs/java/advanced#staticmodel) in the [Admin Service](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) - Use of [Aspects](https://cap.cloud.sap/docs/cds/cdl#aspects) in the Model Definition such as the [`managed` or `cuid` Aspect](https://cap.cloud.sap/docs/cds/common#common-reuse-aspects) in [Books](db/books.cds) - [Input validation](https://cap.cloud.sap/docs/cds/annotations#input-validation) using model annotation `@assert.format` - [Data Localization](https://cap.cloud.sap/docs/guides/localized-data) for [Books](db/books.cds) - Use of [Media Data](https://cap.cloud.sap/docs/guides/providing-services#media-data) in [Books](db/books.cds) and [AdminService](srv/admin-service.cds) Service Model related Features: - [Custom event handlers](https://cap.cloud.sap/docs/java/provisioning-api) such as the [Custom business logic for the Admin Service](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) - [Custom actions](https://cap.cloud.sap/docs/cds/cdl#actions) such as `addToOrder` in the [Admin Service](srv/admin-service.cds). The Action implementation is in the [Admin Service Event Handler](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) - Add annotations for [searchable elements](https://github.wdf.sap.corp/pages/cap/java/query-api#select) in the [Admin Service](srv/admin-service.cds) - [Localized Messages](https://cap.cloud.sap/docs/java/indicating-errors) in the [Admin Service Event Handler](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) - role- and instance-based restrictions in [AdminService](srv/admin-service.cds) and [ReviewService](srv/review-service.cds) - Use of [`@cds.persistence.skip`](https://cap.cloud.sap/docs/advanced/hana#cdspersistenceskip) in [AdminService](srv/admin-service.cds) - [Media Data](https://cap.cloud.sap/docs/guides/providing-services#media-data) processing in the [Admin Service Event Handler](srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java) User Interface related Features: - Support for [SAP Fiori Elements](https://cap.cloud.sap/docs/advanced/fiori) - [SAP Fiori Draft based Editing](https://cap.cloud.sap/docs/advanced/fiori#draft-support) for [Books, Orders](srv/admin-service.cds) and [Reviews](srv/review-service.cds) - [SAP Fiori annotations](https://cap.cloud.sap/docs/advanced/fiori#fiori-annotations) specific for [Browse Books](app/browse/fiori-service.cds), [Manage Books](app/admin/fiori-service.cds), [Manage Orders](app/orders/fiori-service.cds), [Manage Reviews](app/reviews/fiori-service.cds) and [common annotations](app/common.cds), which apply to all UI's - UI Annotations for custom actions in the [Browse Books](app/browse/fiori-service.cds) and [Manage Books](app/admin/fiori-service.cds) UI, including annotations for a button and a popup - [Value Help](https://cap.cloud.sap/docs/cds/annotations#odata) for [Books](app/orders/fiori-service.cds) and [Authors](app/common.cds) - [Model Localization](https://cap.cloud.sap/docs/guides/i18n) for [English](app/_i18n/i18n.properties) and [German](app/_i18n/i18n_de.properties) language for static texts - [Custom File Upload extension](app/admin/webapp/extension/Upload.js) which provides a button for uploading `CSV` files - A simple Swagger UI for the CatalogService API at <http://localhost:8080/swagger/index.html> CDS Maven Plugin Features: - Install [Node.js](srv/pom.xml#L157) in the default version. - Install a [configured version](pom.xml#L24) of [@sap/cds-dk](srv/pom.xml#L167). - Execute arbitrary [CDS](srv/pom.xml#L177) commands. - [Generate](srv/pom.xml#L195) Java POJOs for type-safe access to the CDS model. - [Clean](srv/pom.xml#L150) project from artifacts of the previous build. # Getting Started The following sections describe how to set up, build, and run the project. ## Prerequisites Make sure you have set up a development environment (that means, you’ve installed the CDS Compiler, Java, and Apache Maven) [as described here](https://cap.cloud.sap/docs/java/getting-started). ## Clone Build & Run 1. Clone the project: ```bash git clone https://github.com/SAP-samples/cloud-cap-samples-java.git ``` 2. Build and run the application: ``` mvn spring-boot:run ``` ## Using Eclipse Optionally, use the following steps to import the project to Eclipse: 1. Import the project using **File > Import > Existing Maven Projects**. Now, you should see the projects **bookshop** and **bookshop-parent** in the project/package explorer view. 2. In Project Explorer, change the property "Package Presentation" from "Flat" to "Hierarchical" for better understanding. ### Building and Running 1. To **compile** the project, right-click the file `pom.xml` in the `bookshop-parent` project root folder and select **Run as** > **Maven build**. In the following dialog, enter the string `clean install` into the field labeled with "Goals" and click "Run". Note: This step also compiles the CDS artifacts, thus repeat this once you made changes to the CDS model. This step also generates source files, therefore refresh the "bookshop" project in your IDE. 2. To **run** the application, right-click the `bookshop` project root in the Package Explorer and select **Run as** > **Spring Boot App** (make sure you have [Spring Tools 4 installed](https://marketplace.eclipse.org/content/spring-tools-4-aka-spring-tool-suite-4)). This step creates a default Run Configuration named `Bookshop - Application` and starts the application afterwards. To go on with the next step, stop the application again. 3. Then, set the default working directory by editing your Run Configuration via **Run** > **Run Configurations** > **Bookshop - Application**. On the tab **Arguments** change the default **Working Directory** to: ```${workspace_loc:bookshop-parent}``` Afterwards, click **Run**. This step starts the applications `main` method located in `src/main/java/my/bookshop/Application.java`. 4. Use the following links in the browser to check if everything works fine: <http://localhost:8080/>: This should show the automatically generated index page of served paths. <http://localhost:8080/fiori.html>: This is the actual bookshop application UI. <http://localhost:8080/swagger/index.html>: This is providing a Swagger UI for the CatalogService API. You'll start with a predefined stock of books as this procedure starts the bookshop application with a CSV-initialized in-memory H2 database. Two mock users are defined for local development: - User: `user`, password: `user` to browse books - User: `admin`, password: `admin` to manage books and orders ## Using IntelliJ Idea (Community and Ultimate) IntelliJ can handle the project more or less out-of-the-box. Since some of the event handlers in the project rely on the code generated from the CDS model the build path of the project (module) needs to be extended with the folder containing the generated code. In order to add the generated code you need to add the 'gen' folder to the build path: * Open the project settings. * Navigate to the 'modules' section. * Select the srv/src/gen folder and mark it as 'sources'. * Save and leave the project settings. * Trigger a rebuild. After the generated code is considered by IntelliJ's build the application can be handled just as any other Spring Boot application in IntelliJ. ## Database Setup and Spring Profiles The application comes with two predefined profiles that determine how to run the application: `default`, and `cloud` (see `srv/src/main/resources/application.yaml`). - The `default` profile specifies to use an in-memory H2 database. The in-memory database is set up automatically during startup of the application and initialized with some example data from CSV files. - When deploying the application to Cloud Foundry, the CF Java Buildpack automatically configures the `cloud` Spring profile. This profile doesn’t specify any datasource location. In that case CAP Java can automatically detect SAP HANA service bindings available in the environment. ## API_BUSINESS_PARTNER Remote Service and Spring Profiles The behavior of the API_BUSINESS_PARTNER remote service is controlled using profiles (see `srv/src/main/resources/application.yaml`): - **Using mock data via internal service:** When using only the `default` profile (default when omitting any profile setting), the API_BUSINESS_PARTNER API is mocked as a local service using the mock data. - **Using mock data via internal service through OData:** With the `mocked` profile, all requests to the API_BUSINESS_PARTNER service will be routed through HTTP and OData to itself (`http://localhost:<port>/api/API_BUSINESS_PARTNER/...`). This mode is similar to using a real remote destination, and such helps to prevent issues from differences in local service and remote service behavior. - **Using the sandbox environment:** You can access data from the [SAP API Business Hub sandbox](https://api.sap.com/api/API_BUSINESS_PARTNER/overview) with the `sandbox` profile. The API key needs to be provided with the environment variable `CDS_REMOTE_SERVICES_API_BUSINESS_PARTNER_DESTINATION_HEADERS_APIKEY`. You can retrieve it by clicking on *Show API Key* on [this page](https://api.sap.com/api/API_BUSINESS_PARTNER/overview) after logging in. - **Using S/4HANA cloud or on-premise system:** With the `destination` profile, you can access data from a real S/4HANA system. You need to create a destination with name `s4-destination` and make sure that an instance of XSUAA and destination service are bound to your application. For an on-premise destination, you additionally need to bind the connectivity service and add an additional property `URL.headers.sap-client` with the S/4HANA client number to your destination. The profiles `sandbox` and `destination` can be combined with the `default` profile for [hybrid testing](https://cap.cloud.sap/docs/advanced/hybrid-testing) and with the `cloud` profile when deployed to the cloud. ## Deploy to SAP Business Technology Platform, Cloud Foundry CAP Java applications can be deployed to the SAP Business Technology Platform either in single tenant or in multitenancy mode. See [Multitenancy in CAP Java](https://cap.cloud.sap/docs/java/multitenancy) for more information. Prerequisites: - Install the [Cloud MTA Build Tool](https://sap.github.io/cloud-mta-build-tool/): `npm install -g mbt`. - Install the [Cloud Foundry Command Line Interface](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html). - Get an SAP Business Technology Platform account to deploy the services and applications. - [Create a SAP HANA Cloud Instance](https://developers.sap.com/tutorials/hana-cloud-deploying.html) in your SAP Business Technology Platform space. - Ensure you have an entitlement for `SAP HANA Schemas & HDI Containers` with plan `hdi-shared` in the same space. - Ensure that your CF instances are connected to Internet to download SAPMachine JRE 17 as it is available in `sap_java_buildpack` in online mode only. > [!NOTE] > Please note that some IDEs may interfere with their autobuild during the MTA build and thus lead to corrupt MTA build results. Therefore, please ensure that no IDEs are running in parallel with your MTA build. Deploy as Single Tenant Application: - Rename `mta-single-tenant.yaml` to `mta.yaml` - Run `mbt build` - Run `cf login` - Run `cf deploy mta_archives/bookshop_1.0.0.mtar` Deploy as Multitenant Application: - Rename `mta-multi-tenant.yaml` to `mta.yaml` - Run `mbt build` - Run `cf login` - Run `cf deploy mta_archives/bookshop-mt_1.0.0.mtar` - Go to another subaccount in your global account, under subscriptions and subscribe to the application you deployed. - Run `cf map-route bookshop-mt-app <YOUR DOMAIN> --hostname <SUBSCRIBER TENANT>-<ORG>-<SPACE>-bookshop-mt-app` or create and bind the route manually. > [!NOTE] > Please note that the route length is limited to 63 characters and can easily be exceeded. So keeping the app name and sub-account subdomain as short as possible will help you stay within length. Before you can access the UI using the (tenant-specific) URL to the bookshop(-mt)-app application, make sure to [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform). ## Deploy to SAP Business Technology Platform, Kyma Runtime **TIP:** You can find more information in the [Deploy Your CAP Application on SAP BTP Kyma Runtime](https://developers.sap.com/mission.btp-deploy-cap-kyma.html) tutorial and in the [Deploy to Kyma/K8s](https://cap.cloud.sap/docs/guides/deployment/deploy-to-kyma) guide of the CAP documentation. ### Preconditions - BTP Subaccount with Kyma Runtime - BTP Subaccount with Cloud Foundry Space - [HANA Cloud instance available](https://developers.sap.com/tutorials/hana-cloud-deploying.html) for your Cloud Foundry space - BTP Entitlements for: *HANA HDI Services & Container* plan *hdi-shared*, *Launchpad Service* plan *standard* - Container Registry (e.g. [Docker Hub](https://hub.docker.com/)) - Command Line Tools: [`kubectl`](https://kubernetes.io/de/docs/tasks/tools/install-kubectl/), [`kubectl-oidc_login`](https://github.com/int128/kubelogin#setup), [`pack`](https://buildpacks.io/docs/tools/pack/), [`docker`](https://docs.docker.com/get-docker/), [`helm`](https://helm.sh/docs/intro/install/), [`cf`](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html) - Logged into Kyma Runtime (with `kubectl` CLI), Cloud Foundry space (with `cf` CLI) and Container Registry (with `docker login`) - `@sap/cds-dk` >= 6.6.0 ### Add Deployment Files CAP tooling provides you a Helm chart for deployment to Kyma. For single tenant deployment, replace the `requires` section in _`.cdsrc.json`_ with: ``` "requires": { "auth": { "kind": "xsuaa" }, "approuter": { "kind": "cloudfoundry" }, "db": { "kind": "hana-cloud" } }, ``` **In addition** remove `"profile": "with-mtx-sidecar"` from `.cdsrc.json` and delete the `mtx` folder in root. For multi tenant deployment, replace the `requires` section in _`.cdsrc.json`_ with: ``` "requires": { "multitenancy": true, "extensibility": true, "toggles": true, "auth": { "kind": "xsuaa" }, "approuter": { "kind": "cloudfoundry" } }, ``` Add the CAP Helm chart with the required features to this project: ```bash cds add helm ``` #### Use API_BUSSINESS_PARTNER Remote Service (optional, single tenant only) You can try the `API_BUSINESS_PARTNER` service with a real S/4HANA system with the following configuration: 1. Create either an on-premise or cloud destination in your subaccount. 2. Add configuration required for the destination service by executing the following command. ```bash cds add destination ``` 3. Set the profiles `cloud` and `destination` active in your `values.yaml` file: ```yaml srv: ... env: SPRING_PROFILES_ACTIVE: cloud,destination ``` 4. For on-premise only: Add the connectivity service to your Helm chart: ```bash cds add connectivity ``` Note: `cds add helm` will not add configuration required to create a Connectivity Service Instance. This Service Instance should be created by the Kyma Cluster Administrator. For more information regarding configuration of Connectivity Instance, please check the [documentation](https://cap.cloud.sap/docs/guides/deployment/deploy-to-kyma#connectivity-service). *See also: [API_BUSINESS_PARTNER Remote Service and Spring Profiles](#api_business_partner-remote-service-and-spring-profiles)* ### Prepare Kubernetes Namespace #### Create container registry secret Create a secret `container-registry` with credentials to access the container registry: ``` bash ./scripts/create-container-registry-secret.sh ``` The *Docker Server* is the full qualified hostname of your container registry. #### Create a HDI container / Service Manager Instance and a Secret This step is only required if you're using a BTP Trial account. If you're using a production or a free tier account then you can create HDI Container from Kyma directly by adding a [mapping to your Kyma namespace in your HANA Cloud Instance](https://blogs.sap.com/2022/12/15/consuming-sap-hana-cloud-from-the-kyma-environment/) and skip this step. ##### Single Tenant ``` bash ./scripts/create-db-secret.sh bookshop-db ``` It will create a HDI container `bookshop-db` instance on your currently targeted Cloud Foundry space and a secret `bookshop-db` with the credentials in your current Kubernetes namespace. Make the following changes to your _`chart/values.yaml`_. ```diff srv: bindings: db: - serviceInstanceName: hana + fromSecret: bookshop-db ... hana-deployer: bindings: hana: - serviceInstanceName: hana + fromSecret: bookshop-db ... - hana: - serviceOfferingName: hana - servicePlanName: hdi-shared ``` Make the following changes to your _`chart/Chart.yaml`_. ```diff dependencies: ... - - name: service-instance - alias: hana - version: ">0.0.0" ... ``` ##### Multi Tenant ``` bash ./scripts/create-sm-secret.sh bookshop-sm ``` It will create a Service Manager `bookshop-sm` instance on your currently targeted Cloud Foundry space and a secret `bookshop-sm` with the credentials in your current Kubernetes namespace. Make the following changes to your _`chart/values.yaml`_. ```diff srv: bindings: service-manager: - serviceInstanceName: service-manager + fromSecret: bookshop-sm ... sidecar: bindings: service-manager: - serviceInstanceName: service-manager + fromSecret: bookshop-sm ... - service-manager: - serviceOfferingName: service-manager - servicePlanName: container ``` Make the following changes to your _`chart/Chart.yaml`_. ```diff dependencies: ... - - name: service-instance - alias: service-manager - version: ">0.0.0" ... ``` ### Build ```bash cds build --production ``` **Build image for CAP service:** ```bash mvn clean package -DskipTests=true ``` ```bash pack build $YOUR_CONTAINER_REGISTRY/bookshop-srv \ --path srv/target/*-exec.jar \ --buildpack gcr.io/paketo-buildpacks/sap-machine \ --buildpack gcr.io/paketo-buildpacks/java \ --builder paketobuildpacks/builder-jammy-base \ --env SPRING_PROFILES_ACTIVE=cloud \ --env BP_JVM_VERSION=17 ``` (Replace `$YOUR_CONTAINER_REGISTRY` with the full-qualified hostname of your container registry) **Build Approuter Image:** ```bash pack build $YOUR_CONTAINER_REGISTRY/bookshop-approuter \ --path app \ --buildpack gcr.io/paketo-buildpacks/nodejs \ --builder paketobuildpacks/builder-jammy-base \ --env BP_NODE_RUN_SCRIPTS="" ``` **Build database deployer image (single tenant only):** ```bash pack build $YOUR_CONTAINER_REGISTRY/bookshop-hana-deployer \ --path db \ --buildpack gcr.io/paketo-buildpacks/nodejs \ --builder paketobuildpacks/builder-jammy-base \ --env BP_NODE_RUN_SCRIPTS="" ``` **Build sidecar image (multi tenant only):** ```bash pack build $YOUR_CONTAINER_REGISTRY/bookshop-sidecar \ --path mtx/sidecar/gen \ --buildpack gcr.io/paketo-buildpacks/nodejs \ --builder paketobuildpacks/builder-jammy-base \ --env BP_NODE_RUN_SCRIPTS="" ``` ### Push container images You can push all the container images to your container registry, using: ```bash docker push $YOUR_CONTAINER_REGISTRY/bookshop-srv docker push $YOUR_CONTAINER_REGISTRY/bookshop-approuter ``` #### Single Tenant ```bash docker push $YOUR_CONTAINER_REGISTRY/bookshop-hana-deployer ``` #### Multi Tenant ```bash docker push $YOUR_CONTAINER_REGISTRY/bookshop-sidecar ``` ### Configuration Make the following changes in the _`chart/values.yaml`_ file. 1. Change value of `global.domain` key to your cluster domain. 2. Replace `<your-cluster-domain>` in `xsuaa.parameters.oauth2-configuration.redirect-uris` with your cluster domain. 3. Replace `<your-container-registry>` with your container registry. 4. Make the following change to add backend destinations required by Approuter. ```diff - backendDestinations: {} + backendDestinations: + backend: + service: srv + mtx-api: + service: srv ``` 5. Add your image registry secret created in [Create container registry secret](#create-container-registry-secret) step. ```diff global: domain: null - imagePullSecret: {} + imagePullSecret: + name: container-registry ``` 6. If the application is deployed multiple times in the same cluster, make sure to adapt the values of `xsappname` and `appName` under `saasRegistryParameters` in `values/Chart.yaml` ### Deployment Deploy the helm chart using the following command: #### Single Tenant ```bash helm install bookshop ./chart --set-file xsuaa.jsonParameters=xs-security.json ``` Before you can access the UI you should make sure to [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform). Click on the approuter url logged by the `helm install` to access the UI. #### Multi Tenant ```bash helm install bookshop ./chart --set-file xsuaa.jsonParameters=xs-security-mt.json ``` In case of multi tenant, you'll have to subscribe to the application from a different subaccount. You can follow the steps mentioned [here](https://cap.cloud.sap/docs/guides/deployment/as-saas#subscribe) to access the application. ## Setup Authorizations in SAP Business Technology Platform To access services and UIs that require specific authorizations (e.g. `admin`) you need to assign a corresponding role and role collections to your user in SAP BTP Cockpit. 1. For single-tenant applications open the subaccount where you deployed the `bookshop` application to. For multitenant applications open the subaccount where you subscribed to the `bookshop` application. 2. Navigate to *Security* -> *Roles* 3. Create a role with name `bookshop-admin` based on the `admin` role template of the `bookshop` application: 1. Enter a Business Partner ID of your S/4 system as value for the `businessPartner` attribute. When using the sandbox environment use `10401010`. 4. Navigate to *Security* -> *Role Collections* 5. Create a new role collection `bookshop-admin`: 1. Assign the `bookshop-admin` role to this role collection 2. Assign the role collection to your user # Code Tour Take the [guided tour](.tours) in VS Code through our CAP Samples for Java and learn which CAP features are showcased by the different parts of the repository. Just install the [CodeTour extension](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) for VS Code. # Get Support In case you have a question, find a bug, or otherwise need support, please use our [community](https://answers.sap.com/tags/9f13aee1-834c-4105-8e43-ee442775e5ce). See the documentation at [https://cap.cloud.sap](https://cap.cloud.sap) for more details about CAP. # License Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSES/Apache-2.0.txt) file.
1
advanced-android-book/samples
null
null
# 黒帯エンジニアが教えるプロの技術 Android開発の教科書 こちらに各章のサンプルアプリの一覧があります。 なお、nullチェック・エラーハンドリング等は紙面の節約・処理をシンプルに伝えるために省いています。 ## バグレポートについて クラッシュの発生などバグレポートについては、以下の情報を含めてissueに登録をお願いします。 頂いたレポートで修正可能なものは、`support`ブランチにて、修正を行います。修正についてはそちらをご覧ください。 詳細なレポートは調査に大変役立ちます。 * サンプルアプリ名 * Androidのバージョン・機種名 * 再現手順 * 発生頻度 (3回に1回発生、毎回発生など) * 期待される動作 * Logcatの出力 (もし可能なら) 例) ``` * サンプル名 XXXSample * Androidのバージョン・機種名 6.0.1, Nexus 5X * 再現手順 XXXを実行するとクラッシュします。 * 発生頻度 (3回に1回発生、毎回発生など) 毎回発生 * 期待される動作 クラッシュしないこと * Logcatの出力 (もし可能なら) 特になし
0
lagom/lagom-samples
null
example example-project jvm lagom microservices sample sample-app
# Lagom Samples [![Build Status](https://travis-ci.com/lagom/lagom-samples.svg?branch=1.6.x)](https://travis-ci.com/lagom/lagom-samples) [Lagom](https://www.lagomframework.com/) is an [open source](https://github.com/lagom/lagom) framework for building reactive microservice systems in Java or Scala. This repository contains code examples to help you understand how to achieve common goals. In general, code in each folder of this repository tries to answer a question of type "How do I _xyz_ ?". For example: "How do I use RDBMS read-sides with Cassandra write-sides?". ## Samples index * Shopping Cart: a reference application demoing core Lagom features. It is available in [Java](shopping-cart/shopping-cart-java/README.md) and [Scala](shopping-cart/shopping-cart-scala/README.md). * Using gRPC in Lagom ([Java](grpc-example/grpc-example-java/README.md), [Scala](grpc-example/grpc-example-scala/README.md)) * How do I use RDBMS read-sides with Cassandra write-sides? ([mixed persistence in java](mixed-persistence/mixed-persistence-java-sbt/README.md) or [mixed persistence in scala](mixed-persistence/mixed-persistence-scala-sbt/README.md)) * How do I integrate Lightbend Telemetry (Cinnamon)? ([Java/Maven example](lightbend-telemetry/lightbend-telemetry-java-mvn/README.md)) * How do I configure Log correlation (Cinnamon)? ([Java/Maven example](lightbend-telemetry/log-correlation-java-mvn/README.md)) * How do I use Lagom with Couchbase both write-side and read-side? [Java Maven and Scala Sbt](couchbase-persistence/README.md)) (Couchbase Persistence is **NOT** production ready yet) ## Community-driven examples * How do I authenticate/authorize by JWT? ([Java/Maven example](https://github.com/pac4j/lagom-pac4j-java-demo), [Scala/Sbt example](https://github.com/pac4j/lagom-pac4j-scala-demo)) * How do I generate _OpenAPI/Swagger Specification_ for Lagom service? ([Java/Maven example](https://github.com/taymyr/lagom-samples/blob/master/openapi/java/README.md), [Scala/Sbt example](https://github.com/taymyr/lagom-samples/blob/master/openapi/scala/README.md)) * How do I using Play's JPA API to do CRUD-oriented persistence in a Lagom service? ([Java/SBT example](https://github.com/taymyr/lagom-samples/blob/master/jpa-crud/java-sbt/README.md)) * How do I use MongoDB as read-side in a Lagom service? ([Scala/SBT example](https://github.com/abknanda/mongo-readside-lagom)) * How do I use a Lagom service in JavaScript? ([Scala/SBT example](https://github.com/mliarakos/lagom-scalajs-example)) ## Contributing examples This project follows the [Lagom contributor guidelines](https://github.com/lagom/lagom/blob/master/CONTRIBUTING.md). Please read and follow those when contributing Lagom Samples. ## Pre-requisites To download and run these examples you will need: 1. a [git](https://git-scm.com/downloads) client 2. [sbt](http://www.scala-sbt.org/download.html) or [Maven](https://maven.apache.org/install.html) depending on the example. 3. a [Java Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/index.html) 4. a code editor (such as [IntelliJ](https://www.jetbrains.com/idea/), [Eclipse](https://www.eclipse.org/downloads/), [Atom](https://atom.io/),... ) ## Using these examples If you want to run a specific example you will have to clone the whole repository and then navigate to a specific application folder. For example: * `git clone https://github.com/lagom/lagom-samples.git` * `cd mixed-persistence/mixed-persistence-java-sbt` Each example includes specific instructions in it's `README.md` file on how to run and exercise the application. ## License To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion by you shall be licensed as above, without any additional terms or conditions.
0
MicrosoftDocs/pipelines-java
Sample Java application referred to by Azure Pipelines documentation
null
# Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. # Legal Notices Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode), see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the [LICENSE-CODE](LICENSE-CODE) file. Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653. Privacy information can be found at https://privacy.microsoft.com/en-us/ Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise.
1
robovm/robovm-samples
RoboVM sample projects
null
# RoboVM sample projects Each of the provided samples (unless otherwise noted in the sample's README.md) can be run using Gradle, Maven or Eclipse. ## Run using Gradle First, build the project: ``` ./gradlew build ``` To run in the iPhone simulator: ``` ./gradlew launchIPhoneSimulator ``` To run in the iPad simulator: ``` ./gradlew launchIPadSimulator ``` To run on a connected device: ``` ./gradlew launchIOSDevice ``` To run a console app sample: ``` ./gradlew launchConsole ``` ## Compile & Run using Maven To run in the iPhone simulator: ``` mvn compile robovm:iphone-sim ``` To run in the iPad simulator: ``` mvn compile robovm:ipad-sim ``` To run on a connected device: ``` mvn compile robovm:ios-device ``` To run a console app sample: ``` mvn compile robovm:console ``` ## Run using Eclipse In order to run these samples in Eclipse you may need to run the latest nightly version of the RoboVM for Eclipse plugin. Use the following update site in Eclipse to install it: ``` http://download.robovm.org/nightlies/eclipse/site.xml ``` Then you should be able to import the sample into Eclipse by selecting *File -> Import...* and then *Existing Projects into Workspace*. To run in the iPhone simulator: Right-click the project. Choose *Run As -> iOS Simulator App (iPhone)*. To run in the iPad simulator: Right-click the project. Choose *Run As -> iOS Simulator App (iPad)*. To run on a connected device: Right-click the project. Choose *Run As -> iOS Device App*. ## Adding a new sample 1. Checkout the repo and switch to the 'snapshot' branch. 1. Create a new project in RoboVM Studio, saving it as a sub-directory of robovm-samples (or in one of the subcategory folders like ios or tvos). 1. During project creation, make sure all properties are correct (e.g. _package name_: org.robovm.samples.yoursample). 1. Replace the build.gradle in your project with a build.gradle from another sample. If you don't need any special build instructions remove the build.gradle file. 1. Replace the pom.xml in your project with a pom.xml from another sample. 1. Change the _artifactId_ and _name_ tags in the pom.xml file to match your own. 1. Add the sample in __both__ the root/settings.gradle and root/pom.xml (or subcategory pom.xml) files. 1. Insert a row about your sample into the table below (or the table of a subcategory readme). ## Available samples | Name | Description | Demonstrates | | ---- | ----------- | ------------ | | [Console Samples](console/) | Console sample projects | | | [iOS Samples](ios/) | iOS sample projects | | | [iOS Samples (no-ib)](ios-no-ib/) | iOS sample projects without interface builder UI | | | [RoboPods Samples](robopods/) | RoboPods sample projects | | | [tvOS Samples](tvos/) | tvOS sample projects | | | [AnswerMe](AnswerMe/) | Create Java SDK callable in Objective-C/Swift. | How to create an SDK out of Java code which can be easily used from Objective-C/Swift. | | [ContractR](ContractR/) | Sample app for iOS, Android and JavaFX. | How to share code between an iOS and Android app using native UI in both apps. The iOS and Android projects are using a shared core project which holds the Model part of the Model View Controller pattern. Please note that the code in these projects are in need of clean-up, so please let us know when you find strange things. Please also feel free to improve this sample and let us know. | | [CustomFrameworks](CustomFrameworks/) | Sample app using custom dynamic frameworks. | How to use custom Objective-C & Swift dynamic frameworks in a RoboVM Java project. | | [MyJavaFramework](MyJavaFramework/) | Sample Xcode project calling Java classes via JNI. | How to package Java classes into an iOS dynamic framework and call the packaged classes via [JNI](http://docs.oracle.com/javase/8/docs/technotes/guides/jni/) from a native Objective-C app. |
1
googleads/googleads-adsense-examples
Samples for the AdSense Management API
null
Samples for the AdSense Management API =========================== The AdSense Management API v2 is [now availble](https://ads-developers.googleblog.com/2021/04/announcing-v2-of-adsense-management-api.html). Updated examples can be found for each language in the top-level `v2` directory. These code samples are organized by language. * *dotnet* is a command-line sample that shows how to make most calls against the API, written in C#. * *java* is a command-line sample that shows how to make most calls against the API, written in Java. * *php* is a set of samples that shows how to make most calls against the API, written in PHP. * *python* is a command-line sample that shows how to make most calls against the API, written in Python. * *ruby* is a set of command-line samples that show how to make most calls against the API, written in Ruby. Please refer to the README.md file inside each directory for installation instructions.
0
jvm-profiling-tools/honest-profiler
A sampling JVM profiler without the safepoint sample bias
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
androidthings/drivers-samples
Peripheral driver samples
android-things
# Peripheral Driver Samples Samples for Android Things peripheral drivers located in the [contrib-drivers repository](https://github.com/androidthings/contrib-drivers). > **Note:** The Android Things Console will be turned down for non-commercial > use on January 5, 2022. For more details, see the > [FAQ page](https://developer.android.com/things/faq). ## Build and install Open the project in Android Studio, select the "Run Configuration" for the sample you want to run and click the "Run" button. See each sample subdirectory `README.md` for more instructions. ## License Copyright 2016 Google Inc. 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.
0
ulisesbocchio/jasypt-spring-boot-samples
Sample apps using jasypt-spring-boot
null
[![Build Status](https://travis-ci.org/ulisesbocchio/jasypt-spring-boot-samples.svg?branch=master)](https://travis-ci.org/ulisesbocchio/jasypt-spring-boot-samples) # jasypt-spring-boot-samples Sample apps using jasypt-spring-boot
1
timtebeek/spring-security-samples
null
blog
null
0
eclipse/microprofile-samples
Micro Profile Samples
null
null
0
lenve/spring-security-book-samples
《深入浅出Spring Security》一书配套源码。
null
# spring-security-book-samples 这是 **《深入浅出 Spring Security》** 一书的配套案例。 图书购买地址:[京东](https://item.jd.com/13131798.html) 关注微信公众号【江南一点雨】,回复 `ss`,获取更多 Spring Security 学习资料。 ![](https://open.weixin.qq.com/qr/code?username=a_javaboy)
0
ibm-messaging/mq-dev-samples
Samples for getting started with IBM MQ
null
# mq-dev-samples ## What this repo is for This repo hosts sample code referred to and used as part of [tutorials for IBM MQ on IBM Developer](https://developer.ibm.com/components/ibm-mq/). ## Where to find code to copy/paste into your app We have a wealth of messaging patterns, represented in many languages, including Java, .NET, Python, Node.js and Golang. [They are available at the mq-dev-patterns repo, here!](https://github.com/ibm-messaging/mq-dev-patterns) Feel free to use code from the mq-dev-patterns repo to create your own messaging applications. ## Using the `gettingStarted/jms` samples with TLS (IBM DDC MQ Badge Lab) For reference these instructions were built from [this tutorial](https://developer.ibm.com/components/ibm-mq/tutorials/mq-develop-mq-jms/). Check it out for additional hints and tips. ### Getting setup - Clone this repo - Change directory to the working directory - Linux `cd mq-dev-samples/gettingStarted/jms` - Windows `cd mq-dev-samples\gettingStarted\jms` - Download the `javax.jms-api-2.0.1.jar` jar ``` curl -o javax.jms-api-2.0.1.jar https://repo1.maven.org/maven2/javax/jms/javax.jms-api/2.0.1/javax.jms-api-2.0.1.jar ``` - Download the IBM MQ all client (9.2.2.0) `com.ibm.mq.allclient-9.2.2.0.jar` jar ``` curl -o com.ibm.mq.allclient-9.2.2.0.jar https://repo1.maven.org/maven2/com/ibm/mq/com.ibm.mq.allclient/9.2.2.0/com.ibm.mq.allclient-9.2.2.0.jar ``` - Copy the Queue Manager's public certificate .pem file `qmgrcert.pem` to the `mq-dev-samples/gettingStarted/jms` directory `cp <YOUR_DOWNLOAD_DIRECTORY>/qmgrcert.pem .` (Linux) or `copy <YOUR_DOWNLOAD_DIRECTORY>\qmgrcert.pem .` (Windows) - Use `keytool` to create a client `.p12` trust store ``` keytool -keystore clientTruststore.p12 -storetype pkcs12 -importcert -file qmgrcert.pem -alias server-certificate ``` - Enter and then re-enter a password for your new truststore file `clientTruststore.p12`. It's important to remember this password as we'll use it when we run the sample later. - Type `yes` to trust this certificate ### Generate application credentials and an API key Navigate to the "Application Credentials" tab of your cloud MQ service instance. Click `add`, then create a user called "app". Click `Add and generate API key`, which will bring up your API token. Copy this and save it somewhere as you'll need it in the application you run to authenticate yourself to your MQ instance. ### Start coding to put a message with jms Open the `com/ibm/mq/samples/jms/JmsPut.java` file (Linux) or `com\ibm\mq\samples\jms\JmsPut.java` (Windows) in your favorite editor Uncomment the following line ```java cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, "*TLS12"); ``` Modify the following variables to match your IBM MQ configuration ```java private static final String HOST = "_YOUR_HOSTNAME_"; // Host name or IP address private static final int PORT = 1414; // Listener port for your queue manager private static final String CHANNEL = "DEV.APP.SVRCONN"; // Channel name private static final String QMGR = "QM1"; // Queue manager name private static final String APP_USER = "app"; // User name that application uses to connect to MQ private static final String APP_PASSWORD = "_APP_PASSWORD_"; // Password that the application uses to connect to MQ private static final String QUEUE_NAME = "DEV.QUEUE.1"; // Queue that the application uses to put and get messages to and from ``` ### Compile your jms code - Change directory to `mq-dev-samples/gettingStarted/jms` (Linux) or `mq-dev-samples\gettingStarted\jms` (Windows) - Compile your modified `JmsPut.java` application - For Linux `javac -cp ./com.ibm.mq.allclient-9.2.2.0.jar:./javax.jms-api-2.0.1.jar com/ibm/mq/samples/jms/JmsPut.java` - For Windows `javac -cp .\com.ibm.mq.allclient-9.2.2.0.jar;.\javax.jms-api-2.0.1.jar com\ibm\mq\samples\jms\JmsPut.java` - You should now see a `JmsPut.class` file alongside your `JmsPut.java` source file ### Run your `jmsPut` application Execute your Java code, specifying the `clientTruststore.p12` and `password` you set up earlier - For Linux ``` java -Djavax.net.ssl.trustStore=clientTruststore.p12 -Djavax.net.ssl.trustStorePassword=passw0rd -cp ./com.ibm.mq.allclient-9.2.2.0.jar:./javax.jms-api-2.0.1.jar:. com.ibm.mq.samples.jms.JmsPut ``` - For Windows ``` java -Djavax.net.ssl.trustStore=clientTruststore.p12 -Djavax.net.ssl.trustStorePassword=passw0rd -cp .\com.ibm.mq.allclient-9.2.2.0.jar;.\javax.jms-api-2.0.1.jar;. com.ibm.mq.samples.jms.JmsPut ``` ### What you should see Congratuations, you've just sent you're first IBM MQ Message and you should see output similar to the following: ```console Sent message: JMSMessage class: jms_text JMSType: null JMSDeliveryMode: 2 JMSDeliveryDelay: 0 JMSDeliveryTime: 1617186154396 JMSExpiration: 0 JMSPriority: 4 JMSMessageID: ID:414d512049424d5f4444435f514d202000476460013f0040 JMSTimestamp: 1617186154396 JMSCorrelationID: null JMSDestination: queue:///DEV.QUEUE.1 JMSReplyTo: null JMSRedelivered: false JMSXAppID: JmsPutGet (JMS) JMSXDeliveryCount: 0 JMSXUserID: app JMS_IBM_PutApplType: 28 JMS_IBM_PutDate: 20210331 JMS_IBM_PutTime: 10223528 Your lucky number today is 369 SUCCESS ```
0
joedayz/spring-boot-samples
Spring Boot Demos of SpringSource or mine
null
# spring-boot-samples Spring Boot Demos of SpringSource or mine
0
ArcBees/GWTP-Samples
GWTP-Samples
null
#GWTP-Samples Project samples display GWT-Platform features configuration and uses. ##GWTP Reference * [GWTP Custom Google Search](http://www.google.com/cse/home?cx=011138278718949652927:5yuja8xc600) - Search GWTP documentation, wiki and thread collections. * [GWTP Home](https://github.com/ArcBees/GWTP) - Find the GWT-Platform home here. * [GWTP Documentation](https://github.com/arcbees/gwtp/wiki) - Find out how to use GWT-Platform here. * [GWTP Archetypes](https://github.com/ArcBees/ArcBees-archetypes/tree/master/archetypes) - Start a project from a template here. ##Community * [Join the GWT-Platform G+ Community](https://plus.google.com/communities/113139554133824081251) - See whats happening in the community. * [GWTP Google Group](https://groups.google.com/forum/?fromgroups#!forum/gwt-platform) - Ask for help here. ##Demos <table> <tr> <th>Sample</th> <th>Demo</th> <th>Source</th> </tr> <tr> <th>Basic</th> <td><a href="http://gwtp-sample-basic.appspot.com">AppEngine Demo</a></td> <td><a href="https://github.com/ArcBees/GWTP-Samples/tree/master/gwtp-samples/gwtp-sample-basic">Source</a></td> </tr> <tr> <th>Basic Spring</th> <td><a href="http://gwtp-sample-basic-spring.appspot.com">AppEngine Demo</a></td> <td><a href="https://github.com/ArcBees/GWTP-Samples/tree/master/gwtp-samples/gwtp-sample-basic-spring">Source</a></td> </tr> <tr> <th>Mobile</th> <td><a href="http://gwtp-sample-mobile.appspot.com">AppEngine Demo</a></td> <td><a href="https://github.com/ArcBees/GWTP-Samples/tree/master/gwtp-samples/gwtp-sample-mobile">Source</a></td> </tr> <tr> <th>Nested</th> <td><a href="http://gwtp-sample-nested.appspot.com">AppEngine Demo</a></td> <td><a href="https://github.com/ArcBees/GWTP-Samples/tree/master/gwtp-samples/gwtp-sample-nested">Source</a></td> </tr> <tr> <th>Tabs</th> <td><a href="http://gwtp-sample-tab.appspot.com">AppEngine Demo</a></td> <td><a href="https://github.com/ArcBees/GWTP-Samples/tree/master/gwtp-samples/gwtp-sample-tab">Source</a></td> </tr> </table> ##License * GWTP is freely distributable under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html) ##Thanks to [![Atlassian](http://i.imgur.com/BKkj8Rg.png)](https://www.atlassian.com/)
0
gradle/native-samples
Samples of modern build automation for native languages with Gradle
build-automation build-tool cmake cpp gradle gradle-bt gradle-bt-native native samples swift
# Swift and C++ Sample Projects This repository holds several sample Gradle builds which demonstrate how to use Gradle to build Swift/C++ libraries and applications as [introduced in our blog post](https://blog.gradle.org/introducing-the-new-cpp-plugins). Each sample build is listed below with a bit of information related to the features of Gradle that are demonstrated in that build. Each sample is functionally the same for both Swift and C++ languages. Each C++ sample works on macOS, Linux and Windows with GCC, Clang and Visual C++. Each Swift sample works on macOS and Linux, with Swift 3 and later. ## Deeper build insights with Build Scans You can generate [build-scans](https://gradle.com/build-scans) with these samples by running Gradle with `--scan`. At the end of the build, you will be prompted to upload build data to [scans.gradle.com](https://scans.gradle.com/get-started). As an example of adding more data to a build scan, you can also run any sample with `-I ../../build-scan/buildScanUserData.gradle` in combination with `--scan`. This will add custom values that describe what is being built like [these](https://scans.gradle.com/s/axgvl3hohykbk/custom-values#L1-L7). ### Contributing to these samples If you want to contribute an improvement to the samples, please refer to the [`samples-dev` subproject](samples-dev/README.md). ### Suggesting new samples If you have a use case that isn't covered by an existing sample, open an issue for [gradle-native](https://github.com/gradle/gradle-native/issues). Please describe what you're trying to accomplish so we can help you find a solution. ### Visual Studio support All of the C++ samples have Visual Studio support, added by applying the `visual-studio` plugin. To open a sample build in Visual Studio: ``` > cd <sample-dir> > ./gradlew openVisualStudio ``` ### Xcode support All of the samples have Xcode support, added by applying the `xcode` plugin. To open a sample build in Xcode: ``` > cd <sample-dir> > ./gradlew openXcode ``` ### XCTest support All Swift samples demonstrate XCTest support in Gradle. As a user, you can either interact with the test code as you would usually do through Xcode or you can run the test directly from the command line: ``` > cd <sample-dir> > ./gradlew test ``` ### Google Test support The C++ sample `simple-library` demonstrates some basic Google test support in Gradle. This is currently not as refined as the XCTest support. To run the tests from the command line: ``` > cd <sample-dir> > ./gradlew test ``` ### Incremental Swift compilation The `swiftc` compiler has a built-in incremental compilation feature that tries to reduce the number of `.swift` files that need to be recompiled on each build by analyzing the dependencies between all files. Gradle enables Swift incremental compilation by default, so no extra configuration is required to take advantage of this feature with your Swift projects. ### Debug and release variants The Swift and C++ plugins add a 'debug' and 'release' variant for each library or application. By default, the `assemble` task will build the debug variant only. You can also use the `assembleDebug` and `assembleRelease` tasks to build a specific variant, or both variants. At this stage, there are no convenience tasks to build all variants of a library or application. ### Publishing binaries to a Maven repository Some of the C++ samples are configured to publish binaries to a local Maven repository. For these samples you can run: ``` > cd <sample-dir> > ./gradle publish > tree ../repo/ ``` This will build and publish the debug and release binaries. The binaries are published to a repository in the `cpp/repo` directory. ## Simple application (application) This sample shows how a simple Swift or C++ application can be built with Gradle. The application has no dependencies and the build has minimal configuration. Although there is currently no out-of-the-box support for building applications and libraries from C, there is also a sample build that shows how the C++ support can be configured to build a C application. ### C++ To build and run the application: ``` > cd cpp/application > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` ### Swift To build and run the application: ``` > cd swift/application > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App Hello, World! ``` ### C To build and run the application: ``` > cd c/application > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` ## Simple Library (simple-library) This sample shows how a Swift or C++ library can be built with Gradle. The library has no dependencies. The build is configured to add unit tests. The C++ sample also adds binary publishing to a Maven repository. ### C++ To build the library: ``` > cd cpp/simple-library > ./gradlew assemble BUILD SUCCESSFUL in 1s > find build/lib/main/debug build/lib/main/debug/liblist.dylib ``` To run the unit tests for the library: ``` > ./gradlew test BUILD SUCCESSFUL in 1s ``` ### Swift To build the library: ``` > cd swift/simple-library > ./gradlew assemble BUILD SUCCESSFUL in 1s > find build/lib/main/debug build/lib/main/debug/libList.dylib ``` To run the unit tests for the library: ``` > ./gradlew test > open build/reports/tests/xcTest/index.html ``` ## Application with library dependencies in a single build (transitive-dependencies) This sample shows how a C++ or Swift application and several libraries can be built with Gradle and linked together. The sample is structured as a multi-project build, with the application and each library as separate projects in this build. Dependencies are added using project dependencies. In this sample, the application and libraries all use the same implementation language. Mixing C++ and Swift is shown in another sample below. ### C++ To build and run the application: ``` > cd cpp/transitive-dependencies > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/app Hello, World! ``` The build script also demonstrates how to configure convenience tasks like `assembleDebuggable`, which will assemble all "debuggable" binaries. ``` > ./gradlew assembleDebuggable BUILD SUCCESSFUL in 1s ``` ### Swift To build and run the application: ``` > cd swift/transitive-dependencies > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/App Hello, World! ``` ## Application with Windows Resources (windows-resources) This sample shows how Gradle is able to compile Windows Resources (`rc`) files and link them into a native binary. This sample applies the `'cpp-application'` plugin. This sample requires you have VisualCpp toolchain installed ### C++ To build and run the application: (Note the application only runs and build on Windows) ``` > cd cpp/windows-resources > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/exe/main/debug/app.exe Hello, World! ``` ## Application with precompiled headers (precompiled-headers) This sample shows how Gradle is able to compile code using precompiled headers. This sample applies the `'cpp-application'` plugin. ### C++ To build and run the application: ``` > cd cpp/precompiled-headers > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/exe/main/debug/app Hello, World! ``` ## Application with library dependencies in a composite build (composite-build) This sample shows how several otherwise independent Swift or C++ libraries can be built together with Gradle. The sample is structured as separate builds for each of the libraries and a composite build that includes these. ### C++ To build and run the application: ``` > cd cpp/composite-build > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` ### Swift To build and run the application: ``` > cd swift/composite-build > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App Hello, World! ``` ## Application with prebuilt library dependencies in a Maven repository (binary-dependencies) This sample shows how to publish C++ libraries to a Maven repository and use them from another build. This is currently not supported for Swift. ### C++ To use the sample, first publish a library to the repository using the `simple-library` build: ``` > cd cpp/binary-dependencies > ./gradlew -p ../simple-library publish BUILD SUCCESSFUL in 1s ``` You can find the repository in the `cpp/repo` directory. Next, build the application that uses the library from this repository. ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` The build is also configured to download the Google test binaries from a Maven repository to build and run the unit tests: ``` > ./gradlew test BUILD SUCCESSFUL in 1s ``` ## Application with prebuilt library dependencies (prebuilt-binaries) This sample shows how to use pre-built binaries that are already available on the local machine. Currently, Gradle does not offer a convenient way to do this but it is possible to configure Gradle to use these binaries. ### C++ To use the sample, first create the binaries using the `simple-library` build: ``` > cd cpp/prebuilt-binaries > ./gradlew -p ../simple-library assembleDebug assembleRelease BUILD SUCCESSFUL in 1s ``` Next, build and run the application that uses these binaries: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` ### Swift To use the sample, first create the binaries using the `simple-library` build: ``` > cd swift/prebuilt-binaries > ./gradlew -p ../simple-library assembleDebug assembleRelease BUILD SUCCESSFUL in 1s ``` Next, build and run the application that uses these binaries: ``` > ./gradlew assemble BUILD SUCCESSFUL in 0s > ./build/install/main/debug/App Hello, World! ``` ## Application with Swift package manager conventions (swift-package-manager) This sample shows how to configure Gradle to use a source layout that is different to its conventions. In this case, the sample uses the typical layout for a Swift Package Manager package. It contains an application and a single library. The source files for the application and libraries are all under a single `Sources` directory. This sample also includes a Swift Package Manager build file, so the same source can be built using Swift Package Manager ### C++ ``` > cd cpp/swift-package-manager > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/app/install/main/debug/app Hello, World! ``` ### Swift ``` > cd swift/swift-package-manager > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/app/install/main/debug/App Hello, World! ``` ## Source generation (source-generation) This sample demonstrates using a task to generate source code before building a Swift or C++ application. ### C++ ``` > cd cpp/source-generation > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` Generated sources will be under `build/generated`. ### Swift ``` > cd swift/source-generation > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App Hello, World! ``` Generated sources will be under `build/generated`. ## Application with source library dependencies (source-dependencies) This sample demonstrates using external source dependencies to build Swift and C++ applications that require two libraries. The source for the libraries are hosted in separate Git repositories and declared as 'source dependencies' of the application. When Gradle builds the application, it first checks out a revision of the library source and uses this to build the binaries for the library. The Git repositories to use are declared in the build's `settings.gradle` and then the libraries are referenced in the same way as binary dependencies in the build files. ### Swift To use this sample, build and run the application: ``` > cd swift/source-dependencies > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App World! ``` This will clone version `1.0` of the Git repository at `https://github.com/gradle/native-samples-swift-library` and build the library binaries. You can see the application's output is incorrect. The build is configured to use version `1.0` of the utilities library from this repository and this version contains a bug. Let's fix this. Version `1.1` of the library contains a bug fix. Update the application to use the new version: ``` > cd ../.. > edit build.gradle # change dependency on org.gradle.swift-samples:utilities:1.0 to org.gradle.swift-samples:utilities:1.1 > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App Hello, World! ``` Dynamic dependencies are also supported, so you could also use `1.+`, `[1.1,2.0]` or `latest.release`. Gradle matches the tags of the Git repository to determine which Git revision to use. Branches are also supported, but use a different syntax. See the following sample. ### C++ To use this sample, build and run the application: ``` > cd cpp/source-dependencies > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app World! ``` This will clone version `1.0` of the Git repository at `https://github.com/gradle/native-samples-cpp-library` and build the library binaries. The application output is incorrect because of a bug in the utilities library. Update the application to use a new version that contains a fix: ``` > cd ../.. > edit build.gradle # change dependency on org.gradle.cpp-samples:utilities:1.0 to org.gradle.cpp-samples:utilities:1.1 > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` ## Application with dependency on upstream branch (dependency-on-upstream-branch) This sample shows how a source dependency on a particular branch can be used. ### Swift To use this sample, create the Git repositories containing the libraries: ``` > cd swift/dependency-on-upstream-branch/app > ./gradlew -p ../../.. generateRepos ``` Now you can build and run the application: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App World! ``` You can see the application's output is incorrect. The build is configured to use the most recent changes from the 'release' branch of the utilities library and this branch contains a bug. Let's fix this. Edit the source of the utilities library to fix the bug: ``` > cd repos/utilities-library > git checkout release > edit src/main/swift/Util.swift # follow the instructions to fix the bug in function join() > git commit -a -m 'fixed bug' ``` There's no need to create a tag, as Gradle will take care of checking out the new branch tip. Now build and run the application: ``` > cd ../.. > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App Hello, World! ``` ### C++ To use this sample, create the Git repositories containing the libraries: ``` > cd cpp/dependency-on-upstream-branch/app > ./gradlew -p ../../.. generateRepos ``` Build and run the application: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app World! ``` Edit the source of the utilities library to fix the bug: ``` > cd repos/utilities-library > git checkout release > edit src/main/cpp/join.cpp # follow the instructions to fix the bug in function join() > git commit -a -m 'fixed bug' ``` Now build the application: ``` > cd ../.. > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` ## Application with static library dependencies (static-library) This sample demonstrates building and using static libraries. ### C++ ``` > cd cpp/static-library > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/app Hello, World! ``` ### Swift ``` > cd swift/static-library > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/App Hello, World! ``` ## Application with operating system specific library dependencies (operating-system-specific-dependencies) This sample demonstrates an application that has dependencies on different libraries for each operating system. Currently, there are no conveniences for using libraries that are installed on the build machine. ### Swift ``` > cd swift/operating-system-specific-dependencies > ./gradlew assemble BUILD SUCCESSFUL in 1s > app/build/install/main/debug/App Hello, World! ``` The application selects the 'MacOsConsole' library that prints the output in blue when building on macOS. On Linux, it selects the 'LinuxConsole' library that prints the output in green. Each console library is configured to only build on specific operating systems. ### C++ ``` > cd cpp/operating-system-specific-dependencies > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/app Hello, World! ``` The application selects the 'ansiConsole' library on macOS and Linux and the 'winConsole' library when built on Windows. The output is blue on macOS and green on Linux and Windows. Each console library is configured to only build on specific operating systems, while the application is configured to build on all operating systems (Windows, Linux, macOS). ## Swift application with C++ library dependencies (cpp-dependencies) This sample demonstrates using a C++ library from Swift. ### Swift ``` > cd swift/cpp-dependencies > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/app Hello, World! ``` There are three projects in this sample: a shared C++ library (`:list`), a static C++ library (`:listStatic`), and a swift application with a dependency on the shared C++ library (`:app`). By default, when building the application, only the shared library will be built and used. To change the application to use the static library instead, change the dependency in [app/build.gradle](swift/cpp-dependencies/app/build.gradle#L9) to depend on the `:listStatic` project instead of `:list`. You'll also need to change [app/src/main/swift/LinkedList.swift](swift/cpp-dependencies/app/src/main/swift/LinkedList.swift#L4) to import the "listStatic" module (rather than the "list" module). ## Supporting multiple Swift versions (swift-versions) This sample demonstrates using multiple versions of Swift in a single build. There are two projects that build identical applications. One is written in Swift 3 compatible code (`swift3-app`) and one is written with Swift 4 compatible code (`swift4-app`). When running the application, it will print a message about which version of Swift was used. ### Swift 4 If you have the Swift 4 compiler installed, you can build both applications: ``` # NOTE: Needs Swift 4 tool chain > cd swift/swift-versions > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./swift4-app/build/install/main/debug/App Built for Swift 4 Hello, World! > ./swift3-app/build/install/main/debug/App Built for Swift 3 Hello, World! ``` By default, the tests for a given Swift production component will be compiled for the same version of Swift. For instance, in `swift3-app`, the production and test code will be built with Swift 3 source compatibility. ### Swift 3 If you have the Swift 3 compiler installed, you can only build the Swift 3 application. Attempting to build the Swift 4 application will fail. ``` > cd swift/swift-versions > ./gradlew swift3-app:assemble BUILD SUCCESSFUL in 1s > ./swift3-app/build/install/main/debug/app Built for Swift 3 Hello, World! ``` Currently, Gradle does not offer a convenience to ignore projects that are not buildable due to missing or incompatible tool chains. ## Application uses libraries that are not built by Gradle (injected-plugins) Gradle can also consume source dependencies that come from repositories without Gradle builds. When declaring a source dependency's repository information, you can instruct Gradle to inject plugins into the source dependency. These plugins can configure a Gradle build based on the contents of the repository. ### C++ To use the sample, create the Git repositories containing the libraries: ``` > cd cpp/injected-plugins > ./gradlew -p ../.. generateRepos ``` Now build the application: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` In the "repos" directory, you can find the source code without any Gradle configuration. The `utilities` and `list` builds are configured with the `utilities-build` and `list-build` plugins. ### Swift To use the sample, create the Git repositories containing the libraries: ``` > cd swift/injected-plugins > ./gradlew -p ../.. generateRepos ``` Now build the application: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App Hello, from Gradle build Hello, World! ``` In the "repos" directory, you can find the source code without any Gradle configuration. The `utilities` and `list` builds are configured with the `utilities-build` and `list-build` plugins. ## Application uses a library built by CMake (cmake-library) This sample demonstrates integrating a library that is built by CMake into a Gradle build. The sample is structured as a multi-project build. There are two projects, 'app' and 'utilities', which are built by Gradle. Both of these depend on a library 'list' that is built using CMake. The 'list' library has a Gradle project that wraps the CMake build and exposes its outputs in a way that other Gradle builds can consume. The sample packages the CMake integration logic as a 'cmake-library' plugin and applies the plugin to the 'library' project as a source dependency. ### C++ To use the sample, first create the Git repository containing the sample plugin: ``` > cd cpp/cmake-library > ./gradlew -p ../.. generateRepos ``` Now build the application: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/app Hello, World! ``` This generates the CMake build for the 'list' library, if required, and builds the libraries and application. ## Application and libraries built by CMake (cmake-source-dependencies) This sample demonstrates using Gradle's dependency management features to coordinate building an application and libraries built by CMake. The sample is composed of an application and two libraries. Each of these is hosted in a separate Git repository and connected together using source dependencies. The sample packages the CMake integration logic as a 'cmake-application' and 'cmake-library' plugin and applies these to the different builds. ### C++ To use the sample, first create the Git repository containing the sample plugin: ``` > cd cpp/cmake-source-dependencies/app > ./gradlew -p ../../.. generateRepos ``` Now build the application: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/debug/app Hello, World! ``` This generates the CMake builds for each of the libraries and the application, then builds and links the libraries and applications. ## Using Gradle builds from Swift Package Manager (swift-package-manager-publish) This sample shows how libraries built with Gradle can be used by projects that are built with Swift Package Manager, without having to maintain separate Gradle and Swift PM build for the library. The sample is made up of an application built using Swift PM, and two libraries that are built using Gradle. The sample also includes a 'release' plugin that takes care of generating a Swift PM build from a Gradle build. ### Swift To use the sample, setup the Git repositories for the libraries: ``` > ./gradlew generateRepos ``` Next, create a release of the list library that can be used by Swift PM. This generates a `Package.swift` file to be used by Swift PM, commits the changes and creates a tag: ``` > cd swift/swift-package-manager-publish/list-library > ./gradlew build release BUILD SUCCESSFUL in 1s ``` Do the same for the utilities library: ``` > cd ../utilities-library > ./gradlew build release BUILD SUCCESSFUL in 1s ``` Now build the application using Swift PM: ``` > cd ../app > swift build ``` ### C++ ``` > ./gradlew generateRepos > cd cpp/swift-package-manager-publish/list-library > ./gradlew build release BUILD SUCCESSFUL in 1s > cd ../utilities-library > ./gradlew build release BUILD SUCCESSFUL in 1s > cd ../app > swift build ``` ## Using a module for a system library with Swift (system-library-as-module) Existing system libraries can be wrapped in user defined `module.modulemap` files. ### Swift This sample demonstrates a Swift application that uses libcurl to fetch `example.com`. ``` > cd swift/system-library-as-module > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App ``` ## Provisioning tool chains from within Gradle (provisionable-tool-chains) This sample shows how to provision tool chains used by a Gradle build instead of the system tool chains. Please note the sample doesn't provision any tool chain for Windows yet. The sample can only provision tool chain at configuration. We use the `buildSrc` included build to use tasks for the provisioning. ### Swift This sample demonstrates a Swift tool chain provisioning under Linux. ``` > cd swift/provisionable-tool-chains > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App ``` ### C++ This sample demonstrates a Clang tool chain provisioning under macOS and Linux. ``` > cd cpp/provisionable-tool-chains > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app ``` ## Libraries build with autotools (autotools-library) This sample demonstrates using Gradle's dependency management features to coordinate building libraries built by Autotools (i.e. `configure` and `make`). The sample is composed of an application and a curl library. The curl library is downloaded from the [Curl home page](https://curl.haxx.se/) and then built using the Autotools configuration provided with the library. The application is built with Gradle, linking the curl library statically. When run, the application uses curl to query a REST service to lookup the capital of Sweden and prints this to the console. ### C++ To use the sample, create the Git repositories containing the libraries: ``` > cd cpp/autotools-library > ./gradlew -p ../.. generateRepos ``` Now build the application: ``` > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/app ``` ## Libraries with tests (library-with-tests) This sample demonstrates some basic Google test support in Gradle, building the GoogleTest library from source. ### C++ To run the tests from the command line: ``` > cd cpp/library-with-tests > ./gradlew -p ../.. generateRepos > ./gradlew assemble > ./gradlew test ``` ## Header-only libraries (header-only-library) This sample demonstrates header-only libraries. ### C++ To use the sample, run the tests from the command line: ``` > cd cpp/header-only-library > ./gradlew assemble > ./gradlew test ``` ## iOS Application (ios-application) This sample demonstrates a iOS 11.2 application build for the iPhone simulator, allowing editing of the iOS specific files inside Xcode. ### Swift To use the sample, build the application: ``` > cd swift/ios-application > ./gradlew assemble ``` Now install the application into an iOS simulator running iOS 11.2 by drag and dropping the app into a running simulator. Finally, you can develop the application using Xcode IDE to edit the storyboard and asset catalog. Note that the sample doesn't allow running the iOS application from the IDE. ``` > ./gradlew openXcode ``` ## Publishing macros for transitive consumption by downstream projects (publish-macros) This sample demonstrates how to publish macros to downstream projects. ### C++ To build and run the application: ``` > cd cpp/publish-macros > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./app/build/install/main/debug/app Hello, World! ``` ## Targetting multiple machines (multiple-target-machines) This sample shows how a simple Swift or C++ application can target multiple machines with Gradle. The application has no dependencies and the build has minimal configuration. ### C++ To build and run the application for the target machine of the same type as the current host: ``` > cd cpp/multiple-target-machines > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/app Hello, World! ``` ### Swift To build and run the application for the target machine of the same type as the current host: ``` > cd swift/multiple-target-machines > ./gradlew assemble BUILD SUCCESSFUL in 1s > ./build/install/main/debug/App Hello, World! ```
0
GoogleCloudPlatform/buildpack-samples
null
null
Buildpack Samples ----------------- | Name | Language | Build Tool | Deploy | | ---- | -------- | ---------- | ------ | | [sample-dotnet](sample-dotnet) | C# | .NET SDK | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-dotnet) | | [sample-go](sample-go) | Go | Go Modules | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-go) | | [sample-java-gradle](sample-java-gradle) | Java | Gradle | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-java-gradle) | | [sample-java-mvn](sample-java-mvn) | Java | Maven | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-java-mvn) | | [sample-java-springboot-gradle](sample-java-springboot-gradle) | Java + Spring Boot | Gradle | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-java-springboot-gradle) | | [sample-node](sample-node) | JavaScript (Node.js) | npm | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-node) | | [sample-node-yarn](sample-node-yarn) | JavaScript (Node.js) | yarn | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-node-yarn) | | [sample-node-tsc](sample-node-tsc) | TypeScript (Node.js) | npm | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-node-tsc) | | [sample-node-pnpm](sample-node-pnpm) | Javascript (Node.js) | pnpm | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-node-pnpm) | | [sample-php](sample-php) | PHP | PHP | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-php) | | [sample-php-entrypoint-envvar](sample-php-entrypoint-envvar) | PHP | PHP | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-php-entrypoint-envvar) | | [sample-php-entrypoint-procfile](sample-php-entrypoint-procfile) | PHP | PHP | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-php-entrypoint-procfile) | | [sample-python](sample-python) | Python | pip | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-python) | | [sample-ruby](sample-ruby) | Ruby | bundler | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-ruby) | | [sample-functions-framework-node](sample-functions-framework-node) | JavaScript (Node.js) Functions Framework | npm | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-functions-framework-node) | | [sample-functions-framework-python](sample-functions-framework-python) | Python Functions Framework | pip | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-functions-framework-python) | | [sample-functions-framework-go](sample-functions-framework-go) | Go Functions Framework | Go Modules | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-functions-framework-go) | | [sample-functions-framework-java-mvn](sample-functions-framework-java-mvn) | Java Functions Framework | Maven | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-functions-framework-java-mvn) | | [sample-functions-framework-cpp](sample-functions-framework-cpp) | C++ Functions Framework | CMake + vcpkg | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-functions-framework-cpp) | | [sample-functions-framework-ruby](sample-functions-framework-ruby) | Ruby Functions Framework | Bundler | [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/GoogleCloudPlatform/buildpack-samples.git&dir=sample-functions-framework-ruby) |
0
teleknEsis/TechRepublic-Samples
Sample projects for my Tech Republic app-builder blog
null
null
1
auth0-samples/auth0-react-native-sample
Auth0 Integration Samples for React Native
dx-sdk-quickstart native quickstart react-native sample
# Auth0 React Native Sample This is the sample code for the [Auth0 React Native Quickstart](https://auth0.com/docs/quickstart/native/react-native) using the [Auth0 React Native SDK](https://github.com/auth0/react-native-auth0/). Please see [the sample applications](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login) that demonstrate integrating the Auth0 React Native SDK into your application ## What is Auth0? Auth0 helps you to: * Add authentication with [multiple sources](https://auth0.com/docs/identityproviders), either social identity providers such as **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce** (amongst others), or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS, or any SAML Identity Provider**. * Add authentication through more traditional **[username/password databases](https://auth0.com/docs/connections/database/custom-db)**. * Add support for **[linking different user accounts](https://auth0.com/docs/users/user-account-linking)** with the same user. * Support for generating signed [JSON Web Tokens](https://auth0.com/docs/tokens/json-web-tokens) to call your APIs and **flow the user identity** securely. * Analytics of how, when, and where users are logging in. * Pull data from other sources and add it to the user profile through [JavaScript rules](https://auth0.com/docs/rules). ## Create a Free Auth0 Account 1. Go to [Auth0](https://auth0.com) and click **Sign Up**. 2. Use Google, GitHub, or Microsoft Account to login. ## Issue Reporting If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues. ## Author [Auth0](https://auth0.com) ## License This project is licensed under the MIT license. See the [LICENSE](./LICENSE) file for more info.
0
GoogleCloudPlatform/endpoints-samples
null
null
# Using Endpoints on Google Compute Engine or Container Engine This repository contains samples and utilities for using Google Cloud Endpoints on GCE(Google Compute Engine) or GKE(Google Kubernetes Engine) ## Repository Structure: * [getting-started](getting-started): ESPv2 Google Kubernetes Engine deployment yaml files used in Cloud Endpoint [tutorials](https://cloud.google.com/endpoints/docs/openapi/tutorials). * [gke](gke): ESPv2 deployment yaml files for Google Kubernetes Engine. * [kubernetes](kubernetes): ESPv2 deployment yaml files for Kubernetes. It is almost the same as GKE except that they all need to mount a service account key file to the ESP container. * [k8s](k8s): ESPv1 deployment files for mixed GKE(Google Kubernetes Engine) and Kubernetes deployment. If a file is has `_gke` in the file name it is for GKE, otherwise it is for Kubernetes.
0
xpadro/spring-integration
Samples of different Spring Integration modules (jms, batch, integration)
null
# spring-integration Samples of different Spring Integration modules (jms, batch, integration). These modules are split into the following sections: * [HTTP] - Processing of messages over HTTP. * [WEB SERVICES] - Examples using Spring Integration Web Services support. * [MONGO DB] - Integration with a MongoDB database. * [RMI] - Processing of messages over RMI. * [SPRING JMS] - Although not a direct part of the Spring Integration project, it is included in the certification guide. For this reason, it is appropriate to include this module in this repository. * [FILE] - Support for file processing. * [GENERIC] - Generic examples which are not specific to any of the previous sections. Inside each section there is another readme file with a list of all related project examples. Some of them have a link to a blog entry explaining in detail how its components work. [WEB SERVICES]: https://github.com/xpadro/spring-integration/tree/master/webservices [SPRING JMS]: https://github.com/xpadro/spring-integration/tree/master/spring-jms [HTTP]: https://github.com/xpadro/spring-integration/tree/master/http [MONGO DB]: https://github.com/xpadro/spring-integration/tree/master/mongodb [RMI]: https://github.com/xpadro/spring-integration/tree/master/rmi [FILE]: https://github.com/xpadro/spring-integration/tree/master/file [GENERIC]: https://github.com/xpadro/spring-integration/tree/master/generic
0
tarek360/Material-Animation-Samples
Samples in Material Animation (Deprecated)
null
# Material-Animation-Samples (Deprecated) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Material--Animation--Samples-brightgreen.svg?style=flat)](http://android-arsenal.com/details/3/1857) [or watch it on youtube](https://youtu.be/Yo0izprt7a4) [![](https://github.com/tarek360/Material-Animation-Samples/raw/master/layout_transition.gif)](https://youtu.be/Yo0izprt7a4) [![](https://github.com/tarek360/Material-Animation-Samples/raw/master/play_pause.gif)](https://www.youtube.com/watch?v=UFdV7qysyZQ) #Samples: Samples in material animation will be added through the next two monthes. - Layout Material Transition - Play Pause Morphing - Expandable Search widget - more is coming.. #License >Copyright 2015 tarek360 >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
arun-gupta/wildfly-samples
Samples for WildFly and related technologies
null
WildFly Related Samples =======================
0
Esri/arcgis-maps-sdk-java-samples
ArcGIS Maps SDK for Java samples
api arcgis-maps-sdk arcgis-maps-sdk-for-java desktop-application geospatial gradle java javafx maps native-development sample-code
# ArcGIS Maps SDK for Java Samples [![Link: ArcGIS Developers home](https://img.shields.io/badge/ArcGIS%20Developers%20Home-633b9b?style=flat-square)](https://developers.arcgis.com) [![Link: Documentation](https://img.shields.io/badge/Documentation-633b9b?style=flat-square)](https://developers.arcgis.com/java/) [![Link: API Reference](https://img.shields.io/badge/API%20Reference-633b9b?style=flat-square)](https://developers.arcgis.com/java/api-reference/reference/index.html) [![Link: Tutorials](https://img.shields.io/badge/Tutorials-633b9b?style=flat-square)](https://developers.arcgis.com/documentation/mapping-apis-and-services/tutorials/) [![Link: Demos](https://img.shields.io/badge/Demos-633b9b?style=flat-square)](https://github.com/Esri/arcgis-runtime-java-demos) [![Link: Toolkit](https://img.shields.io/badge/Toolkit-633b9b?style=flat-square)](https://github.com/Esri/arcgis-runtime-toolkit-java) [![Link: Esri Community](https://img.shields.io/badge/Esri%20Community%20Questions-2d2670?style=flat-square)](https://community.esri.com/t5/arcgis-runtime-sdk-for-java-questions/bd-p/arcgis-runtime-sdk-for-java-questions) ![ArcGIS Developers Twitter](https://img.shields.io/twitter/url?label=ArcGIS%20Developers&logoColor=2d2670&url=https%3A%2F%2Ftwitter.com%2FArcGISDevs) [![Link: ArcGIS Maps SDKs for Native Apps Blog](https://img.shields.io/badge/ArcGIS%20Runtime%20SDKS%20Blog-2d2670?style=flat-square)](https://community.esri.com/t5/arcgis-runtime-sdks-blog/bg-p/arcgis-runtime-sdks-blog) [![Link: ArcGIS Blog for Developers](https://img.shields.io/badge/ArcGIS%20Blog%20for%20Developers-2d2670?style=flat-square)](https://www.esri.com/arcgis-blog/developers/) ![Gradle build](https://github.com/Esri/arcgis-runtime-samples-java/workflows/Java%20CI%20with%20Gradle/badge.svg) Welcome to the ArcGIS Maps SDK for Java Samples repository. The ArcGIS Maps SDK for Java is used to build mapping, location, and GIS applications for desktop applications running on Windows, Mac, or Linux. This repo contains a set of sample projects demonstrating how to accomplish various mapping and geospatial tasks with the ArcGIS Maps SDK for Java. ### Sections * [Sample Viewer](#sample-viewer) * [Running the samples locally via this project](#running-the-samples-locally-via-this-project) * [Setup an API Key](#setup-an-api-key) * [Offline sample data](#offline-sample-data) * [System requirements for ArcGIS Maps SDK for Java](#system-requirements-for-arcgis-maps-sdk-for-java) * [Issues](#issues) * [Contributing](#contributing) ### Sample viewer You can browse our samples by downloading our [Sample Viewer Application](https://arcgisruntime.maps.arcgis.com/home/item.html?id=d34b33f673134862bdb414814d9fbd0a). ![Java Sample Viewer](sample-viewer.png) ### Running the samples locally via this project Each sample is an individual [Gradle](https://docs.gradle.org/current/userguide/userguide.html) project that can be run standalone. Installing Gradle is not necessary since each sample includes the Gradle wrapper. #### Pre-requisites: * [System Requirements for ArcGIS Maps SDK for Java](#system-requirements-for-arcgis-maps-sdk-for-java) * An API Key. [More details](#setup-an-api-key) * [IntelliJ IDEA](https://www.jetbrains.com/idea/) * Fork and clone this repo. [More details](WorkingWithGit.md). #### Manually via the IDE: 1. Open IntelliJ IDEA and select _File > Open..._. 2. Choose one of the sample project directories (e.g. `display-map`) and click _OK_. 3. Select _File > Project Structure..._ and ensure that the Project SDK and language level are set to use Java 17. 4. Store your API key in the `gradle.properties` file located in the `/.gradle` folder within your home directory. The API key will be set as a Java system property when the sample is run. Note: if a `gradle.properties` file does not already exist in the `/.gradle` folder within your home directory, a Gradle task in the samples `build.gradle` file will generate one for you to populate with your API key. ``` apiKey = yourApiKey ``` 5. Open the Gradle view with _View > Tool Windows > Gradle_. 6. In the Gradle view, double-click the `run` task under _Tasks > application_ to run the app. Note: *if you encounter the error `Could not get unknown property 'apiKey' for task ':run' of type org.gradle.api.tasks.JavaExec.` you may have to set the Gradle user home in the IntelliJ Gradle settings to the `/.gradle` folder in your home directory.* #### Via the terminal: 1. `cd` into one of the sample project directories (e.g. `display-map`). 2. Run `gradle wrapper` to create the Gradle Wrapper 3. Store your API key in the `gradle.properties` file located in the `/.gradle` folder within your home directory. The API key will be set as a Java system property when the sample is run. 4. Run `./gradlew run` on Linux/Mac or `gradlew.bat run` on Windows to run the app. ### Setup an API key Accessing Esri location services, including basemaps, routing, and geocoding, requires authentication using either an ArcGIS identity or an API Key: 1. ArcGIS identity: An ArcGIS named user account that is a member of an organization in ArcGIS Online or ArcGIS Enterprise. 2. API key: A permanent key that gives your application access to Esri location services. Visit your [ArcGIS Developers Dashboard](https://developers.arcgis.com/dashboard) to create a new API key or access an existing API key. ### Offline sample data Some samples require offline data. A `samples-data` directory will automatically download to the project root when the Gradle project is configured/imported. ### System requirements for ArcGIS Maps SDK for Java See the ArcGIS Maps SDK for Java's [system requirements](https://developers.arcgis.com/java/reference/system-requirements/). ### Issues Find a bug or want to request a new feature? Please let us know by submitting an issue. ### Contributing Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing). New to Git? Check out our [Working with Git](WorkingWithGit.md) guide. ### Licensing Copyright 2023 Esri 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. A copy of the license is available in the repository's license.txt file.
0
LarryDpk/pkslow-samples
samples for www.pkslow.com: Java, Spring Boot, Spring Cloud, Docker, Kubernetes, Cloud, Big Data
docker gcp java kubernetes spring-boot spring-cloud
# pkslow-samples - [GitHub](https://github.com/LarryDpk/pkslow-samples) - [Gitee](https://gitee.com/larrydpk/pkslow-samples) There articles and code samples on website www.pkslow.com. Mainly Topics: Java, Spring Boot, Spring Cloud, Docker, Kubernetes, Cloud, Big Data, Python <img src="https://pkslow.oss-cn-shenzhen.aliyuncs.com/images/pkslow-topics.png" width="400" alt="pkslow.com"> Build Package: ```shell script mvn clean install ``` # 南瓜慢说 你终于来了! 欢迎来到**南瓜慢说**的世界。 南瓜慢说的个人网站为 www.pkslow.com ,寓意就是南瓜慢说(pumpkin slow). 该网站会记录我最新和最全的文章,部分文章会同步其它平台。 对应的GitHub仓库为:[pkslow-samples](https://github.com/LarryDpk/pkslow-samples),该仓库主要是个人技术文章和相关的代码示例。 主要涉及的内容有: - Java - Spring Boot - Spring Cloud - Docker - Kubernetes - Cloud - Big Data - Python 可以通过以下命令构建项目: ```bash mvn clean install ``` 将坚持记录所思所想,希望带给自己成长的同时,能帮助到别人。 做一个简简单单的人, 做一个普普通通的人, 做一个不伤害社会的人, 做一个至少有一点点益处的人。 <br/> 过好自己渺小的一生,而不至于虚无、后悔。 每一个不曾起舞的日子,都是对生命的辜负。 > 敢一行,则予知。脚踏实地,知行合一。 <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Spring Boot <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## GraalVM相关 [GraalVM和Spring Native尝鲜,一步步让Springboot启动飞起来,66ms完成启动](https://www.pkslow.com/archives/spring-boot-native-graalvm) - Code: [/spring-boot/spring-boot-native-graalvm](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-boot-native-graalvm) [Spring Native打包本地镜像,无需通过Graal的maven插件buildtools](https://www.pkslow.com/archives/spring-boot-native-without-buildtools) - Code: [/spring-boot/spring-boot-native-without-buildtools](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-boot-native-without-buildtools) [Quarkus入门体验,22ms启动一个Web服务](https://www.pkslow.com/archives/quarkus-quickstart) - Code: [/other/quarkus-quickstart](https://github.com/LarryDpk/pkslow-samples/tree/master/other/quarkus-quickstart) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## 配置 [Spring自定义转换类,让@Value更方便](https://www.pkslow.com/archives/spring-custom-convert) - Code: [/spring-cloud/rest-service](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/rest-service) [使用SpringBootCondition更自由地定义条件化配置](https://www.pkslow.com/archives/springbootcondition) - Code: [/spring-boot/springboot-common](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-common) [用ApplicationContextRunner测试配置类](https://www.pkslow.com/archives/test-config-class-with-applicationcontextrunner) - Code: [/spring-boot/springboot-common](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-common) [Bean初始化操作initMethod、@PostConstruct和InitializingBean](https://www.pkslow.com/archives/bean-initializing) - Code: [/spring-boot/springboot-common](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-common) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## 监控 [用InfluxDB+Grafana监控Springboot应用](https://www.pkslow.com/archives/springboot-monitored-by-influxdb-grafana) - Code: [/spring-boot/springboot-influxdb](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-influxdb) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## 数据操作 [Spring Data JPA的Audit功能,审计数据库的变更](https://www.pkslow.com/archives/spring-data-jpa-audit) - Code: [/spring-boot/spring-data-jpa-audit](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-data-jpa-audit) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## Web开发 [Spring MVC获取HTTP请求头的两种方式](https://www.pkslow.com/archives/spring-mvc-get-headers) - Code: [/spring-boot/spring-data-jpa-audit](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-data-jpa-audit) [在Spring WebFlux的任何地方获取Request对象](https://www.pkslow.com/archives/spring-webflux-get-request) - Code: [/spring-cloud/webflux-service](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/webflux-service) [在Spring Boot中整合Katharsis,来快速开发JSON API的Web应用](https://www.pkslow.com/archives/springboot-katharsis) - Code: [/spring-boot/spring-boot-katharsis](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-boot-katharsis) [Spring在Filter中记录Web请求Request和返回Response的内容及时长](https://www.pkslow.com/archives/spring-log-request-response) - Code: [/spring-boot/springboot-common](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-common) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## Security [Springboot集成Spring Security实现JWT认证](https://www.pkslow.com/archives/springboot-spring-security-jwt-web) - Code: [/spring-boot/spring-security-jwt](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-security-jwt) [Springboot WebFlux集成Spring Security实现JWT认证](https://www.pkslow.com/archives/springboot-spring-security-jwt-webflux) - Code: [/spring-boot/spring-security-jwt-webflux](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-security-jwt-webflux) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## Spring Batch [通过例子讲解Spring Batch入门,优秀的批处理框架](https://www.pkslow.com/archives/spring-batch-introduction) - Code: [/other/spring-batch/spring-batch-simple](https://github.com/LarryDpk/pkslow-samples/tree/master/other/spring-batch/spring-batch-simple) [Spring Batch远程分区的本地Jar包模式](https://www.pkslow.com/archives/spring-batch-remote-partition-local-jar) - Code: [/other/spring-batch/remote-partition-local](https://github.com/LarryDpk/pkslow-samples/tree/master/other/spring-batch/remote-partition-local) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## 其它 [Spring Boot Actuator show the git and build info](https://www.pkslow.com/archives/springboot-actuator-git-build-info-en) - Code: [/spring-boot/springboot-common](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-common) [Spring Boot通过Actuator显示git和build的信息](https://www.pkslow.com/archives/springboot-actuator-git-build-info) - Code: [/spring-boot/springboot-common](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-common) [Spring AOP与AspectJ的对比及应用](https://www.pkslow.com/archives/spring-aop-vs-aspectj) - Code: [/spring-boot/springboot-aspectj](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-aspectj) [Springboot整合AOP和注解,实现丰富的切面功能](https://www.pkslow.com/archives/springboot-aspectj-annotation) - Code: [/spring-boot/springboot-aspectj](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-aspectj) [Spring Boot Integration with Google Bard](https://www.pkslow.com/archives/spring-boot-google-bard) [Spring Boot整合Google Bard - Web接口访问Google AI聊天机器人](https://www.pkslow.com/archives/spring-boot-google-bard-cn) - Code: [spring-boot/spring-boot-google-bard](https://github.com/LarryDpk/pkslow-samples/blob/master/spring-boot/spring-boot-google-bard) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Spring Cloud <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## Spring Cloud Data Flow [Spring Cloud Data Flow整合UAA使用外置数据库和API接口](https://www.pkslow.com/archives/spring-cloud-dataflow-uaa-api) - Code: [/spring-cloud/cloudfoundry-uaa-server](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/cloudfoundry-uaa-server) [Spring Cloud Data Flow整合Cloudfoundry UAA服务做权限控制](https://www.pkslow.com/archives/spring-cloud-dataflow-uaa) - Code: [/spring-cloud/cloudfoundry-uaa-server](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/cloudfoundry-uaa-server) [Spring Cloud Data Flow整合UAA之使用LDAP进行账号管理](https://www.pkslow.com/archives/spring-cloud-dataflow-uaa-ldap) - Code: [/spring-cloud/ldap-server](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/ldap-server) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## Spring Cloud Stream [整合Spring Cloud Stream Binder与RabbitMQ进行消息发送与接收](https://www.pkslow.com/archives/spring-cloud-stream-binder-rabbit) - Code: [/spring-cloud/spring-cloud-stream/spring-cloud-stream-binder-rabbit](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/spring-cloud-stream/spring-cloud-stream-binder-rabbit) [整合Spring Cloud Stream Binder与Kafka进行消息发送与接收](https://www.pkslow.com/archives/spring-cloud-stream-binder-kafka) - Code: [/spring-cloud/spring-cloud-stream/spring-cloud-stream-binder-kafka](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/spring-cloud-stream/spring-cloud-stream-binder-kafka) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## 其它 [Spring Cloud Gateway简单入门,强大的微服务网关](https://www.pkslow.com/archives/spring-cloud-gateway-introduction) - Code: [/spring-cloud/spring-cloud-gateway](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/spring-cloud-gateway) [Spring Cloud服务发现组件Eureka](https://www.pkslow.com/archives/spring-cloud-eureka) - Code: [/spring-cloud/spring-cloud-eureka](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/spring-cloud-eureka) [Spring Cloud Service Discovery with Netflix Eureka](https://www.pkslow.com/archives/spring-cloud-eureka-en) - Code: [/spring-cloud/spring-cloud-eureka](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/spring-cloud-eureka) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Docker [Docker启动PostgreSQL时创建多个数据库](https://www.pkslow.com/archives/docker-postgresql-multiple-databases) - Code: [/docker/postgresql-multiple-databases](https://github.com/LarryDpk/pkslow-samples/tree/master/docker/postgresql-multiple-databases) [通过Docker启动DB2,并在Spring Boot整合DB2](https://www.pkslow.com/archives/db2) - Code: [/spring-boot/spring-data-jpa-db2](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-data-jpa-db2) [通过Docker启动Solace,并在Spring Boot通过JMS整合Solace](https://www.pkslow.com/archives/solace) - Code: [/spring-boot/springboot-jms-solace](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/springboot-jms-solace) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Kubernetes [最好的Kubernetes客户端Java库fabric8io,快来自定义你的操作](https://www.pkslow.com/archives/kubernetes-client-fabric8io) - Code: [/kubernetes/kubernetes-client-fabric8io](https://github.com/LarryDpk/pkslow-samples/tree/master/kubernetes/kubernetes-client-fabric8io) [Kubernetes ConfigMap详解,多种方式创建、多种方式使用](https://www.pkslow.com/archives/kubernetes-configmap) - Code: [/kubernetes/configmap-springboot](https://github.com/LarryDpk/pkslow-samples/tree/master/kubernetes/configmap-springboot) [Kubernetes使用Keda进行弹性伸缩,更合理利用资源](https://www.pkslow.com/archives/keda) - Code: [/kubernetes/keda](https://github.com/LarryDpk/pkslow-samples/tree/master/kubernetes/keda) [Helm Template初体验,方便管理多环境](https://www.pkslow.com/archives/helm-template) - Code: [/cloud/helm](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/helm) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Cloud [K8ssandra入门-详细记录在Linux上部署K8ssandra到Kubernetes](https://www.pkslow.com/archives/k8ssandra) - Code: [/cloud/k8ssandra](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/k8ssandra) [使用Stargate访问K8ssandra,Springboot整合Cassandra](https://www.pkslow.com/archives/k8ssandra-stargatre) - Code: [/spring-boot/spring-data-cassandra](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-boot/spring-data-cassandra) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## dapr [dapr本地托管的服务调用体验与Java SDK的Spring Boot整合](https://www.pkslow.com/archives/dapr-java-sdk-springboot) - Code: [/cloud/dapr/dapr-springboot](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/dapr/dapr-springboot) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## Google Cloud Platform [整合Spring Cloud Stream Binder与GCP Pubsub进行消息发送与接收](https://www.pkslow.com/archives/spring-cloud-stream-binder-pubsub) - Code: [/spring-cloud/spring-cloud-stream/spring-cloud-stream-binder-pubsub](https://github.com/LarryDpk/pkslow-samples/tree/master/spring-cloud/spring-cloud-stream/spring-cloud-stream-binder-pubsub) [在GCP上创建Cloud SQL的三种方式(Console,gcloud,Terraform)](https://www.pkslow.com/archives/create-gcp-cloudsql) - Code: [/cloud/terraform/src/main/terraform/gcp/cloudsql](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/terraform/src/main/terraform/gcp/cloudsql) [Three ways to create Cloud SQL on GCP(Console,gcloud,Terraform)](https://www.pkslow.com/archives/create-gcp-cloudsql-en) - Code: [/cloud/terraform/src/main/terraform/gcp/cloudsql](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/terraform/src/main/terraform/gcp/cloudsql) [在GCP上创建GCE的三种方式(Console,gcloud,Terraform)](https://www.pkslow.com/archives/create-gcp-gce) - Code: [/cloud/terraform/src/main/terraform/gcp/gce](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/terraform/src/main/terraform/gcp/gce) [通过Terraform创建GCP Pubsub](https://www.pkslow.com/archives/terraform-gcp-pubsub) - Code: [/cloud/terraform/src/main/terraform/gcp/pubsub](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/terraform/src/main/terraform/gcp/pubsub) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## 《Terraform 101 从入门到实践》 这部分内容在GitHub [terraform-101](https://github.com/LarryDpk/terraform-101): [《Terraform 101 从入门到实践》 前言](https://www.pkslow.com/archives/terraform-101-preface) [《Terraform 101 从入门到实践》 第一章 Terraform初相识](https://www.pkslow.com/archives/terraform-101-introduction) [《Terraform 101 从入门到实践》 第二章 Providers插件管理](https://www.pkslow.com/archives/terraform-101-providers) [《Terraform 101 从入门到实践》 第三章 Modules模块化](https://www.pkslow.com/archives/terraform-101-modules) [《Terraform 101 从入门到实践》 第四章 States状态管理](https://www.pkslow.com/archives/terraform-101-states) [《Terraform 101 从入门到实践》 第五章 HCL语法](https://www.pkslow.com/archives/terraform-101-hcl) [《Terraform 101 从入门到实践》 Terraform常用命令](https://www.pkslow.com/archives/terraform-101-commands) [《Terraform 101 从入门到实践》 Functions函数](https://www.pkslow.com/archives/terraform-101-functions) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> ## Terraform [Terraform模块Module管理,聚合资源的抽取与复用](https://www.pkslow.com/archives/terraform-module) - Code: [/cloud/terraform/src/main/terraform/module-example](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/terraform/src/main/terraform/module-example) [Terraform入门教程,示例展示管理Docker和Kubernetes资源](https://www.pkslow.com/archives/terraform) - Code: [/cloud/terraform/src/main/terraform/docker](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/terraform/src/main/terraform/docker) - Code: [/cloud/terraform/src/main/terraform/kubernetes](https://github.com/LarryDpk/pkslow-samples/tree/master/cloud/terraform/src/main/terraform/kubernetes) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Java基础 [Protobuf入门与使用示例,高性能的序列化框架](https://www.pkslow.com/archives/protobuf-introduction) - Code: [/java-basic/protobuf](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/protobuf) [远程过程调用框架gRPC入门及Java示例代码](https://www.pkslow.com/archives/grpc-introduction) - Code: [/java-basic/grpc](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/grpc) [通过Maven用LiquiBase对数据库变更进行版本控制](https://www.pkslow.com/archives/liquibase) - Code: [/java-basic/liquibase](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/liquibase) [用pl.pojo.tester测试Pojo类,提高测试覆盖率](https://www.pkslow.com/archives/pl-pojo-tester) - Code: [/java-basic/pl-pojo-tester](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/pl-pojo-tester) [Java如何设置代理来访问受限资源](https://www.pkslow.com/archives/java-proxy) - Code: [/java-basic/java-proxy](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/java-proxy) [Apache Beam入门及Java SDK开发初体验](https://www.pkslow.com/archives/apache-beam) - Code: [/bigdata/apache-beam/direct-runner](https://github.com/LarryDpk/pkslow-samples/tree/master/bigdata/apache-beam/direct-runner) [Java如何测量方法执行时间](https://www.pkslow.com/archives/java-elapsed-time) - Code: [/java-basic/java-elapsed-time](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/java-elapsed-time) [Java JDK Proxy和CGLib动态代理示例讲解](https://www.pkslow.com/archives/jdk-cglib-proxy) - Code: [/java-basic/jdk-cglib-proxy](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/jdk-cglib-proxy) [Java多种方法实现等待所有子线程完成再继续执行](https://www.pkslow.com/archives/wait-for-threads-to-finish) - Code: [java-basic/wait-for-threads-to-finish](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/wait-for-threads-to-finish) [Java multiple ways to wait for threads to finish](https://www.pkslow.com/archives/wait-for-threads-to-finish-en) - Code: [java-basic/wait-for-threads-to-finish](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/wait-for-threads-to-finish) [Callable VS Runnable对比](https://www.pkslow.com/archives/runnable-vs-callable) - Code: [java-basic/runnable-vs-callable](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/runnable-vs-callable) [Difference Between Callable and Runnable in Java](https://www.pkslow.com/archives/runnable-vs-callable-en) - Code: [java-basic/runnable-vs-callable](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/runnable-vs-callable) [Multiple Ways to Download Files from Internet in Java](https://www.pkslow.com/archives/java-sava-a-file-from-internet) [Java从网上下载文件的几种方式](https://www.pkslow.com/archives/java-sava-a-file-from-internet-cn) - Code: [java-basic/download-file-from-internet](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/download-file-from-internet) [How to Install Zookeeper and Kafka Cluster](https://www.pkslow.com/archives/install-zookeeper-and-kafka-cluster) - Code: [other/install-kafka-cluster](https://github.com/LarryDpk/pkslow-samples/tree/master/other/install-kafka-cluster) [使用Thumbnailator生成缩略图(缩放、旋转、裁剪、水印)](https://www.pkslow.com/archives/java-thumbnailator) - Code: [java-basic/download-file-from-internet](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/java-thumbnailator) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Python [用Python做了一个广东疫情新增病例动态视频](https://www.pkslow.com/archives/python-covid-19-guangdong) - Code: [/python/src/main/python/covid-19-Guangdong](https://github.com/LarryDpk/pkslow-samples/tree/master/python/src/main/python/covid-19-Guangdong) [用Python库BeautifulSoup来读取广东疫情近期数据并存在csv上](https://www.pkslow.com/archives/python-bs4-csv) - Code: [/python/src/main/python/beautifulsoup4-example](https://github.com/LarryDpk/pkslow-samples/tree/master/python/src/main/python/beautifulsoup4-example) [用GPU来运行Python代码](https://www.pkslow.com/archives/run-python-with-gpu) - Code: [/python/src/main/python/cuda](https://github.com/LarryDpk/pkslow-samples/tree/master/python/src/main/python/cuda) [Use Python to Build a Google Bard Chatbot Client Locally](https://www.pkslow.com/archives/google-bard-python-chatbot) [用Python基于Google Bard做一个交互式的聊天机器人](https://www.pkslow.com/archives/google-bard-python-chatbot-cn) - Code: [python/google-bard-python-chatbot](https://github.com/LarryDpk/pkslow-samples/tree/master/python/src/main/python/google-bard-python-chatbot) [Google Cloud Platform Tutorial](https://www.pkslow.com/archives/gcp) - Code: [python/apache-beam](https://github.com/LarryDpk/pkslow-samples/tree/master/python/src/main/python/apache-beam) - Code: [python/spark](https://github.com/LarryDpk/pkslow-samples/tree/master/python/src/main/python/spark) - Code: [python/airflow](https://github.com/LarryDpk/pkslow-samples/tree/master/python/src/main/python/airflow) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # 数据库 [How to partition the big table in PostgreSQL - Range List Hash](https://www.pkslow.com/archives/postgresql-partitioning-en) - Code: [/other/postgresql](https://github.com/LarryDpk/pkslow-samples/tree/master/other/postgresql) [示例讲解PostgreSQL表分区的三种方式](https://www.pkslow.com/archives/postgresql-partitioning) - Code: [/other/postgresql](https://github.com/LarryDpk/pkslow-samples/tree/master/other/postgresql) [InfluxDB入门及使用,一个优秀的时序数据库](https://www.pkslow.com/archives/influxdb-introduction) - Code: [/java-basic/influxdb](https://github.com/LarryDpk/pkslow-samples/tree/master/java-basic/influxdb) <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # 状态 ![Repobeats analytics](https://repobeats.axiom.co/api/embed/13cfae2492671e23cbc71c4f469e6c9c789769f7.svg "Repobeats analytics image") <div align="right"> <b><a href="#pkslow-samples">↥ back to top</a></b> </div> # Thanks to JetBrains <h3 align="center">JetBrains</h3> <p align="center"> <a href="https://www.jetbrains.com/?from=pkslow-samples"> <img width="260px" src="jetbrains-variant-4.png"> </a> </p> > Thanks JetBrains to support the project providing such great IDE.
0
sequenceiq/sequenceiq-samples
SequenceIQ Hadoop examples
null
SequenceIQ Hadoop sample projects ============================ This repository is a collection of sample projects and code examples featured in our blog entries - for more details check [SequenceIQ blog](http://blog.sequenceiq.com). This samples repository and the blog contains random thoughts and proof-of-concepts/interesting issues we have face during our product development stack. Where the samples are not covered by a blog entry, we try to make them self explanatory or supply a short readme. Please feel free to collaborate, share, ask for help or report issues. * **flume-sources** module: [Custom Apache Flume source](http://blog.sequenceiq.com/blog/2014/02/22/custom-flume-source/) * **etl-samples** module: [ETL - producing better quality data](http://blog.sequenceiq.com/blog/2014/02/28/etl-and-data-quality/) * **hdp-sandbox-access** module: [Accessing HDP2 sandbox from the host](http://blog.sequenceiq.com/blog/2014/03/05/access-hdp2-sandbox/) * **lastfm-morphlines-etl** module: [How-to: Process Data using Morphlines (in Kite SDK)](http://blog.cloudera.com/blog/2014/04/how-to-process-data-using-morphlines-in-kite-sdk/) * **hdp-sandbox-access** module: [HDFS and java.nio.channels](http://blog.sequenceiq.com/blog/2014/03/07/read-from-hdfs/) * **mapreduce-morphline** module: [Data cleaning with MapReduce and Morphlines](http://blog.sequenceiq.com/blog/2014/03/11/data-cleaning-with-mapreduce-and-morphlines/) * **yarn-queue-tests** module: [YARN Capacity Scheduler](http://blog.sequenceiq.com/blog/2014/03/14/yarn-capacity-scheduler/) * **tez-dag-jobs** module: [Using Mahout with Tez](http://blog.sequenceiq.com/blog/2014/03/31/mahout-on-tez/) * **yarn-monitoring-R** module: [Monitoring YARN with R]() * **scalding-correlation** module: [Correlation example with Scalding](http://blog.sequenceiq.com/blog/2014/06/23/scalding-correlation-example/) * **spark-clustering** module: [K-means clustering on Spark](http://blog.sequenceiq.com/blog/2014/07/31/spark-mllib/) Thanks, [SequenceIQ](http://sequenceiq.com)
0
GoogleCloudPlatform/getting-started-java
null
samples
# Getting started on Google Cloud Platform for Java® [![CircleCI Build Status](https://circleci.com/gh/GoogleCloudPlatform/getting-started-java.svg?style=shield&circle-token=51b789e102291cbeae6817678d02da0f4cf25f1f)](https://circleci.com/gh/GoogleCloudPlatform/getting-started-java) [![Coverage Status](https://codecov.io/gh/GoogleCloudPlatform/getting-started-java/branch/main/graph/badge.svg)](https://codecov.io/gh/GoogleCloudPlatform/getting-started-java) The code for the samples is contained in individual folders on this repository. Follow the instructions at [Getting Started on Google Cloud Platform for Java](https://cloud.google.com/java/) or the README files in each folder for instructions on how to run locally and deploy. Managed VMs on Google Cloud Platform use the [Java Servlets](http://www.oracle.com/technetwork/java/overview-137084.html) & [Java Server Pages](http://www.oracle.com/technetwork/java/index-jsp-138231.html) on [Jetty](http://www.eclipse.org/jetty/). 1. [Helloworld-servlet](helloworld-servlet) Servlet based Hello World app 1. [HelloWorld-jsp](helloworld-jsp) Java Server Pages based Hello World app 1. [Bookshelf](bookshelf) A full featured app that demonstrates Authentication and CRUD operations for [Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/overview?hl=en) and [Cloud SQL](https://cloud.google.com/sql/docs/introduction). ## Google Cloud Samples To browse ready to use code samples check [Google Cloud samples](https://cloud.google.com/docs/samples). ## Contributing changes * See [CONTRIBUTING.md](CONTRIBUTING.md) ## Licensing * See [LICENSE](LICENSE) Java is a registered trademark of Oracle Corporation and/or its affiliates.
0
GoogleCloudPlatform/cloud-bigtable-examples
Examples of how to use Cloud Bigtable both with GCE map/reduce as well as stand alone applications.
samples
# Google Cloud Bigtable examples [![Travis CI status][travis-shield]][travis-link] [![Stack Overflow][stackoverflow-shield]][stackoverflow-link] Bigger than a data warehouse, fast enough for real-time access, and less expensive than running virtual machines. The world-renowned database that powers Google is now available to you worldwide. ## Overview [Google Cloud Bigtable](https://cloud.google.com/bigtable/) offers you a fast, fully managed, almost infinitely scalable NoSQL database service that's ideal for web, mobile, and IoT applications requiring terabytes to petabytes of data. Unlike comparable market offerings, Cloud Bigtable doesn't require you to sacrifice speed, scale, or cost efficiency when your applications grow. The Bigtable service that Cloud Bigtable relies upon has been battle-tested at Google for more than 10 years—it's the database driving major applications such as Search, Analytics, Maps and Gmail. ## Quickstart [Quickstart/HBase](quickstart) - Create a Cloud Bigtable Cluster and the hbase shell from within a docker container on your local machine ## Java * [Hello World](java/hello-world) - This sample has been migrated to: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/bigtable/hbase/snippets/src/main/java/com/example/bigtable/HelloWorld.java * [Import HBase Sequence files](java/dataflow-import-examples) Import HBase sequence files directly to Cloud Bigtable using Dataflow. * [Dataproc Wordcount using Map/Reduce](java/dataproc-wordcount) - How to load data to Cloud Bigtable using Dataproc on GCE * [GAE J8 Std-Hello World](https://github.com/googlecloudplatform/java-docs-samples/tree/master/appengine-java8/bigtable) - Accessing Cloud Bigtable from App Engine standard ## Dataflow * [Connector-Examples](java/dataflow-connector-examples) - Using the cloud dataflow connector for Bigtable, do write Hello World to two rows, Use Cloud Pub / Sub to count Shakespeare, count the number of rows in a Table, and copy records from BigQuery to BigTable. * [Pardo-HelloWorld](java/dataflow-pardo-helloworld) - example of using Cloud Dataflow without the connector. ## Go * [cbt](https://github.com/GoogleCloudPlatform/gcloud-golang/tree/master/bigtable/cmd/cbt) [doc](https://godoc.org/google.golang.org/cloud/bigtable/cmd/cbt) Basic command line interactions with Cloud Bigtable - A really great place to start learning the Go Client. * [helloworld](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/bigtable/helloworld) - Basic Hello world example application demonstrating how to read and write to a Cloud Bigtable instance. * [usercounter](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/bigtable/usercounter) - Accessing Cloud Bigtable from App Engine Flexible * [search](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/bigtable/search) - Create and search a Cloud Bigtable. ## Python * [Hello World](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/bigtable/hello) A minimal application that demonstrates using the Googe Cloud Client libraries to create a temporary table, write some rows, read them back and clean up. * [Hello World (Happybase)](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/bigtable/hello_happybase) A minimal application that demonstrates using the Happybase API create a temporary table, write some rows, read them back and clean up. ## Questions and discussions If you have questions or run into issues with Google Cloud Bigtable or the client libraries, you can use any of the following forums: * Stack Overflow: tag questions with [`google-cloud-bigtable`][stackoverflow-link] * Mailing list: [google-cloud-bigtable-discuss@][google-cloud-bigtable-discuss] You can also subscribe to [google-cloud-bigtable-announce@][google-cloud-bigtable-announce] list to receive infrequent product and client library announcements. ## Contributing changes See [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to contribute to this project. ## More examples More Google Cloud Bigtable examples are available in the following languages: * [Java](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/bigtable) * [Python](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/bigtable) * [Node](https://github.com/googleapis/nodejs-bigtable/tree/master/samples) * [Go](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/bigtable) * [Dotnet](https://github.com/GoogleCloudPlatform/dotnet-docs-samples/tree/master/bigtable/api) * [C++](https://github.com/googleapis/google-cloud-cpp/tree/master/google/cloud/bigtable/examples) * [Ruby](https://github.com/GoogleCloudPlatform/ruby-docs-samples/tree/master/bigtable) * [PHP](https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/bigtable) ## License Apache 2.0; see [LICENSE](LICENSE) for details. <!-- references --> [travis-shield]: https://travis-ci.org/GoogleCloudPlatform/cloud-bigtable-examples.svg [travis-link]: https://travis-ci.org/GoogleCloudPlatform/cloud-bigtable-examples/builds [stackoverflow-shield]: https://img.shields.io/badge/stackoverflow-google--cloud--bigtable-blue.svg [nodejs-bigtable]: https://github.com/googleapis/nodejs-bigtable [stackoverflow-link]: http://stackoverflow.com/search?q=[google-cloud-bigtable] [google-cloud-bigtable-discuss]: https://groups.google.com/group/google-cloud-bigtable-discuss [google-cloud-bigtable-announce]: https://groups.google.com/group/google-cloud-bigtable-announce
0
apache/dubbo-samples
samples for Apache Dubbo
dubbo
# Dubbo Samples Samples for Apache Dubbo. ![Build Status](https://github.com/apache/dubbo-samples/workflows/Dubbo%202/badge.svg) ![license](https://img.shields.io/github/license/apache/dubbo-samples.svg) This repository contains a number of projects to illustrate various usages of Dubbo from basic to advanced, pls. check README in each individual sub projects. It is also helpful to cross reference to [Dubbo User Manual](https://dubbo.apache.org/zh-cn/overview/tasks/) to understand the features demoed in this project. What's more, [dubbo-go](https://github.com/apache/dubbo-go) samples are moved to [dubbo-go-samples](https://github.com/apache/dubbo-go-samples). ## Build and Run Samples To compile all samples, run the following command in the top directory of this project, or step into the sub directories to compile one single sample: **It is highly not recommend to build the entire project from the root directory, as building the entire samples can take a long time. Each module in Samples is designed independently so you can first go to the demo directory you care about, then execute the build and run the demo.** For example, ```bash $ cd 1-basic/dubbo-samples-spring-boot $ mvn clean package ``` You may need to read each individual README under the sub directories if you have to understand how to build and run. ## Integration Test This project is also used for integration tests for dubbo. If you are just learning how to use Dubbo you don't have to care about this part. **How to build and run a integration test** Dubbo integration test base on docker container, and relies on an image used to run the provider application and test cases. Integration test leverages [docker](https://docs.docker.com/get-started/) to setup test environment, more accurately, to start dubbo provider instance, and any other supporting systems like registry center if necessary, in docker. Please install `docker` and `docker-compose` first, then build the test image `dubbo/sample-test`. ```bash cd dubbo-samples ./test/build-test-image.sh ``` Use a debian mirror through env `DEBIAN_MIRROR` if apt download files slowly, the following example uses aliyun mirror server [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) : ```bash cd dubbo-samples DEBIAN_MIRROR=http://mirrors.aliyun.com ./test/build-test-image.sh ``` Then we use the `run-tests.sh` script to run the test cases. * Run single test case ```bash cd dubbo-samples ./test/run-tests.sh <project.basedir> ``` For example, run the `dubbo-samples-annotation` test case: ``` ./test/run-tests.sh 2-advanced/dubbo-samples-annotation ``` * Run all test cases ```bash cd dubbo-samples ./test/run-tests.sh ``` If docker container fails to startup successfully in any case, you can check log files in directory `${project.basedir}/target/logs` to understand what happens. Pls. note integration tests rely on a Docker environment, make sure the docker environment is available before running them. **How to add more integration test** If you are interested in contributing more integration test for dubbo, pls. read further to understand how to enable integration test for one particular sample from the scratch. Please follow the steps below: 1. Add a file named `case-configuration.yml` to test project. This file is used to configure the test modules and environment, including dubbo provider / test services, dependent third-party services. 2. Add a file named `case-versions.conf` to test project. This file is used to configure the supported component version rules to support multi-version testing. **Details of `case-configuration.yml`:** Take the case `dubbo-samples-annotation` as an example: ```yaml services: dubbo-samples-annotation: type: app basedir: . mainClass: org.apache.dubbo.samples.annotation.AnnotationProviderBootstrap dubbo-samples-annotation-test: type: test basedir: . tests: - "**/*IT.class" systemProps: - zookeeper.address=dubbo-samples-annotation - zookeeper.port=2181 - dubbo.address=dubbo-samples-annotation - dubbo.port=20880 waitPortsBeforeRun: - dubbo-samples-annotation:2181 - dubbo-samples-annotation:20880 depends_on: - dubbo-samples-annotation ``` The project contains a dubbo provider `AnnotationProviderBootstrap` and an embedded zookeeper server, as well as a test class `AnnotationServicesIT`. Therefore, we have to define two services, one service runs `AnnotationProviderBootstrap`, and the other service runs test classes. The service `type` of running dubbo provider is `app`, and the service `type` of running test is `test`. The project directory is the same as the case configuration directory, so `basedir` is `.` . Use hostname to access between containers, the default `hostname` of the container is the same as serviceName. So through `dubbo-samples-annotation:2181`, the embedded zookeeper server can be accessed from the test container. There are many test cases similar to this example, only need to modify the `mainClass` and hostname. Extract the changed as variables, and the unchanged content as templates. When using the template, you only need to modify the variable value, which makes the case configuration easier. The above example can use a template `app-builtin-zookeeper.yml`, use `from` to reference it and override the variable value in `props`: ```yaml from: app-builtin-zookeeper.yml props: project_name: dubbo-samples-annotation main_class: org.apache.dubbo.samples.annotation.AnnotationProviderBootstrap zookeeper_port: 2181 dubbo_port: 20880 ``` Another template is `app-external-zookeeper.yml`, which supports an external zookeeper service. you can find all the templates in the directory `test/dubbo-scenario-builder/src/main/resources/configs`. **Details of `case-versions.conf`:** Version rules for spring app: ``` # Spring app dubbo.version=2.7*, 3.* spring.version=4.*, 5.* ``` Version rules for spring-boot 1.x app: ``` # SpringBoot app dubbo.version=2.7*, 3.* spring-boot.version=1.* ``` Version rules for spring-boot 2.x app: ``` # SpringBoot app dubbo.version=2.7*, 3.* spring-boot.version=2.* ``` For more details, please refer to the following case configurations: * [dubbo-samples-annotation](dubbo-samples-annotation/case-configuration.yml) : A simple provider service with builtin zookeeper. * [dubbo-samples-api](dubbo-samples-api/case-configuration.yml) : A simple provider service with external zookeeper. * [dubbo-samples-chain](dubbo-samples-chain/case-configuration.yml) : A multiple services with external zookeeper. * [dubbo-samples-migration](dubbo-samples-migration/README.md) : A compatibility test with the provider and consumer have different dubbo verison. That's it, then feel free to add more integration test for the Dubbo project, have fun.
0
VaughnVernon/IDDD_Samples
These are the sample Bounded Contexts from the book Implementing Domain-Driven Design" by Vaughn Vernon: http://vaughnvernon.co/?page_id=168"
null
These are the sample Bounded Contexts from the book "Implementing Domain-Driven Design" by Vaughn Vernon: http://vaughnvernon.co/?page_id=168 The models and surrounding architectural mechanisms may be in various states of flux as the are refined over time. Some tests may be incomplete. The code is not meant to be a reflection of a production quality work, but rather as a set of reference projects for the book. Points of Interest ================== The iddd_agilepm project uses a key-value store as its underlying persistence mechanism, and in particular is LevelDB. Actually the LevelDB in use is a pure Java implementation: https://github.com/dain/leveldb Currently iddd_agilepm doesn't employ a container of any kind (such as Spring). The iddd_collaboration project uses Event Sourcing and CQRS. It purposely avoids the use of an object-relational mapper, showing that a simple JDBC-based query engine and DTO matter can be used instead. This technique does have its limitations, but it is meant to be small and fast and require no configuration or annotations. It is not meant to be perfect. It may be helpful to make one additional mental note on the iddd_collaboration CQRS implementation. To keep the example simple it persists the Event Sourced write model and the CQRS read model in one thread. Since two different stores are used--LevelDB for the Event Journal and MySQL for the read model--there may be very slight opportunities for inconsistency, but not much. The idea was to keep the two models as close to consistent as possible without using the same data storage (and transaction) for both. Two different storage mechanisms were used purposely to demonstrate that they can be separate. The iddd_identityaccess project uses object-relational mapping (Hibernate), but so as not to leave it "boring" it provides a RESTful client interface and even publishes Domain-Event notifications via REST (logs) and RabbitMQ. Finally the iddd_common project provides a number of reusable components. This is not an attempt to be a framework, but just leverages reuse to the degree that code copying doesn't liter each project. This is not a recommendation, but it did work well and save a considerable amount of work while producing the samples. Usage ===== Requires -------- - Java 7 (8+ does not work) - MySQL Client + Server - RabbitMQ Setup (with Docker) ------------------- To make it easy to run the tests and it requirements, the `startContainers.sh` script is provided. Which will start a: - MySQL Server container - RabbitMQ Server container - RabbitMQ Management container If the `mysql` command is available, which is the mysql client, also the required SQL scripts will be imported into the MySQL Server. If you use the `startContainers.sh` script, you don't need MySQL Server and RabbitMQ installed locally. Instead, Docker needs to be installed as the script will start MySQL and RabbitMQ in Docker containers. Build ------ You can build the project by running: ``` ./gradlew build ``` This automatically downloads Gradle and builds the project, including running the tests. The Gradle build using Maven repositories was provided by Michael Andrews (Github michaelajr and Twitter @MichaelAJr). Thanks much! I hope you benefit from the samples. Vaughn Vernon Author: Implementing Domain-Driven Design Twitter: @VaughnVernon http://vaughnvernon.co/
1
hazelcast/hazelcast-code-samples
Hazelcast Code Samples
null
Hazelcast Code Samples Readme ============================= The folder **/code-samples** in your package contains an extensive collection of code samples which you can use to learn how to use Hazelcast features. From distributed primitives to Service Provider Interface (SPI), you can see Hazelcast in action readily. How to run ---------- If the sample has a README file, follow the instructions. A lot of samples have shell scripts like "start.sh", "start-member.sh" or "start-client.sh", use them to run the sample. If none of the previous options apply, use _java -cp target/classes:target/lib/\* <fully qualified name of the main class>_ to run the sample. Included sample folders ----------------------- * **/clients** — Includes sample code that shows how to create a Hazelcast client, put a message on a queue by this client and receive that message by a Hazelcast node. Further how to set up client's near cache, deploy user code to member, communicate via REST or populate client statistics to member. * **/cluster** — cluster state managements and shutdown * **/cluster-split-brain-protection** — setting up cluster split brain protection programatically * **/cluster-split-brain-protection-xml** — setting up cluster split brain protection via XML configuration * **/cluster-state** — managing cluster state to frozen, passive and shutdown. * **/demo** — You can start multiple nodes and operate usual map operations using the code samples here. * **/distributed-collections** — Includes Distributed Queue, Bounded Queue, Listeners, Set, List, Queue store, Ringbuffer and Ringbuffer store code samples. * **/distributed-executor** — examples of distributed task execution e.g. executing on all member, just key owner, only lite nodes only, on specific member. Also examples of usage of futures and scheduled executions. * **/distributed-map** — An extensive code samples folder that includes many features of the Hazelcast distributed map in action. * **/distributed-primitives** — Includes Distributed AtomicLong, AtomicReference, CountDownLatch, IdGenerator, FlakeIdGenerator, CardinalityEstimator, Condition, Semaphore and Lock code samples. * **/distributed-topic** — Code samples to see publish/subscriber messaging model. * **/enterprise** — Includes socket and security interceptor, CPMap, HD store and hot restart code samples. * **/hazelcast-integration** — Code samples to show how you can integrate Hazelcast with Hibernate 2nd Level Cache and Spring. It also includes code samples for web session replication and resource adapter implementation. * **/jcache** — An extensive code samples folder for operations including creating a cache and writing entries to it, creating listeners and clients. * **/jet** — Code samples to demonstrate building stream and batch processing applications using Hazelcast's Jet engine. * **/jmx** — example of connecting to Hazelcast member via JMX. * **/json** — examples of JSON objects stored in Hazelcast. * **/learning-basics** — Code samples to show some Hazelcast basics like creating, configuring and destroying Hazelcast instances, configuring logging and Hazelcast configuration. * **/monitoring** — Includes code samples that show how to check if a Hazelcast cluster is safe to be shutdown. * **/near-cache** — Shows the benefits of Near Caches, local subsets of data that track the master copy in the grid. Further extends the _/clients_ examples. * **/network-configuration** — Shows what options Hazelcast configuration has regarding to network (e.g. partition grouping, multicast, ports, outbound ports, etc.) * **/osgi** — Demonstrates how to use Hazelcast's OSGI support * **/replicated-map** — Code samples to show how to get a replicated map and create an entry listener. * **/serialization** — Includes code samples that implement various serialization interfaces like DataSerializable, IdentifiedDataSerializable, Externalizable and Portable. It also has code samples to show how to plug a custom serializer using StreamSerializer and ByteArraySerializer interfaces and usage of Kryo and Protobuf serializers. * **/spi** — Includes code samples that create a simple counter application using Hazelcast’s Service Provider Interface (SPI). * **/sql** — Examples of using SQL directly, or via JDBC. * **/transactions** — Code samples showing how to use the TransactionalMap and TransactionalTask interfaces. Included helper folders ----------------------- * **/checkstyle** — Java code style configuration * **/helper** — Shared utility classes and methods for samples
0
spring-projects/spring-amqp-samples
Samples for Spring AMQP
null
This project hosts some samples that complement [Spring AMQP](https://github.com/SpringSource/spring-amqp), showing you how to get started with Spring and AMQP. # Build Instructions # Install the [RabbitMQ](https://www.rabbitmq.com) broker first (version 2.3.1 or better). Then clone from GIT and then use Maven (2.1.*): $ git clone ... $ mvn install SpringSource ToolSuite users (or Eclipse users with the latest m2eclipse plugin) can import the projects as existing Maven projects. The basic HelloWorld sample has two versions (with synchronous and asynchronous consumers). Both have two Java classes called `Producer` and `Consumer` with main methods to launch. Run the producer first and ensure that the broker is already running. The Stocks sample has a UI that can be launched as a Java main, and a daemon server process with the same properties. You can run them from an IDE easily. Run the `Server` and then the `Client` and you should see a swing client pop up and stock tickers appearing. To run from the command line you can use the Maven exec plugin: $ mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass=org.springframework.amqp.rabbit.stocks.Server & $ mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass=org.springframework.amqp.rabbit.stocks.Client In the example above we backgrounded the server process, or you could run it in a different window to make things clearer in the console logs. ## Web UI The Stocks sample is also a web application. You should be able to run it in your IDE, e.g. if you imported the project into STS (or Eclipse with Maven support) you can drag it onto a server, or use `Run As...->On Server`. From the command line you can use $ mvn jetty:run The web UI is designed like the swing client - it has a ticker table that updates every second (if there is any new data), and an order entry form. The `QuoteController` manages the interaction between the browser and the application and between the application and the AMQP broker. ## RabbitMQ Tutorials Spring Boot versions of the [6 standard RabbitMQ tutorials](https://www.rabbitmq.com/getstarted.html) are provided in `rabbitmq-tutorials`. ## Spring Boot Applications Several Spring Boot applications are also provided, with names `spring-rabbit-...`. Explore their individual READMEs for more information. # Contributing to Spring AMQP Samples Here are some ways for you to get involved in the community: * Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](https://forum.spring.io/) by responding to questions and joining the debate. * Create [JIRA](https://jira.springsource.org/browse/AMQP) tickets for bugs and new features and comment and vote on the ones that you are interested in. * Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](https://help.github.com/forking/). If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing. * Watch for upcoming articles on Spring by [subscribing](https://www.springsource.org/node/feed) to springframework.org Refer to the spring-amqp [Contributor's Guidelines](https://github.com/spring-projects/spring-amqp/blob/master/CONTRIBUTING.adoc) for complete information about the necessary steps. ## Code Conventions and Housekeeping None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge. * Use the Spring Framework code format conventions (import `eclipse-code-formatter.xml` from the root of the project if you are using Eclipse). * Make sure all new .java files to have a simple Javadoc class comment with at least an @author tag identifying you, and preferably at least a paragraph on what the class is for. * Add the ASF license header comment to all new .java files (copy from existing files in the project) * Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes). * Add some Javadocs and, if you change the namespace, some XSD doc elements (Spring AMQP is not stellar in this area yet, but it will have to come up to scratch one day, so you will be helping a lot). * A few unit tests would help a lot as well - someone has to do it. * If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
0
javaee-samples/javaee8-samples
Java EE 8 Samples
beanvalidation cdi glassfish javaee javaee8 jsf json-b payara servlet servlets tomcat
# Java EE 8 Samples # This workspace consists of Java EE 8 Samples and unit tests. They are categorized in different directories, one for each Technology/JSR. Some samples/tests have documentation, otherwise read the code. ## How to run? ## Samples are tested on Payara, GlassFish and Tomcat using Arquillian. Arquillian uses container profiles to start up and deploy tests to individual containers. Only one container profile can be active at a given time, otherwise there will be dependency conflicts. These are the available container profiles: * Payara and GlassFish * ``payara-ci-managed`` This profile will install a Payara server and start up the server per sample. Useful for CI servers. The Payara version that's used can be set via the ``payara.version`` property. This is the default profile and does not have to be specified explicitly. * ``payara-micro-managed`` This profile will install Payara Micro and start up the jar per sample. Useful for CI servers. The Payara Micro version that's used can be set via the ``payara.micro.version`` property. * ``payara-remote`` This profile requires you to start up a Payara server outside of the build. Each sample will then reuse this instance to run the tests. Useful for development to avoid the server start up cost per sample. This profile supports for some tests to set the location where Payara is installed via the ``glassfishRemote_gfHome`` system property. E.g. ``-DglassfishRemote_gfHome=/opt/payara173`` This is used for sending asadmin commands to create container resources, such as users in an identity store. * ``glassfish-embedded`` This profile uses the GlassFish embedded server and runs in the same JVM as the TestClass. Useful for development, but has the downside of server startup per sample. * ``glassfish-remote`` This profile requires you to start up a GlassFish server outside of the build. Each sample will then reuse this instance to run the tests. Useful for development to avoid the server start up cost per sample. This profile supports for some tests to set the location where GlassFish is installed via the ``glassfishRemote_gfHome`` system property. E.g. ``-DglassfishRemote_gfHome=/opt/glassfish50`` This is used for sending asadmin commands to create container resources, such as users in an identity store. * Tomcat * ``tomcat-remote`` This profile requires you to start up a plain Tomcat 9 server outside of the build. Each sample will then reuse this instance to run the tests. Tomcat supports samples that make use of Servlet, JSP, Expression Language (EL), WebSocket and JASPIC. This profile requires you to enable JMX in Tomcat. This can be done by adding the following to ``[tomcat home]/bin/catalina.sh``: ``` JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote=true " JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false " JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false" JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=localhost " ``` This profile also requires you to set a username (``tomcat``) and password (``manager``) for the management application in ``tomcat-users.xml``. See the file ``test-utils/src/main/resources/tomcat-users.xml`` in this repository for a full example. Be aware that this should *only* be done for a Tomcat instance that's used exclusively for testing, as the above will make the Tomcat installation **totally insecure!** * ``tomcat-ci-managed`` This profile will install a Tomcat server and start up the server per sample. Useful for CI servers. The Tomcat version that's used can be set via the ``tomcat.version`` property. The containers that download and install a server (the \*-ci-managed profiles) allow you to override the version used, e.g.: * `-Dpayara.version=5.0.0.174` This will change the version from the current one (e.g 5.0.0.172) to 5.0.0.173 for Payara testing purposes. * `-Dglassfish.version=5.0` This will change the version from the current one (e.g 5.1.1) to 5.0 for GlassFish testing purposes. **To run them in the console do**: 1. In the terminal, ``mvn test -fae`` at the top-level directory to start the tests for the default profile. When developing and runing them from IDE, remember to activate the profile before running the test. To learn more about Arquillian please refer to the [Arquillian Guides](http://arquillian.org/guides/) **To run only a subset of the tests do at the top-level directory**: 1. Install top level dependencies: ``mvn clean install -pl "test-utils" -am`` 1. cd into desired module, e.g.: ``cd cdi`` 1. Run tests against desired server, e.g.: ``mvn clean test -P glassfish-ci-managed`` ## How to contribute ## With your help we can improve this set of samples, learn from each other and grow the community full of passionate people who care about the technology, innovation and code quality. Every contribution matters! There is just a bunch of things you should keep in mind before sending a pull request, so we can easily get all the new things incorporated into the master branch. Standard tests are jUnit based. Test classes naming must comply with surefire naming standards `**/*Test.java`, `**/*Test*.java` or `**/*TestCase.java`. For the sake of clarity and consistency, and to minimize the upfront complexity, we prefer standard jUnit tests using Java, with as additional helpers HtmlUnit, Hamcrest and of course Arquillian. Please don't use alternatives for these technologies. If any new dependency has to be introduced into this project it should provide something that's not covered by these existing dependencies. ### Some coding principles ### * When creating new source file do not put (or copy) any license header, as we use top-level license (MIT) for each and every file in this repository. * Please follow JBoss Community code formatting profile as defined in the [jboss/ide-config](https://github.com/jboss/ide-config#readme) repository. The details are explained there, as well as configurations for Eclipse, IntelliJ and NetBeans. ### Small Git tips ### * Make sure your [fork](https://help.github.com/articles/fork-a-repo) is always up-to-date. Simply run ``git pull upstream master`` and you are ready to hack. * When developing new features please create a feature branch so that we incorporate your changes smoothly. It's also convenient for you as you could work on few things in parallel ;) In order to create a feature branch and switch to it in one swoop you can use ``git checkout -b my_new_cool_feature`` That's it! Welcome in the community! ## CI Job ## CI jobs are executed by [Travis](https://travis-ci.org/javaee-samples/javaee8-samples). Note that by the very nature of the samples provided here it's perfectly normal that not all tests pass. This normally would indicate a bug in the server on which the samples are executed. If you think it's really the test that's faulty, then please submit an issue or provide a PR with a fix. ## Run each sample in Docker * Install Docker client from http://boot2docker.io * Build the sample that you want to run as ``mvn clean package -DskipTests`` For example: (note the exact module doens't exist yet, wip here) ``mvn -f jaxrs/jaxrs-client/pom.xml clean package -DskipTests`` * Change the second line in ``Dockerfile`` to specify the location of the generated WAR file * Run boot2docker and give the command ``docker build -it -p 80:8080 javaee8-sample`` * In a different shell, find out the IP address of the running container as: ``boot2docker ip`` * Access the sample as http://IP_ADDRESS:80/jaxrs-client/webresources/persons. The exact URL would differ based upon the sample.
0
spring-cloud-samples/spring-cloud-contract-samples
Samples for Spring Cloud Contract project
null
null
0
heibaiying/spring-samples-for-all
spring、spring-boot、spring-cloud 常用整合用例
dubbo eureka hystrix kafka mongodb mybatis openfeign rabbitmq redis ribbon spring-sample springboot-sample springcloud-demo websocket zipkin zuul
# Spring-Samples-For-All ![spring](https://img.shields.io/badge/spring-5.1.3.RELEASE-brightgreen.svg) ![springboot](https://img.shields.io/badge/springboot-2.1.1.RELEASE-brightgreen.svg) ![springcloud](https://img.shields.io/badge/springcloud-Finchley.SR2-brightgreen.svg) ![jdk](https://img.shields.io/badge/jdk->=1.8-blue.svg) ![author](https://img.shields.io/badge/author-heibaiying-orange.svg) 本项目仓库提供 spring、spring-boot、spring-cloud 的常用整合用例。**每个用例都提供详细的图文说明**,并给出官方文档的具体链接作为参考。随着 spring 的迭代,本仓库会持续更新,升级版本和丰富用例。 **版本说明**: spring: 5.1.3.RELEASE spring-boot:2.1.1.RELEASE spring-cloud:Finchley.SR2 <br/> >:star::star::star:**对大数据技术栈感兴趣的小伙伴可以关注我的新仓库:[大数据入门指南](https://github.com/heibaiying/BigData-Notes)** ## 1. spring samples 所有 spring 的项目我都会提供两个版本的 sample: - 一个版本是基于 xml 配置,也就是最为常见的配置方式; - 另一个版本完全基于代码配置(项目以**annotation**结尾),这也是目前 spring 官方推荐的更为灵活配置方法,也方便更好的衔接 spring boot 的配置。 | samples | 描述 | 官方文档 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [springmvc-base](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/springmvc-base)<br/>[springmvc-base-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/springmvc-base-annotation) | springmvc 基础、参数绑定、格式转换、数据校验、<br/>异常处理、 文件上传下载、视图渲染 | [Spring Mvc ](https://docs.spring.io/spring/docs/5.1.3.RELEASE/spring-framework-reference/web.html#mvc) | | [spring-aop](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-aop)<br/>[spring-aop-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-aop-annotation) | spring 切面编程 | [Spring AOP](https://docs.spring.io/spring/docs/5.1.3.RELEASE/spring-framework-reference/core.html#aop) | | [spring-jdbc](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-jdbc)<br/>[spring-jdbc-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-jdbc-annotation) | spring jdbc-template 的使用 | [Using JdbcTemplate](https://docs.spring.io/spring/docs/5.1.3.RELEASE/spring-framework-reference/data-access.html#jdbc-JdbcTemplate) | | [spring-mybatis](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-mybatis)<br/>[spring-mybatis-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-mybatis-annotation) | spring 整合 mybatis | [Mybatis-Spring](http://www.mybatis.org/spring/zh/index.html) | | [spring-druid-mybatis](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-druid-mybatis)<br/>[spring-druid-mybatis-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-druid-mybatis-annotation) | spring 整合 druid、mybatis | [Alibaba druid](https://github.com/alibaba/druid/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98) | | [spring-redis](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-redis)<br/>[spring-redis-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-redis-annotation) | spring 整合 redis 单机 + 集群(jedis 客户端)<br/>spring 整合 redis 单机 + 集群(redisson 客户端) | [Redisson](https://github.com/redisson/redisson/wiki/%E7%9B%AE%E5%BD%95) | | [spring-mongodb](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-mongodb)<br/>[spring-mongodb-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-mongodb-annotation) | spring 整合 mongodb | [Spring Data MongoDB](https://docs.spring.io/spring-data/mongodb/docs/2.1.3.RELEASE/reference/html/#mongo.mongo-db-factory-java) | | [spring-memcached](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-memcached)<br/>[spring-memcached-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-memcached-annotation) | spring 整合 memcached(单机 + 集群) | [Xmemcached](https://github.com/killme2008/xmemcached/wiki/Xmemcached%20%E4%B8%AD%E6%96%87%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97) | | [spring-rabbitmq](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-rabbitmq)<br/>[spring-rabbitmq-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-rabbitmq-annotation) | spring 整合 rabbitmq、消息序列化与反序列化 | [Rabbitmq](http://www.rabbitmq.com/getstarted.html)<br>[Spring AMQP](https://docs.spring.io/spring-amqp/docs/2.1.3.BUILD-SNAPSHOT/reference/html/) | | [spring-dubbo](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-dubbo)<br/>[spring-dubbo-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-dubbo-annotation) | spring 整合 dubbo | [Dubbo ](http://dubbo.apache.org/zh-cn/docs/user/quick-start.html) | | [spring-websocket](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-websocket)<br/>[spring-websocket-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-websocket-annotation) | spring 整合 websocket | [Spring Websocket](https://docs.spring.io/spring/docs/5.1.3.RELEASE/spring-framework-reference/web.html#websocket) | | [spring-mail](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-email) <br/>[spring-mail-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-email-annotation) | spring 普通文本邮件、附件邮件、模板邮件 | [Spring Email](https://docs.spring.io/spring/docs/5.1.3.RELEASE/spring-framework-reference/integration.html#mail) | | [spring-scheduling](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-scheduling)<br/>[spring-scheduling-annotation](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring/spring-scheduling-annotation) | spring 定时任务 | [Task Execution and Scheduling](https://docs.spring.io/spring/docs/5.1.3.RELEASE/spring-framework-reference/integration.html#scheduling) | <br/> ## 2. spring-boot samples | samples | 描述 | 官方文档 | | ------------------------------------------------------------ | ------------------------------------------ | ------------------------------------------------------------ | | [spring-boot-base](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-base) | spring-boot 基础 | [spring boot 官方文档](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/)<br>[spring boot 中文官方文档](https://www.breakyizhan.com/springboot/3028.html) | | [spring-boot-yml-profile](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-yml-profile) | yml 语法和多配置切换 | [Using YAML Instead of Properties](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-external-config-yaml) | | [spring-boot-tomcat](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-tomcat) | spring-boot 整合外部容器(tomcat) | [Use Another Web Server](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#howto-use-another-web-server) | | [spring-boot-servlet](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-servlet) | spring boot 整合 servlet 3.0 | [Embedded Servlet Container Support](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-embedded-container) | | [spring-boot-jsp](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-jsp) | spring-boot 整合 jsp(内置容器) | [JSP Limitations](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-jsp-limitations) | | [spring-boot-data-jpa](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-data-jpa) | spring-boot data jpa 的使用 | [Spring Data JPA](https://docs.spring.io/spring-data/jpa/docs/2.1.3.RELEASE/reference/html/) | | [spring-boot-mybatis](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-mybatis) | spring-boot+HikariDataSources 整合 mybatis | [Mybatis-Spring](http://www.mybatis.org/spring/zh/index.html)<br/>[Mybatis-Spring-Boot-Autoconfigure](http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/) | | [spring-boot-druid-mybtais](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-druid-mybatis) | spring-boot 整合 druid、mybatis | [Alibaba druid](https://github.com/alibaba/druid/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)<br/>[druid-spring-boot-starter](https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter) | | [spring-boot-redis](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-redis) | spring-boot 整合 redis | [Working with NoSQL Technologies](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-nosql) | | [spring-boot-mongodb](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-mongodb) | spring-boot 整合 mongodb | [Working with NoSQL Technologies](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-nosql) | | [spring-boot-memcached](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-memcached) | spring-boot 整合 memcached | [Xmemcached](https://github.com/killme2008/xmemcached/wiki/Xmemcached%20%E4%B8%AD%E6%96%87%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97) | | [spring-boot-rabbitmq](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-rabbitmq) | spring-boot 整合 rabbitmq | [RabbitMQ support](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-rabbitmq) | | [spring-boot-dubbo](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-dubbo) | spring-boot 整合 dubbo | [Dubbo ](http://dubbo.apache.org/zh-cn/docs/user/quick-start.html) | | [spring-boot-websocket](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-websocket) | spring-boot 整合 websocket | [Using @ServerEndpoint](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#howto-create-websocket-endpoints-using-serverendpoint) | | [spring-boot-kafka](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-kafka) | spring-boot 整合 kafka | [Apache Kafka Support](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-kafka) | | [spring-boot-actuator](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-actuator) | actuator + Hyperic SIGAR 应用信息监控 | [Spring Boot Actuator](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#production-ready) | | [spring-boot-swagger2](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/spring-boot-swagger2) | spring-boot 集成 Swagger2 打造在线接口文档 | [Springfox Reference Documentation](http://springfox.github.io/springfox/docs/current/) | <br/> ## 3. spring-cloud samples | samples | 描述 | 官方文档 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [spring-cloud-Eureka](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-eureka) | Eureka 服务的注册和发现 | [Service Discovery: Eureka Server](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi_spring-cloud-eureka-server.html) | | [spring-cloud-Eureka-cluster](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-eureka-cluster) | Eureka 高可用集群搭建 | [Service Discovery: Eureka Server](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi_spring-cloud-eureka-server.html) | | [spring-cloud-Ribbon](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-ribbon) | Ribbon 客户端负载均衡<br/>RestTemplate 服务远程调用 | [Client Side Load Balancer: Ribbon](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi_spring-cloud-ribbon.html) | | [spring-cloud-OpenFeign](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-feign) | OpenFeign 声明式服务调用、服务容错处理 | [Declarative REST Client: Feign](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi_spring-cloud-feign.html) | | [spring-cloud-Hystrix](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-hystrix) | Hystix 服务容错保护<br/>hystrix dashboard 断路器监控<br>Turbine 断路器聚合监控 | [Circuit Breaker: Hystrix Clients](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi__circuit_breaker_hystrix_clients.html)<br/>[Hystrix metrics aggregation with Turbine](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi_spring-cloud-consul-turbine.html) | | [spring-cloud-Zuul](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-zuul) | Zuul 网关服务 | [Router and Filter: Zuul](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi__router_and_filter_zuul.html) | | [spring-cloud-Sleuth-Zipkin](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-sleuth-zipkin) | Sleuth + Zipkin 服务链路追踪 | [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi__introduction.html#sleuth-adding-project) | | [spring-cloud-Config-Bus](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-cloud/spring-cloud-config) | Config 分布式配置中心 <br>集成 Bus 消息总线 实现配置热更新 | [Spring Cloud Config Client](https://cloud.spring.io/spring-cloud-static/Finchley.SR2/multi/multi__spring_cloud_config_client.html) | <br/> ## 4.spring分布式session和分布式事务 | sample | 描述 | 官方文档 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | [spring-session](https://github.com/heibaiying/spring-samples-for-all/tree/master/distributed-solution/spring-session) | spring 实现分布式 session | [spring session](https://spring.io/projects/spring-session#learn) | | [spring boot + spring session](https://github.com/heibaiying/spring-samples-for-all/tree/master/distributed-solution/spring-boot-session) | spring boot + spring session 实现分布式 session | [spring session](https://spring.io/projects/spring-session#learn) | | [springboot-druid-mybatis-atomikos](https://github.com/heibaiying/spring-samples-for-all/tree/master/spring-boot/springboot-druid-mybatis-multi) | spring boot + druid + mybatis + atomikos<BR> 配置多数据源、支持分布式事务 ( JTA 方式实现) | [Distributed Transactions with JTA](https://docs.spring.io/spring-boot/docs/2.1.2.RELEASE/reference/htmlsingle/#boot-features-jta) | <br/> ## 5.参考资料 相关参考文档放在了仓库的 referenced documents 目录下,文件目录如下: - Servlet3.1 规范(最终版).pdf - Thymeleaf 中⽂参考⼿册.pdf <br> <div align="center"> <a href = "https://blog.csdn.net/m0_37809146"> <img width="200px" src="https://gitee.com/heibaiying/BigData-Notes/raw/master/pictures/blog-logo.png"/> </a> </div> <div align="center"> <a href = "https://blog.csdn.net/m0_37809146"> 欢迎关注我的博客:https://blog.csdn.net/m0_37809146</a> </div>
0
gupaoedu-tom/netty4-samples
《Netty4核心原理与手写RPC框架实战》随书代码示例工程
null
# 《Netty4核心原理与手写RPC框架实战》 ### 京东购买链接:[https://item.jd.com/12829724.html](https://item.jd.com/12829724.html) ### 当当购买链接:[http://product.dangdang.com/28528192.html](http://product.dangdang.com/28528192.html) 在互联网分布式系统的推动下,Netty是作为一个能够支撑高性能高并发的底层网络通信框架而存在。Netty底层是基于Java NIO来实现的,对NIO进行了非常多的优化,因此深受广大开发者尤其是一线大厂开发者的青睐。 作为一个Java开发人员,如果没有研究过Netty,那么你对Java语言的使用和理解仅仅停留在表面,会点SSH,写几个MVC,访问数据库和缓存,这些只是初级Java程序员干的事。如果你要进阶,想了解Java服务器的深层高阶知识,Netty是一个必须要跨越的门槛。学会了Netty,你可以实现自己的HTTP服务器、FTP服务器、UDP服务器、RPC服务器、WebSocket服务器、Redis的Proxy服务器、MySQL的Proxy服务器等。 ★如果你想知道Nginx是怎么写出来的, ★如果你想知道Tomcat和Jetty是如何实现的, ★如果你也想实现一个简单的Redis服务器, ...... 那都应该好好研究一下Netty,它们高性能的原理都是类似的。 因为Netty5.x版本已被官方弃用,本书内容基于Netty 4版本来分析其核心原理,培养高级程序员自己造轮子的能力。全书不仅讲述理论知识,并且围绕能够落地的实战场景,开创手写源码的学习方式,使读者学习源码更加高效。本书主要特色是首次提供了基于Netty手写RPC框架,基于Netty手写消息推送系统等实战案例。 # 关于我 ### 为什么说我来自文艺界?   我自幼爱好书法和美术,长了一双能书会画的手,而且手指又长又白,因此以前的艺名叫“玉手藝人”。中学期间,曾获市级书法竞赛一等奖,校园美术竞赛一等奖,校园征文比赛二等奖。担任过学生会宣传部长,负责校园黑板报、校园刊物的编辑、排版、设计。   2008年参加工作后,做过家具建模、平面设计等工作,亲自设计了咕泡学院的Logo。做讲师之后,给自己起了一个跟姓氏谐音的英文名字“Tom”,江湖人称“编程界写字写得最好的、书法界编程最牛的文艺汤”。 ### 我的技术生涯   我的IT技术生涯应该算是从2009年开始的,在此之前做过UI设计,做过前端网页,到2009年才真正开始参与Java后台开发。在这里要感谢所有帮助过我入门编程的同事和老师。从2010年至2014年担任过项目组长、项目经理、架构师、技术总监,对很多的开源框架建立了自己的独特见解。我会习惯性地用形象思维来理解抽象世界。譬如:看到二进制0和1,我会想到《周易》中的两仪——阴和阳;看到颜色值用RGB表示,我会想到美术理论中的太阳光折射三原色;下班回家看到炒菜流程,我会想到模板方法模式;坐公交车看到学生卡、老人卡、爱心卡,我会想到策略模式;等等。大家看到的这本书,很多地方都融入了这种形象思维。 ### 为什么写书?   自2019年《Spring 5核心原理与30个类手写实战》出版以来,深受广大读者喜爱,有些学员将此书作为学习的参考教材。为继续满足大家对技术的追求,借此机会将本人多年对Netty的研究笔记整理成书奉献给各位“汤粉”。 在此,特别感谢责任编辑董英、李秀英及电子社的团队成员的付出,尤其在疫情期间,即使是远程办公也同样坚守岗位审稿至深夜。 # 技术交流 ![关注公众号Tom弹架构](https://user-images.githubusercontent.com/54272541/139790847-bbcccc8c-cd5e-4bdc-9b1b-bc923a9d4d99.png) ### 推荐《[Spring5核心原理与30个类手写实战](https://github.com/gupaoedu-tom/spring5-samples)》,4个月销量破万,连续占据畅销榜。 ### 推荐《[设计模式就该这样学](https://github.com/gupaoedu-tom/design-samples)》已全面开启预售!!!
0
spring-cloud/spring-cloud-dataflow-samples
Sample starter applications and code for use with the Spring Cloud Data Flow project
null
null
1
dapr/quickstarts
Dapr quickstart code samples and tutorials showcasing core Dapr capabilities
null
# Dapr Quickstarts and Tutorials [![Build Status](https://github.com/dapr/quickstarts/workflows/samples/badge.svg?event=push&branch=master)](https://github.com/dapr/quickstarts/actions?workflow=samples) [![Discord](https://img.shields.io/discord/778680217417809931)](https://discord.com/channels/778680217417809931/778680217417809934) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache-yellow.svg)](https://www.apache.org/licenses/LICENSE-2.0) If you are new to Dapr and haven't done so already, it is recommended you go through the Dapr [Getting Started](https://docs.dapr.io/getting-started/install-dapr-cli/) instructions. ### Quickstarts Pick a building block API (for example, PubSub, state management, etc) and rapidly try it out in your favorite language SDK (recommended), or via HTTP. Visit the [Dapr Docs Quickstarts Guide](https://docs.dapr.io/getting-started/quickstarts/) for a comprehensive walkthrough of each example. | Dapr Quickstart | Description | |:--------:|:--------:| | [Publish and Subscribe](./pub_sub) | Asynchronous communication between two services using messaging | | [Service Invocation](./service_invocation) | Synchronous communication between two services using HTTP | | [State Management](./state_management/) | Store a service's data as key/value pairs in supported state stores | | [Bindings](./bindings/) | Work with external systems using input bindings to respond to events and output bindings to call operations | | [Secrets Management](./secrets_management/) | Securely fetch secrets | | [Actors](./actors) | Create stateful, long running objects with identity | | [Configuration](./configuration) | Get configuration items as key/value pairs or subscribe to changes whenever a configuration item changes | | [Cryptography](./cryptography) | Perform cryptographic operations without exposing keys to your application | | [Resiliency](./resiliency) | Define and apply fault-tolerant policies (retries/back-offs, timeouts and circuit breakers) to your Dapr API requests | | [Workflow](./workflows) | Dapr Workflow enables you to create long running, fault-tolerant, stateful applications | ### Tutorials Go deeper into a topic or scenario, oftentimes using building block APIs together to solve problems (for example, build a distributed calculator, build and deploy an app to Kubernetes). | Tutorials | Description | |------|------| | [Hello-world](./tutorials/hello-world) | Demonstrates how to run Dapr locally. Highlights service invocation and state management. | | [Hello-kubernetes](./tutorials/hello-kubernetes) | Demonstrates how to run Dapr in Kubernetes. Highlights service invocation and state management. | | [Distributed-calculator](./tutorials/distributed-calculator) | Demonstrates a distributed calculator application that uses Dapr services to power a React web app. Highlights polyglot (multi-language) programming, service invocation and state management. | | [Pub-sub](./tutorials/pub-sub) | Demonstrates how to use Dapr to enable pub-sub applications. Uses Redis as a pub-sub component. | | [Bindings](./tutorials/bindings) | Demonstrates how to use Dapr to create input and output bindings to other components. Uses bindings to Kafka.| | [Observability](./tutorials/observability) | Demonstrates Dapr tracing capabilities. Uses Zipkin as a tracing component. | | [Secret Store](./tutorials/secretstore) | Demonstrates the use of Dapr Secrets API to access secret stores. | ## Code of Conduct Please refer to our [Dapr Community Code of Conduct](https://github.com/dapr/community/blob/master/CODE-OF-CONDUCT.md)
0
lenve/oauth2-samples
null
null
# oauth2-samples ### 跟着松哥学 Spring Cloud Security OAuth2 扫码加微信(微信ID:**a_java_boy2**),备注 OAuth2,进群讨论。 ![微信ID:a_java_boy2](https://user-images.githubusercontent.com/6023444/75459026-ba70d500-59b9-11ea-8cbd-3d5889f356c4.png) #### 本仓库所有 Demo 都有配套文章 |Demo|文章| |:---|:---| |authorization_code|[这个案例写出来,还怕跟面试官扯不明白 OAuth2 登录流程?](https://mp.weixin.qq.com/s/GXMQI59U6uzmS-C0WQ5iUw)| |client_credentials|[死磕 OAuth2,教练我要学全套的!](https://mp.weixin.qq.com/s/33Oxu6YMjwco3WRE07_IiQ)| |implicit|[死磕 OAuth2,教练我要学全套的!](https://mp.weixin.qq.com/s/33Oxu6YMjwco3WRE07_IiQ)| |password|[死磕 OAuth2,教练我要学全套的!](https://mp.weixin.qq.com/s/33Oxu6YMjwco3WRE07_IiQ)| |authorization_code_redis|[OAuth2 令牌还能存入 Redis ?越玩越溜!](https://mp.weixin.qq.com/s/cGopy8hDPtkn8Q7HUYabbA)| |jwt|[想让 OAuth2 和 JWT 在一起愉快玩耍?请看松哥的表演](https://mp.weixin.qq.com/s/xEIWTduDqQuGL7lfiP735w)| |oauth2-sso|[Spring Boot+OAuth2,一个注解搞定单点登录!](https://mp.weixin.qq.com/s/EyAMTbKPqNNnEtZACIsMVw)| |github_login|[分分钟让自己的网站接入 GitHub 第三方登录功能](https://mp.weixin.qq.com/s/tq4Q306J3hJFEtGL1EpOBA)| ### 案例配套视频(付费) 链接:https://pan.baidu.com/s/184jGNKlrDYkdqRS8igYL_Q 密码:1tgf 付费视频介绍:[Spring Boot + Vue 系列视频教程](https://mp.weixin.qq.com/s/1k4CZ6_re11fQM_6_00jCw)
0
EventStore/samples
Samples showing practical aspect of EventStoreDB, Event Sourcing
cqrs database event-sourcing eventstore eventstoredb samples
# EventStoreDB samples [EventStoreDB](https://www.eventstore.com/) is an industrial-strength database technology used for event-sourcing. It is open source and runs on most platforms or as SaaS in [Event Store Cloud](https://www.eventstore.com/event-store-cloud). This repository provides practical samples that demonstrate features of [EventStoreDB](https://www.eventstore.com/) and its client SDKs. Common operations and samples are in the [client repositories](https://github.com/EventStore?q=EventStore+Client) ## Contributing Feel free to [create a GitHub issue](https://github.com/EventStore/samples/issues/new) if you have any questions or request for more explanation or samples. We're open to any contribution! If you noticed some inconsistency, missing piece, or you'd like to extend existing samples - we're happy to [get your Pull Request](https://github.com/EventStore/samples/compare). Read more in the [Contribution Guidelines](./CONTRIBUTING.md) ## Samples Samples are organized by topics in dedicated directories by programming languages/environments. ### Quickstart Quickstart guides have been created that show you how to stand up a sample Hello World application that appends to and reads from a stream in EventStoreDB. Find the sample for your preferred client language below: - .NET: [ASP.NET Core sample](/Quickstart/Dotnet/esdb-sample-dotnet) - Go: [Gin sample](/Quickstart/Go/esdb-sample-go) - Java: [Spring Boot sample](Quickstart/Java/esdb-sample-springboot) - Node.js: [Express.js sample](/Quickstart/Nodejs/esdb-sample-nodejs) - Python: [Flask sample](/Quickstart/Python/esdb-sample-python) - Rust: [Rocket sample](/Quickstart/Rust/esdb-sample-rust) ### **[CQRS flow](./CQRS_Flow/)** - [.NET](./CQRS_Flow/Dotnet/) **Description**: - Demonstrates typical event sourcing with CQRS flow - Stores events in EventStoreDB - Shows how to handle the write model and read model - Builds read models using [Subscription to `$all`](https://developers.eventstore.com/clients/grpc/subscribing-to-streams/#subscribing-to-all) - Shows how to store read models as ElasticSearch documents - Shows how to write unit and integration tests - [Java](./CQRS_Flow/Java/) **Description**: - Demonstrates typical event sourcing with CQRS flow - Stores events in EventStoreDB - Shows how to handle the write model and read model - Builds read models using [Subscription to `$all`](https://developers.eventstore.com/clients/grpc/subscribing-to-streams/#subscribing-to-all) - Shows how to store read models as Postgres documents - Shows how to write unit and integration tests The examples show 2 variations of handling business logic: - [Aggregate pattern](./CQRS_Flow/Java/event-sourcing-esdb-aggregates) - [Command handlers as pure functions](./CQRS_Flow/Java/event-sourcing-esdb-simple) ### **[Crypto Shredding](./Crypto_Shredding/)** - [.NET](./Crypto_Shredding/Dotnet/) **Description**: - Shows how to protect sensitive data (e.g. for [European General Data Protection Regulation](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation)) in Event-Sourced Systems. - Shows how to use the .NET `System.Security.Cryptography` library with [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) algorithm to encrypt and decrypt events' data. - Stores events in EventStoreDB ### **[Sending EventStoreDB logs to Elasticsearch](./Logging/Elastic/)** **Description** These samples show how to configure various ways of sending logs from EventStoreDB to Elasticsearch: - [Logstash](./Logging/Elastic/Logstash/), - [Filebeat](./Logging/Elastic/Filebeat/), - [FilebeatWithLogstash](./Logging/Elastic/FilebeatWithLogstash/) ## Running samples locally Check the `README.md` file in the specific sample folder for detailed instructions. ## Support Information on EventStoreDB support: https://eventstore.com/support/. EventStoreDB Documentation: https://developers.eventstore.com/
0
gmazza/blog-samples
Source code for the tutorials on my blog.
null
blog-samples ============ This download holds the source code for tutorials in my blog listed at https://glenmazza.net/blog/entry/blog-index. Use at own risk. :)
0
ehcache/ehcache3-samples
Some examples / tutorials on using Ehcache 3.
null
# Ehcache 3 Samples This repository contains examples of and tutorials about usage of Ehcache 3. ## Samples - 'basic' - demonstrates basic configuration and usage of Ehcache 3 - 'clustered' - demonstrates using distributed caching features with Terracotta server - 'jsr107' - demonstrates configuration through JSR-107 (JCache) - 'fullstack' - binding with Spring, Hibernate and Metrics using JSR-107 in a real application - 'scale-continuum' - live benchmark with different caching options - 'caching-still-matters' - code examples used for the "Caching Still Matters" conference
0
firebase/quickstart-java
Quickstart samples for Firebase Java Admin SDK
null
# Firebase Quickstarts for Java A collection of quickstart samples demonstrating the Firebase APIs using the Admin Java SDK. For more information, see https://firebase.google.com. ## How to make contributions? Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) ## License See [LICENSE](LICENSE) ## Build Status [![Build Status](https://travis-ci.org/firebase/quickstart-java.svg?branch=master)](https://travis-ci.org/firebase/quickstart-java)
0
pravega/pravega-samples
Sample Applications for Pravega.
data-streaming pravega sample-app streaming-data
# Pravega and Analytics Connectors Examples This repository contains code samples to demonstrate how developers can work with [Pravega](http://pravega.io). We also provide code samples to connect analytics engines such as [Flink](https://flink.apache.org/) and [Spark](http://spark.apache.org/) with Pravega as a storage substrate for data streams. We also provide samples for using new pravega schema registry with pravega applications. For more information on Pravega, we recommend to read the [documentation and the developer guide](http://pravega.io). # Repository Structure This repository is divided into sub-projects (`pravega-client-examples`, `flink-connector-examples`, `schema-registry-examples`, and `spark-connector-examples`), each one addressed to demonstrate a specific component. In these sub-projects, we provide a battery of simple code examples aimed at illustrating how a particular feature or API works. Moreover, we also include a `scenarios` folder that contains more complex applications as sub-projects, which show use-cases exploiting one or multiple components. > Hint: Have a look to the [terminology and concepts](http://pravega.io/docs/latest/terminology/) in Pravega. ## Pravega Client Examples | Example Name | Description | Language | | ------------- |:-----| :-----| | `gettingstarted` | Simple example of how to read/write from/to a Pravega `Stream`. | [Java](pravega-client-examples/src/main/java/io/pravega/example/gettingstarted) | `consolerw` | Application that allows users to work with `Stream`, `Transaction` and `StreamCut` APIs via CLI. | [Java](pravega-client-examples/src/main/java/io/pravega/example/consolerw) | `noop` | Example of how to add a simple callback executed upon a read event. | [Java](pravega-client-examples/src/main/java/io/pravega/example/noop) | `statesynchronizer` | Application that allows users to work with `StateSynchronizer` API via CLI. | [Java](pravega-client-examples/src/main/java/io/pravega/example/statesynchronizer) | `streamcuts` | Application examples demonstrating the use of `StreamCut`s via CLI. | [Java](pravega-client-examples/src/main/java/io/pravega/example/streamcuts) | `tables` | Application examples demonstrating the use of `KeyValueTable`s via CLI. | [Java](pravega-client-examples/src/main/java/io/pravega/example/tables) The related documentation and instructions are [here](pravega-client-examples). ## Flink Connector Examples | Example Name | Description | Language | | ------------- |:-----| :-----| | `wordcount` | Counting the words continuously from a Pravega `Stream` to demonstrate the usage of Flink connector for Pravega. | [Java](flink-connector-examples/src/main/java/io/pravega/example/flink/wordcount) | `primer` | This sample demonstrates Pravega "exactly-once" feature jointly with Flink checkpointing and exactly-once mode. | [Java](flink-connector-examples/src/main/java/io/pravega/example/flink/primer) | `streamcuts` | This sample demonstrates the use of Pravega StreamCuts in Flink applications. | [Java](flink-connector-examples/src/main/java/io/pravega/example/flink/streamcuts) The related documentation and instructions are [here](flink-connector-examples). ## Scenarios | Example Name | Description | Language | |----------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| :-----| | [`turbineheatsensor`](scenarios/turbine-heat-sensor) | It emulates parallel sensors producing temperature values (writers) and parallel consumers performing real-time statistics (readers) via Pravega client. | [Java](scenarios/turbine-heat-sensor/src/main/java/io/pravega/turbineheatsensor) | [`turbineheatprocessor`](scenarios/turbine-heat-processor) | A Flink streaming application for processing temperature data from a Pravega stream produced by the `turbineheatsensor` app. The application computes a daily summary of the temperature range observed on that day by each sensor. | [Java](scenarios/turbine-heat-processor/src/main/java/io/pravega/turbineheatprocessor), [Scala](scenarios/turbine-heat-processor/src/main/scala/io/pravega/turbineheatprocessor) | [`anomaly-detection`](scenarios/anomaly-detection) | A Flink streaming application for detecting anomalous input patterns using a finite-state machine. | [Java](scenarios/anomaly-detection/src/main/java/io/pravega/anomalydetection) | [`pravega-flink-connector-sql-samples`](scenarios/pravega-flink-connector-sql-samples) | Flink connector table api/sql samples. | [Java](scenarios/pravega-flink-connector-sql-samples/src/main/java/io/pravega/connectors.nytaxi) | [`pravega-flink-autoscaling`](scenarios/pravega-flink-autoscaling) | Demonstrates coordinated auto-scaling of Pravega streams and Flink task managers. This sample is build independently in its own folder. | [Java](scenarios/pravega-flink-autoscaling/) ## Schema Registry Examples The prerequisite for running Schema Registry Examples is to deploy Pravega and Schema Registry Service. For instructions to run pravga schema registry, please see instructions [here](https://github.com/pravega/schema-registry) | Example Name | Description | Language | | ------------- |:-----| :-----| | `Avro` | Samples for registering schema in avro format with registry service. Samples demonstrate how to use avro schemas and serializers for writing and reading data from pravega streams. | [Java](schema-registry-examples/src/main/java/io/pravega/schemaregistry/samples/avro) | `Protobuf` | Samples for registering schema in protobuf format with registry service. Samples demonstrate how to use protobuf schemas and serializers for writing and reading data from pravega streams. | [Java](schema-registry-examples/src/main/java/io/pravega/schemaregistry/samples/protobuf) | `Json` | Samples for registering schema in json format with registry service. Samples demonstrate how to use json schemas and serializers for writing and reading data from pravega streams. | [Java](schema-registry-examples/src/main/java/io/pravega/schemaregistry/samples/json) | `Multiple Formats` | Samples that demonstrate how to serialize data in different formats and write into same pravega stream. | [Java](schema-registry-examples/src/main/java/io/pravega/schemaregistry/samples/multiformatdemo) | `Codec` | Samples that demonstrate how to use additional codecs and share encoding information using schema registry service. This sample demonstrates using compression codecs for snappy and gzip. | [Java](schema-registry-examples/src/main/java/io/pravega/schemaregistry/samples/codec) The related documentation and instructions are [here](schema-registry-examples). ## Spark Connector Examples | Example Name | Description | Language | | ------------- |:-----| :-----| | `batch_file_to_pravega` | PySpark batch job that reads events from the file and writes to a Pravega stream | [Python](spark-connector-examples/src/main/python/batch_file_to_pravega.py) | `batch_pravega_to_console` | PySpark batch job that reads from a Pravega stream and writes to the console | [Python](spark-connector-examples/src/main/python/batch_pravega_to_console.py) | `stream_generated_data_to_pravega` | PySpark Streaming job that writes generated data to a Pravega stream | [Python](spark-connector-examples/src/main/python/stream_generated_data_to_pravega.py) | `stream_pravega_to_console` | PySpark Streaming job that reads from a Pravega stream and writes to the console | [Python](spark-connector-examples/src/main/python/stream_pravega_to_console.py) | `stream_bounded_pravega_to_console` | PySpark Streaming job that reads from a bounded Pravega stream and writes to the console | [Python](spark-connector-examples/src/main/python/stream_bounded_pravega_to_console.py) | `stream_pravega_to_pravega` | PySpark Streaming job that reads from a Pravega stream and writes to another Pravega stream | [Python](spark-connector-examples/src/main/python/stream_pravega_to_pravega.py) | `StreamPravegaToConsole` | Scala Spark Streaming job that reads from a Pravega stream and writes to the console | [Scala](spark-connector-examples/src/main/scala/io/pravega/example/spark/StreamPravegaToConsole.scala) | `StreamPravegaToPravega` | Scala Spark Streaming job that reads from a Pravega stream and writes to another Pravega stream | [Scala](spark-connector-examples/src/main/scala/io/pravega/example/spark/StreamPravegaToPravega.scala) The related documentation and instructions are [here](spark-connector-examples). ## Hadoop Connector Examples (_Retired: available up to Pravega Samples release 0.10_) | Example Name | Description | Language | | ------------- |:-----| :-----| | `wordcount` | Counts the words from a Pravega `Stream` filled with random text to demonstrate the usage of Hadoop connector for Pravega. | [Java](https://github.com/pravega/pravega-samples/tree/r0.10/hadoop-connector-examples/src/main/java/io/pravega/example/hadoop/wordcount) | `terasort` | Sort events from an input Pravega `Stream` and then write sorted events to one or more streams. | [Java](https://github.com/pravega/pravega-samples/tree/r0.10/hadoop-connector-examples/src/main/java/io/pravega/example/hadoop/terasort) The related documentation and instructions are [here](https://github.com/pravega/pravega-samples/tree/r0.10/hadoop-connector-examples). # Build Instructions Next, we provide instructions for building the `pravega-samples` repository. There are two main options: - _Out-of-the-box_: If you want a quick start, run the samples by building `pravega-samples` out-of-the-box (go straight to section `Pravega Samples Build Instructions`). - _Build from source_: If you want to have fun building the different projects from source, please read section `Building Pravega Components from Source (Optional)` before building `pravega-samples`. ## Pre-requisites * Java 11 * Python 3.8 (if you wish to run the python examples) ## Building Pravega Components from Source (Optional) ### Pravega Build Instructions If you want to build Pravega from source, you may need to generate the latest Pravega `jar` files and install them to your local Maven repository. To build Pravega from sources and use it here, please run the following commands: ``` $ git clone https://github.com/pravega/pravega.git $ cd pravega $ ./gradlew install ``` The above command should generate the required `jar` files into your local Maven repository. > Hint: For using in the sample applications the Pravega version you just built, you need to update the `pravegaVersion=<local_maven_pravega_version>` property in `gradle.properties` file of `pravega-samples`. For more information, please visit [Pravega](https://github.com/pravega/pravega). ### Flink Connector Build Instructions To build the Flink connector from source, follow the below steps to build and publish artifacts from source to local Maven repository: ``` $ git clone --recursive https://github.com/pravega/flink-connectors.git $ cd flink-connectors $ ./gradlew install ``` > Hint: For using in the sample applications the Flink connector version you just built, you need to update the `flinkConnectorVersion=<local_maven_flink_connector_version>` property in `gradle.properties` file of `pravega-samples`. For more information, please visit [Flink Connectors](https://github.com/pravega/flink-connectors). ### Schema Registry Build Instructions Schema registry uses pravega, so make sure pravega is installed and running before installing schema registry. To build Schema Registry from source, follow the below steps to build and publish artifacts from source to local Maven repository: ``` $ git clone https://github.com/pravega/schema-registry.git $ cd schema-registry $ ./gradlew install $ cd server/build/install/schema-registry $ # edit conf/schema-registry.config.properties to point to pravega URI (hint: if you are running pravega standalone, it would be tcp://localhost:9090) $ ./bin/schema-registry ``` For more information, please visit [Schema Registry](https://github.com/pravega/schema-registry). ### Configuring Pravega Samples for Running with Source Builds In the previous instructions, we noted that you will need to change the `gradle.properties` file in `pravega-samples` for using the Pravega components built from source. Here we provide an example of how to do so: 1) Imagine that we want to build Pravega from source. Let us assume that we executed `git clone https://github.com/pravega/pravega.git` and the last commit of `master` branch is `2990193xxx`. 2) After executing `./gradlew install`, we will see in our local Maven repository (e.g., `~/.m2/repository/io/pravega/*`) artifacts that contain in their names that commit version such as `0.3.0-1889.2990193-SNAPSHOT`. These artifacts are the result from building Pravega from source. 3) The only thing you have to do is to set `pravegaVersion=0.3.0-1889.2990193-SNAPSHOT` in the `gradle.properties` file of `pravega-samples`. While this example is for Pravega, the same procedure applies for Flink and Spark connectors. ## Pravega Samples Build Instructions The `pravega-samples` project is prepared for working out-of-the-box with [release artifacts](https://github.com/pravega/pravega/releases) of Pravega components, which are already available in Maven central. To build `pravega-samples` from source, use the built-in gradle wrapper as follows: ``` $ git clone https://github.com/pravega/pravega-samples.git $ cd pravega-samples $ ./gradlew clean installDist ``` That's it! You are good to go and execute the examples :) To ease their execution, most examples can be run either using the gradle wrapper (gradlew) or scripts. The above gradle command automatically creates the execution scripts that can be found under: ``` pravega-samples/pravega-client-examples/build/install/pravega-client-examples/bin ``` There is a Linux/Mac script and a Windows (.bat) script for each separate executable. _Working with `dev` branch_: If you are curious about the most recent sample applications, you may like to try the `dev` version of `pravega-samples` as well. To do so, just clone the `dev` branch instead of `master` (default): ``` $ git clone -b dev https://github.com/pravega/pravega-samples.git $ cd pravega-samples $ ./gradlew clean installDist ``` The `dev` branch works with Pravega snapshots artifacts published in our [JFrog repository](https://oss.jfrog.org/artifactory/jfrog-dependencies/io/pravega/) instead of using release versions. # Proposed Roadmap We propose a roadmap to proceed with the execution of examples based on their complexity: 1. [Pravega client examples](pravega-client-examples): First step to understand the basics of Pravega and exercise the concepts presented in the documentation. 2. [Flink connector examples](flink-connector-examples): These examples show the basic functionality of the Flink connector for Pravega. 3. [Spark connector examples](spark-connector-examples): These examples show the basic functionality of the Spark connector for Pravega. 4. [Scenarios](scenarios): Applications that go beyond the basic usage of Pravega APIs, which may include complex interactions between Pravega and analytics engines (e.g., Flink, Spark) to demonstrate analytics use cases. # Where to Find Help Documentation on Pravega and Analytics Connectors: * [Pravega.io](http://pravega.io/), [Pravega Wiki](https://github.com/pravega/pravega/wiki). * [Flink Connectors Wiki](https://github.com/pravega/flink-connectors/wiki). Did you find a problem or bug? * First, check our [FAQ](http://pravega.io/docs/latest/faq/). * If the FAQ does not help you, create a [new GitHub issue](https://github.com/pravega/pravega-samples/issues). Do you want to contribute a new example application? * Follow the [guidelines for contributors](https://github.com/pravega/pravega/wiki/Contributing). Have fun!!
1
web3j/sample-project-maven
Sample web3j Maven project
null
# web3j Sample Project This project provides a very simple starter application for working with web3j and the test Ethereum network (testnet) known as Rinkeby. The demo deploys a *hello world* smart contract which contains a greeting message. The current greeting message can be read and modified in the smart contract. In order to run this demo, three pieces of information are required: 1. Ethereum client (or node) endpoint. The simplest thing to do is [request a free access token](https://infura.io/register.html) from Infura. 2. A wallet file. This can be generated using the web3j [command line tools](https://docs.web3j.io/command_line.html) by running the command: 3. Some Ether. This can be requested from the [Rinkeby Faucet](https://www.rinkeby.io/#faucet). - To create a wallet file, run the command: ```aidl web3j wallet create ``` - You will be asked to secure your wallet with a password. You will have the option of choosing a destination directory for your wallet file. In the `Application.java` class under the package `org.web3j.sample`, on line `66-67` replace the placeholders with your wallet file password and directory path. - With the access token retrieved from Infura, on line `58` replace the placeholder in the url with your token. You can find this under the `Endpoint` section: ![Alt text](Artboard.png) Once these details have been added to the main Application class, you'll be good to go. ### Run the project - Make sure to be in the root directory - First we need to create the smart contracts deriving from the solidity file `Greeter.sol` by running: ```aidl mvn web3j:generate-sources ``` - This will create the Greeter and Mortal contract under the package `org.web3j.model` - Clean and build the project, run the command: ```aidl mvn install ``` This will also generate a jar file with all the dependencies which we will run once it has been created. - Run the `Main` method in `Application.java` by running ``` mvn exec:java ``` - Alternatively, you can run the `main` method in `Application.java` in your chosen IDE, e.g. `IntelliJ` ## Functionality This application demonstrates a number of core features of web3j and Ethereum: - Connecting to a node on the Ethereum network - Loading an Ethereum wallet file - Sending Ether from one address to another - Deploying a smart contract to the network - Reading a value from the deployed smart contract - Updating a value in the deployed smart contract - Viewing an event logged by the smart contract ## Background This application has purposefully been kept as simple as possible with the aim of demonstrating how to deploy and work with a smart contract on the decentralised Ethereum network. If you require further background information about the above configuration items for the project you can refer to the below. For a more comprehensive overview, I recommend you read the [Java Magazine Article](https://web3j.io/articles/web3j%20article%20-%20Java%20Magazine%20JanuaryFebruary%202017.pdf), watch the [YouTube](https://youtube.com/watch?v=ea3miXs_P6Y) talk, and read all of the [documentation](https://docs.web3j.io). ### Smart contracts The contained smart contract is based on the [Greeter contract example](https://www.ethereum.org/greeter), with the addition that the value stored in the Greeter can be modified. The associated Java smart contract wrapper is named Greeter. For more background on smart contracts, refer to the [smart contracts](https://docs.web3j.io/smart_contracts.html) section of the docs. ### Infura If you don't want to sign up to Infura, and would like to run a node yourself, there are instructions in the [getting started](https://docs.web3j.io/getting_started.html#start-a-client) section of the docs. ### Testnets For more information on the different Ethereum test networks (or testnets), refer to the [testnet overview](https://docs.web3j.io/transactions.html#ethereum-testnets) in the docs. ### Ether For background on Ether, refer to the transactions [overview](https://docs.web3j.io/transactions.html#transactions) section of the docs. ### Wallets and transaction signing For a more technical overview of working with wallet files, refer to the [Offline transaction signing](https://docs.web3j.io/transactions.html#offline-transaction-signing) section of the docs. ## Viewing requests A logback configuration is included in the project dependencies allowing the logging of protocol messages if required. To enable, simply change the following [line]() in the logback configuration to read: ```xml <logger name="org.web3j.protocol" level="DEBUG"/> ```
1
uber/cadence-java-samples
null
null
# Java Cadence Samples These samples demonstrate various capabilities of Java Cadence client and server. You can learn more about Cadence at: * [Cadence Service](https://github.com/uber/cadence) * [Cadence Java Client](https://github.com/uber/cadence-java-client) * [Go Cadence Client](https://github.com/uber-go/cadence-client) ## Overview of the Samples * **HelloWorld Samples** The following samples demonstrate: * **HelloActivity**: a single activity workflow * **HelloActivityRetry**: how to retry an activity * **HelloAsync**: how to call activities asynchronously and wait for them using Promises * **HelloAsyncLambda**: how to run part of a workflow asynchronously in a separate task (thread) * **HelloAsyncActivityCompletion**: an asynchronous activity implementation * **HelloChild**: a child workflow * **HelloException**: exception propagation and wrapping * **HelloQuery**: a query * **HelloSignal**: sending and handling a signal * **HelloPeriodic**: a sample workflow that executes an activity periodically forever * **HelloSearchAttributes**: how to use search attributes * **HelloCron**: a cron workflow * **FileProcessing** demonstrates task routing features. The sample workflow downloads a file, processes it, and uploads the result to a destination. The first activity can be picked up by any worker. However, the second and third activities must be executed on the same host as the first one. ## Get the Samples Run the following commands: git clone https://github.com/uber/cadence-java-samples cd cadence-java-samples ## Import into IntelliJ In the IntelliJ user interface, navigate to **File**->**New**->**Project from Existing Sources**. Select the cloned directory. In the **Import Project page**, select **Import project from external model**, choose **Gradle** and then click **Next**->**Finish**. ## Build the Samples ./gradlew build ## Run Cadence Server Run Cadence Server using Docker Compose: curl -O https://raw.githubusercontent.com/uber/cadence/master/docker/docker-compose.yml docker-compose up If this does not work, see the instructions for running Cadence Server at https://github.com/uber/cadence/blob/master/README.md. ## Register the Domain To register the *samples-domain* domain, run the following command once before running any samples: ./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomain Or using Cadence CLI: ``` cadence --domain samples-domain domain register ``` ## See Cadence UI The Cadence Server running in a docker container includes a Web UI. Connect to [http://localhost:8088](http://localhost:8088). Enter the *samples-domain* domain. You'll see a "No Results" page. After running any sample, change the filter in the top right corner from "Open" to "Closed" to see the list of the completed workflows. Click on a *RUN ID* of a workflow to see more details about it. Try different view formats to get a different level of details about the execution history. ## Install Cadence CLI [Command Line Interface Documentation](https://mfateev.github.io/cadence/docs/08_cli) ## Run the samples Each sample has specific requirements for running it. The following sections contain information about how to run each of the samples after you've built them using the preceding instructions. Don't forget to check unit tests found under src/test/java! ### Hello World To run the hello world samples: ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivity ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivityRetry ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsync ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsyncActivityCompletion ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsyncLambda ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloChild ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloException ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloPeriodic ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloQuery ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloSignal ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloSearchAttributes ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloCron ### File Processing This sample has two executables. Execute each command in a separate terminal window. The first command runs the worker that hosts the workflow and activities implementation. To demonstrate that activities execute together, we recommend that you run more than one instance of this worker. ./gradlew -q execute -PmainClass=com.uber.cadence.samples.fileprocessing.FileProcessingWorker The second command starts workflows. Each invocation starts a new workflow execution. ./gradlew -q execute -PmainClass=com.uber.cadence.samples.fileprocessing.FileProcessingStarter ### Trip Booking Cadence implementation of the [Camunda BPMN trip booking example](https://github.com/berndruecker/trip-booking-saga-java) Demonstrates Cadence approach to SAGA. To run: ./gradlew -q execute -PmainClass=com.uber.cadence.samples.bookingsaga.TripBookingSaga ### Sprint Boot Application Example of how to start a cadence worker service using Spring Boot Framework To run: # Start Cadence Server # see https://github.com/uber/cadence/tree/master/docker # register domain ./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomain ./gradlew -q execute -PmainClass=com.uber.cadence.samples.spring.CadenceSamplesApplication
0
opensagres/xdocreport.samples
XDocReport Samples
null
XDocReport Samples ================== [![Build Status](https://secure.travis-ci.org/opensagres/xdocreport.samples.png)](http://travis-ci.org/opensagres/xdocreport.samples)
0
habuma/spring-boot-in-action-samples
Example code from Spring Boot in Action
null
# Spring Boot in Action Sample Code This repository contains example code from Spring Boot in Action. In as much as is possible when writing compilable/verifiable code to be injected into a not-easily-verifiable work of prose, the code should be aligned with what was printed. There may be slight variations, however. This code will be tagged with FIRST_PRINTING to indicate that the code aligns with the first printing of the first edition of the book. This allows for further evolution of the code after publication while still maintaining a reference back to the code as it aligns with the printed book. Please feel free to offer suggestions in the form of pull requests if you see opportunity for improvement. And I'd certainly appreciate it if you'd please purchase a copy of _Spring Boot in Action_ ([Amazon](http://www.amazon.com/Spring-Boot-Action-Craig-Walls/dp/1617292540) | [Manning](https://www.manning.com/books/spring-boot-in-action) | [Barnes & Noble](http://www.barnesandnoble.com/w/spring-boot-in-action-craig-walls/1121907935)).
1
mduisenov/GrokkingAlgorithms
java samples of Grokking Algorithm book by Aditya Y. Bhargava
algorithms grokking grokking-algorithms grokkingalgorithms java
# GrokkingAlgorithms java samples of Grokking Algorithm book by Aditya Y. Bhargava
0
jimulabs/mirror-samples
Sample projects for jimu Mirror
null
mirror-samples ============== Sample projects for [Mirror](http://jimulabs.com). See README files in individual projects for more information.
1
sudar/pig-samples
Collection of Pig scripts that I use for my talks and workshops
null
pig-samples =========== Collection of Pig scripts that I use for my talks and workshops about Pig and Hadoop. ## Slides You can find the slides that I used from my [slideshare account](http://www.slideshare.net/Sudar/pig-workshop). You can also checkout, some of my [other talks](http://sudarmuthu.com/my-talks) as well. ## File list ### Pig files The following are the pig files that are present in this repository. - load-store.pig - Load and store example - multi-delimiter.pig - Explain how to load data using multiple delimiters - data-bag.pig - Explain the bag data structure - lookup.pig - Explains how to lookup to a particular column in a relation - group-by.pig - Explains how group up operator works - filter-by.pig - Demonstrates the filter by operator - count.pig - Demonstrates the count operator - order-by.pig - Demonstrates the order by operator - distinct.pig - Demonstrates the distinct operator - limit.pig - Demonstrates the LIMIT operator - join.pig - Demonstrates the JOIN operator - count-words.pig - Count the number of words in a text file - strip-quote.pig - Strips quotes from tweets. Demonstrates UDF - get-twitter-names.pig - Finds twitter usernames from tweets. Demonstrates UDF - from-vim.pig - Finds all tweets that were tweeted from Vim. Demonstrates Filter UDF functions - stream-shell-script.pig - Demonstrates how shell commands can be executed in Pig through Streaming - stream-python.pig - Streams data through a python script - strip.py - This python script would be invoked by Pig and the data will be streamed through it ### UDF directory The /udf directory contains the Java source code for the UDF that are consumed by the pig scripts. The following are the Java files that are present in this directory. - StripQuote.java - An Eval UDF function that strips quote from strings - GetTwitterNames.java - An Eval UDF function to get the twitter names in a tweet - FromVim.java - A filter UDF function ### Data directory The /data directory contains the data files that are used by these samples. The following are the files that are present in this directory. - dropbox-policy.txt - A copy of dropbox policy document. This file is used for doing word analysis. - tweets.csv - A dump of my tweets that I got from twitter. - data-bag.txt - A simple data file to explain bag data type - nested-schema.txt - A simple data file to explain nested data schemas - simple-tuples - A simple data file to explain simple tuples - multi-delimiter.txt - A simple data file that contains data that have multiple delimiters ### other files - clean.sh - A shell script to clean pig log files and output data files ## License The library and the example are released under released under BeerWare license. I would, however, consider it a great courtesy if you could email me and tell me about your project and how this code was used, just for my own continued personal gratification. ## Contributions All contributions (even documentation) are welcome :) If you would like to contribute to this project, then just fork it in github and send a pull request.
0
xpoft/vaadin-samples
null
null
Vaadin Samples ======================= ## Versions # Vaadin 7.6.x SpringVaadinIntegration 3.2.x VaadinSample 3.2.x # Vaadin 7.2.x SpringVaadinIntegration 3.x VaadinSample 3.x # Vaadin 7.1.x SpringVaadinIntegration 2.x VaadinSample 2.x ## Spring Vaadin Integration Sample project for SpringVaadinIntegration add-on. http://vaadin.com/addon/springvaadinintegration ~~~~ git clone git://github.com/xpoft/vaadin-samples.git vaadin-samples cd spring-integration mvn jetty:run ~~~~ Then open http://localhost:9090/ ## Spring Boot ~~~~ git clone git://github.com/xpoft/vaadin-samples.git vaadin-samples cd spring-boot mvn compile exec:java ~~~~ Then open http://localhost:9090/ ## Spring Security ~~~~ git clone git://github.com/xpoft/vaadin-samples.git vaadin-samples cd spring-security mvn jetty:run ~~~~ Then open http://localhost:9090/ ## Apache Shiro ~~~~ git clone git://github.com/xpoft/vaadin-samples.git vaadin-samples cd apache-shiro mvn jetty:run ~~~~ Then open http://localhost:9090/ ## Changes ### Vaadin beta10 #### Spring Security & Apache Shiro Added ErrorHandler instead of Terminal. Now you can't customize error page. Exception on UI action is more ugly.
0
lucid-lynxz/BlogSamples
博客/笔记中的demo
null
# BlogSamples 博客/笔记中的demo [TOC] ### VideoViewDemo 系统自带视频播放控件 VideoView的使用demo 包含特性: 获取帧视图作为封面,触摸滑动改变音量/亮度,全屏播放等 ### ExplandableListViewDemo 1. 基本使用,点击事件,懒加载图片等; 2. 将展开的group标题栏位置浮动在顶部,取自 [这篇博客](http://blog.csdn.net/h7870181/article/details/40400155); 3. [展开/收缩动画](https://github.com/idunnololz/AnimatedExpandableListView); 4. 三级列表的写法:嵌套一个自定义的Expandable,重写onMeasure即可,不然会不显示; ### WebViewDemo webView的基础使用: js/java代码互调,返回键回退,页面适应手机屏幕,读取cookie,远端调试webView页面... ### TextRelatedDemo 项目过程中碰到的相关问题汇总<br> * 简单的图文混排实现(Html.fromHtml / span); * 自定义控件圆圈文字的实现(主要是text居中的实现); ### SvgAnimationDemo 介绍了三种线条动画的写法
0
lkrnac/book-eiws-code-samples
Examples for book Pivotal Certified Spring Enterprise Integration Specialist Exam A Study Guide
null
[ ![Codeship Status for lkrnac/book-eiws-code-samples](https://codeship.com/projects/3d6d0a40-ae3f-0132-7ed9-2ecd9a04cc80/status?branch=master)](https://codeship.com/projects/68847) Examples for book **Pivotal Certified Spring Enterprise Integration Specialist Exam A Study Guide** http://www.apress.com/9781484207949 # More information http://lkrnac.net/blog/2015/10/enterprise-spring-examples-and-integration-tests # Build cd 0000-examples-parent mvn clean install cd ../0000-examples mvn clean install # Possible first time build error Error message: [ERROR] Failed to execute goal org.hornetq:hornetq-maven-plugin:1.2.0:start (start) on project 0501-jms11-jndi: Execution start of goal org.hornetq:hornetq-maven-plugin:1.2.0:start failed: A required class was missing while executing org.hornetq:hornetq-maven-plugin:1.2.0:start: org/slf4j/LoggerFactory Just continue build where it ended: mvn clean install -rf :0501-jms11-jndi
0
joshiste/spring-boot-admin-samples
Samples for Spring Boot Admin
null
spring-boot-admin-samples ================= This repository contains some examples using [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin). ## basic-auth This examples shows how to add basic auth credentials when accessing the client managment endpoints without exposing them to the user. Fixed credentials are used, which must be the same for every client application. Every user who gains access to the admin server, can acces all client applications. To implement this you simply need to add a [ZuulFilter](https://github.com/joshiste/spring-boot-admin-samples/blob/master/basic-auth/admin-server/src/main/java/com/github/joshiste/spring/boot/admin/samples/admin/BasicAuthFilter.java) which adds the authorization header. ## spring-session This examples uses spring session backed by redis to secure the admin server. The client application can decide whether the user has access or not. The code is basically taken from the great [Spring guide on using Spring Security and Angular JS](https://spring.io/guides/tutorials/spring-security-and-angular-js/#_the_api_gateway_pattern_angular_js_and_spring_security_part_iv). Only small changes are necessary from the tutorial to make this run with Spring Boot Admin. ## oauth2 This example shows how to secure your endpoints and the admin server using oauth2. The client application can decide wheter the user has access or not. The code is basically taken from the great [Spring guide on using Spring Security and Angular JS](https://spring.io/guides/tutorials/spring-security-and-angular-js/#_sso_with_oauth2_angular_js_and_spring_security_part_v) and only adapted so that the ui server becomes the admin server and the necessary security config to allow the health-checks.
0
kumuluz/kumuluzee-samples
KumuluzEE samples demonstrate how to get started using KumuluzEE microservice framework. They provide small, specific, working samples that can be used as a reference for your own projects.
cloud-native java javaee kumuluzee microprofile microservice-example microservices
# KumuluzEE Samples > These samples demonstrate how to get started using KumuluzEE microservice framework. They provide small, specific, working samples that can be used as a reference for your own projects. These samples and quickstarts contain several working projects that demonstrate how to use [KumuluzEE](https://github.com/kumuluz/kumuluzee) microservices. They also serve as test projects for the framework itself. We recommend that you go through some of these samples to get a better understanding of the framework and use them as a reference for your own projects. Keep in mind that while projects containing multiple microservices are located in the same repository in order to simplify things, is is often recommended that you separate microservices by repository as well. Samples will be constantly added over time. ## About The samples demonstrate many different use cases for using KumuluzEE to create self-sustaining microservices. The latest version of the samples will always use the latest version of the KumuluzEE framework. Therefore, it is recommended to use the latest version of the KumuluzEE framework for these samples. This way, you will also get all the latest features of the KumuluzEE. Refer to the usage section on how to build and run the samples. Some samples are tagged as well. The tags (eg. `v3.2.0`) will correspond to the KumuluzEE release version in order to easily access the desired version of the framework that is used in the examples. Tha `master` branch will always use the latest snapshot version of the framework and the latest samples. If you wish to use a snapshot version of KumuluzEE when running the samples, you must make sure you add the Sonatype snapshots repository to your `pom.xml`. The `master` branch already contains the repository as it's targeted against the snapshot version of the framework. ```xml <repositories> <repository> <id>sonatype-snapshots</id> <name>Sonatype Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> ``` The following samples are available (list might not be up-to-date; please refer to the actual list above): Tutorial: - Simple microservice tutorial (microservices-simple) - Cloud-native Java EE Microservices with KumuluzEE: REST service using config, discovery, security, metrics, logging and fault tolerance (tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security) Java EE samples: - Bean Validation - JAX-RS - JAX-WS - JPA and CDI - JSF - JSP and Servlet - Servlet - Websocket - REST service over HTTPS - Logging with JUL and KumuluzEE KumuluzEE extensions - samples: - KumuluzEE Config - KumuluzEE Config with etcd - KumuluzEE Config with Consul - KumuluzEE MicroProfile Config - KumuluzEE Discovery with etcd - KumuluzEE Discovery with Consul - KumuluzEE Logs with Log4j2 - KumuluzEE Logs with JUL - KumuluzEE REST - KumuluzEE Security with Keycloak for REST services - KumuluzEE Security with Keycloak for CDI - KumuluzEE Fault Tolerance - KumuluzEE Event Streaming with Kafka - KumuluzEE Cors - KumuluzEE Metrics - KumuluzEE Health - KumuluzEE AMQP - KumuluzEE Ethereum - KumuluzEE GraphQL - KumuluzEE gRPC - KumuluzEE OpenAPI - KumuluzEE OpenAPI MicroProfile - KumuluzEE Swagger - KumuluzEE OpenTracing - KumuluzEE Reactive - KumuluzEE Rest Client ## Requirements In order to run these examples as they are intended, you will need the following: 1. Java 8 (or newer), you can use any implementation: * If you have installed Java, you can check the version by typing the following in a command line: ``` java -version ``` 2. Maven 3.2.1 (or newer): * If you have installed Maven, you can check the version by typing the following in a command line: ``` mvn -version ``` 3. Git: * If you have installed Git, you can check the version by typing the following in a command line: ``` git --version ``` ## Usage 1. Clone the Git repository containing the examples: ``` git clone git@github.com:kumuluz/kumuluzee-samples.git ``` 2. Checkout the desired tagged version of the examples and the KumuluzEE framework (alternatively skip this step if you want the latest and greatest) ``` cd kumuluzee-samples git checkout v3.2.0 ``` To run a specific sample, please refer to the specific README file of the sample. Most of the time you either build and run it directly with a maven command or build Docker containers and run them. ## Changelog Recent changes can be viewed on Github on the [Releases Page](https://github.com/kumuluz/kumuluzee-samples/releases) ## Contribute See the [contributing docs](https://github.com/kumuluz/kumuluzee-samples/blob/master/CONTRIBUTING.md) When submitting an issue, please follow the [guidelines](https://github.com/kumuluz/kumuluzee-samples/blob/master/CONTRIBUTING.md#bugs). Issues related to KumuluzEE itself should be submitted at https://github.com/kumuluz/kumuluzee/issues. ## License MIT
0
ludwiggj/CleanCode
Code samples taken from CleanCode book
null
null
0
st-tu-dresden/videoshop
SalesPoint sample application
null
null
1
Azure-Samples/cognitive-services-personalizer-samples
Samples for the Microsoft personalizer
null
--- page_type: sample languages: - java - csharp - javascript - python - php products: - azure description: "Repository for samples, tutorial, snippets and utilities that will help you understand and make great use of the Cognitive Services Personalizer." urlFragment: cognitive-services-personalizer-samples --- # Azure Cognitive Services - Personalizer Samples Repository for samples, tutorial, snippets and utilities that will help you understand and make great use of the Cognitive Services Personalizer. ## About Personalizer <!--[Personalizer on Azure](TBD) --> [Personalizer Documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/personalizer) <!-- [Personalizer launch blog post](TBD) --> ## SDKs and Client Libraries for Personalizer * [.NET Nuget](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Personalizer/) * [Python PIP Package](https://pypi.org/project/azure-cognitiveservices-personalizer/) * [Node JS NPM](https://www.npmjs.com/package/@azure/cognitiveservices-personalizer/v/1.0.0) * Java: Coming soon * [Ruby Gem](https://rubygems.org/gems/azure_cognitiveservices_personalizer) * [Go](https://github.com/Azure/azure-sdk-for-go/tree/master/services/preview/personalizer/v1.0/personalizer) ## Quickstarts Using Personalizer with SDKs * C# & .NET * Python * Java * PHP * NodeJS ## Samples * [Personalizer-powered ChatBot suggestions (C#)](/samples/ChatbotExample) * [Personalizer using Cognitive Services Text Analytics (C#)](/samples/CrawlFeaturizer) * [Getting Features from Anonymous users http UserAgent (C#)](/samples/HttpRequestFeatures) * [Azure Notebook (Python) Simulating Users](/samples/azurenotebook) ## Demo Websites & Apps These are samples designed to create appealing, interactive apps that illustrate how Personalizer works. * Interactive Demo Website * See it in action [here](https://personalizerdevdemo.azurewebsites.net/) and [here](https://personalizercontentdemo.azurewebsites.net/) * [Source code](https://personalizationdemo.azurewebsites.net/) * [Interactive Chat Bot](/demos/techfest-demo-master) ### Prerequisites Basic understanding of Personalizer ### Installation See the README.md in each sample for instructions. ### Getting the Samples 1. git clone https://github.com/Azure-Samples/cognitive-services-personalizer-samples 2. cd cognitive-services-personalizer-samples ## Demo Interactive Demo Run the demo on your box ## Resources - Personalizer Landing Page - Documentation - UserVoice - Stack Overflow
0
Azure-Samples/azure-spring-apps-samples
Sample projects for Azure Spring Apps
azure java microservices spring spring-boot spring-cloud
--- page_type: sample languages: - java products: - azure-spring-apps description: "Sample projects for Azure Spring Apps" urlFragment: "azure-spring-apps-samples" --- # Azure Spring Apps Samples ![Build](https://github.com/Azure-Samples/azure-spring-apps-samples/actions/workflows/build.yml/badge.svg) ![Check Markdown Links](https://github.com/Azure-Samples/azure-spring-apps-samples/actions/workflows/markdown-link-check.yml/badge.svg) ## Overview Azure Spring Apps is a PaaS to help you easily deploy Spring Boot applications to Azure without any code changes. The goal of Azure Spring Apps is to let you focus on your code and let us take care of the operation work. Rich features are provided and some of the highlighted ones are: - Managed native Spring Cloud Service Registry - Managed native Spring Cloud Config Server - Managed native Spring Cloud Distributed Tracing with Azure AppInsights - Built-in metrics aggregation and monitoring - Built-in logs aggregation and search - Zero code change is required to run your Spring Boot apps in Azure Spring Apps You can find more details about Azure Spring Apps in the [official documentation](https://docs.microsoft.com/azure/spring-apps/). This repository contains samples projects for Azure Spring Apps. These sample projects show how to use various features in Azure Spring Apps. The table below shows the list of samples available in this repository. | Folder | Description | |----------------------------------|--------------------------------------------| | [custom-config-server-client](./custom-config-server-client/) | Sample showing how to access Azure Spring Apps managed Config Server through Azure RBAC when your applications are running outside Azure Spring Apps | | [custom-eureka-client](./custom-eureka-client/) | Sample showing how to access Azure Spring Apps managed Spring Cloud Service Registry through Azure RBAC when your applications are running outside Azure Spring Apps | | [managed-identity-keyvault](./managed-identity-keyvault) | Sample project using system-assigned managed identity to access Key Vault | | [managed-identity-storage-blob](./managed-identity-storage-blob) | Sample project using system-assigned managed identity to access Storage blob | | [service-binding-cosmosdb-mongo](./service-binding-cosmosdb-mongo/) | Service binding sample with Azure CosmosDB Mongo API | | [service-binding-cosmosdb-sql](./service-binding-cosmosdb-sql/) | Service binding sample with Azure CosmosDB SQL API | | [service-binding-mysql](./service-binding-mysql/) | Service binding sample with Azure Database for MySQL | | [service-binding-redis](./service-binding-redis/) | Service binding sample with Azure Cache for Redis | | [storage-sample](./storage-sample/) | Sample showing how to use temporary and persistent storage in Azure Spring Apps | | [java-11-sample](./java-11-sample/) | Java 11 sample project to run in Azure Spring Apps | | [java-8-sample](./java-8-sample/) | Java 8 sample project to run in Azure Spring Apps | ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
1
googleworkspace/cloud-search-samples
Samples for Google Cloud Search
cloud-search google-cloud-search google-workspace samples
# Cloud Search Samples ![logo][cloudsearch-logo] This repository contains end-to-end samples for Cloud Search, including indexing, structured data management, and querying. You must sign up to use Cloud Search. For more information on Cloud Search, including signing up, see https://developers.google.com/cloud-search/ ## Contributing changes * See [CONTRIBUTING.md](CONTRIBUTING.md) ## Licensing * See [LICENSE](LICENSE) Java is a registered trademark of Oracle Corporation and/or its affiliates. [cloudsearch-logo]: http://www.gstatic.com/images/branding/product/2x/google_cloud_search_96dp.png
0
srecon/ignite-book-code-samples
All code samples, scripts and more in-depth examples for the book high performance in-memory computing with Apache Ignite. Please use the repository the-apache-ignite-book" for Ignite version 2.6 or above."
bigdata cache gridgain high-performance ignite in-memory nosql
# High performance in-memory data grid with Apache Ignite All code samples, scripts and more in-depth examples for the book **High performance in-memory computing with Apache Ignite**. [![alt text](/highperfomance-mini.jpg "book cover")](http://leanpub.com/ignite)
0
huaweicloud/spring-cloud-huawei-samples
This project provide samples for Spring Cloud Huawei. Read each sub-project for details about each sample.
null
# Spring Cloud Huawei Samples [中文](README_CN.md) This project provide samples for Spring Cloud Huawei. Read each sub-project and [wiki](https://github.com/huaweicloud/spring-cloud-huawei-samples/wiki) for details about each sample. Directory description: - basic:This project providers sample to show working with Spring Cloud Microservices. - basic-tomcat:This project provides a simple example of a Spring Boot application running on a standalone Tomcat - canary:This project providers sample to show working with Canary Deploy. - migrate:Demonstrate the dubbo,eureka, hsf, sofa, nacos and tsf projects and their transformation to spring cloud microservices. - porter:This project provides 5 microservices using Spring Cloud Huawei and ServiceComb Java Chassis. Branches: * master: for Spring Cloud 2022.0.x and reqiures JDK 17 * 2021.0.x: for Spring Cloud 2021.0.x and reqiures JDK 8 * 2020.0.x: for Spring Cloud 2020.0.x and reqiures JDK 8 * Hoxton: for Spring Cloud Hoxton(EOL, not for pruducton use) * Greenwich: for Spring Cloud Greenwich(Community maintenance is not recommended for production environment) * Finchley: for Spring Cloud Finchley(Community maintenance is not recommended for production environment) ## Prerequisites Running samples, must first [prepare CSE environment](/CSE-ENV.md) [More information](https://support.huaweicloud.com/devg-cse/cse_devg_0006.html) can be found in Huawei Cloud. And edit `bootstrap.yml` for each microserivce, configure the correct CSE services, like config center and service center. Samples using CSE 2.0 in default,the config service is kie ``` spring: cloud: servicecomb: config: serverType: kie serverAddr: http://127.0.0.1:30110 ``` If using CSE 1.0,config service change to config-center. ``` spring: cloud: servicecomb: config: serverType: config-center serverAddr: http://127.0.0.1:30113 fileSource: consumer.yaml ``` ## Cloud Service Engine(CSE) Cloud Service Engine (CSE) provides service registry, service governance, and configuration management. It allows you to quickly develop microservice applications and implement high-availability O&M. Furthermore, it supports multiple languages and runtime systems, and unified access and governance of intrusive frameworks such as Spring Cloud, Apache ServiceComb (Java Chassis/Go Chassis), and Dubbo, and non-intrusive service meshes. CSE has two versions: CSE 1.0 and CSE 2.0. CSE 2.0 provides an exclusive edition of the microservice engine. The microservice engine exclusive edition is a commercial engine that supports large-scale microservice application management. You can select different specifications based on service requirements. Engine resources are exclusively used and the performance is not affected by other tenants. Compared with CSE 1.0, CSE 2.0 completely upgrades the underlying architecture, functions, security, and performance. It provides independent service registration and discovery centers and configuration centers to support definition and governance based on user service scenarios. [Table 1](https://support.huaweicloud.com/productdesc-cse/cse_productdesc_0001.html#cse_productdesc_0001__table88531734172219) describes the feature comparison between the two versions. More informationcan be found in [Official Documents](https://support.huaweicloud.com/cse/index.html) .
0