full_name
stringlengths
7
104
description
stringlengths
4
725
topics
stringlengths
3
468
readme
stringlengths
13
565k
label
int64
0
1
odrotbohm/sos
Sample projects for my talk Refactoring to a System of Systems""
microservices modularity software-architecture spring
# Refactoring to a System of Systems _NOTE: This is currently highly work in progress. Be sure to check out every now and then for more detailed information and explanations about the individual modules._ This repository contains some sample code for my talk "Refactoring to a System of Systems" that outlines what problems developers can run into if they split up a system into multiple ones but transfer interaction patterns of typical monolithic applications as is. Slides of that talk and a recording of it will be linked here as soon as they become available. The repository contains five different projects, each of them potentially split into multiple ones in turn. For details on the individual ones, please refer to the READMEs conatined in the individual project's root. ## Context The sample application is built around an e-commerce domain with the following Bounded Contexts: * _Catalog_ - containing product master data (in our case product name and price). * _Inventory_ - keeping track of the number of available items per product. * _Order_ - keeping track of orders placed by customers. ![Domain](images/domain.png?raw=true "Domain") The individual modules provide sketch implementations of these Bounded Context and the following interactions between them implemented: 1. When a product is added, the inventory needs to register empty stock for that product. 2. When an order is completed, the inventory needs to update the stock for the products ordered. ## Modules * [_The Monolith_](00-monolith) - a typical monolithic Spring Boot application with the Bounded Contexts implemented in packages and the interaction being based on active invocations of Spring beans residing in a different BC. * [_The Microlith_](10-microlith) - the former approach transferred into separate systems but keeping the same interaction patter of synchronous, non-idempotent operations. The systems invoking each other via HTTP calls. * [_The Modulith_](20-modulith) - an improved version of the monolith with the Bounded Contexts interacting via Spring application events and event listeners. * [_SOS Messaging_](30-messaging-sos) - the individual Bounded Contexts implemented as separate systems and the interaction implemented via a Kafka message broker. * [_SOS REST_](40-restful-sos) - the individual Bounded Contexts implemented as separate systems and the interaction implemented via the events exposed as REST resources. ![Project structure](images/structure.png?raw=true "Project structure") ## Build The repository should build by simply running `./mvnw clean install` using a recent JDK 8. Sample code uses Lombok, which means that you need a Lombok-enabled IDE in case you want to import the projects into it. For detailed instructions about how to work with the individual projects, see the individual module's READMEs.
1
IBM/application-modernization-javaee-quarkus
Application Modernization Sample - From Java EE (2010) to Cloud-Native (2021)
cloudnative events-triggered jakartaee java javaee micro-frontends microprofile microservices openliberty opensource quarkus strangler websphere
## Application Modernization - From Java EE in 2010 to Cloud-Native in 2021 This sample demonstrates how to modernize 10+ year-old Java EE applications with cloud-native technologies and the modern Java runtimes Quarkus and Open Liberty. The modernized application is deployed to and operated with OpenShift, the enterprise distribution of Kubernetes. ### Project Structure * [Demonstrated Capabilities, Technologies and Tools](#demonstrated-capabilities-technologies-and-tools) * [Introduction Video (12 mins)](#introduction-video) * [Session Recording: Application Modernization and Rabbits (30 mins)](http://heidloff.net/article/webinar-recording-application-modernization-and-rabbits/) * [Architecture](#architecture) * [Documentation](#documentation) * [Deployment via Docker Desktop](#deployment-via-docker-desktop) * [Deployment to OpenShift on IBM Cloud with Tekton](#deployment-to-openshift-on-ibm-cloud-with-tekton) * [Deployment to OpenShift on IBM Cloud with Tekton and ArgoCD](documentation/Deployments.md#deployment-to-openshift-on-ibm-cloud-with-tekton-and-argocd) * [Deployment to OpenShift on IBM Cloud with local Scripts](documentation/Deployments.md#deployment-to-openshift-on-ibm-cloud-with-local-scripts) * [More Deployment Options](documentation/Deployments.md) ### Demonstrated Capabilities, Technologies and Tools Application modernization is a journey. The legacy application has been modernized in ten steps. 1. Monolith - WebSphere Traditional 8.5.5 - Java EE 6 app from 2008 with Db2 database running in VMs or bare metal. 2. Monolith - WebSphere Traditional 9 in container - Application converted with Transformation Advisor. 3. Monolith - WebSphere Liberty - Application converted with Eclipse Migration Tools. 4. Separated frontend - Dojo frontend in separate container. 5. Monolith - Open Liberty - Modern project structure. 6. Strangled Catalog Service and remaining Open Liberty Monolith - Strangled catalog service (inspired by Mono2Micro) developed with Quarkus and Postgres. - Event driven architecture via Kafka. 7. Strangled Catalog Service and remaining Quarkus Monolith - Strangled Quarkus catalog service uses reactive programming model. - Remaining Quarkus monolith runs as native executable. 8. Micro frontend based web application - Developed with single-spa and Vue.js. Messaging is done via RxJS. 9. CI/CD via Tekton - Target OpenShift. Via OpenShift Pipelines operator. 10. CI/CD via Tekton and ArgoCD - Target OpenShift. Via OpenShift GitOps operator. ### Introduction Video The following 12 minutes video describes the project on a high level: <kbd>[![Video](documentation/video.png)](https://youtu.be/lw95LLqa37g)</kbd> ### Architecture Architecture of the legacy application: <kbd><img src="documentation/start.png" /></kbd> Screenshot of legacy storefront application: <kbd><img src="documentation/storefront-shop.png" /></kbd> Architecture of the modernized application: <kbd><img src="documentation/end.png" /></kbd> Screenshot of modernized storefront application: <kbd><img src="documentation/modernized-ui-1.png" /></kbd> ### Documentation * Project Overview * [Project Overview Video](http://heidloff.net/article/video-application-modernization-in-baby-steps/) (12 mins) * Talk: [Application Modernization and Rabbits](http://heidloff.net/article/webinar-recording-application-modernization-and-rabbits/) (30 mins) * [Project Teaser Video](https://youtu.be/evhQ7BslMeU) (2 mins) * Rabbit video: [Application Modernization and Rabbits](http://heidloff.net/articles/application-modernization-and-rabbits/) * [Project Overview Slides](documentation/AppModernization.pdf) * IBM Modernization Tools and IBM WebSphere * [Improving operational Efficiency through Application Modernization](http://heidloff.net/article/improving-operational-efficiency-through-application-modernization/) * [Modernizing Java EE Applications with WebSphere Liberty](http://heidloff.net/article/modernizing-java-ee-applications-with-websphere-liberty/) * [Step-by-Step Instructions how to use Transformation Advisor](http://heidloff.net/article/step-by-step-instructions-ibm-transformation-advisor/) * [Increasing Productivity for legacy Liberty Applications](http://heidloff.net/article/increasing-developer-productivity-for-legacy-liberty-applications/) * [Moving from WebSphere Liberty to Open Source with Open Liberty](http://heidloff.net/article/modernizing-websphere-liberty-applications-with-open-liberty/) * Strangler Pattern and Event Driven Architecture * [Don’t build distributed Monoliths!](http://heidloff.net/article/do-not-build-distributed-monoliths/) * [Strangler Pattern Example](http://heidloff.net/article/strangler-pattern-example/) * [Step-by-Step Instructions for Mono2Micro](http://heidloff.net/article/step-by-step-instructions-mono2micro/) * [Event driven Architectures for loosely coupled Microservices](http://heidloff.net/article/event-driven-architectures-loosely-coupled-microservices/) * [Using Quarkus for building reactive Applications](http://heidloff.net/article/using-quarkus-reactive-applications) * User Experience Modernization * [Modernizing Applications with new User Experiences](http://heidloff.net/article/modernizing-applications-with-new-user-experiences/) * [Using Micro Frontends in Microservices based Architectures](http://heidloff.net/article/using-micro-frontends-microservices/) * [Developing Micro Frontends with Single-Spa](http://heidloff.net/article/developing-micro-frontends-single-spa/) * [Developing loosely coupled Micro Frontends via RxJS](http://heidloff.net/article/developing-loosely-coupled-micro-frontends-rxjs/) * OpenShift Development and Deployment Patterns * [Exernalizing Configurations for OpenShift Deployments](http://heidloff.net/article/externalizing-configurations-for-openshift-deployments/) * [Deploying Db2 on OpenShift](http://heidloff.net/article/deploying-ibms-db2-on-openshift/) * [Deploying Postgres on OpenShift](http://heidloff.net/article/deploying-postgres-on-openshift/) * [Deploying Kafka on OpenShift](http://heidloff.net/article/deploying-kafka-on-openshift/) * [Connecting to managed Database Services via TLS](http://heidloff.net/article/connecting-to-managed-database-services-via-tls/) * [Deployments of Applications to OpenShift via Source](http://heidloff.net/article/deployments-of-applications-to-openshift-via-source/) * [Deploying Nginx on OpenShift](http://heidloff.net/article/deploying-nginx-on-openshift/) * [Using CORS for OpenShift Applications](http://heidloff.net/article/using-cors-for-openshift-applications/) * [Running Liberty Applications with Db2 locally](http://heidloff.net/article/running-liberty-applications-with-db2-locally/) * [Running legacy Java Applications locally](http://heidloff.net/article/running-legacy-java-applications-locally/) * CI/CD and DevOps * [Deploying Tekton on OpenShift](http://heidloff.net/article/deploying-tekton-on-openshift/) * [Sample Tekton Pipelines for Microservices](http://heidloff.net/article/sample-tekton-pipelines-for-microservices/) * [Debugging Tekton on OpenShift](http://heidloff.net/article/debugging-tekton-on-openshift/) * [Accessing GitHub in Tekton Tasks on OpenShift](http://heidloff.net/article/accessing-github-in-tekton-tasks-on-openshift/) * [Deploying ArgoCD on OpenShift](http://heidloff.net/article/deploying-argocd-on-openshift/) * [Using GitOps on OpenShift](http://heidloff.net/article/using-gitops-on-openshift/) * Observability * [OpenShift Logging Quick Start](http://heidloff.net/article/openshift-logging-quick-start/) * [Logging for OpenShift via LogDNA](http://heidloff.net/article/logging-for-openshift-via-logdna/) * More Resources * [10 Reasons why Enterprises should modernize Applications](http://heidloff.net/article/ten-reasons-why-enterprises-should-modernize-applications/) * [Application Modernization Resources on IBM Developer](http://heidloff.net/article/application-modernization-resources-on-ibm-developer/) * [IBM Garage Application Modernization Playbook](https://ibm-cloud-architecture.github.io/modernization-playbook/applications/refactor/) ### Deployment via Docker Desktop If you want to run the modernized application locally, you can invoke the following commands. All you need is a local Docker installation and the git CLI. Notes: * Docker requires 14 GB memory, 10 CPUs and 80 GB disk space * It takes roughly 15 - 20 minutes to start everything * Make sure docker-compose is also installed (sounds like this needs to be installed separately on some systems) ``` $ git clone https://github.com/nheidloff/application-modernization-javaee-quarkus.git && cd application-modernization-javaee-quarkus $ ROOT_FOLDER=$(pwd) $ sh ${ROOT_FOLDER}/scripts-docker/build-and-run.sh ``` The 'build-and-run.sh' script will launch the following containers. <kbd><img src="documentation/Containers.png" /></kbd> Once everything has been started, you can open the web applications: * Legacy Dojo frontend: http://localhost/CustomerOrderServicesWeb * Modern micro-frontend based application: http://localhost:8080 See the [documentation](documentation/RunDemo.md) how to run the demo. ### Deployment to OpenShift on IBM Cloud with Tekton The following scripts deploy the modernized application on Red Hat [OpenShift on IBM Cloud](https://cloud.ibm.com/kubernetes/overview?platformType=openshift). However the same instructions should work for other OpenShift and OCP deployments, for example [CodeReady Containers](https://developers.redhat.com/products/codeready-containers/overview). First create an [IBM Cloud Account](https://cloud.ibm.com/registration). Then create an OpenShift cluster, for example via the [IBM Cloud Dashboard](https://cloud.ibm.com/kubernetes/catalog/create?platformType=openshift). I've tested classic infrastructure, single zone, OpenShift 4.6.17, b3c.8x32 and 3 worker nodes. Additionally you need to install Tekton. The easiest option is to use the '[OpenShift Pipelines](https://docs.openshift.com/container-platform/4.6/pipelines/installing-pipelines.html)' operator from the OperatorHub view in the OpenShift Console ([screenshots](documentation/deploy-tekton-1.png)). Simply accept all defaults. No local installations are necessary. ``` $ git clone https://github.com/nheidloff/application-modernization-javaee-quarkus.git && cd application-modernization-javaee-quarkus $ ROOT_FOLDER=$(pwd) $ sh ${ROOT_FOLDER}/scripts-openshift-tekton/check-prerequisites.sh $ oc login ... $ sh ${ROOT_FOLDER}/scripts-openshift/deploy-db2.sh $ sh ${ROOT_FOLDER}/scripts-openshift/deploy-kafka.sh $ sh ${ROOT_FOLDER}/scripts-openshift/deploy-postgres.sh $ sh ${ROOT_FOLDER}/scripts-openshift-tekton/deploy-application.sh $ sh ${ROOT_FOLDER}/scripts-openshift-tekton/show-urls.sh ```
1
raulh82vlc/Image-Detection-Samples
This sample app supports Building a MVP with Face recognition and AR" and "Quest of a Hero part 2" presentations as well as it has two different possibilities to build face detection mechanism. The first one is OpenCV based and the second one is by means of Camera 2 API"
camera2-api face-detection image-processing image-recognition machine-learning mvp opencv presentation
# Face Detection samples with Augmented Reality (AR) [![Build Status](https://travis-ci.org/raulh82vlc/Image-Detection-Samples.svg?branch=master)](https://travis-ci.org/raulh82vlc/Image-Detection-Samples) [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html) This sample app is basically made to support the following talks: - [Building a *"Minimum Viable Product"* (MVP) with *Face recognition* and *AR* in Android @ **Droidcon London 2017**](https://speakerdeck.com/raulh82vlc/building-a-minimum-viable-product-mvp-with-face-recognition-and-ar-in-android-at-droidcon-london-2017) - [Quest of a hero presentation slides @ Londroid April 2017](https://speakerdeck.com/raulh82vlc/quest-of-a-hero-at-londroid-april-2017) presentation ### Pre requirements to play the sample apps - For OpenCV you will need to install the OpenCV manager prior to execute this OpenCV sample on your device or making an in app native OpenCV installation with the .so file. - I would fairly suggest to start Camera 2 sample first to allow camera permissions on your device, since OpenCV is looking for both permissions and OpenCV library, might fail at some point if there is a race condition. - Last suggestion, don´t use any emulator for those sample apps, it is a camera specific project, it does not work well with emulators. ### Screenshot of Use case 1 ![Screencast UX](./art/openCV.gif) ### Screenshot of Use case 2 ![Screencast UX](./art/camera2.gif) ### Features - _Use case 1_ uses *OpenCV* with its camera widget, in addition to detecting face or eyes as well as rendering basic graphics to show areas recognised. - _Use case 2_ uses *Camera 2* for camera stream (using a TextureView for the preview), face detection. Then it uses a View with Canvas to render the augmented reality object. ### SDK support Support SDKs from **21** to **25** # Disclosure - Libraries used - [OpenCV 3.2.0](http://docs.opencv.org/trunk/d5/df8/tutorial_dev_with_OCV_on_Android.html) by OpenCV - [Camera 2 API](https://developer.android.com/reference/android/hardware/camera2/package-summary.html) by Google # References - [Tutorial of OpenCV](http://www.learnopencv.com/image-recognition-and-object-detection-part1/) by Satya Mallick - [OpenCV Face detection sample app](https://github.com/opencv/opencv/tree/master/samples/android/face-detection) by OpenCV - [OpenCV for Secret Agents](https://www.packtpub.com/application-development/opencv-secret-agents) by Joseph Howse - [Android Camera 2 Basic sample app](https://github.com/googlesamples/android-Camera2Basic) by Google ### Remarks - This is not a finished app, and it is only made for supporting presentations content. - Don´t expect to have complete functionalities or being error proof. For this you would need to contribute to the sample app or creating a brand new project with further support on other devices. It is only checked on Nexus 5 phone for instance. ### Contributions Please read first [CONTRIBUTING](./CONTRIBUTING.md) ## About the author **Raul Hernandez Lopez**, - [Insights and projects (Personal projects blog)](https://raulh82vlc.github.io/) - [@RaulHernandezL (Twitter)](https://twitter.com/RaulHernandezL) - [raul.h82@gmail.com](mailto:raul.h82@gmail.com) # License ``` Copyright (C) 2017 Raul Hernandez Lopez Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```
1
parrt/cs601
USF CS601 lecture notes and sample code
null
CS601 Principles of software development ===== University of San Francisco<br> [Terence Parr](http://parrt.cs.usfca.edu) # Description There is more to being a professional developer than learning the syntax and libraries of a programming language--that part is easy. You must learn how to use the myriad of programming tools, how to write robust code, how to produce a simple design, how to interact with team members, How to use the latest development tools, and how to cope with a constantly moving target. Furthermore, you must learn how the network, computer, operating system, and your software operate as a unit to provide a useful service. To do this, you must acquire skills traditionally associated with system hardware and software administration. This class provides a survey of real-world programming mechanics and introduces you to the latest object-oriented software development strategies. You might be surprised that you're more than just a developer: you are the customer and also the quality assurance team! My primary goal is to prepare you for a productive programming and research life while in graduate school at USF. Furthermore, I intend to give you a taste of the technologies, strategies, and problems you will encounter as a professional programmer. Most importantly, I want to teach you to how to learn new concepts and technologies, solve your own problems, and do your own research. As a programmer, you must constantly struggle to keep up with the latest advances or you and your skills will become obsolete in a few years. # Administrivia **ROOM.** Lo Schiavo Science 307. **TIME.** MWF 12:45pm - 2:30pm, Jan 27 (Tue) - May 14 (Thur). **EXAMS.** There will be 2 exams but no final exam as your final project will count as the final exam. **SPRING BREAK.** March 16 - March 20. No class. # Lectures [See CS601 lectures at github](https://github.com/parrt/cs601/tree/master/lectures) #### Instruction format Class periods of 1:45min each 2 times per week for 15 weeks. Instructor-student interaction during lecture is encouraged. All programming will be done in the Java programming language. ### Books There is no textbook for this class. ### Grading | Artifact | Grade Weight | Due date | |--------|--------|--------| |Graph| 5%| Feb 15| |Proxy| 10%| Mar 10 | |RingBuffer | 5%| Mar 26 | |Webmail | 25%| May 14 (last day of class) | |Quizzes | 5%| sporadic | |Exam 1| 25%| Mar 31 | |Exam 2| 25%| May 14 | *No final exam, gmail project counts as the final but we do have a second exam on the last day of class.* *I expect to see proper git commit messages and github usage so I can track your development.* I consider an "A" grade to be above and beyond what most students have achieved. A "B" grade is an average grade for a graduate student or what you could call "competence" in a business setting. A "C" grade means that you either did not or could not put forth the effort to achieve competence. An "F" grade implies you did very little work or had great difficulty with the class compared to other students. Projects that do not run exactly as specified will lose 10% of the total points. Make sure that you do not have hardcoded files/directories in your code, remember that UNIX is case-sensitive as is Java, file names and class names must be correct, specified method signatures must be correct, etc... Code quality counts. Even if you have perfect functionality, I will deduct points for poor and sloppy coding. *I will be very strict and set a high standard in my grading*, but I will work hard to help you if you are having trouble. You some of you may not get the grade you were hoping for in this class, but I will do everything I can to make sure you learn a lot and have a satisfying educational experience! Unless you are sick or have a family emergency, I will not change deadlines for projects nor exam times. For example, I will not give you a special final exam just because you want to fly home early. Consult the university academic calendar before making travel plans. **SOFTWARE.** Students can use any Java development environment they want, but I will be testing projects under OS X (or Linux) so make sure that your projects work on a UNIX box. The community edition of Intellij is the best Java development environment in my opinion. Projects will be submitted through github.com. For help with git, I suggest you download [sourcetree](http://www.sourcetreeapp.com/). Intellij knows how to deal with git directly as well. You might also find the [Google Chrome extension Github Tree](https://chrome.google.com/webstore/detail/github-tree/ljoidanknjnfhcefkjbhjpmpccgmnobo) useful. **ABOUT ME.** My name is Terence Parr and I’m a professor in the computer science department. Please call me Terence (the use of “Terry” is a capital offense). For more information on me, see http://parrt.cs.usfca.edu. **TARDINESS.** Please be on time for class. It is a big distraction if you come in late. **ACADEMIC HONESTY.** You must abide by the copyright laws of the United States and academic honesty policies of USF. You may not copy code from other current or previous students. All suspicious activity will be investigated and, if warranted, passed to the Dean of Sciences for action. Copying answers or code from other students or sources during a quiz, exam, or for a project is a violation of the university’s honor code and will be treated as such. Plagiarism consists of copying material from any source and passing off that material as your own original work. Plagiarism is plagiarism: it does not matter if the source being copied is on the Internet, from a book or textbook, or from quizzes or problem sets written up by other students. The golden rule: **You must never represent another person’s work as your own.** My policy is as follows: * The first observed incident of cheating will result in a zero on the quiz or the assignment (for example). It will be reported to both the CS chair and the CS program assistant for tracking. * The second observed incident of cheating after the initial incident will result in a failing grade for the course. If you ever have questions about what constitutes plagiarism, cheating, or academic dishonesty in my course, please feel free to ask me. I’m happy to discuss the issue in a forthright manner. Official text from USF: ``As a Jesuit institution committed to *cura personalis*—-the care and education of the whole person-—USF has an and will you take great way to say will you will you fail in with the Leica and you and I and you and is and you will so it's by his death I believe you are David is in a supervised soft as a whisper is well respected and everybody knows everything is going in and you what this person cares about that person care about Satan knows exactly how you and never even though you and I is is is going as wellobligation to embody and foster the values of honesty and integrity. USF upholds the standards of honesty and integrity from all members of the academic community. All students are expected to know and adhere to the University's Honor Code. You can find the full text of the code online at http://www.usfca.edu/catalog/policies/honor.'' **ON DISABILITIES.** If you are a student with a disability or disabling condition, or if you think you may have a disability, please contact USF Student Disability Services (SDS) at 415/422-2613 within the first week of class, or immediately upon onset of the disability, to speak with a disability specialist. If you are determined eligible for reasonable accommodations, please meet with your disability specialist so they can arrange to have your accommodation letter sent to me, and we will discuss your needs for this course. For more information, please visit http://www.usfca.edu/sds/ or call 415/422-2613. # Syllabus * [Administrative details](https://github.com/parrt/cs601/blob/master/lectures/admin.pdf) * [Introduction](https://github.com/parrt/cs601/blob/master/lectures/intro.pdf) * [Software licensing lecture](https://github.com/parrt/cs601/blob/master/lectures/software-licensing.md) ## Tools * [Compiling and Running Simple Java Code](https://github.com/parrt/cs601/blob/master/lectures/javac-jar.md) * [UNIX command line](https://github.com/parrt/cs601/raw/master/lectures/linux.pdf) * [Git on command-line](https://github.com/parrt/cs601/blob/master/lectures/git-basics.md) (See https://github.com/USF-CS601-S15/parrt-doublekey) * [Team collaboration tools](https://github.com/parrt/cs601/blob/master/lectures/github-dev.md) * [Java I/O, unicode](https://github.com/parrt/cs601/blob/master/lectures/javaio.md) * [Sockets, protocols](https://github.com/parrt/cs601/blob/master/lectures/sockets.md) ## Network programming * [DNS](https://github.com/parrt/cs601/blob/master/lectures/dns.md) * [POP/SMTP](https://github.com/parrt/cs601/blob/master/lectures/email.md) * [http protocol](https://github.com/parrt/cs601/blob/master/lectures/http.md) * [proxy servers](https://github.com/parrt/cs601/blob/master/lectures/proxies.md) ## Concurrent programming in Java [Thread synchronization; barriers, thread communication; Volatile, AtomicInt, Java's memory model, lockless data structures](https://github.com/parrt/cs601/blob/master/lectures/threads.md) ## Web architecture * [web app architecture](https://github.com/parrt/cs601/blob/master/lectures/webapp.md), [old client-server notes](https://github.com/parrt/cs601/blob/master/lectures/client-server.md) * [Servlets](https://github.com/parrt/cs601/blob/master/lectures/servlets.md); services/REST * [cookies](https://github.com/parrt/cs601/blob/master/lectures/cookies.md) * [sessions](https://github.com/parrt/cs601/blob/master/lectures/sessions.md) * [web page generation](https://github.com/parrt/cs601/blob/master/lectures/page.generation.md) * [StringTemplate](https://github.com/parrt/cs601/blob/master/lectures/stringtemplate.md) ## Databases [SQL, schema, sqlite, group by, joins, Java + SQLLite](https://github.com/parrt/cs601/blob/master/lectures/db.md) ## Principles * [Why writing software is not like engineering](http://blog.parr.us/2014/12/29/why-writing-software-is-not-like-engineering/) * [Project management](lectures/project-mgmt-intro-grabbag.md) * [Agile development](lectures/agile.md) * [Design patterns](lectures/patterns.md) * OO concepts, [OO Worksheet](lectures/oo-worksheet.md) * [Top-down-design](lectures/top.down.design.md) * [jGuru case study](lectures/jguru.md) * [The Essentials of Debugging](http://blog.parr.us/2014/11/17/the-essentials-of-debugging/) * [Refactoring](lectures/refactoring.md) * [Software testing](lectures/testing.md) * [Mythical Man month](lectures/mythical-man-month.md) * [Little Nybbles of Development Wisdom](http://parrt.cs.usfca.edu/doc/devnybbles.html) * [Software licensing](lectures/software-licensing.md) * Maintenance and dynamically typed languages, language adoption * http://sns.cs.princeton.edu/docs/asr-oopsla13.pdf * http://www.slideshare.net/lmeyerov/oopsla-talk2 * http://programmers.stackexchange.com/questions/221615/why-do-dynamic-languages-make-it-more-difficult-to-maintain-large-codebases/221658#221658
1
steve-perkins/fitnessjiffy-spring
Diet and exercise tracker... a robust Spring Boot sample application
null
[![build status](https://gitlab.com/steve-perkins/fitnessjiffy-spring/badges/master/build.svg)](https://gitlab.com/steve-perkins/fitnessjiffy-spring/commits/master) # FitnessJiffy (Java / Spring Framework version) * [Intro and Background](#intro-and-background) * [Technologies Used](#technologies-used) * [Previous Technologies Used Along the Way](#previous-technologies-used-along-the-way) * [Application Features and Screenshots](#application-features-and-screenshots) ## Intro and Background FitnessJiffy is an application for tracking diet and exercise, and generating charts and reports for health information over time. Under the surface though, it's really a self-learning and teaching tool. I've written numerous versions of this application over the years, every time I want some deeper experience in learning a new programming language or framework. This version is based on [Java](http://www.oracle.com/technetwork/java/index.html) and the [Spring Framework](http://spring.io/). Although these have long been the primary tools in my professional career, I wrote this version of the app as an excuse to explore [Spring Boot](http://projects.spring.io/spring-boot/). I used the code and build process here as the basis for a lengthy blog post on Spring Boot (http://steveperkins.com/use-spring-boot-next-project), which was linked from the Spring website and drew a bit of attention in that community. ***If you're looking for a robust sample application to get started with Spring Boot, then you've come to right place.*** ## Technologies Used In addition to Spring Boot, this application makes use of technologies including: * [Java 8](http://www.oracle.com/technetwork/java/index.html) * [Spring Boot](http://projects.spring.io/spring-boot/) * [Spring Data JPA](http://projects.spring.io/spring-data-jpa/) * [Spring Security](http://projects.spring.io/spring-security/) * [MySQL](http://dev.mysql.com/) (with [H2](http://www.h2database.com/html/main.html) for unit testing) * [Flyway](https://flywaydb.org/) * [JSR-305 annotations](http://findbugs.sourceforge.net/) * [Thymeleaf templates](http://www.thymeleaf.org/) * [Twitter Bootstrap](http://getbootstrap.com/) * [jQuery](http://jquery.com/) * [amCharts](http://amcharts.com) (A JavaScript library for generating charts and reports) * [Gradle](http://gradle.org/) * [JUnit](http://junit.org/) ## Previous Technologies Used Along the Way If you go splunking through the commit history, you'll find the following: * [Google Guava](https://code.google.com/p/guava-libraries/) * No longer necessary after the move from Java 7 to Java 8 * [Joda-Time](http://www.joda.org/joda-time/) * Likewise replaced by the Java 8 standard library * [PostgreSQL](http://www.postgresql.org/) * I know PostgreSQL is more feature-rich than MySQL, and is trendy among developers right now. However, I needed to improve my hands-on familiarity with MySQL due to some professional work (dev features or not, MySQL ***blows PostgreSQL away*** when it comes to ops support for replication and scalability). Since this is a small open source application, the wide availability of cheap MySQL hosting doesn't hurt either. * [Apache Maven](http://maven.apache.org/) ## Application Features and Screenshots *(click on a screenshot thumbnail to see its full size)* Login and logout is built around Spring Security, with some custom event-handling hooks. In the future, I might add OpenID or OAuth support, to let users authenticate through an existing account with some provider (e.g. Google, Yahoo, etc). More importantly, there is not yet a "Create User" function in the web application. Users must be created in the database manually. This is not so much due to the complexity of adding a "Create User" page, but rather due to not yet being ready to open it up a hosted version of the application for public use. However, the Flyway database scripts do create an initial test user for you, with username `demo@demo.com` and password `password`. <a href="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/login.png"><img src="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/login-thumbnail.png"/></a> Users can track their weight on a daily basis, and their profile will show their current body-mass index (BMI) and the estimated number of daily calories needed to maintain their current weight: <a href="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/profile.png"><img src="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/profile-thumbnail.png"/></a> Tracking and editing of foods eaten each day: <a href="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/food-eaten.png"><img src="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/food-eaten-thumbnail.png"/></a> Recently-eaten foods (i.e. within the previous two weeks) appear in a convenient pull-down selector. Users can also search for foods by name, full or partial: <a href="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/food-search.png"><img src="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/food-search-thumbnail.png"/></a> The database includes a built-in set of "global" foods, which are visible to all users but cannot be modified. When a user modifies a "global" food, or simply creates a new food from scratch, then a food is created in that user's "private" set of foods. This is all transparent to the user. <a href="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/food-create.png"><img src="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/food-create-thumbnail.png"/></a> The database includes comprehensive data on over 800 exercises, taken from the [2011 Compendium of Physical Activities](https://sites.google.com/site/compendiumofphysicalactivities/). By using the user's weight on the date when an exercise was performed, FitnessJiffy can calculate how many calories were burned by that particular user. <a href="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/exercise-performed.png"><img src="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/exercise-performed-thumbnail.png"/></a> Users have quick access to recently-performed exercises (i.e. within the previous two weeks), can search for exercises by full or partial name, and can browse exercises by category. <a href="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/exercise-search.png"><img src="https://github.com/steve-perkins/fitnessjiffy-spring/raw/screenshots/screenshots/exercise-search-thumbnail.png"/></a> FitnessJiffy stores for each day a summary of each user's stats (e.g. weight, calories burned, etc), for quick retrieval as JSON so that charts can be rendered and report data summarized on the client-side. Whenever any data pertaining to a user changes, FitnessJiffy schedules a background thread to update that user's report data for the affected data range. This thread is scheduled to run after a five-minute delay, to avoid unnecessary duplication when the user makes multiple changes within a short period of time.
1
ewolff/microservice
Sample of a Microservice setup for my book. Based on Spring Cloud / Netflix / Java / Docker / Docker Compose / Docker Machine / Vagrant
null
Microservice Sample ============== <details> <summary>Translations:</summary> - [German / Deutsch](LIESMICH.md) </details> This is a sample for my Microservices Book ([English](http://microservices-book.com/) / [German](http://microservices-buch.de/)). This project creates a VM with the complete micro service demo system in Docker containers inside a Vagrant VM. The services are implemented in Java using Spring and Spring Cloud. It uses three microservices: - Order to process orders. - Customer to handle customer data. - Catalog to handle the items in the catalog. Technologies ------------ - Eureka for Lookup - Ribbon for Load Balancing. See the classes CatalogClient and CustomerClient in com.ewolff.microservice.order.clients in the microservice-demo-order project. - Hystrix is used for resilience. See CatalogClient in com.ewolff.microservice.order.clients in the microservice-demo-order project . Note that the CustomerClient won't use Hystrix. This way you can see how a crash of the Customer microservices makes the Order microservice useless. - Hystrix has a dashboard. Turbine can be used to combine the data from multiple sources. However, this does not work at the moment. - Zuul is used to route HTTP requests from the outside to the different services. - Spring Cloud Config isn't used. It is disabled with spring.cloud.config.enabled=false in the bootstrap files. How To Run ---------- The demo can be run with [Vagrant](docker-vagrant/README.md) or [Docker Machine and Docker Compose](docker/README.md). [How to run](HOW-TO-RUN.md) includes more details. <details> <summary>Translations:</summary> - [German / Deutsch](WIE-LAUFEN.md) </details> Remarks on the Code ------------------- The servers for the infrastructure are pretty simple thanks to Spring Cloud: - microservice-demo-eureka is the Eureka server for service discovery. - microservice-demo-zuul is the Zuul server. It distributes the requests to the three microservices. - microservice-demo-turbine can be used to consolidate the Hystrix metrics and has a Hystrix dashboard. The microservices are: - microservice-demo-catalog is the application to take care of items. - microserivce-demo-customer is responsible for customers. - microservice-demo-order does order processing. It uses microservice-demo-catalog and microservice-demo-customer. Ribbon is used for load balancing and Hystrix for resilience. The microservices have a Java main application in src/test/java to run them stand alone. microservice-demo-order uses a stub for the other services then. Also, there are tests that use customer driven contracts. That is why it is ensured that the services provide the correct interface. These CDC tests are used in microservice-demo-order to verify the stubs. In microserivce-demo-customer and microserivce-demo-catalog they are used to verify the implemented REST services.
1
jaxio/celerio-angular-quickstart
Generate an Angular 5 CRUD application from an existing database schema (we provide a sample one)
angular angular-material angular5 celerio code-generator crud-application crud-generator java primeng reverse-engineering spring-boot spring-data typescript
# Celerio Angular Quickstart [![Build Status](https://travis-ci.org/jaxio/celerio-angular-quickstart.svg?branch=master)](https://travis-ci.org/jaxio/celerio-angular-quickstart) This Angular quickstart uses Angular Cli to create an application skeleton and Celerio to **reverse your relational database schema** and **generate** the Angular + Spring Boot code to access your database content. The generated code covers much more areas than a simple Hello World app (search, pagination, validation, auto-complete, etc.) **To generate an application from our sample database, follow the instructions from the [quickstart][] folder.** Take a look at the generated code for yourself. Out of this [sample SQL schema](https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart-conf/01-create.sql) and this [Celerio configuration](https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart-conf/celerio-maven-plugin.xml), we generate this [code](https://github.com/jaxio/celerio-angular-quickstart/tree/master/quickstart-generated), thanks to these [templates](https://github.com/jaxio/celerio-angular-quickstart/tree/master/pack-angular/celerio/pack-angular). By default we use a sample H2 database schema. Using your own database schema and database engine is just a matter of configuration. Check as an example our instructions to [use MySQL][] instead of H2. ## What to expect? To see it in action with no effort you may run our sample docker image or watch a screencast. Remember, this is just a generated sample, the idea is to generate your own application using a more realistic database schema. ### Sample Docker image To run the docker image of the sample generated webapp: docker run -p 8080:8080 nromanetti/celerio-angular-quickstart Then access it at [localhost:8080](http://localhost:8080) ### Screencast The following [screencast](https://www.youtube.com/watch?v=MBrgeykyTGs) shows you what to expect. ## About the project Our goal is to provide solid code generation templates for advanced Angular CRUD web applications. Code generation templates are written in [Velocity][] and interpreted by [Celerio][], an Open Source `code generator` tool for data-oriented applications. Here is the folder organization: * [pack-angular](https://github.com/jaxio/celerio-angular-quickstart/blob/master/pack-angular) folder contains the Celerio code generation templates that are interpreted/copied by [Celerio][]. * [quickstart-conf](https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart-conf) folder contains the minimal configuration that Celerio needs to generate this quickstart. * [quickstart](https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart) folder is where you can generate the quickstart. * [quickstart-generated](https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart-generated): folder is an already generated quickstart provided here so you can browse the source code even from your phone :) ## About the generated code The generated Angular CRUD web app uses the following technologies/frameworks: * [Angular Cli](http://cli.angular.io/) a command line interface for Angular * [Angular 5](http://angular.io/) web framework: we try to always use the most recent version * [TypeScript](https://www.typescriptlang.org/): much easier than JavaScript... * [PrimeNG](http://primefaces.org/primeng/): Angular components library, we leverage file upload, auto-complete, calendar, tri-state checkbox, server-side pagination, etc. * [Angular Material](https://material.angular.io/): Material Design components for Angular apps * [Spring Boot](http://projects.spring.io/spring-boot/): Java app backend, made easy, we generate REST endpoints, etc. * [Spring Security](http://projects.spring.io/spring-security/): basic security by default * [Spring Data JPA](http://projects.spring.io/spring-data-jpa/): leverage query by example, etc. ## Contribute You may contribute in several ways: * By reviewing the generated code, are PrimeNG, Angular, Spring Data, Spring Boot, etc. properly used ? * By trying to generate a project using your own database schema * By using the generated app and trying to find its limits You may of course [report issues](https://github.com/jaxio/celerio-angular-quickstart/issues) and/or submit pull requests. [generated quickstart]: https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart-generated [quickstart]: https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart [AOT instructions]: https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart/README-AOT.md [use MySQL]: https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart/README-MYSQL.md [Celerio]: https://github.com/jaxio/celerio [Velocity]: http://velocity.apache.org/
1
jlmd/UpcomingMoviesMVP
Sample project of MVP and Material Design using as repository a list of upcoming movies
null
Upcoming movies MVP ========= [![Build Status](https://travis-ci.org/jlmd/UpcomingMoviesMVP.svg?branch=master)](https://travis-ci.org/jlmd/UpcomingMoviesMVP) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-UpcomingMoviesMVP-brightgreen.svg?style=flat)](https://android-arsenal.com/details/3/1516) Project created for autolearning where I try to apply the new **Material Design** and Android good practices to develop a **MVP (Model View Presenter)** application using a mocked list of **upcoming movies** as the domain of the application. Motivation ---- After see the MVP implementations of: - [MVPCleanArchitecture](https://github.com/glomadrian/MvpCleanArchitecture) by [glmoadrian](https://github.com/glomadrian) - [EffectiveAndroidUI](https://github.com/pedrovgs/EffectiveAndroidUI) by [pedrovgs](https://github.com/pedrovgs) I decided to make my own implenentation using these two projects as reference. Libraries used ---- - [Dagger](http://square.github.io/dagger/) - [Retrofit](http://square.github.io/retrofit/) - [ButterKnife](http://jakewharton.github.io/butterknife/) - [FloatingActionButton](https://github.com/makovkastar/FloatingActionButton) - [Picasso](http://square.github.io/picasso/) - [Otto](http://square.github.io/otto/) Screenshots ---- ![screenshot](./art/screenshot1.png "Screenshot 1") ![screenshot](./art/screenshot2.png "Screenshot 2") ![screenshot](./art/screenshot3.png "Screenshot 3") Developed by --- José Luis Martín - <joseluis.martind@gmail.com> * [LinkedIn](https://www.linkedin.com/in/jlmartind) * [Twitter](https://twitter.com/jlmartind) License ---- ``` Copyright 2014 José Luis Martín Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```
1
couchbaselabs/try-cb-java
Java-Based Couchbase 7.0 travel-sample application
null
# Couchbase Java Travel-Sample Application This is a sample application for getting started with [Couchbase Server] and the [Java SDK]. The application runs a single page web UI for demonstrating SQL for Documents (N1QL), Sub-document requests and Full Text Search (FTS) querying capabilities. It uses Couchbase Server together with the [Spring Boot] web framework for [Java], [Swagger] for API documentation, [Vue] and [Bootstrap]. The application is a flight planner that allows the user to search for and select a flight route (including the return flight) based on airports and dates. Airport selection is done dynamically using an autocomplete box bound to N1QL queries on the server side. After selecting a date, it then searches for applicable air flight routes from a previously populated database. An additional page allows users to search for Hotels using less structured keywords. ![Application](app.png) ## Prerequisites To download the application you can either download [the archive](https://github.com/couchbaselabs/try-cb-java/archive/master.zip) or clone the repository: git clone https://github.com/couchbaselabs/try-cb-java.git <!-- If you want to run the application from your IDE rather than from the command line you also need your IDE set up to work with maven-based projects. We recommend running IntelliJ IDEA, but Eclipse or Netbeans will also work. --> We recommend running the application with Docker, which starts up all components for you, but you can also run it in a Mix-and-Match style, which we'll decribe below. ## Running the application with Docker You will need [Docker](https://docs.docker.com/get-docker/) installed on your machine in order to run this application as we have defined a [_Dockerfile_](Dockerfile) and a [_docker-compose.yml_](docker-compose.yml) to run Couchbase Server 7.0.0, the front-end [Vue app](https://github.com/couchbaselabs/try-cb-frontend-v2.git) and the Java REST API. To launch the full application, simply run this command from a terminal: docker-compose up > **_NOTE:_** You may need more than the default RAM to run the images. We have tested the travel-sample apps with 4.5 GB RAM configured in Docker's Preferences... -> Resources -> Memory. When you run the application for the first time, it will pull/build the relevant docker images, so it might take a bit of time. This will start the Java backend, Couchbase Server 7.0.0 and the Vue frontend app. ``` ❯ docker-compose up ... Creating couchbase-sandbox-7.0.0 ... done Creating try-cb-api ... done Creating try-cb-fe ... done Attaching to couchbase-sandbox-7.0.0, try-cb-api, try-cb-fe couchbase-sandbox-7.0.0 | Starting Couchbase Server -- Web UI available at http://<ip>:8091 couchbase-sandbox-7.0.0 | and logs available in /opt/couchbase/var/lib/couchbase/logs couchbase-sandbox-7.0.0 | Configuring Couchbase Server. Please wait (~60 sec)... try-cb-api | wait-for-couchbase: checking http://db:8091/pools/default/buckets/travel-sample/ try-cb-api | wait-for-couchbase: polling for '.scopes | map(.name) | contains(["inventory", " try-cb-fe | wait-for-it: waiting 400 seconds for backend:8080 try-cb-api | wait-for-couchbase: ... couchbase-sandbox-7.0.0 | Configuration completed! couchbase-sandbox-7.0.0 | Couchbase Admin UI: http://localhost:8091 couchbase-sandbox-7.0.0 | Login credentials: Administrator / password try-cb-api | wait-for-couchbase: checking http://db:8094/api/cfg try-cb-api | wait-for-couchbase: polling for '.status == "ok"' try-cb-api | wait-for-couchbase: checking http://db:8094/api/index/hotels-index try-cb-api | wait-for-couchbase: polling for '.status == "ok"' try-cb-api | wait-for-couchbase: Failure try-cb-api | wait-for-couchbase: Creating hotels-index... try-cb-api | wait-for-couchbase: checking http://db:8094/api/index/hotels-index/count try-cb-api | wait-for-couchbase: polling for '.count >= 917' try-cb-api | wait-for-couchbase: ... try-cb-api | wait-for-couchbase: ... try-cb-api | wait-for-couchbase: checking http://db:9102/api/v1/stats try-cb-api | wait-for-couchbase: polling for '.indexer.indexer_state == "Active"' try-cb-api | wait-for-couchbase: polling for '. | keys | contains(["travel-sample:def_airport try-cb-api | wait-for-couchbase: polling for '. | del(.indexer) | del(.["travel-sample:def_na try-cb-api | wait-for-couchbase: value is currently: try-cb-api | false try-cb-api | wait-for-couchbase: ... try-cb-api | wait-for-couchbase: polling for '. | del(.indexer) | map(.num_pending_requests = try-cb-api | try-cb-api | . ____ _ __ _ _ try-cb-api | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ try-cb-api | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ try-cb-api | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) try-cb-api | ' |____| .__|_| |_|_| |_\__, | / / / / try-cb-api | =========|_|==============|___/=/_/_/_/ try-cb-api | :: Spring Boot :: (v2.5.0) try-cb-api | try-cb-api | 2021-06-04 14:47:12.896 INFO 1 --- [ main] trycb.Application : Starting Application v2.3.0 using Java 1.8.0_292 on e7a5966cfaad with PID 1 (/app/target/try-cb-java.jar started by root in /app) try-cb-api | 2021-06-04 14:47:12.908 INFO 1 --- [ main] trycb.Application : No active profile set, falling back to default profiles: default try-cb-api | 2021-06-04 14:47:17.271 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) try-cb-api | 2021-06-04 14:47:17.335 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] try-cb-api | 2021-06-04 14:47:17.335 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.46] try-cb-api | 2021-06-04 14:47:17.531 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext try-cb-api | 2021-06-04 14:47:17.532 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4339 ms try-cb-api | 2021-06-04 14:47:17.787 DEBUG 1 --- [ main] o.s.w.f.CommonsRequestLoggingFilter : Filter 'logFilter' configured for use try-cb-api | 2021-06-04 14:47:19.460 INFO 1 --- [ cb-events] com.couchbase.core : [com.couchbase.core][DnsSrvLookupFailedEvent][75ms] DNS SRV lookup failed (name not found), trying to bootstrap from given hostname directly. try-cb-api | 2021-06-04 14:47:22.039 INFO 1 --- [ cb-events] com.couchbase.core : [com.couchbase.core][BucketOpenedEvent][1184ms] Opened bucket "travel-sample" {"coreId":"0x8503f8fb00000001"} try-cb-api | 2021-06-04 14:47:23.953 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' try-cb-api | 2021-06-04 14:47:24.012 INFO 1 --- [ main] trycb.Application : Started Application in 12.758 seconds (JVM running for 14.829) try-cb-api | 2021-06-04 14:47:24.019 INFO 1 --- [ main] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT try-cb-api | 2021-06-04 14:47:24.025 INFO 1 --- [ main] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC try-cb-fe | wait-for-it: backend:8080 is available after 88 seconds try-cb-fe | try-cb-fe | > try-cb-frontend-v2@0.1.0 serve try-cb-fe | > vue-cli-service serve --port 8081 try-cb-fe | try-cb-fe | INFO Starting development server... try-cb-fe | DONE Compiled successfully in 7785ms2:47:36 PM try-cb-fe | try-cb-fe | try-cb-fe | App running at: try-cb-fe | - Local: http://localhost:8081/ try-cb-fe | try-cb-fe | It seems you are running Vue CLI inside a container. try-cb-fe | Access the dev server via http://localhost:<your container's external mapped port>/ try-cb-fe | try-cb-fe | Note that the development build is not optimized. try-cb-fe | To create a production build, run npm run build. try-cb-fe | ``` You should then be able to browse the UI, search for US airports and get flight route information. To end the application press <kbd>Control</kbd>+<kbd>C</kbd> in the terminal and wait for docker-compose to gracefully stop your containers. ## Mix and match services Instead of running all services, you can start any combination of `backend`, `frontend`, `db` via docker, and take responsibility for starting the other services yourself. As the provided `docker-compose.yml` sets up dependencies between the services, to make startup as smooth and automatic as possible, we also provide an alternative `mix-and-match.yml`. We'll look at a few useful scenarios here. ### Bring your own database If you wish to run this application against your own configuration of Couchbase Server, you will need version 7.0.0 or later with the `travel-sample` bucket setup. > **_NOTE:_** If you are not using Docker to start up the API server, or the > provided wrapper `wait-for-couchbase.sh`, you will need to create a full text > search index on travel-sample bucket called 'hotels-index'. You can do this > via the following command: curl --fail -s -u <username>:<password> -X PUT \ http://<host>:8094/api/index/hotels-index \ -H 'cache-control: no-cache' \ -H 'content-type: application/json' \ -d @fts-hotels-index.json With a running Couchbase Server, you can pass the database details in: CB_HOST=10.144.211.101 CB_USER=Administrator CB_PSWD=password docker-compose -f mix-and-match.yml up backend frontend The Docker image will run the same checks as usual, and also create the `hotels-index` if it does not already exist. ### Running the Java API application manually You may want to run the Java application yourself, to make rapid changes to it, and try out the features of the Couchbase API, without having to re-build the Docker image. You may still use Docker to run the Database and Frontend components if desired. Please ensure that you have the following before proceeding. * Java 8 or later (Java 11 recommended) * Maven 3 or later Install the dependencies: mvn clean install The first time you run against a new database image, you may want to use the provided `wait-for-couchbase.sh` wrapper to ensure that all indexes are created. For example, using the Docker image provided: docker-compose -f mix-and-match.yml up db export CB_HOST=localhost CB_USER=Administrator CB_PSWD=password ./wait-for-couchbase.sh echo "Couchbase is ready!" mvn spring-boot:run -Dspring-boot.run.arguments="--storage.host=$CB_HOST storage.username=$CB_USER storage.password=$CB_PSWD" If you already have an existing Couchbase server running and correctly configured, you might run: mvn spring-boot:run -Dspring-boot.run.arguments="--storage.host=localhost storage.username=Administrator storage.password=password" Finally, if you want to see how the sample frontend Vue application works with your changes, run it with: docker-compose -f mix-and-match.yml up frontend ### Running the front-end manually To run the frontend components manually without Docker, follow the guide [here](https://github.com/couchbaselabs/try-cb-frontend-v2) ## REST API reference, and tests. All the travel-sample apps conform to the same interface, which means that they can all be used with the same database configuration and Vue.js frontend. We've integrated Swagger/OpenApi version 3 documentation which can be accessed on the backend at `http://localhost:8080/apidocs` once you have started the app. (You can also view a read-only version at https://docs.couchbase.com/java-sdk/current/hello-world/sample-application.html#) To further ensure that every app conforms to the API, we have a [test suite][try-cb-test], which you can simply run with the command: ``` docker-compose --profile test up test ``` If you are running locally though, with a view to extending or modifying the travel-sample app, you will likely want to be able to make changes to both the code and the tests in parallel. * Start the backend server locally, for example using "Running the Java API application manually" above. * Check out the [test suite][try-cb-test] repo in a separate working directory, and run the tests manually, as per the instructions. Check the test repo for details on how to run locally. [Couchbase Server]: https://www.couchbase.com/ [Java SDK]: https://docs.couchbase.com/java-sdk/current/hello-world/overview.html [Spring Boot]: https://spring.io/projects/spring-boot [Java]: https://www.java.com/en/ [Swagger]: https://swagger.io/resources/open-api/ [Vue]: https://vuejs.org/ [Bootstrap]: https://getbootstrap.com/ [try-cb-test]: https://github.com/couchbaselabs/try-cb-test/
0
lynxbroker/API-examples
Code samples that show some of the LYNX API possible implementations
automated-trading ibapi lynx-api trading-algorithms
# LYNX API examples Code samples that show some of the LYNX API possible implementations. ### Table of contents - [**Excel**](https://github.com/lynxbroker/API-examples/tree/master/Excel) - request real-time market data from TWS via API using Microsoft Excel - [**Java**](https://github.com/lynxbroker/API-examples/tree/master/Java) - code samples of the API integration with Java & [*quickstart*](https://github.com/lynxbroker/API-examples/tree/master/Java/quickstart) application - [**Python**](https://github.com/lynxbroker/API-examples/tree/master/Python) - code samples of the API integration with Python --- ##### For more information in regard to the API Documentation, visit our [website](https://api.lynx.academy). --- <p align="center"> <img src="Java/place_order/images/logo_cover.svg"> </p>
0
jaisonfdo/RemindMe
Sample application explains about scheduling local notifications
null
null
1
JmStefanAndroid/EasyBehavior
一个可以上拉下滑的Ui效果(4.0+)eg: A Behavior Sample
behavior
# EasyBehavior - 如果你正苦于实现一个酷炫的个人信息页面效果 - 如果产品要求你实现下拉放大背景图,上滑能看到详细信息 - 如果还要求一系列同步动画效果 - 通过Behavior实现它将是你的不二选择,本项目旨在帮助各位轻松实现自己的Behavior! ---------- ### 注意: - demo2已在master分支中移除,需要的话请前往backupv1分支,切换版本到低于26 - androidx适配版本已发布,请拉取androidx分支 ---------- ## 博文地址  [例子1 链接](http://blog.csdn.net/gjm15881133824/article/details/73742219)  [例子2 链接](http://blog.csdn.net/gjm15881133824/article/details/74946322) ---------- ## DEMO下载 https://fir.im/ckh1 ---------- ## 效果图 ![EasyBehavior](/gif/EasyBehavior.gif) ![CoAliBehavior](/gif/Coali.gif) ---------- ## 例子的实现 注意:以下内容可能引起您的轻度不适(xing fen),请慎重阅读,例子中呢,用到了两个Behavior。</p> 1.用户头像的放大以及缩小,按照上面的方法,我们可以很明白的知道实现步骤了 - 继承 ``` public class CircleImageInUsercBehavior extends CoordinatorLayout.Behavior<CircleImageView> { ``` - 重写onDependentViewChanged, ``` //当dependency变化的时候调用 @Override public boolean onDependentViewChanged(CoordinatorLayout parent, CircleImageView child, View dependency) { //初始化一些基础参数 init(parent, child, dependency); //计算比例 ... //设置头像的大小 ViewCompat.setScaleX(child, percent); ViewCompat.setScaleY(child, percent); return false; } ``` 啊?这样就搞定了?是的!就是这么easy!!</br> ![这里写图片描述](http://img.blog.csdn.net/20170627112207279?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZ2ptMTU4ODExMzM4MjQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)</br> **那我有一个问题了,是不是说每一个view想要做跟随动画,都得创建一个相应的Behavior呢?答案很明显是NO~!**</br> 看完下一个例子你就会明白了</br> ---------- 2.这个Behavior用途主要有以下3点: - 控制背景图的放大以及回弹 - 中间middle部分跟随背景图的放大缩小做相应的移动 - Toolbar的背景Alpha的改变 第一步:初始化参数,通过tag查找每一个View,这里需要注意,我们需要在布局文件中,每个相应的View都需要声明相同的tag 如 `android:tag="你的tag"`,当然,也可以用原始的findViewById,这里只是希望id改动时,我们的Behavior可以不受到影响 ``` @Override public boolean onLayoutChild(CoordinatorLayout parent, AppBarLayout abl, int layoutDirection) { ... if (mToolBar == null) { mToolBar = (Toolbar) parent.findViewWithTag(TAG_TOOLBAR); } ... abl.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { ...//实现Toolbar的背景变化 }); ... } ``` 第二步:开始scale动画(下拉上划滑动过程中) ``` @Override public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dx, int dy, int[] consumed) { if (!isRecovering) {//未在回弹动画中,开始我们的变化动画 if (...) { scale(child, target, dy); return; } } super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed); @Override public boolean onNestedPreFling(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, float velocityX, float velocityY) { if (velocityY > 100) {//当y速度>100,就秒弹回 isAnimate = false; } return super.onNestedPreFling(coordinatorLayout, child, target, velocityX, velocityY); } } ``` 第三步:松手的回弹 ``` @Override public void onStopNestedScroll(CoordinatorLayout coordinatorLayout, AppBarLayout abl, View target) { recovery(abl);//回弹,这个方法详细请看源码 super.onStopNestedScroll(coordinatorLayout, abl, target); } ``` ok,步骤就是这样,是不是很easy呢? ---------- 附:AppBarLayout的跟随动画,不仅仅是上面的一种方式 我们也可以在逻辑代码中通过原生的Listener来实现 ``` mAppBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { //计算进度百分比 float percent = Float.valueOf(Math.abs(verticalOffset)) / Float.valueOf(appBarLayout.getTotalScrollRange()); ...//根据百分比做你想做的 } }); ``` ## License -------- ``` Copyright (C) 2017 JmStefanAndroid Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```
1
spring-petclinic/spring-petclinic-reactive
Reactive version of Spring PetClinic sample application based on Spring Webflux and Cassandra
astra cassandra reactive reactive-programming spring-weblux
<!--- STARTEXCLUDE ---> # Reactive Implementation of 🐈 Spring PetClinic 🐕 *15 minutes, Intermediate, [Start Building](https://github.com/DataStax-Examples/spring-petclinic-reactive#prerequisites)* This sample is a fully reactive version of the Spring PetClinic application using Spring WebFlux. <!--- ENDEXCLUDE ---> ![image](https://raw.githubusercontent.com/DataStax-Examples/spring-petclinic-reactive/master/hero.png) ## Get Started To build and play with this app, follow the build instructions that are located here: [https://github.com/DataStax-Examples/spring-petclinic-reactive](https://github.com/DataStax-Examples/spring-petclinic-reactive#prerequisite) <!--- STARTEXCLUDE ---> ## Prerequisites Let's do some initial setup by creating a serverless(!) database. ### DataStax Astra 1. Create a [DataStax Astra DB account](https://dtsx.io/38yYuif) if you don't already have one: ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-register-basic-auth.png) 2. On the home page. Locate the button **`Create Database`** ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-dashboard.png) 3. Locate the **`Get Started`** button to continue ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-select-plan.png) 4. Define a **database name**, **keyspace name** and select a database **region**, then click **create database**. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-create-db.png) 5. Your Astra DB will be ready when the status will change from *`Pending`* to **`Active`** 💥💥💥 ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-active.png) 6. After your database is provisioned, we need to generate an Application Token for our App. Go to the `Settings` tab in the database home screen. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-settings.png) 1. Select `Admin User` for the role for this Sample App and then generate the token. Download the CSV so that we can use the credentials we need later. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-settings-token.png) 1. After you have your Application Token, head to the database connect screen and select the driver connection that we need. Go ahead and download the `Secure Bundle` for the driver. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-connect-bundle.png) 9. Make note of where to use the `Client Id` and `Client Secret` that is part of the Application Token that we generated earlier. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-connect-bundle-driver.png) ### Github 1. Click `Use this template` at the top of the [GitHub Repository](https://github.com/DataStax-Examples/spring-petclinic-reactive#prerequisite): ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/github-use-template.png) 2. Enter a repository name and click 'Create repository from template': ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/github-create-repository.png) 3. Clone the repository: ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/github-clone.png) ## 🚀 Getting Started Paths: *Make sure you've completed the [prerequisites](#prerequisites) before starting this step* - [Running on Gitpod](#running-on-gitpod) - [Deploying to Vercel](#deploying-to-vercel) - [Deploying to Netlify](#deploying-to-netlify) ### Running on Gitpod 1. Click the 'Open in Gitpod' link: [![Open in IDE](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/spring-petclinic/spring-petclinic-reactive) <!--- ENDEXCLUDE ---> ![Astra Database Creation Form](doc/img/db-creation-4.png?raw=true) **✅ View your Database and connect** View your database. It may take 2-3 minutes for your database to spin up. You will receive an email at that point. **👁️ Expected output** *Initializing* ![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/dashboard-pending-1000.png?raw=true) Once the database is ready, notice how the status changes from `Pending` to `Active` and Astra enables the **CONNECT** button. ![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/dashboard-withdb-1000.png?raw=true) ### 2. Copy credentials to connect **✅ Navigate to your credentials** Locate the combo `Organization: <Your email>` on the top navigation. On the right side of your organization, click the ellipsis (...) then click your `<Your email>`. ![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/organization-combo-1000.png?raw=true) You should land on the following screen. Scroll down to the bottom of the page to locate the `Service Account` in `Security Settings` ![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/organization-home-1000.png?raw=true) **✅ Create Service Account** Create a service account by clicking `Add Service Account` button above the section as shown below ![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/security-settings-annotated.png?raw=true) When panel open on the right, click `Add` ![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/security-add-org-annotated.png?raw=true) **✅ Copy credentials to your clipboard** Click the ellipsis at end of Service Account row to open menu as select `Copy Credentials` ![my-pic](https://github.com/datastaxdevs/shared-assets/blob/master/astra/organization-copycredentials-1000.png?raw=true) The credentials you copied to the clipboard look like the following JSON, we will use it in gitpod to enable connectivity. ```json { "clientId":"149de2c7-9b07-41b3-91ad-9453dee4dc54", "clientName":"cedrick.lunven@datastax.com", "clientSecret":"aaaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" } ``` ### 3. Start in Gitpod **✅ Open Gitpod (with creds copied to clipboard)** [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/datastaxdevs/workshop-spring-reactive) When you first launch gitpod, it builds the image. ![image](doc/img/building-workspace.png?raw=true) Git pod pulls the image. ![image](doc/img/pulling-image.png?raw=true) **✅ Paste credentials in Gitpod terminal** Once Gitpod loads the workspace, you'll be asked to paste your service account credentials in the Gitpod terminal at the bottom of the screen. The [setup.sh](setup.sh) script at the root of the repository is what asks this question. ![image](doc/img/script-copy-creds.png?raw=true) **✅ Open Swagger UI in browser** When gitpod finishes building the app, a new tab will open in your browser showing the following. ![image](doc/img/exec-start.png?raw=true) **🎉 Celebrate!** You've successfully built the Spring Petclinic Reactive backend application! ![image](doc/img/exec-api-page.png?raw=true) **✅ Start the Web UI** : You may have noticed another terminal named `spring-petclinic-angular`. This is where the UI should start. ![image](doc/img/start-ui.png?raw=true) After answering the question about analytics usage, you should be able to access the UI on a new tab. ![Pet Clinic Welcome Screen](doc/img/ui-top.png?raw=true) **NOTE** If you want to run everything locally, reference the [LOCAL_README.md](doc/LOCAL_README.md) ## Understand the architecture ### Internal Architecture our of component Let's have a look inside the main component `spring-petclinic-reactive` to see which libraries and frameworks have been used. ![Pet Clinic Welcome Screen](doc/img/internal-architecture.png?raw=true) - `Spring-boot`: Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need minimal Spring configuration. - `Spring-Security`: Spring Security is a powerful and highly customizable authentication and access-control framework. It is the de-facto standard for securing Spring-based applications. Spring Security is a framework that focuses on providing both authentication and authorization to Java applications. Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom requirements. - `Spring-WebFlux`: Spring sub framework allowing to create Reactive Rest Endpoint. - `Spring-Actuator`: Expose Endpoints to expose metrics to third party system: health, infos, jmx,prometheus,... - `Spring-Test`: Enabled unit testing and mocking with Spring configuration and beans. - `Spring-Cloud`: Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer’s own laptop, bare metal data centres, and managed platforms such as Cloud Foundry. - `SpringFox` *(Swagger)*: Annotation based rest documentation generation and test client generation (swagger-ui). ![Pet Clinic Welcome Screen](doc/img/swagger.png?raw=true) ### Logical Architecture ![Pet Clinic Welcome Screen](doc/img/logical-architecture.png?raw=true) Here, you can find a description of the logical architecture components: - `spring-parclinic-angular`: This is the existing project that provides a user interface implementation using Angular. It has been used as well for other backend projects like the **spring-petclinic-rest** - `prometheus`: Our component exposes some metrics through the actuator endpoint. A registry will push this information into the Prometheus database (docker-based). ![Pet Clinic Welcome Screen](doc/img/prometheus.png?raw=true) - `Grafana`: Allows to create dashboards based on data stored in prometheus. ![Pet Clinic Welcome Screen](doc/img/grafana.png?raw=true) - `zipkin`: Our component includes the `spring-cloud-sleuth` dependency allowing Brave to push metrics usage of the API to the distributed tracing component Zipkin. To enable this tracing set the property `zipkin.enabled` to true in `application.yaml`. To start zipkin use `docker-compose up -d` ``` zipkin: enabled: true baseUrl: http://localhost:9411 sender: type: web ``` ![Pet Clinic Welcome Screen](doc/img/zipkin.png?raw=true) - `Apache Cassandra`: A NoSQL database - `DataStax Astra` : Apache Cassandra available in the Cloud for free as a managed service (DBaas) ### Data Model diagram The underlying data model implemented in Apache Cassandra is different from the one you would have defined with a relational database. ![Pet Clinic Welcome Screen](doc/img/data-model.png?raw=true) To enable scalability, Apache Cassandra does not support joins or integrity constraints. Therefore we used some denormalization. We also created some `secondary indices` to queries columns that are not the PARTITION KEY. These secondary indices work well in this case because the cardinality is low (e.g, few pets for an owner). The application generates the objects related to the data model (e.g., tables, indices, udts) at startup. ## C. Contributing The [issue tracker](https://github.com/spring-petclinic/spring-petclinic-reactive/issues)is the preferred channel for bug reports, features requests and submitting pull requests. For pull requests, editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at http://editorconfig.org. ![banner](doc/img/banner.png?raw=true)
1
heagoo/apkeditor_plugin_translation
A sample translation plugin for APK Editor
apk-editor translate-plugin
# apkeditor_plugin_translation A sample translation plugin for APK Editor (Pro). In this project, src directory contains source code of the sample translation plugin; translate_debugger.zip is a patch to correct some spoiled variables (like "1 $%") which are wrongly translated by the translation plugin. (The patch is provided by a Russian friend) It only makes sense when APK Editor (Pro) is installed: APK Editor: https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor APK Editor Pro: https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor.pro Please uncomment following lines in AndroidManifest.xml if built for free version: ```   <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="application/com.gmail.heagoo.apkeditor-translate" /> </intent-filter> ``` To develop a translation plugin, you should create your own activity, which can get translation request and return the translation result. The translation request is sent in terms of TranslateItem which is defined as: ``` package com.gmail.heagoo.apkeditor.translate;   import java.io.Serializable; public class TranslateItem implements Serializable {       private static final long serialVersionUID = -3101805950698159689L;     public String name;     public String originValue;     public String translatedValue;       public TranslateItem(String _n, String _o) {        this.name = _n;        this.originValue = _o;     }       public TranslateItem(String _n, String _o, String _t) {        this.name = _n;        this.originValue = _o;        this.translatedValue = _t;     } } ``` And, please refer to following code to get all the passed parameters: ```     @Override     protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // ...        Intent intent = getIntent();        Bundle bundle = intent.getExtras();        // Target language code like "-de"        this.targetLanguageCode = bundle.getString("targetLanguageCode");        // Translated items are also passed, so that we can revise it        this.translatedFilePath = bundle.getString("translatedList_file");        this.translatedList = (List<TranslateItem>) readObjectFromFile(translatedFilePath);        // Untranslated items, which are to be translated        String path =bundle.getString("untranslatedList_file");        this.untranslatedList = (List<TranslateItem>) readObjectFromFile(path);        // ...     }       public static Object readObjectFromFile(String filePath) {        Object result = null;        File file = new File(filePath);        ObjectInputStream objIn = null;        try {            objIn = new ObjectInputStream(new FileInputStream(file));            result = objIn.readObject();        } catch (IOException e) {            e.printStackTrace();        } catch (ClassNotFoundException e) {            e.printStackTrace();        } finally {            closeWithoutThrow(objIn);        }        return result;     } ``` After the translation, we should return back the result using following code: ```     private void setResult(List<TranslateItem> stringValues) {        Intent intent = new Intent();        intent.putExtra("targetLanguageCode", this.targetLanguageCode);        writeObjectToFile(this.translatedFilePath, stringValues);        intent.putExtra("translatedList_file", this.translatedFilePath);          this.setResult(RESULT_OK, intent);     }       public static void writeObjectToFile(String filePath, Object obj) {        File file = new File(filePath);        ObjectOutputStream objOut = null;        try {            objOut = new ObjectOutputStream(new FileOutputStream(file));            objOut.writeObject(obj);            objOut.flush();        } catch (IOException e) {            e.printStackTrace();        } finally {            closeWithoutThrow(objOut);        }     } ``` As there may be thousands of TranslateItem, thus it is passed by file, not by itself.
1
c4software/vuejs-cordova-sample
Sample VueJS app thats use Cordova capabilities
null
# vuejs-cordova-sample [![Build Status](https://travis-ci.org/c4software/vuejs-cordova-sample.svg?branch=master)](https://travis-ci.org/c4software/vuejs-cordova-sample) > Sample VueJS app thats use Cordova capabilities ![Demo screenshot](demo.png) ## Build Setup ```bash # install dependencies npm install # serve with hot reload at localhost:8080 npm run serve # build for production to run in Cordova npm run build ``` ## First Cordova build Run the command : ```sh npm run build cd cordova_app cordova platform add android cordova run # or build ``` ## Next Cordova build ```sh npm run cordova_run # or cordova_build ``` ## Plugins - cordova-plugin-dialogs - cordova-plugin-vibration - cordova-plugin-geolocation - cordova-plugin-flashlight - cordova-plugin-camera - phonegap-nfc - cordova-plugin-statusbar - cordova-plugin-headercolor
1
getgauge-examples/java-gradle-selenium
A sample project illustrating Gauge features using webdriver
null
# Deprecation notice Do not use this sample. It's a reference on why page objects will burn your house. Gauge recommends **not** using page objects. Refer https://github.com/getgauge-examples/gauge-active-admin-example-maven and our [blog](https://blog.getgauge.io/are-page-objects-anti-pattern-21b6e337880f) # Gauge example in Java [![Build Status](https://travis-ci.org/getgauge-examples/java-gradle-selenium.svg?branch=master)](https://travis-ci.org/getgauge-examples/java-gradle-selenium) This is an example project for doing web automation testing with [Gauge](http://getgauge.io). This project tests some of the functionalities of the [active admin demo](https://github.com/getgauge/activeadmin-demo) app. This app is hosted as a Java WAR (with embedded Jetty). ## Running this example The tests are run on Chrome by default. ### Prerequisites This example requires the following softwares to run. * [Java 1.7](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) or above * Note that Gauge works with Java 1.6 and above. But this particular example uses Java 1.7 * [Gauge](https://docs.gauge.org/getting_started/installing-gauge.html) * Gauge Java plugin * can be installed using `gauge install java` * Chrome ### Setting up the System Under Test (SUT) * Download [activeadmin-demo.war](https://github.com/getgauge-examples/activeadmin-demo/releases/tag/untagged-f0befd5494efa4baabd2) * Bring up the SUT by executing the below command ``` java -jar activeadmin-demo.war ``` * The SUT should now be available at [http://localhost:8080/](http://localhost:8080) ## Run specs If you already have Gradle installed, you can execute specs as `gradle specs`. Otherwise, you can use the gradle wrapper and run specs as below: ### On Linux / Mac ``` ./gradlew gauge ``` ### On Windows ``` gradlew.bat gauge ``` This runs Gauge specs with [Gradle](http://gradle.org). This uses Chrome as default browser for specs execution. Make sure Chrome is installed in your machine and [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) is in PATH. If you want to use Firefox/IE as browser, pass the corresponding argument to set browser environment as follows: ``` ./gradlew gauge -Penv=firefox or ./gradlew gauge -Penv=ie ``` Note: * Gauge can also be used with other [build tools](https://docs.gauge.org/latest/configuration.html#build-tools) like maven and ant. * You can use Gauge even without a build script! ## Topics covered in the example * [Specification](https://docs.gauge.org/latest/writing-specifications.html#specifications-spec), [Scenario](https://docs.gauge.org/latest/writing-specifications.html#scenario), [Step](https://docs.gauge.org/latest/writing-specifications.html#step), [Concepts](https://docs.gauge.org/latest/writing-specifications.html#concepts) and [Context Steps](https://docs.gauge.org/latest/writing-specifications.html#longstart-context) * [Table parameters](https://docs.gauge.org/latest/writing-specifications.html#table-parameters) * Using [External datasource (special param)](https://docs.gauge.org/latest/writing-specifications.html#special-parameters) * Using [tags](https://docs.gauge.org/latest/writing-specifications.html#tags) * Using Gauge with [Selenium Webdriver](http://docs.seleniumhq.org/projects/webdriver/) * Running Gauge specs with [Gradle](http://gradle.org) # Copyright Copyright 2016, ThoughtWorks Inc.
1
nicegraham/selenium-grid2-api
Selenium Grid2 API details / sample code
null
selenium-grid2-api ================== This is an attempt to document the Grid2 API endpoints, along with some code to interact with same and give some sample custom proxies, html renderers and capability matchers. Oh, and some servlets too. Grid2 available endpoints: * /grid/console/ * /grid/beta/console/ * /grid/register/ * /grid/driver/ * /wd/hub/ * /selenium-server/driver/ * /grid/resources/ * /grid/api/proxy/ * /grid/api/hub/ * /grid/api/testsession/ * /lifecycle-manager/ console ------- * /grid/console/ * /grid/beta/console/ This is the default view of the grid, showing the connected nodes and their test slots both free and busy. **base url:** ``` http://localhost:4444/grid/console/ http://localhost:4444/grid/beta/console/ ``` /grid/register/ --------------- Used to register a node on the hub. **base url:** ``` http://localhost:4444/grid/register/ ``` **parameter formats accepted:** ``` JSON as per https://code.google.com/p/selenium/wiki/DesiredCapabilities ``` **sample request:** ``` http://localhost:4444/grid/register/ ``` **response:** ``` "ok" ``` /grid/driver/ ------------- **base url:** ``` http://localhost:4444/grid/driver/ ``` **parameter formats accepted:** ``` ``` **sample request:** ``` http://localhost:4444/grid/driver/ ``` **response:** ``` ``` /wd/hub ------- **base url:** ``` http://localhost:4444/wd/hub ``` **parameter formats accepted:** ``` url parameters ``` **sample request:** ``` http://localhost:4444/wd/hub/status ``` **response from hub:** ``` { "status": 13, "value": { "message": "Session [(null externalkey)] not available and is not among the last 1000 terminated sessions.\nActive sessions are[ext. key bf655635-3ef8-4997-865f-3a00ffadf01e, ext. key b3a098fa-4dce-47ca-8ed0-8bc02e734155, 5cf0bdd3-07e9-4dd7-a1e1-9c87da8b8c4c (int. key, remote not contacted yet.), ext. key 5ae2b631-d8fe-40dc-8851-a9415290b6dd, ext. key f575c810-aa50-43ad-973c-dfed62660a34, ext. key d466b0ba-4cbc-4aa1-a785-92ffa486e86b]", "class": "org.openqa.grid.common.exception.GridException", "stackTrace": [ { "fileName": "ActiveTestSessions.java", "lineNumber": 109, "className": "org.openqa.grid.internal.ActiveTestSessions", "methodName": "getExistingSession" }, { "fileName": "Registry.java", "lineNumber": 423, "className": "org.openqa.grid.internal.Registry", "methodName": "getExistingSession" }, { "fileName": "RequestHandler.java", "lineNumber": 234, "className": "org.openqa.grid.web.servlet.handler.RequestHandler", "methodName": "getSession" } ] } } ``` **response from node:** ``` { "sessionId": null, "status": 0, "value": { "os": { "arch": "x86", "name": "Windows XP", "version": "5.1" }, "java": { "version": "1.7.0_21" }, "build": { "revision": "unknown", "time": "unknown", "version": "unknown" } }, "state": "success", "class": "org.openqa.selenium.remote.Response", "hCode": 4684600 } ``` /grid/resources/ ---------------- Allows you to access resources stored in the server .jar file. **base url:** ``` http://localhost:4444/grid/resources/ ``` **parameter formats accepted:** ``` url parameters ``` **sample request:** ``` http://localhost:4444/grid/resources/org/openqa/grid/images/console-beta.js ``` **response:** ``` The contents of the console-beta.js ``` /grid/api/proxy/ ---------------- **base url:** ``` http://localhost:4444/grid/api/proxy/ ``` **parameter formats accepted:** ``` JSON, url parameters ``` **sample request:** ``` http://localhost:4444/grid/api/proxy/ { "id": "http://10.105.140.42:5555" } or { "id":"http://10.105.140.42:5555", "isAlive":"" } or http://localhost:4444/grid/api/proxy?id=http://10.20.30.40:5555 ``` **sample response:** ``` { "id": "http://10.105.140.42:5555", "request": { "class": "org.openqa.grid.common.RegistrationRequest", "capabilities": [ { "platform": "XP", "browserName": "internet explorer", "maxInstances": "1", "version": "7" }, { "platform": "XP", "browserName": "firefox", "maxInstances": "2", "version": "9" }, { "platform": "XP", "browserName": "chrome", "maxInstances": "2" } ], "configuration": { "port": 5555, "hubConfig": "hubServlets.json", "registerCycle": 5000, "hub": "http://10.20.30.40:4444/grid/register", "newSessionWaitTimeout": -1, "remoteHost": "http://10.105.140.42:5555", "prioritizer": null, "throwOnCapabilityNotPresent": true, "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", "browser": "browserName=internet explorer,platform=XP,version=7,maxInstances=1", "maxSession": 5, "role": "node", "Dport=5556": "ensureCleanSession=true", "Dwebdriver.ie.driver=C:\\automation\\IEDriverServer.exe": "", "servlets": "com.groupon.SeleniumGridExtrasServlet", "host": "10.105.140.42", "cleanUpCycle": 5000, "browserTimeout": 600000, "hubHost": "autotestweb-002", "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", "url": "http://10.105.140.42:5555", "register": true, "nodePolling": 5000, "Dwebdriver.server.session.timeout": "120", "hubPort": 4444, "Dwebdriver.chrome.driver=C:\\automation\\chromedriver.exe": "", "timeout": 600000 } }, "msg": "proxy found !", "success": true } ``` /grid/api/hub/ -------------- API to query the hub config remotely. use the API by sending a GET to grid/api/hub/ with the content of the request in JSON,specifying the parameters you're interesting in, for instance, to get the timeout of the hub and the registered servlets : **base url:** ``` http://localhost:4444/grid/api/hub/ ``` **parameter formats accepted:** ``` JSON ``` **sample request:** ``` http://localhost:4444/grid/api/hub/ {"configuration": [ "timeout", "servlets" ] } if no param is specified, all params known to the hub are returned. {"configuration": [] } ``` **sample response:** ``` { "port": 4444, "servlets": "", "host": null, "throwOnCapabilityNotPresent": true, "cleanUpCycle": 5000, "nodePolling": 5000, "browserTimeout": 0, "maxSession": 5, "role": "hub", "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", "newSessionWaitTimeout": -1, "success": true, "timeout": 300000, "prioritizer": null } ``` /grid/api/testsession/ ---------------------- **base url:** ``` http://localhost:4444/grid/api/testsession/ ``` **parameter formats accepted:** ``` url parameters, JSON ``` **sample request:** ``` http://localhost:4444/grid/api/testsession?session=196555 ``` **sample response:** ``` ``` /lifecycle-manager ----------------- The only implemented action is to shutdown the hub. **base url:** ``` http://localhost:4444/lifecycle-manager ``` **parameter formats accepted:** ``` url parameters ``` **sample request:** ``` http://localhost:4444/lifecycle-manager?action=shutdown ``` **sample response:** ``` null ```
1
caprica/vlcj-javafx-demo
Sample application showing vlcj rendering video in a JavaFX scene.
null
![vlcj](https://github.com/caprica/vlcj/raw/master/etc/vlcj-logo.png "vlcj") _For a brand-new bleeding edge demo application using the currently in development vlcj-5.0.0 and LibVLC 4.0.0, switch to the [5.x development branch](https://github.com/caprica/vlcj-javafx-demo/tree/vlcj-5.x)._ vlcj-javafx-demo ================ Demo showing how vlcj can be used to render video to a JavaFX Canvas. The new JavaFX PixelBuffer is used to avoid a full-frame buffer copy, this is the strongly recommended approach. See: * https://github.com/caprica/vlcj/issues/883 * https://mail.openjdk.java.net/pipermail/openjfx-dev/2019-June/023347.html With the PixelBuffer the native video buffer is directly shared with JavaFX thereby avoiding full-frame copies for each video frame. Performance is *really good* with PixelBuffer. This solution is likely to outperform the Swing/Java2D implementation and likely may be the best approach for a cross-platform media player (even on OSX, which has not supported the optimal embedded solution for a long time now.) GPU Support ----------- GPU support even for modern video cards is pretty poor in JavaFX under Java7. nVidia cards seem to be better supported at the moment. If your video card is not supported then JavaFX will fall back to a software renderer. This will hobble your video playback performance. Java8 seems much better - i.e. some modern mainstream AMD graphic cards seem better supported. Under Java8 this sample application is working fine with a Radeon HD 7700 series video card on Linux. It of course works a lot better with an nVidia GeForce GTX 1050 Ti, also tested on Linux. Java/JavaFX Versions -------------------- This example project now requires JDK 11 and at least JavaFX 13 (for the new PixelBuffer). Note that it is still possible in your own projects to use some of the other examples in this project on JDK 1.7 or earlier versions of JavaFX if you need to support that. Notes ----- Contemporary versions of JavaFX provide a SwingNode so that it is possible to embed Swing components inside a JavaFX scene - so why not use this for vlcj? Well, vlcj still would require a heavyweight AWT Canvas, and heavyweight components do not work with the SwingNode component. So whichever way you look at it, you're stuck with direct rendering, as per the test cases provided by this project. What might be an option for you is to go the otherway, using Swing/AWT for your vlcj video window and embedding a JavaFX scene inside your Swing application. Memory Profile -------------- Using the standard JVM settings (default garbage collector): ![Standard JVM Settings Memory Profile](https://github.com/caprica/vlcj-javafx-demo/raw/master/doc/memory-profile-default-options.png "Standard Options Memory Profile") This test case plays a DVD ISO. I can't really explain the behaviour of the garbage collector, it seems erratic and to change behaviour over time. Nevertheless, there is clearly no memory leak, and it can run consistently in under 100Mb of heap memory.
1
BottegaIT/ddd-leaven-v2
DDD-CqRS sample v2.0 project that helps you with starting out advanced domain modeling using Spring, JPA and testing
null
ddd-leaven-v2 ============= DDD-CqRS sample v2.0 project that helps you with starting out advanced domain modeling using Spring, JPA and testing. Wiki is still under construction, bout you can use this "map" to navigate through the code: http://prezi.com/akrfq7jyau8w/ddd-cqrs-leaven-v20/ Group: https://groups.google.com/forum/#!forum/ddd-cqrs-sample Blog: http://ddd-cqrs-leaven.blogspot.com/ ## Another DDD and CqRS Sample? Primary goals of this project are the following: * presenting sample implementation of all DDD Building Blocks and techniques - no technical compromises, real world problems and solutions * presenting advanced lingustic techniques that are usefull for exploring Domian Exper knowledge during Modeling Wirlpool sessions * providing well crafted code, ready to be utilized in production * presenting ready ready to use and easy to adopt tools and best practices ## What is Leaven idea? Our intention is to provide a leaven ([leavening agent](http://en.wikipedia.org/wiki/Leavening_agent)) - something that you use to make bread - a good one. ## You are the Architect! So you take our leaven, understand it deeply and modify to fit your context. You don't need to couple your code with the leaven code. You can, but don't have to extend our classes. Better approach is to change, rename and repackage leaven classes:. Leaven is really simple and small. We achieved this by developing straightforward code without unnecessary abstraction-distraction like XML, and inner accidental complexity typical for frameowrks. If You want to change something then go straight to the code and do it instead of reading this documentation. You are the Architect! Noninvasive philosophy Our goal is to prepare a business developer programming model (way of thinking about class-level design) that is free of any platform-specific solutions. Business developer should focus on analysis and domain modeling - engine does technical stuff. Portable architecture - technical independence Although the implementation is based on Spring and JPA we managed to avoid any special approach or programming model. Therefore our architecture is portable which means You can implement this "style" using any Java framework or platform (EJB, etc).
1
anandbagmar/AppiumJavaSample
Sample project for running tests using Java/TestNG/Appium
null
# AppiumJavaSample Sample project for running tests using Java/TestNG/Appium ## Setting up your machine ### Prerequisites before running the script for Appium setup * Set `JAVA_HOME` as an environment variable * Set `ANDROID_HOME` as an environment variable - pointing to the directory where Android SDK should be setup * Execute the following scripts to setup your Mac [setupAndroidSDK.sh](setupAndroidSDK.sh) or Ubuntu [setup_linux.sh](setup_linux.sh) machine automatically > The above script will install all dependencies required for implementing / running tests on Android devices. To do the setup for iOS devices, run `appium-doctor` and see the list of dependencies that are missing, and install the same. > You may be prompted for password or confirmations along the way ## Running the tests ### Prerequisites: * Start appium server manually (and update the url/port if not using the default) * Have devices connected / emulators started. Accordingly, update the (.*Test.java) test file with the relevant information about the devices * The device should have the Calculator app ### Tests This project includes the following tests implemented for Android & iOS devices: #### Android * [AppiumNativeAndroidMessagesTest.java](src/test/java/com/eot/sample/android/AppiumNativeAndroidMessagesTest.java) - run an Appium test against the Messages app * [AppiumNativeAndroidParallelCalcTest.java](src/test/java/com/eot/sample/android/AppiumNativeAndroidParallelCalcTest.java) - run 2 Appium tests, in parallel, using testng * [AppiumWebAndroidHelloWorldTest.java](src/test/java/com/eot/sample/android/AppiumWebAndroidHelloWorldTest.java) - runs an appium test against a Chrome browser (mobile-web) in the connected device #### iOS * [AppiumNativeiOSHelloWorldTest.java](src/test/java/com/eot/sample/ios/AppiumNativeiOSHelloWorldTest.java) - run an Appium test against the Messages app * [AppiumWebiOSHelloWorldTest.java](src/test/java/com/eot/sample/ios/AppiumWebiOSHelloWorldTest.java) - run 2 Appium tests, in parallel, using testng
1
aws-samples/aws-cloudhsm-jce-examples
Sample applications demonstrating how to use the CloudHSM JCE
null
# aws-cloudhsm-jce-examples These sample applications demonstrate how to use the JCE with CloudHSM. They show basic functionality, as well as best practices regarding performance. ## License Summary This sample code is made available under a modified MIT license. See the LICENSE file. ## Building the examples ### Dependencies The latest SDK5 version of CloudHSM JCE is required. They should be installed using the official procedures documented here: * https://docs.aws.amazon.com/cloudhsm/latest/userguide/java-library-install_5.html The examples are tested on a fresh Amazon Linux 2 AMI. You will need to have the following packages installed: * OpenJDK 8 * Apache Maven 3.0.5 You can install these packages on Amazon Linux 2 by running ``` sudo yum install -y java-1.8.0-amazon-corretto-devel maven ``` If you are running on Amazon Linux 1, you will need to install extra packages to get Maven. You can follow these instructions to build the samples on Amazon Linux 1: ``` # Maven is only available through extra packages sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo # You will need Java 1.8 to build the samples sudo yum install -y java-1.8.0-openjdk-devel sudo yum install -y apache-maven # When updating alternatives, choose the 1.8 path: /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java sudo update-alternatives --config java ``` ### Building You can build the project using Maven. Maven will copy the required CloudHSM jars into a local repository and build fat jars which can be executed from the command line. These fat jars will be placed in the `target/assembly/` directory. Before you build your project, be sure to enter the correct CloudHSM version number based on which CloudHSM JCE Provider you have installed on your system. By default, this project is set to use the latest available CloudHSM version, and you may need to make modifications if you are running an older version (note that not all tests are guaranteed to work with older versions of the client). To do this, modify the following line in the `pom.xml` to match your version: ``` <cloudhsmVersion>5.5.0</cloudhsmVersion> ``` To build the project, use the following command: ``` mvn validate mvn clean package ``` ## Running the samples You will need to have a CloudHSM Client connected to an ACTIVE cluster. For more details, please follow the official instructions here: * https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html You will need to provide credentials to the JCE provider in order to run the samples. Please read about JCE provider credentials here: * https://docs.aws.amazon.com/cloudhsm/latest/userguide/java-library-install_5.html#java-library-credentials_5 All Java dependencies should be bundled in the fat jars. Jars can be run using the following command line (as an example): ``` java -ea -jar target/assembly/login-runner.jar --help ``` ## Running and verifying all the samples To run and verify all the samples together, run the command ```mvn verify```
1
gailasgteach/JavaFX-SpringBoot-Samples
Project code from jChampionsConference: Front and Center: JavaFX with SpringBoot
null
# JavaFX-SpringBoot-Samples Projects IgniteDemo - JavaFX & SpringBoot with two views. SpringBootRest - Rest Server using JPA, Hibernate, H2 in-memory database Provides CRUD REST endpoints for MusicCategory table Synchronous traditional REST server, uses embedded Tomcat. See applications.properties for custom configuration. SpringBootRestMySql - Rest Server using JPA, Hibernate, MySQL database. You must install MySQL (Community Edition is fine) See the application.properties file for custom configuration, including root password Optionally install MySQLWorkbench to initialize database with schema and data SpringBootWebClientFX - JavaFX & SpringBoot client that provides CRUD operations. Uses WebFlux WebClient in blocking mode. You must run the SpringBootRest (or SpringBootRestMySql) server first. SpringBootWebClientFXMultiThread - JavaFX & SpringBoot client that provides CRUD operations. Uses WebFlux WebClient in blocking mode Uses JavaFX Concurency library to make REST calls in a background thread Includes a delay so you can see the ProgressIndicator. You must run the SpringBootRest (or SpringBootRestMySql) server first. WeatherService - SpringBoot Reactive WebService Emits random Weather forecasts on interval as server sent events Uses SpringBoot WebFlux library WeatherJFXClient - JavaFX & SpringBoot client that subscribes to the Reactive Weather Service and displays weather forecasts as they arrive. You must run WeatherService first.
0
mdeinum/pro-spring-mvc-code
Source code for the sample application in Pro Spring MVC.
null
Pro Spring MVC Code =================== This repository contains the code samples and sample application as build and published in Pro Spring MVC.
1
romainz/CoordinatorLayoutSample
Several sample for CordinatorLayout uses
null
# CoordinatorLayoutSample Several samples for CoordinatorLayout uses: * A large fixed toolbar * A scrollable toolbar * A collapsable toolbar * A scrollable and collapsable toolbar * A collapsable toolbar with an image having a parallax animation * A use of CoordinatorLayout behavior * A floating action button with a snackbar * A toolbar with pager tabs * A toolbar with pager tabs and parallax image # Play store CoordinatorLayout samples - https://play.google.com/store/apps/details?id=com.zanon.tests&hl=fr # Some links: * Android Design Support Library - http://android-developers.blogspot.fr/2015/05/android-design-support-library.html * Handling Scrolls with CoordinatorLayout - https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout * Material Design with the Android Design Support Library - http://www.sitepoint.com/material-design-android-design-support-library/ # Google documentation: * AppBarLayout - https://developer.android.com/reference/android/support/design/widget/AppBarLayout.html * CoordinatorLayout - https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.html * CollapsingToolbarLayout - https://developer.android.com/reference/android/support/design/widget/CollapsingToolbarLayout.html
1
microsoft/movie-db-java-on-azure
Sample movie database app built using Java on Azure
azure azure-cli azure-container-registry azure-container-service azure-functions azure-redis-cache azure-storage azure-traffic-manager java jenkins jenkins-pipeline kubernetes mysql spring-boot spring-data
# Movie Database App using Java on Azure # The purpose of this sample application is to illustrate a modern Java app in the cloud; the result of this project will be to create a movie database similar to IMDB. ## Requirements ## In order to create and deploy this sample application, you need to have the following: An Azure subscription; if you don't already have an Azure subscription, you can activate your [MSDN subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/) or sign up for a [free Azure account](https://azure.microsoft.com/pricing/free-trial/). In addition, you will need all of the following components before you go through the steps in this README: | [Azure CLI](http://docs.microsoft.com/cli/azure/overview) | [Java 8](http://java.oracle.com/) | [Maven 3](http://maven.apache.org/) | [Git](https://github.com/) | [Docker](https://www.docker.com/) | **NOTE**: There are additional requirements in the *[~/deployment/README.md](deployment/README.md)* file which are required in order to setup your development environment; other required components will be installed automatically by the provisioning scripts. ## Overview ## In the following sections, you will create a development sandbox environment on Azure which uses the following components: - web apps in Linux containers on [Azure App Service (AAS)](https://azure.microsoft.com/en-us/services/app-service/) - Data apps in Kubernetes clusters in the [Azure Container Service (ACS)](https://azure.microsoft.com/en-us/services/container-service/) - [Azure Container Registry (ACR)](https://azure.microsoft.com/en-us/services/container-registry/) for container images - [Azure Database for MySQL](https://azure.microsoft.com/en-us/services/mysql/) for data - [Azure Storage](https://azure.microsoft.com/en-us/services/storage/) for media contents The following diagram illustrates the full topology for this sample application enviroment: ![](./media/movie-app-layout-2.jpg) In this basic layout, the following design decisions have been implemented: - Internet-facing web apps are running in Linux containers on AAS, which can run across multiple regions worldwide. - For better performace, this enviroment uses the following: - [Azure Traffic Manager](https://azure.microsoft.com/en-us/services/traffic-manager/) to route requests for better performance and availability. - [Azure Redis Cache](https://azure.microsoft.com/en-us/services/cache/) for high throughput and low-latency. - Container images for the web apps are built using Docker and pushed to a managed private Docker registry in ACR, and deployed to Linux containers on AAS. - The web apps communicate with the data apps running in Kubernetes clusters in ACS. - Data apps are REST API apps which store and read data from Azure Database for MySQL, which is a fully managed database as a service; data apps store images into and read images from Azure Storage. - Another traffic manager is deployed as a load balancer in the front of data apps for routing requests for better performance and availability. **Note**: For now, Node.js is being used instead of Java in this sample application for the Azure functions; this will be updated in the near future. ## Create and Deploy the Sample Application ## ### Download and customize the sample for your development environment ### 1. Follow the steps in the *[~/deployment/README.md](deployment/README.md)* file of the sample project to clone the project repo and set up your development environment. 1. Navigate to the configuration directory for your Maven installation; for example: */usr/local/maven/3.5.0/libexec/conf/* or *%ProgramFiles%\apache-maven\3.5.0\conf*: a. Open the *settings.xml* file with a text editor. b. Add parameterized settings for ACR access settings to the `<servers>` collection in the the *settings.xml* file, this will enable Maven to use a private registry; for example: ```xml <servers> <server> <id>${env.ACR_LOGIN_SERVER}</id> <username>${env.ACR_USERNAME}</username> <password>${env.ACR_PASSWORD}</password> <configuration> <email>john_doe@contoso.com</email> </configuration> </server> </servers> ``` c. Save and close your *settings.xml* file. <a name="create-the-initial-build"></a> ### Create the initial build ### 1. Open a command prompt and navigate to the *~/deployment/* folder of your local repo. 1. Login to your Azure account and specify which subscription to use: ```shell az login az account set --subscription "<your-azure-subscription>" ``` **NOTE**: You can use either a subscription name or id when specifying which subscription to use; to obtain a list of your subscriptions, type `az account list`. 1. **For Microsoft developers**, we have network security group rules applied to the resources in the development subscriptions which restrict the network access from the internal CORP network. This blocks the SSH communications between the VM's provisioned in this project. To workaround this, set the environment variable `MS_CORP` before you start the provision process: ```shell export MS_CORP=1 ``` 1. Build an initial layout on Azure using an ARM template from using one of the following methods: ```shell source provision.sh ``` > **NOTE**: On Windows, run all shell scripts in Git Bash. The provisioning script will create the following resources in Azure, which may take a long time to complete: * A MySQL instance * A Redis Cache instance * A Function app for resizing images * Two traffic managers for load balancing * An Azure Container Registry for hosting a private Docker image * Two Linux-based web apps for front-end websites * Two Azure Container Services (Kubernetes Clusters) for REST API services * An Azure Container Service (Kubernetes Cluster) for a Jenkins server ### Deploy Java function to Azure Functions using Maven plugin 1. Open a command prompt and navigate to the folder which contains the function app, which is located in the "*~/function-app/*" folder of your repo; this is a Java function app which: * Re-sizes images uploaded to Azure Storage * Trigger by an Azure Blob upload action. 1. Build the data app: ```shell mvn clean package ``` 1. Deploy the function app to Azure Functions using Maven plugin: ```shell mvn azure-functions:deploy ``` ### Deploy the internal-facing data app into a Kubernetes cluster in ACS ### 1. Open a command prompt and navigate to the folder which contains the data app, which is located in the "*~/data-app/*" folder of your repo; this is a Spring Boot app which: * Stores and reads data from Azure Database for MySQL using Spring JDBC * Stores images into and reads images from Azure Storage. 1. Build and dockerize the data app, and push the container into ACR: ```shell mvn package docker:build -DpushImage ``` 1. Deploy the data app to a Kubernetes cluster in ACS [using Maven](https://docs.microsoft.com/en-us/azure/container-service/kubernetes/container-service-deploy-spring-boot-app-using-fabric8-maven-plugin): ```shell mvn clean fabric8:resource fabric8:apply ``` 1. Run below command to watch the creation process of your service object in Kubernetes. Wait until column `EXTERNAL-IP` has a valid IP address, which means your data app is accessible from internet now. ```shell kubectl get svc --namespace=${TARGET_ENV} --watch ``` 1. Navigate to the *~/deployment/* folder of your local repo and run the following script, which will configure various variables for your local enviroment: ```shell cd ../deployment source dev_setup.sh ``` **NOTE**: Microsoft is currently developing a Maven plugin to deploy to a Kubernetes cluster in Azure Container Service, so in the future you will be able to use `mvn deploy`. #### Test your data app deployment #### Run the following command to test whether your data app was successfully deployed: ```shell curl http://${DATA_API_URL}/api/v1 ``` ### Deploy the Internet-facing web app into Linux containers in AAS ### 1. Open the Internet-facing web app, which is located in the "*~/web-app/*" folder of your repo. * This is also a Spring Boot app which talks to the data app that we just deployed. * The web app can also use Azure Redis Cache using Spring Data Redis. 1. Build and dockerize the web app, and push the container into ACR: ```shell mvn package docker:build -DpushImage ``` 1. Use [Maven plugin for Azure Web Apps](https://github.com/Microsoft/azure-maven-plugins/tree/master/azure-webapp-maven-plugin) to deploy the web app to a Linux container in Azure App Service: ```shell mvn azure-webapp:deploy -Dwebapp.resourceGroup=${EAST_US_GROUP} -Dwebapp.appName=${EAST_US_WEBAPP_NAME} ``` Learn more details about how to use Maven Plugin for Azure Web Apps with Azure Container Registry from [this step-by-step tutorial](https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-deploy-spring-boot-app-from-container-registry-using-maven-plugin) at Microsoft Docs Site. #### Test and diagnose your sample deployment #### Test and diagnose using one of the following two methods: * Open website in a web browser ``` open http://${EAST_US_WEBAPP_NAME}.azurewebsites.net/ ``` * Run the following command in a console window: ```shell curl http://${EAST_US_WEBAPP_NAME}.azurewebsites.net/index ``` ### OPTIONAL: Enable monitoring and diagnostics using third party services ### You can optionally enable *New Relic* and *OverOps* monitoring and diagnostics in both the web app and data app by using the steps in the following sections. #### Enable New Relic #### To enable monitoring using *New Relic*, use the following steps. - Open a console and navigate to the `~/web-app` folder in your local repo. - Configure the following environment variables: ```shell export NEW_RELIC_LICENSE_KEY=<your-new-relic-license-key> export WEBAPP_NEW_RELIC_APP_NAME=<app-name-in-new-relic> ``` - Run the following command to build an image with New Relic and push the image to ACR; for example, if your image name is *web-app-w-new-relic*: ```shell mvn package docker:build@with-new-relic -DpushImage ``` - Run the following commands to deploy the web app to AAS: ```shell mvn azure-webapp:deploy@with-new-relic -Dwebapp.resourceGroup=${EAST_US_GROUP} -Dwebapp.appName=${EAST_US_WEBAPP_NAME} ``` - Browse to your account portal in New Relic to see real-time monitoring data. #### Enable OverOps #### To enable diagnostics using *OverOps*, use the following steps. - Open a console and navigate to the `~/web-app` folder in your local repo. - Configure the following environment variables: ```shell export OVEROPSSK=<your-overops-sk> ``` - Run the following command to build an image with OverOps and push the image to ACR; for example, if your image name is *web-app-w-overops*: ```shell mvn package docker:build@with-overops -DpushImage ``` - Run the following commands to deploy the web app to AAS: ```shell mvn azure-webapp:deploy@with-overops -Dwebapp.resourceGroup=${EAST_US_GROUP} -Dwebapp.appName=${EAST_US_WEBAPP_NAME} ``` - Browse to your account portal in OverOps to see real-time diagnostic data. #### Enable Azure Application Insights #### To enable monitoring using *Azure Application Insights*, use the following steps. - [Get an Application Insights instrumentation key](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-java-get-started) - Put the key into ~/web-app/src/main/java/com/microsoft/azure/java/samples/moviedb/web/AppInsightsConfig.java - Redeploy your application <!-- * **App Dynamics** > **NOTE**: Detailed notes will be included here at a later date. * **Dynatrace** > **NOTE**: Detailed notes will be included here at a later date. --> ### Automate continuous integration and continuous deployment (CI/CD) using Jenkins ### 1. Use an existing Jenkins instance, setup continuous delivery - build and configure pipeline using: a. A pipeline config file from the cloned repo b. The forked repo As part of the [initial build](#create-the-initial-build), a Jenkins cluster with pipelines is setup in a Kubernetes cluster in Azure Container Service. You can see that at: ```shell http://${JENKINS_URL} ``` <!-- > **NOTE**: Add a screenshot of the Jenkins dashboard here > **NOTE**: Add the steps to login with the Jenkins CLI --> 1. Download the Jenkins CLI JAR from your Jenkins server; for example: ```shell curl -O http://${JENKINS_URL}/jnlpJars/jenkins-cli.jar ``` 1. Log into your Jenkins Dashboard, then build and deploy the development, test and production releases for these environments: ```shell java -jar jenkins-cli.jar -s \ http://${JENKINS_URL}/ login java -jar jenkins-cli.jar -s \ http://${JENKINS_URL}/ \ build 'movie-db-pipeline-for-dev' -f -v ``` **NOTE**: Job *movie-db-pipeline-for-dev* is for `dev` environment you created in previous section. If you want to have `test` and `prod` environments, you will first need create them using below commands. ```shell cd ./deployment source provision.sh --env test source provision.sh --env prod ``` Then you can build the `test` and `prod` environments using similar steps; e.g. `build 'movie-db-pipeline-for-test' -f -v`. ### Continue to develop apps and rapidly deploy them ### The steps in this section will walk you through the steps to make a simple change to your web app and see those changes reflected on the hom page when you browse to your web app. 1. Using IntelliJ change the name of the web app in the *~/web-app/src/main/resources/templates/index.html* page; for example: ```html <h1 class="cover-heading">Welcome to My Cool Movie DB on Azure!!!</h1> ``` 1. Using IntelliJ and Maven, build, deploy and test the web app: ```shell mvn spring-boot:run curl http://localhost:8080/ ``` 1. Using IntelliJ and Git, push changes to the forked repo when you are satisfied with the changes: ```shell git push origin master ``` 1. Watch Jenkins building and deploying dev and test releases on the Jenkins Dashboard (triggered by GitHub) Go to `http://${JENKINS_URL}` 1. Trigger a new build of job `movie-db-pipeline-for-dev` to deploy your latest changes to `dev` environment. 1. Once these steps have been completed, you should see your updated title on the home page of your web app. ### Scale apps ### 1. Scale out Internet facing web apps ```shell az appservice plan update --number-of-workers 6 \ --name ${EAST_US_WEBAPP_PLAN} \ --resource-group ${EAST_US_GROUP} az appservice plan update --number-of-workers 6 \ --name ${WEST_EUROPE_WEBAPP_PLAN} \ --resource-group ${WEST_EUROPE_GROUP} ``` ## Sample Application Summary ## In review, this sample application utilized all of the following design concepts and technologies. ### Web App Design ### - It is a Spring Boot app with an embedded Tomcat server - It can run in Linux Containers in Azure App Service <!-- The Spring Boot app starts up using secrets stored in Azure Key Vault. App uses Spring Cloud Vault to access secrets inside Azure Key Vault, a "Secret Backend" --> - App uses Azure Redis Cache and accesses it using Spring Data Redis > **NOTE**: In the future the app secrets will be stored in an Azure Key Vault. ### Data App Design ### - It is a Spring Boot app with an embedded Tomcat server - It can run in Kubernetes clusters in Azure Container Service <!-- The Spring Boot app starts up using secrets stored in Azure Key Vault. Uses Spring Cloud Vault to access secrets from Azure Key Vault, a "Secret Backend" --> - App uses Azure Redis Cache and accesses it using Spring Data Redis - App stores and fetches images into and from Azure Storage - App stores and reads app data into and from SQL MySQL-as-a-service using Spring JDBC > **NOTE**: In the future the app secrets will be stored in an Azure Key Vault. ### Functions Design ### - They are used for independent micro computations - They are used for linking two disconnected units in a workflow - re-sizes images uploaded to Azure Storage. They are triggered by an Azure Blob upload action. ## Troubleshooting ## This section will document some of the issues which have been identified when trying to build and deploy this sample application; more will be added as different issues are discovered. ### 'Permission Denied' error when creating the data app ### When you are attempting to build the data app, you might encounter the following error: `[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.11:build (default-cli) on project data-app: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Permission denied` This error is caused when your user account does not have permissions to create the necessary socket for Docker; more details are available in [Solving Docker permission denied while trying to connect to the Docker daemon socket](https://techoverflow.net/2017/03/01/solving-docker-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket/). ### 'Password Complexity' errors when provisioning the sample application ### Some of the Azure services have various password complexity requirements; as a result, you may encounter various errors related to password complexity when you are running the provision scripts. In order to avoid or resolve these issues, you should ensure that the passwords which you choose adhere to standards; for example, at the very least you should choose passwords which have a mixture of uppercase letters, lowercase letters, numbers, and punctuation. ## Contributing ## 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. ## Disclaimer ## **Note**: The sample code, scripts, and documentation in this sample application are not supported under any Microsoft standard support program or service. This sample application is provided AS IS without warranty of any kind. Microsoft disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of this sample application remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use this sample application, even if Microsoft has been advised of the possibility of such damages.
1
beautifulSoup/CNotification
Sample of custom notification.
null
null
1
kunny/ZoomableDraweeView-sample
Sample project for Fresco's ZoomableDraweeView
null
# Fresco ZoomableDraweeView sample [![Build Status](https://travis-ci.org/kunny/ZoomableDraweeView-sample.svg?branch=master)](https://travis-ci.org/kunny/ZoomableDraweeView-sample) Sample project for [Fresco](http://frescolib.org)'s `ZoomableDraweeView`, which supports pinch-to-zoom. ## Features - ZoomableDraweeView (Local) - ZoomableDraweeView (Network) - Gallery ## License Sample project is Apache 2.0-licensed, but some sources from Fresco samples follow its own license. See the [LICENSE](https://github.com/kunny/ZoomableDraweeView-sample/blob/master/LICENSE) for details.
1
IG-Group/ig-webapi-java-sample
Java sample application to access the IG Web API
null
## IG Web API Java Sample [![Build Status](https://travis-ci.org/IG-Group/ig-webapi-java-sample.svg?branch=master)](https://travis-ci.org/IG-Group/ig-webapi-java-sample) ### Overview This repository contains two simple Java console sample applications which access the IG REST and Streaming APIs: 1) **ig-webapi-java-sample-console**: A basic console based application which logs in via /session V2, retrieves a list of position, watchlist, subscribes to lightstreamer and create a position. 2) **ig-webapi-java-sample-console-ui**: A UI based console application (please increase the windows size to prevent scrolling) which shows a graph with the current market price and allows user to place a trade. Authentication is via /session V3. ### Getting started 1) Set the destination IG environment in **environment.properties**. 2) Open a command line / shell prompt and run **mvn clean** to install the Lighstreamer client in ig-webapi-java-client/lib to your local maven repository. 3) Run **mvn clean install** to build the project. 4.a) Run basic console app: ``` cd ig-webapi-java-sample-console java -jar target/ig-webapi-java-sample-console-<project version>.jar <username> <password> <api key> ``` 4.b) Run UI based console app ``` cd ig-webapi-java-sample-console-ui java -jar target/ig-webapi-java-sample-console-ui-<project version>.jar <username> <password> <api key> [<optional epic>] ``` To attach a remote debugger: java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y -jar target/ig-webapi-java-sample-console...
1
auth0-samples/auth0-pnp-exampleco-timesheets
End to end sample for the Server + API Patterns & Practices document
null
# Auth0 Architecture Scenario Samples These sample applications serve as the implementation samples for the [Auth0 Architecture Scenarios](https://auth0.com/docs/architecture-scenarios). In these scenario we build a timesheet application for a fictitious company named ExampleCo. For more information on the samples, please refer to the README in each sample folder. Also refer to the individual Architecture Scenario documents for more information: * [Server Client + API](https://auth0.com/docs/architecture-scenarios/application/server-api) * [SPA + API](https://auth0.com/docs/architecture-scenarios/application/spa-api) ## What is Auth0? Auth0 helps you to: * Add authentication with [multiple authentication sources](https://docs.auth0.com/identityproviders), either social like **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among 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://docs.auth0.com/mysql-connection-tutorial)**. * Add support for **[linking different user accounts](https://docs.auth0.com/link-accounts)** with the same user. * Support for generating signed [JSON Web Tokens](https://docs.auth0.com/jwt) 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://docs.auth0.com/rules). ## Create a free account in Auth0 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/whitehat) details the procedure for disclosing security issues. ## Author [Auth0](auth0.com) ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
1
jasonray/jersey-starterkit
Sample java project showing a hello world jersey project
null
Overview ======== This is a starter project using jax-rs / jersey. I've created this because I often find myself wanting to expirement with something that needs a webservice, and this gives me a starting spot. Clone or fork and use as needed. Note: if you like this version, I highly recommend checking out the sample dropwizard implemenation (https://github.com/jasonray/jersey-starterkit/tree/dropwizard), much better for quick implemenations of java based web services. I love me some dropwizard. Until I discovered node/express. How-to run ========== 0.1) Pre-req You will need the following installed: Java Gradle (optional) A java web container, such as Tomcat. If you are on a mac, I recommend to do the following: - install Homebrew (see: http://brew.sh/) - install Java and Tomcat: ``` brew cask install java brew install tomcat ``` If you will be using Tomcat, you will likely want to make sure you have CATALINA_HOME set. On a mac, edit your profile ``` vi ~/.bash_profile ``` and then add the following (replacing with the directory where you Tomcat instance is deployed: ``` export CATALINA_HOME=/usr/local/Cellar/tomcat/x.x.x/libexec ``` 1) Compile The project compiles using gradle. If you already have gradle installed, compile using: ``` gradle build ``` If you do not have gradle installed, you can utilize the gradle wrapper included in the source ``` ./gradlew war ``` The war file is compiled to: `build/libs/jersey-starterkit.war` 2) Deploy the war file to web container. I've been using apache-tomcat [http://tomcat.apache.org], and typically copy the war to the tomcat webapps directory. On my machine: ``` cp build/libs/jersey-starterkit.war /usr/local/Cellar/tomcat/x.x.x/libexec/webapps/ ``` Shortcut: if you are using tomcat, and $CATALINA_HOME is set, you can run: `./deploy.sh` 3) Confirm that it is running by fetching the URL at on webcontainer + /jersey-helloworld/rest/hello. On my machine: ``` curl localhost:8080/jersey-starterkit/rest/hello ``` The supported endpoints are: ``` http://localhost:8080/jersey-starterkit/rest/customer/id/1 ``` ``` http://localhost:8080/jersey-starterkit/rest/echo?m=hello ``` ``` http://localhost:8080/jersey-starterkit/rest/hello ``` Opening in Eclipse ================== If you use Eclipse, the gradle scripts are nice enough to create your eclipse project and classpath files. First time only --------------- If you have gradle installed, run: ``` gradle eclipse ``` Now you can import the project into eclipse. Updating classpath files ------------------------ If you update dependencies, pull the new libs into your classpath: ``` gradle eclipseClasspath ``` Logging ======= There is a log4j configuration defined in `src/main/resources/log4j.properties`. By default this will log to the STDOUT and to a series of log files. Change the logging configuration as needed. If you would like to use the default logging, create the logging folders: ``` > sudo mkdir /restapi > chmod a+wr /restapi ````
1
scauzhangpeng/Shortcut
桌面快捷方式Sample
null
# 概览 &emsp;&emsp;桌面快捷快捷方式,可在受支持的启动器中显示,帮助用户快速访问应用的某些功能。例如点击桌面“扫一扫”快捷方式,便启动App并且跳转到扫一扫界面。例如添加小程序到桌面,用户点击桌面快捷方式便可启动App快速进入小程序。 &emsp;&emsp;在 Android 8.0(API 级别 26)及更高版本中,才支持创建桌面快捷方式。与静态和动态快捷方式不同,桌面快捷方式在受支持的启动器中显示为单独的图标 <image src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/1e7545ec98684c8b99433dce9de05597~tplv-k3u1fbpfcp-watermark.image" width=300 align="center"/> # 权限 创建桌面快捷方式权限不需要运行时请求,在AndroidManifest.xml声明即可。 ```xml <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" /> ``` 可是,华为、小米、OPPO、Vivo等厂商的权限管理都将**创建桌面快捷方式**权限设计成运行时权限,默认权限是禁止。这样我们要解决两个问题: 1. 如何检测当前应用是否获取了**创建桌面快捷方式**权限 **华为、小米、OPPO、Vivo检测方法不相同,具体分析过程参考[《是否允许创建快捷方式的权限检测》](http://www.lefo.me/2017/05/19/shortcut-permission),根据这篇文章本人已经整理好相关可运行代码 [github](url)** | 厂商 | 检测方法 |机型有问题请issue| | --- | --- |---| | 华为 |反射com.huawei.hsm.permission.PermissionManager#canSendBroadcast|Android 7-11| | 小米|反射AppOpsManager#checkOpNoThrow|Android 7-11| |OPPO|ContentProvider查询URI:content://settings/secure/launcher_shortcut_permission_settings|Android 7-11| |Vivo|ContentProvider查询URI:content://com.bbk.launcher2.settings/favorites|Android 7-11| 2. 是否可以按照运行时权限进行请求让用户进行授权同意 **不可以,需要引导用户跳转应用设置界面进行权限开启,可以跳转应用设置界面,亦可以跳转单独的创建桌面快捷方式权限设置界面** | 应用设置界面 |创建桌面快捷方式权限界面 | | --- | --- | | <image src='https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/fdd324b2e1ea446bb32e29670f7a0e2f~tplv-k3u1fbpfcp-watermark.image' width=200/> |<image src='https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/2bc76255f2694771b83928c26235dfb4~tplv-k3u1fbpfcp-watermark.image' width=200/>| # 参数 - 创建ShortcutInfoCompat对象,必须包含ID,Intent,ShortLable三个参数。ID是唯一性,Intent是点击桌面快捷方式图标后的跳转意图,ShortLable是所创建的快捷方式显示的名称。 ```java /** * Builder class for {@link ShortcutInfoCompat} objects. */ public static class Builder { private final ShortcutInfoCompat mInfo; public Builder(@NonNull Context context, @NonNull String id) { mInfo = new ShortcutInfoCompat(); mInfo.mContext = context; mInfo.mId = id; } ... ... /** * Creates a {@link ShortcutInfoCompat} instance. */ @NonNull public ShortcutInfoCompat build() { // Verify the arguments if (TextUtils.isEmpty(mInfo.mLabel)) { throw new IllegalArgumentException("Shortcut must have a non-empty label"); } if (mInfo.mIntents == null || mInfo.mIntents.length == 0) { throw new IllegalArgumentException("Shortcut must have an intent"); } return mInfo; } } ``` - Icon不是必须的,如果没有主动设置则显示默认图标。这里特别提出Icon,是由于 Android 8.0(API 级别 26)引入了自适应启动器图标,在不同设备型号上显示为不同的形状。如果设置的Icon是圆形、圆角都可能被系统调整后包了一层白边。如果设置Icon是正方形则可能某些机型直接显示为正方形。 | 厂商 | 图标表现形式 |预期表现形式| | --- | --- |---| | 华为 |<image src='https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ea5f8da088884899a924c0509c1cf022~tplv-k3u1fbpfcp-watermark.image' width=300, height=100/>|<image src='https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/51d9101dfd194cf08465485053961365~tplv-k3u1fbpfcp-watermark.image' width=300, height=100/>| | 小米|<image src='https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/46cacbdf176a4003b4ed0205f4d44e38~tplv-k3u1fbpfcp-watermark.image' width=300, height=110/>|<image src='https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a7072d2d65ed43aeafa33bb817ffefcf~tplv-k3u1fbpfcp-watermark.image' width=300, height=110/>| 这样我们要解决一个问题: 1. 如何让创建的桌面快捷方式图标与App图标保持一致 **将设置图标缩放为App图标的大小,然后合并绘制两个图标,取两者重合保留设置图标内容** # 唯一性 &emsp;&emsp;根据```ShortcutInfoCompat#Builder(@NonNull Context context, @NonNull String id)```设置的ID可以标识每一个快捷方式。可是,华为8.0 ~ 8.1出现了一个bug,名称一致也认为是相同的快捷方式,在9.0之后就已修复。 这样我们要解决一个问题: 1. 如何解决华为8.0 - 8.1这两个版本因为名称相同导致无法创建快捷方式的异常 **遍历已有快捷方式,是否存在相同名称的快捷方式,存在则对准备创建的快捷方式改名,目前在后面加一个“.”(当然可以UUID确保完全不一样),等待创建成功的回调后,再默默根据ID对快捷方式进行更新名称操作** # 点击快捷方式打开App &emsp;&emsp;点击快捷方式,打开的意图是所设置的Intent,Sample给的方法是跳转一个透明界面,然后进行逻辑处理。从抽屉式中的通知、桌面快捷方式、微件等端外进入App都可以跳转透明的界面再分发做处理。
0
piomin/sample-quarkus-microservices
Sample applications illustrating usage of Quarkus framework for building microservice architecture
graalvm java microservices openshift quarkus s2i swagger unit-testing
null
1
apolloconfig/apollo-use-cases
Show various usage scenarios and sample codes of the Apollo configuration center, welcome to share more configuration use cases in your daily work!
null
# Purpose 展示Apollo配置中心的各种使用场景和示例代码,目前包含了以下示例项目: * [spring-boot-logger](spring-boot-logger):演示[Spring Boot Logging](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html)如何通过Apollo配置中心实现动态调整Logging Level * [spring-cloud-logger](spring-cloud-logger):演示[Spring Boot Logging](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html)在Spring Cloud环境下如何通过Apollo配置中心方便地实现动态调整Logging Level * [spring-cloud-zuul](spring-cloud-zuul):演示[Spring Cloud Zuul](https://cloud.spring.io/spring-cloud-netflix/single/spring-cloud-netflix.html#netflix-zuul-reverse-proxy)如何通过Apollo配置中心实现动态路由 * [spring-cloud-zuul-ratelimit](spring-cloud-zuul-ratelimit):演示[Spring Cloud Zuul](https://cloud.spring.io/spring-cloud-netflix/single/spring-cloud-netflix.html#netflix-zuul-reverse-proxy)的第三方限流插件[marcosbarbero/spring-cloud-zuul-ratelimit](https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit)如何通过Apollo配置中心实现动态限流 * [spring-cloud-gateway](spring-cloud-gateway):演示[Spring Cloud Gateway](https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.0.3.RELEASE/single/spring-cloud-gateway.html)如何通过Apollo配置中心实现动态路由 * [spring-boot-encrypt](spring-boot-encrypt):演示如何结合[jasypt-spring-boot](https://github.com/ulisesbocchio/jasypt-spring-boot)实现Apollo中存储加密配置 * [dynamic-datasource](dynamic-datasource):演示[Spring Boot默认的HikariCP DataSource](https://github.com/brettwooldridge/HikariCP)如何通过Apollo配置中心实现动态切换数据源(其它类型的DataSource也是类似的,可以依样画葫芦) * [dubbo](dubbo): 演示[Dubbo](https://github.com/apache/incubator-dubbo)如何通过Apollo配置中心实现中心化配置 * [spring-boot-dubbo](spring-boot-dubbo): 演示[Dubbo Spring Boot Starter](https://github.com/apache/incubator-dubbo-spring-boot-project)如何通过Apollo配置中心实现中心化配置 * 该项目同时也演示了如何通过apollo管理logback的配置,详见[logback-spring.xml](https://github.com/ctripcorp/apollo-use-cases/blob/master/spring-boot-dubbo/spring-boot-dubbo-provider/src/main/resources/logback-spring.xml) * [netflix-archaius](netflix-archaius): 演示[Netflix Archaius](https://github.com/Netflix/archaius)如何使用Apollo配置中心作为其服务端使用 * [sentinel](sentinel): 演示[Sentinel](https://github.com/alibaba/Sentinel)如何通过Apollo配置中心实现中心化流控规则配置 * [properties-keeper](properties-keeper): 演示如何通过apollo管理启动前需要加载的properties文件配置 * [spring-boot-agent](spring-boot-agent): 演示如何通过java agent探针技术实现应用无缝接入Apollo配置中心 * [spring-mvc-logger](spring-mvc-logger): 演示Spring/SpringMVC项目下如何通过Apollo配置中心实现动态调整日志的属性值 欢迎大家把日常工作中的更多配置使用案例分享出来,提交Pull Request即可! # Instructions 1. 部署并启动Apollo配置中心 * 请参考[分布式部署指南](https://github.com/ctripcorp/apollo/wiki/%E5%88%86%E5%B8%83%E5%BC%8F%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97) * 如果只是Demo用途的话,可以参考[Quick Start](https://github.com/ctripcorp/apollo/wiki/Quick-Start)文档快速地在本地启动一套Apollo配置中心,或者参考[Apollo开发指南](https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97)通过IDE在本地启动一套Apollo配置中心 2. 配置Apollo Meta信息 * Apollo支持应用在不同的环境有不同的配置,所以需要配置Apollo Meta信息 * 示例代码在`application.properties`或System Property配置了`apollo.meta=http://localhost:8080`,请根据实际部署情况调整该配置 3. 以上步骤都完成后,就可以参考各子模块的README.md来运行示例项目了
1
openskynetwork/osky-sample
OpenSky sample data
null
# osky-sample This repository contains a 5 minutes sample of ADS-B data as stored by the OpenSky Network and some tools to process them. The raw messages are stored using the [Avro serialization system](https://avro.apache.org/) with the following schema: ``` { "name": "ModeSEncodedMessage", "type": "record", "namespace": "org.opensky.avro.v2", "fields": [ {"name": "sensorType", "type": "string"}, {"name": "sensorLatitude", "type": ["double", "null"]}, {"name": "sensorLongitude", "type": ["double", "null"]}, {"name": "sensorAltitude", "type": ["double", "null"]}, {"name": "timeAtServer", "type": "double"}, {"name": "timeAtSensor", "type": ["double", "null"]}, {"name": "timestamp", "type": ["double", "null"]}, {"name": "rawMessage", "type": "string"}, {"name": "sensorSerialNumber", "type": "int"}, {"name": "RSSIPacket", "type": ["double", "null"]}, {"name": "RSSIPreamble", "type": ["double", "null"]}, {"name": "SNR", "type": ["double", "null"]}, {"name": "confidence", "type": ["double", "null"]} ] } ``` A example decoder is also provided (see below). We've been storing all messages received by our network for more than two years in this format. If you need more data for your research, contribute to the network with a sensor or send a mail to contact@opensky-network.org. Please also check out the [slides](oskyws15_data_tools.pdf) on the data and tools of this repository. ## The data sample The OpenSky avro sample can be found [here](avro/raw20150421_sample.avro). This file contains 304131 records as received by the OpenSky Network on April, 21st between 12:00 and 12:05 UTC. For more information, run e.g. `java -cp tools-1.0-fat.jar org.opensky.tools.AvroInfo avro/raw20150421_sample.avro` (see below). ## Example Tools All tools are based on the [java-adsb project](https://github.com/openskynetwork/java-adsb). In order to use the tools, build the package using `mvn package`. The archive tools-1.0-fat.jar (target/) currently includes the following tools for processing OpenSky's avro files. #### AvroInfo This tool parses the avro file and prints useful information. For more information, run `java -cp tools-1.0-fat.jar org.opensky.tools.AvroInfo` or try `java -cp tools-1.0-fat.jar org.opensky.tools.AvroInfo avro/raw20150421_sample.avro`. #### Avro2Kml This tool parses the avro, decodes the messages and outputs file in the Keyhole Markup Language (KML). This file can e.g. be displayed by Google Earth. It will include all selected tracks and additional information extracted from the avro file. An example screenshot of the result for the avro sample provided in this repository can be found [here](img/kml_example.png). To generate a kml from the sample file, use `java -cp tools-1.0-fat.jar org.opensky.tools.Avro2Kml avro/raw20150421_sample.avro raw20150421_sample.kml`. Then open raw20150421_sample.kml using Google Earth. For more parameters (such as filters), run `java -cp tools-1.0-fat.jar org.opensky.tools.Avro2Kml -h`. #### ExtractArea This tool goes through OpenSky avro files and filters messages that were sent within a certain area. The area can be defined by a center coordinate and a radius. Output will be another avro filei. Example: To filter all messages from a 10 km radius around Zurich airport, you can use `java -cp tools-1.0-fat.jar org.opensky.tools.ExtractArea -c 8.55,47.45 -r 10000 avro/raw20150421_sample.avro airport_zurich.avro`. Use Avro2Kml to see the result in Google Earth. #### Avro2SQLite This tool decodes the avro file and stores all positions and velocities in an sqlite database. Do a `SELECT sql FROM sqlite_master;` on a SQLite3 file created with this tool to see the database structure. Example: ```bash # convert sample avro to sqlite3 database java -cp tools-1.0-fat.jar org.opensky.tools.Avro2SQLite avro/raw20150421_sample.avro raw20150421_sample.sqlite3 # ... # check out database sqlite3 raw20150421_sample.sqlite3 # Example query: show me two random flights # # sqlite> SELECT id, icao24, callsign, DATETIME(first, 'unixepoch'), DATETIME(last, 'unixepoch') FROM flights ORDER BY RANDOM() LIMIT 2; # 370|406091|BAW605 |2015-04-21 12:00:01|2015-04-21 12:05:00 # 568|400f00|EZY78WC |2015-04-21 12:00:06|2015-04-21 12:01:24 # # Now show me the last position of the flight with the callsign EZY78WC (id 568): # # sqlite> SELECT DATETIME(timestamp, 'unixepoch'), longitude, latitude, altitude FROM positions WHERE flight=568 ORDER BY timestamp DESC LIMIT 1; # 2015-04-21 12:01:23|10.8334121704102|46.2030494819253|10058.4 ``` #### AvroSort This tool sort unsorted OpenSky avro files by the time the messages arrived at the OpenSky server (timeAtServer). This is important for a proper position decoding since the decoder assumes messages to be ordered in time. Simply run `java -cp tools-1.0-fat.jar org.opensky.tools.AvroSort sample.avro sample_sorted.avro`. Note: the tools first loads all data into memory. So make sure you have enough memory available. Otherwise use AvroSplit to split the Avro file in consitent small files. #### AvroSplit This tool can be used to split one Avro file into an arbitrary number of smaller files without losing flight consistency. It can also be used to join multiple Avro files since it allows a arbitrary number of input as well as output files! Usage: * `java -cp tools-1.0-fat.jar org.opensky.tools.AvroSplit -o outfile -n 5 sample.avro` -- splits sample.avro into 5 files called outfile1.avro, outfile2.avro, ... * `java -cp tools-1.0-fat.jar org.opensky.tools.AvroSplit -o outfile in1.avro in2.avro ...` -- joins input files to one avro file outfile1.avro
1
nareshbafna/oauth2
Spring Security OAuth2 sample with separate Resource and Auth servers
null
This is the from sample application I found on https://github.com/SpringSource/spring-security-oauth.git I just did following on top of the samples 1. Moved from tomcat to jetty 2. Changed storge and in memory implementations to jdbc ones 3. Separated oauth resource and authentication servers
1
sleberknight/basic-hbase-examples
Contains sample code for a lightning talk on HBase.
null
null
1
mooosu/spring-mvc-mybatis-sample
A java web application sample based spring-mvc and integrated with mybatis
null
spring-mvc-mybatis-sample ========================= A java web application sample based spring-mvc and integrated with mybatis Related: http://stackoverflow.com/questions/5786582/how-to-use-annotation-validation-in-spring-with-error-message-gotten-from-proper Shiro Subject: http://shiro.apache.org/subject.html Shiro tag: http://shiro.apache.org/java-authorization-guide.html Shiro Spring configuration http://shiro.apache.org/spring.html Shiro Annotations List: http://shiro.apache.org/java-annotations-list.html Articles: http://www.infoq.com/articles/apache-shiro http://lwx522.iteye.com/blog/1635388 captcha http://www.ibm.com/developerworks/web/library/wa-apacheshiro/ Validation: http://springinpractice.com/2008/07/17/annotation-based-validation-with-the-spring-bean-validation-framework/
1
cdelmas/microservices-comparison
A sample project to compare Microservices libraries.
null
null
1
spring-petclinic/spring-petclinic-angularjs
AngularJS 1 and Spring Boot 2 version of the Spring Petclinic sample application
angular1 angularjs devtools spring-boot
null
1
r3gis3r/SampleCSipSimpleApp
CSipSimple plugin/library usage sample application
null
Introduction ============ This project aim to show very basic way to include or integrate CSipSimple in another application Before doing everything, please read with a lot of attention : [Licensing information](http://code.google.com/p/csipsimple/wiki/Licensing?wl=en) As you will notice there is several ways to integrate with CSipSimple. Depending on the way you choose you will have to adapt manifest and included libs. The standalone way ------------------ ### Info This implies that you have a Commercial License of pjsip and that you respect LGPL license of CSipSimple. ### Setup project * Checkout and be able to build CSipSimple. For that read the [How To Build wiki page](http://code.google.com/p/csipsimple/wiki/HowToBuild?wl=en). Once you are sure that you can build CSipSimple and run it by your own means, you can proceed the next step. * Turn CSipSimple into a library project. For that read [official android doc about library projects](http://developer.android.com/guide/developing/projects/projects-eclipse.html) * Mute some conflicting CSipSimple definitions of permissions in manifest of CSipSimple. This is marked as `<!-- COMMENT THIS if you plan to use in library mode -->` In the current trunk version. * Then you can checkout the project of this github and reference CSipSimple as a library (refer to official android doc about libraries). Keep in mind that obviously in this case you can't install both your app and CSipSimple. It will conflicts due to the fact content providers names are indentical. The plugin way -------------- ### Info If you plan to be a CSipSimple plugin or want to distribute two apps (one that is CSipSimple repackaged as a plugin and the other yours), this project is still valid but it's slightly different to setup. In this case the repackaged CSipSimple (or CSipSimple itself) remains under GPL license terms. And your plugin can be released under your license terms. ### Setup project * Checkout this project. * Checkout CSipSimple api part (this is a package that is standalone and integrated in CSipSimple source code). * Checkout CSipSimple strings api part (this is a folder containing useful string). To do so : cd SampleCSipSimpleApp/src/ mkdir -p com/csipsimple cd com/csipsimple svn checkout http://csipsimple.googlecode.com/svn/trunk/CSipSimple/src/com/csipsimple/api api cd ../../.. mkdir -p res/values cd res/values svn export http://csipsimple.googlecode.com/svn/trunk/CSipSimple/res/values/api_strings.xml api_strings.xml Then you have to change manifest to be in plugin mode. So no need to redefine all entry points of CSipSimple because all are already defined in CSipSimple app part. * Remove the reference to the CSipSimple library in eclipse settings of the project * Delete the `AndroidManifest.xml` file and rename `AndroidManifestPlugin.xml` file to `AndroidManifest.xml`.
1
callistaenterprise/blog-multitenancy
Sample application demonstrating dynamic Multi-tenancy with Spring Boot, Hibernate and Liquibase
null
# Multi Tenancy with Spring Boot, Hibernate & Liquibase ## Overview Multi Tenancy usually plays an important role in the business case for SAAS solutions. Spring Data and Hibernate provide out-of-the-box support for different Multi-tenancy strategies. Configuration however becomes more complicated, and the available examples are few. This project complements my blog series on Multi Tenancy (see https://callistaenterprise.se/blogg/teknik/2020/09/19/multi-tenancy-with-spring-boot-part1/), and contains working examples of different Multi Tenant strategies implemented with Spring Boot, Hibemate and Liquibase, complete with support for database migrations as well as dynamically set up new tenants on the fly. ## How to use the examples The master branch contains a common, minimal example project skeleton. The different Multi-tenancy strategy examples are in separate branches. ### Database per tenant The `database` branch implements the *Database per tenant* strategy. ### Schema per tenant The `schema` branch implements the *Schema per tenant* strategy. ### Shared Database with Discriminator, using Hibernate Filters The `shared_database_hibernate` branch implements the *Shared Database with Discriminator* strategy, using Hibernate's experimental support for discriminator-based multi-tenancy (see e.g. https://hibernate.atlassian.net/browse/HHH-6054) ### Shared Database with Discriminator, using PostgreSQL's Row Level Security The `shared_database_postgres_rls` branch implements the *Shared Database with Discriminator* strategy, using PostgreSQL's Row Level Security. ## How to start a Dockerized postgres database All the examples require a postgres database running at localhost:5432. Run the following command to use the provided `docker-compose.yml` configuration to start a dockerized postgres container: ``` docker-compose up -d ``` Close it down with the following command when done, or if you need to recreate the database: ``` docker-compose down ```
1
selenide-examples/testcontainers
Selenide + TestContainers (Docker) sample project
automated-tests docker selenide selenium-java testcontainers testing-tools
# Selenide + TestContainers (Docker) This is a sample project showing how to run tests in Docker with help of TestContainer library. Look for `SearchTestWithDocker` to see how to run Docker with just a single annotation! [![Build Status](https://travis-ci.org/selenide-examples/testcontainers.png)](https://travis-ci.org/selenide-examples/testcontainers) ## How to run tests > ./gradlew test --rerun-tasks
1
kazuki43zoo/mybatis-spring-boot-jpetstore
A sample web application built on MyBatis 3, Spring Boot and Thymeleaf 3.
mybatis selenide selenium spring-boot spring-mvc spring-security thymeleaf
# mybatis-spring-boot-jpetstore [![Java CI](https://github.com/kazuki43zoo/mybatis-spring-boot-jpetstore/actions/workflows/ci.yaml/badge.svg)](https://github.com/kazuki43zoo/mybatis-spring-boot-jpetstore/actions/workflows/ci.yaml) [![Dependency Check](https://github.com/kazuki43zoo/mybatis-spring-boot-jpetstore/actions/workflows/dependency-check.yaml/badge.svg)](https://github.com/kazuki43zoo/mybatis-spring-boot-jpetstore/actions/workflows/dependency-check.yaml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=kazuki43zoo_mybatis-spring-boot-jpetstore&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=kazuki43zoo_mybatis-spring-boot-jpetstore) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=kazuki43zoo_mybatis-spring-boot-jpetstore&metric=coverage)](https://sonarcloud.io/summary/new_code?id=kazuki43zoo_mybatis-spring-boot-jpetstore) This sample is a web application built on MyBatis, Spring Boot(Spring MVC, Spring Security) and Thymeleaf. This is another implementation of MyBatis JPetStore sample application (https://github.com/mybatis/jpetstore-6). Original application is available for downloading in the downloads section of MyBatis project site. In this section, we will walk through this sample to understand how is it built and learn how to run it. > **Note** > > This sample application is under development. > If you found an issue, please report from [here](https://github.com/kazuki43zoo/mybatis-spring-boot-jpetstore/issues/new). ## Requirements * Java 8+ (JDK 1.8+) ## Stacks * MyBatis Spring Boot Starter 2.2 (MyBatis 3.5, MyBatis Spring 2.0) * Spring Boot 2.7 (Spring Framework 5.3, Spring Security 5.7) * Thymeleaf 3.0 * Hibernate Validator 6.2 (Bean Validation 2.0) * HSQLDB 2.5 (Embed Database) * Flyway 8.5 (DB Migration) * Tomcat 9.0 (Embed Application Server) * Groovy 4.0 (Use multiple line string on MyBatis Mapper method) * Lombok 1.18 * Selenide 6.5 * Selenium 4.1 * etc ... ## Run using Maven command * Clone this repository ``` $ git clone https://github.com/kazuki43zoo/mybatis-spring-boot-jpetstore.git ``` * Run a web application using the spring-boot-plugin ``` $ cd mybatis-spring-boot-jpetstore.git $ ./mvnw clean spring-boot:run ``` ## Run using java command * Build a jar file ``` $ ./mvnw clean package -DskipTests=true ``` * Run java command ``` $ java -jar target/mybatis-spring-boot-jpetstore-2.0.0-SNAPSHOT.jar ``` ## Perform integration test using Maven command Perform integration tests for screen transition. ``` $ ./mvnw clean test ``` ## Run on IDEs (Note) This sample use the [Lombok](https://projectlombok.org/) to generate setter method, getter method and constructor. If this sample application run on your IDE, please install the Lombok. (see [https://projectlombok.org/download.html](https://projectlombok.org/download.html)) And this application use the groovy language to use multiple line string on MyBatis Mapper method. If this sample application run on your IDE, please convert to groovy project and add `src/main/groovy` into source path. And if you use a STS(or Eclipse), please install the Groovy Eclipse plugin. About how install the Groovy Eclipse, please see as follow: * https://github.com/groovy/groovy-eclipse/wiki e.g.) multiple line string on MyBatis Mapper method ```groovy @Mapper @CacheNamespace interface CategoryMapper { @Select(''' SELECT CATID AS categoryId, NAME, DESCN AS description FROM CATEGORY WHERE CATID = #{categoryId} ''') Category getCategory(String categoryId) } ``` ## Access to the index page [http://localhost:8080/](http://localhost:8080/) ![Index Screen](images/screen-index.png) ![Catalog Screen](images/screen-catalog.png) ## Default active accounts (ID/PASSWORD) * j2ee/j2ee * ACID/ACID ## Data Store In this application, application data stored in filesystem files. ``` $HOME └── db     + jpetstore.script    + jpetstore.properties ``` ## Project Structure Project structure of this sample application is as follow: ``` . └── src    └── main       ├── groovy       │   └── com       │   └── kazuki43zoo       │   └── jpetstore       │   └── mapper // Store mapper interfaces       ├── java       │   └── com       │   └── kazuki43zoo       │   └── jpetstore       │   ├── component // Store general component classes │      │   ├── event │      │   ├── exception │      │   ├── message │      │   └── validation       │   ├── config // Store configuration classes       │   ├── domain // Store domain objects       │   ├── service // Store service classes       │   └── ui // Store classes that depends user interface       │   └── controller // Store controller classes       └── resources       ├── db // Store sql files for Flyway       │   └── migration       ├── static // Store static web resource files       │   ├── css       │   └── images       └── templates // Store view template files for Thymeleaf       ├── account       ├── auth       ├── cart       ├── catalog       ├── error       └── order ```
1
AgoraIO/Basic-Audio-Call
Sample app to join/leave a channel, mute/unmute, and switch between the speaker/headset.
agora groupchat voicechat
# Basic Audio Call _Other Languages: [简体中文](README.zh.md)_ Agora provides a set of sample applications demonstrating how to integrate the Agora Audio SDK for: - [1-to-1 voice calls](#1-to-1-voice-calls) - [Group vocie calls](#group-voice-calls) ## Platforms Supported ### 1-to-1 Voice Calls Sample applications for 1-to-1 voice calls are provided for Android, iOS. The 1-to-1 voice call sample applications, demonstrate how to: - Join / leave a channel - Mute / unmute audio - Switch speaker Project Folder Name|Platform|Description ---|---|--- [Agora Android Voice Tutorial - 1 to 1](./One-to-One-Voice/Agora-Android-Voice-Tutorial-1to1)|Android|Agora Android Voice Tutorial 1 to 1 [Agora iOS Voice Tutorial for Swift - 1 to 1](./One-to-One-Voice/Agora-iOS-Voice-Tutorial-Swift-1to1)|iOS|Agora iOS Voice Tutorial 1 to 1 using Swift ### Group Voice Calls Sample applications for group voice calls are provided for Android, iOS. The group voice call sample applications, demonstrate how to: - Join / leave a channel - Mute / unmute audio - Switch speaker Project Folder Name|Platform|Description ---|---|--- [Open Voice Call for Android](./Group-Voice-Call/OpenVoiceCall-Android)|Android|Open Voice Call for Android [Open Voice Call iOS for Objective C](./Group-Voice-Call/OpenVoiceCall-iOS-Objective-C)|iOS|Open Voice Call for iOS using Objective C [Open Voice Call iOS for Swift](./Group-Voice-Call/OpenVoiceCall-iOS)|iOS|Open Voice Call for iOS using Swift ## Contact Us - For potential issues, take a look at our [FAQ](https://docs.agora.io/en/faq) first - Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials - Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) for more complicated real use case - Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community) - You can find full API documentation at [Document Center](https://docs.agora.io/en/) - If you encounter problems during integration, you can ask question in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io) - You can file bugs about this sample at [issue](https://github.com/AgoraIO/Basic-Audio-Call/issues) ## License All sample applications are licensed under the MIT License (MIT). [View the license](LICENSE.md).
1
DataStax-Examples/spring-data-starter
⚡️ A sample Spring Data Cassandra REST API
building-sample-apps cassandra dev rest-api spring spring-data spring-data-cassandra
<!--- STARTEXCLUDE ---> # Spring Data Cassandra REST API *10 minutes, Beginner, [Start Building](https://github.com/DataStax-Examples/spring-data-starter#prerequisites)* This application uses Spring Data Cassandra and DataStax Astra DB to build a REST API for a backend service that interacts with products and orders. <!--- ENDEXCLUDE ---> ![image](https://user-images.githubusercontent.com/3254549/90944387-439a1f00-e3d3-11ea-9df4-e8a5580c62cd.png) ## Objectives * Run a REST API that connects to DataStax Astra DB ## How this works We're using Spring Data Cassandra and Datastax Astra DB to build a REST API that stores Products and Orders. ## Get Started To build and play with this app, follow the build instructions that are located here: [https://github.com/DataStax-Examples/spring-data-starter](https://github.com/DataStax-Examples/spring-data-starter#prerequisites) <!--- STARTEXCLUDE ---> # Running Spring Data Cassandra REST API Follow the instructions below to get started. ## Prerequisites Let's do some initial setup by creating a serverless(!) database. ### DataStax Astra 1. Create a [DataStax Astra account](https://dtsx.io/38HWu73) if you don't already have one: ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-register-basic-auth.png) 2. On the home page. Locate the button **`Create Database`** ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-dashboard.png) 3. Locate the **`Get Started`** button to continue ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-select-plan.png) 4. Define a **database name**, **keyspace name** and select a database **region**, then click **create database**. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-create-db.png) 5. Your Astra DB will be ready when the status will change from *`Pending`* to **`Active`** 💥💥💥 ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-active.png) 6. After your database is provisioned, we need to generate an Application Token for our App. Go to the `Settings` tab in the database home screen. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-settings.png) 7. Select `Admin User` for the role for this Sample App and then generate the token. Download the CSV so that we can use the credentials we need later. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-settings-token.png) 8. After you have your Application Token, head to the database connect screen and select the driver connection that we need. Go ahead and download the `Secure Bundle` for the driver. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-connect-bundle.png) 9. Make note of where to use the `Client Id` and `Client Secret` that is part of the Application Token that we generated earlier. ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/astra-db-connect-bundle-driver.png) ### Github 1. Click `Use this template` at the top of the [GitHub Repository](https://github.com/DataStax-Examples/spring-data-starter): ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/github-use-template.png) 2. Enter a repository name and click 'Create repository from template': ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/github-create-repository.png) 3. Clone the repository: ![image](https://raw.githubusercontent.com/DataStax-Examples/sample-app-template/master/screenshots/github-clone.png) ## 🚀 Getting Started Paths: *Make sure you've completed the [prerequisites](#prerequisites) before starting this step* - [Running on Gitpod](#running-on-gitpod) ### Running on Gitpod 1. Click the 'Open in Gitpod' link: [![Open in IDE](https://gitpod.io/button/open-in-gitpod.svg)](https://dtsx.io/2QjoULs) 2. Once your Gitpod workspace has loaded, you'll be asked to paste your service account credentials in the Gitpod terminal at the bottom of the screen: ![image](https://user-images.githubusercontent.com/3254549/90944321-e900c300-e3d2-11ea-9624-dae5f81b6a0a.png) 3. When the app is finished building, click the 'Open Browser' button on the bottom right of the screen: ![image](https://user-images.githubusercontent.com/3254549/90944371-249b8d00-e3d3-11ea-8305-b7d4fad9742c.png) 4. You've successfully build a Spring Data Cassandra application! ![image](https://user-images.githubusercontent.com/3254549/90944387-439a1f00-e3d3-11ea-9df4-e8a5580c62cd.png) <!--- ENDEXCLUDE --->
1
DAYUCS/Hyperledger-Fabric-Demo
A sample Fabric SDK Java application
null
# Hyperledger
1
chrishantha/jfr-flame-graph
Get Method Sampling from Java Flight Recorder Dump and convert to FlameGraph compatible format.
flamegraph java java-flight-recordings jmc-parser
Note: Travis has removed the support for Oracle JDK 8. Therefore the build status is removed temporarily. Converting JFR Method Profiling Samples to FlameGraph compatible format. ======================================================================== This is a simple application to read Method Profiling Samples from Java Flight Recorder dump and convert those Stack Traces to [FlameGraph] compatible format. [FlameGraph]: https://github.com/brendangregg/FlameGraph This application uses the unsupported [JMC Parser]. [JMC Parser]: http://hirt.se/blog/?p=446 See my blog post on "[Flame Graphs with Java Flight Recordings]" for more details. [Flame Graphs with Java Flight Recordings]: http://isuru-perera.blogspot.com/2015/05/flame-graphs-with-java-flight-recordings.html ## Prerequisites This project depends on Oracle JDK 8. Therefore, make sure that `JAVA_HOME` is set to Oracle JDK 8. ## How to build and install Build and install `jfr-flame-graph` app using ``` ./gradlew installDist ``` This will install the executable into `./build/install/jfr-flame-graph/bin`. You can add this location to your `PATH`. ## Clone FlameGraph repository Clone [Brendan]'s [FlameGraph] repository and set the environment variable `FLAMEGRAPH_DIR` to FlameGraph directory [Brendan]: http://www.brendangregg.com/bio.html ``` git clone https://github.com/brendangregg/FlameGraph.git export FLAMEGRAPH_DIR=/path/to/FlameGraph ``` ## How to generate a Flame Graph There are helper scripts, to generate the flame graphs in `./build/install/jfr-flame-graph/bin` directory. For example: ``` ./create_flamegraph.sh -f /tmp/highcpu.jfr -i > flamegraph.svg ``` Open the SVG file in your web browser. Use -h with scripts to see the available options. For example: ``` $ ./jfr-flame-graph -h Usage: JFRToFlameGraphWriter [options] Options: -d, --decompress Decompress the JFR file Default: false -et, --end-timestamp End timestamp in seconds for filtering Default: 9223372036854775807 -e, --event Type of event used to generate the flamegraph Default: cpu Possible Values: [cpu, allocation-tlab, allocation-outside-tlab, exceptions, monitor-blocked, io] -h, --help Display Help -ha, --hide-arguments Hide arguments in methods Default: false -i, --ignore-line-numbers Ignore Line Numbers in Stack Frame Default: false * -f, --jfrdump Java Flight Recorder Dump -l, --live Export stack trace sample timestamp (in json output type) Default: false -o, --output Output file -ot, --output-type Output type Default: folded Possible Values: [folded, json] -j, --print-jfr-details Print JFR details and exit Default: false -t, --print-timestamp Print timestamp in JFR Details Default: false -rv, --show-return-value Show return value for methods in the stack Default: false -st, --start-timestamp Start timestamp in seconds for filtering Default: -9223372036854775808 -sn, --use-simple-names Use simple names instead of qualified names in the stack Default: false ``` ## License Copyright (C) 2015 M. Isuru Tharanga Chrishantha Perera Licensed under the Apache License, Version 2.0
0
melix/jmh-gradle-example
Sample project showcasing the JMH gradle plugin
null
jmh-gradle-example ================== Sample project showcasing the JMH gradle plugin Clone this repository, then change directory and type: ```./gradlew jmh```
1
kikoso/Event-Bus-Architecture
Event Bus Architecture sample
null
# Event-Bus-Architecture Event Bus Architecture sample Example for the medium post
1
matzuk/PaginationSample
Sample of practical using of AutoLoadingRecyclerView and PaginationTool
null
# PaginationSample Sample of practical using of AutoLoadingRecyclerView and PaginationTool which transform common RecyclerView in RecyclerView with infinity pagination with RxJava help # Components 1. <b>com.matsyuk.pagination_sample.utils</b> - <b><i>AutoLoadingRecyclerView</i></b> is a RecyclerView with the ability to add more items on it when reaches the end of the list, and <b><i>PaginationTool</i></b> is independent, more flexibla, stable and compact module which transform any RecyclerView in RecyclerView with infinity pagination. <b><i>AutoLoadingRecyclerView</i></b> and <b><i>PaginationTool</i></b> with correct error handling and reorienation screen handling 2. <b>com.matsyuk.pagination_sample.data</b> - Fake data source for lists 3. <b>com.matsyuk.pagination_sample.ui</b> - samples of practical using # Description Article about AutoLoadingRecyclerView - http://habrahabr.ru/post/268991/ Article about PaginationTool - http://habrahabr.ru/post/271875/ # Example of PaginationTool using ```java // RecyclerView pagination PaginationTool<List<Item>> paginationTool = PaginationTool. buildPagingObservable( recyclerView, offset -> EmulateResponseManager.getInstance().getEmulateResponse(offset, LIMIT)) .setLimit(LIMIT) .build(); pagingSubscription = paginationTool .getPagingObservable() .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Subscriber<List<Item>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(List<Item> items) { recyclerViewAdapter.addNewItems(items); recyclerViewAdapter.notifyItemInserted(recyclerViewAdapter.getItemCount() - items.size()); } }); ``` # License Copyright 2015 Eugene Matsyuk (matzuk2@mail.ru) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
1
payu-intrepos/payumoney-new-sample-app
New Sample App For PayUmoney and PnP SKD integration
null
# payumoney-new-sample-app Accept mobile payments in any Android App using our native Android SDK. With our mobile SDKs, you do not need to worry about PCI DSS compliance by eliminating the need to send card data to your server. Instead, our libraries send the card data directly to PayU servers which are PCI-DSS Compliant. The PayUmoney mobile SDKs ensure strong encryption and data security to ensure complete peace of mind to your users. ## Features Supported The following features are supported in the PayUmoney Plug and Play Android SDK. 1. Saved Cards 2. Auto-OTP Read 3. Entry Multiple Payment methods 4. Ready to use Payment UI ## Payment Modes Supported The following payment modes are supported in the PayUmoney Plug and Play Android SDK. 1. Credit Card 2. Debit Card 3. NetBanking 4. EMI 5. UPI 6. Wallets Refer Integration doc - https://developer.payumoney.com/android/?_ga=2.172164586.838333375.1597297930-1070203210.1585657838
1
therealmanalu/pso-example-java
Particle Swarm Optimization (PSO) Sample Code using Java
null
pso-example-java ================ Particle Swarm Optimization (PSO) Sample Code using Java This project is a complete version of Particle Swarm Optimization with Java sample code described in http://gandhim.wordpress.com/2010/04/04/particle-swarm-optimization-pso-sample-code-using-java.
1
vitovalov/TabbedCoordinatorLayout
TabbedCoordinatorLayout is a Sample project demostrating the usage of TabLayout (ViewPager with Tabs) inside of CollapsingToolbarLayout all together in CoordinatorLayout
null
# TabbedCoordinatorLayout with Navigation Drawer TabbedCoordinatorLayout is a Sample project demostrating the usage of CoordinatorLayout, Collapsing Toolbar paired with TabLayout and now extended with side Navigation Drawer menu. ![img](art/demo.gif)
1
jaxio/generated-projects
Sample projects generated by Celerio, a Jaxio product.
null
null
1
davidkiss/spring-cloud-streams-kafka-demo
Sample application using Spring Boot, Spring Cloud Stream and Kafka
null
null
1
JorgeCastilloPrz/Dagger2Scopes
Dagger 2 sample app implementing multiple scopes. Clean arquitecture.
null
[![Build Status](https://travis-ci.org/JorgeCastilloPrz/Dagger2Scopes.svg?branch=master)](https://travis-ci.org/JorgeCastilloPrz/Dagger2Scopes) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Dagger2Scopes-brightgreen.svg?style=flat)](https://android-arsenal.com/details/3/1717) ![Dagger2Scopes image](/art/dagger2scopes.png?raw=true) Dagger2Scopes is a sample Android app to implement usual Dagger 1 multiple scoping logic with the brand new Dagger 2 Google lib. In this sample you will be able to find the following features: * Multiple scopes with Dagger 2 (Components and subcomponents). * An approach to Clean Architecture. * An approach to MVP pattern. Dependency Injection -------------------- Dagger 2 erases the dagger 1 graph concept by introducing the brand new components. The components available in this sample app are the following: * `ApplicationComponent`: This component will be used to expose application context and generic dependencies to components depending on this one or to child components. It will be used to inject `Dagger2ScopesApp` and activities/fragments by component composition. * `AbstractActivityComponent`: This one is used as an abstract activity scoped component and exposes activity context and common dependencies linked to activity lifecycle, like `Navigator` or `ToolbarAnimator`. * `GameListActivityComponent`: Extends `AbstractActivityComponent` to provide game list related dependencies. * `GameDetailsActivityComponent`: Extends `AbstractActivityComponent` to provide game details related dependencies. All the activity scoped components are sharing the custom `@ActivityScope`. Clean ----- This sample is modeled using the [Uncle Bob's Clean Arquitecture approach][clean-arquitecture-post]. To reach the main goals of **Clean**, i am including the following modules: * **android**: This one contains the ui graphics and platform implementations for some dependencies defined in the domain layer, like the `Navigator`. Dependency injection is defined here too. * **presentation** (java): Presentation logic for the application is held here. It is the layer used to decouple the graphic view details from the model and the classes which work with it. * **domain** (java): The business logic of the app. Here, you will also find the use cases (interactors), threading logic, and some boundaries defined by interfaces to implement in other modules, like the `Navigator` or the `GameRepository`. * **repository** (java): My implementation for the repository is defined here. * **datasources** (java): Data source implementations. Every dependency is provided by the dependency injection framework which maximizes the power of **Inversion of Control** principle. By this way, the dependencies **always** point from the outer layers to the inner ones. There aren't any inner layer classes depending on outer ones. Every layer has his very own entity mapper to provide the inner layer inmediately next to it with the entity forms most adequated to it. This is done by that way to not violate de dependency rules. That is mentioned by **Uncle Bob**: *"...That would violate The Dependency Rule because it would force an inner circle to know something about an outer circle. So when we pass data across a boundary, it is always in the form that is most convenient for the inner circle."* Attributions ------------ * Dagger 2 component and module structure based on [Dagger 2 Google Samples][dagger2-samples]. * Project inspired by this [blog entry][fernando-cejas-blogentry] from [@android10][fernando-cejas-github]. * Clean arquitecture composition inspired by [Clean-Contacts][panavtec-clean-contacts] project by [@PaNaVTEC][panavtec-github]. Developed By ------------ * Jorge Castillo Pérez - <jorge.castillo.prz@gmail.com> <a href="https://www.linkedin.com/in/jorgecastilloprz"> <img alt="Add me to Linkedin" src="https://github.com/JorgeCastilloPrz/EasyMVP/blob/master/art/linkedin.png" /> </a> License ------- Copyright 2015 Jorge Castillo Pérez 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. [dagger2-samples]: https://github.com/google/dagger [fernando-cejas-blogentry]: http://fernandocejas.com/2015/04/11/tasting-dagger-2-on-android/ [fernando-cejas-github]: https://github.com/android10 [clean-arquitecture-post]: http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html [panavtec-github]: https://github.com/PaNaVTEC [panavtec-clean-contacts]: https://github.com/PaNaVTEC/Clean-Contacts
1
HMS-Core/hms-push-serverdemo-java
Java sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.
hms huawei java push push-notifications sendmessage sever
# HMS Core Push Kit Sample Code (Java) English | [中文](README_ZH.md) ## Contents * [Introduction](#Introduction) * [Environment Requirements](#Environment-Requirements) * [Installation](#Installation) * [Configuration](#Configuration) * [Sample Code](#Sample-Code) * [Technical Support](#technical-support) * [License](#License) ## Introduction The sample code for Java encapsulates the server-side APIs of Push Kit, for your reference or direct use. The following table describes packages of Java sample code. | Package| Description| | ---- | ---- | | examples| Sample code packages.| | messaging| Package where Push Kit server APIs are encapsulated.| ## Environment Requirements JDK 8.0 or later is recommended. ## Configuration Set the following parameters. | Parameter| Description| | ---- | ---- | | appid| App ID, which is obtained from the app information.| | appsecret | App secret, which is obtained from the app information.| | token_server | URL for Huawei OAuth 2.0 to obtain a token. For details, please refer to [OAuth 2.0-based Authentication](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/oauth2-0000001212610981?ha_source=hms1). | | push_open_url | Access address of Push Kit. For details, please refer to [Downlink Message Sending](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110?ha_source=hms1). | ## Sample Code #### 1. Send an Android data message. Code location: [examples/SendDataMessage.java](src/main/java/com/huawei/push/examples/SendDataMessage.java) #### 2. Send an Android notification message. Code location: [examples/SendNotifyMessage.java](src/main/java/com/huawei/push/examples/SendNotifyMessage.java) #### 3. Send a message by topic. Code location: [examples/SendTopicMessage.java](src/main/java/com/huawei/push/examples/SendTopicMessage.java) #### 4. Send a message by conditions. Code location: [examples/SendConditionMessage.java](src/main/java/com/huawei/push/examples/SendConditionMessage.java) #### 5. Send a message to a Huawei quick app. Code location: [examples/SendInstanceAppMessage.java](src/main/java/com/huawei/push/examples/SendInstanceAppMessage.java) #### 6. Send a message through the WebPush agent. Code location: [examples/SendWebpushMessage.java](src/main/java/com/huawei/push/examples/SendWebpushMessage.java) #### 7. Send a message through the APNs agent. Code location: [examples/SendApnsMessage.java](src/main/java/com/huawei/push/examples/SendApnsMessage.java) #### 8. Send a test message. Code location: [examples/SendTestMessage.java](src/main/java/com/huawei/push/examples/SendTestMessage.java) ## Technical Support You can visit the [Reddit community](https://www.reddit.com/r/HuaweiDevelopers/) to obtain the latest information about HMS Core and communicate with other developers. If you have any questions about the sample code, try the following: - Visit [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Votes), submit your questions, and tag them with `huawei-mobile-services`. Huawei experts will answer your questions. - Visit the HMS Core section in the [HUAWEI Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001?ha_source=hms1) and communicate with other developers. If you encounter any issues when using the sample code, submit your [issues](https://github.com/HMS-Core/hms-push-serverdemo-java/issues) or submit a [pull request](https://github.com/HMS-Core/hms-push-serverdemo-java/pulls). ## License The sample code is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
1
IntuitDeveloper/SampleApp-Webhooks-Java
Java Sample to demonstrate how to integrate your app using webhooks
java java-sample quickbooks sampleapp-webhooks-java webhook
[![Rate your Sample](views/Ratesample.png)][ss1][![Yes](views/Thumbup.png)][ss2][![No](views/Thumbdown.png)][ss3] # SampleApp-Webhooks-Java SampleApp-Webhooks-Java <p>Welcome to the Intuit Developer's Webhooks Java Sample App.</p> <p>This sample app is meant to provide working examples of how to integrate your app with the Intuit Small Business ecosystem. Specifically, this sample application demonstrates the following:</p> <ul> <li>Implementing webhooks endpoint to receive event notifications.</li> <li>Best practices to be followed while processing the event notifications.</li> <li>Sample code using QuickBooks Online SDK to call CDC API to sync data between the app and the QuickBooks Online company.</li> </ul> <p>Please note that while these examples work, features not called out above are not intended to be taken and used in production business applications. In other words, this is not a seed project to be taken cart blanche and deployed to your production environment.</p> <p>For example, certain concerns are not addressed at all in our samples (e.g. security, privacy, scalability). In our sample apps, we strive to strike a balance between clarity, maintainability, and performance where we can. However, clarity is ultimately the most important quality in a sample app.</p> <p>Therefore there are certain instances where we might forgo a more complicated implementation (e.g. caching a frequently used value, robust error handling, more generic domain model structure) in favor of code that is easier to read. In that light, we welcome any feedback that makes our samples apps easier to learn from.</p> ## Table of Contents * [Requirements](#requirements) * [First Use Instructions](#first-use-instructions) * [Running the code](#running-the-code) * [Configuring the endpoint](#configuring-the-endpoint) * [Project Structure](#project-structure) * [Reset the App](#reset-the-app) ## Requirements In order to successfully run this sample app you need a few things: 1. Java 1.8 2. A [developer.intuit.com](http://developer.intuit.com) account 3. An app on [developer.intuit.com](http://developer.intuit.com) and the associated app token, consumer key, and consumer secret. 4. QuickBooks Java SDK (already included in the [`lib`](lib) folder) 5. Two sandbox companies, connect both companies with your app and generate the oauth tokens. ## First Use Instructions 1. Clone the GitHub repo to your computer 2. In [`config.properties`](src/main/resources/config.properties), set oauth.type as 1 or 2 depending on type of app you have. For OAuth2 apps set value as 2. 3. For OAuth2 apps, fill in the [`config.properties`](src/main/resources/config.properties) file values (companyid, oauth2.accessToken). 4. For OAuth1 apps, fill in the [`config.properties`](src/main/resources/config.properties) file values (companyid, app token, consumer key, consumer secret, access token key, access token secret). 5. Also add webhooks subscribed entities and webhooks verifier token that was generated when you subscribed for webhoooks event. ## Running the code Once the sample app code is on your computer, you can do the following steps to run the app: 1. cd to the project directory</li> 2. Run the command:`./gradlew bootRun` (Mac OS) or `gradlew.bat bootRun` (Windows)</li> 3. Wait until the terminal output displays the "Started Application in xxx seconds" message. 4. Open your browser and go to http://localhost:8080/companyConfigs - This will list the companies in the repository for which you have subscribed event notification. 5. The webhooks endpoint in the sample app is http://localhost:8080/webhooks 6. Once an event notification is received and processed, you can perform step 4 to see that the last updated timestamp has been updated for the realmId for which notification was received. 7. To run the code on a different port, uncomment and update server.port property in application.properties ## Configuring the endpoint Webhooks requires your enpoint to be exposed over the internet. The easiest way to do that while you are still developing your code locally is to use [ngrok](https://ngrok.com/). Here are the steps to configure ngrok 1. Download and install ngrok 2. Expose your localhost by running "./ngrok http 8080" on the command line. 3. You will then get a forwarding url that looks something like this: Forwarding https://cb063e9f.ngrok.io -> localhost:8080 (Remember to use only https url and not the http url for webhooks) This will expose localhost:8080 to the Internet. Your endpoint url will now be https://cb063e9f.ngrok.io/webhooks Copy this url and use it for setting up webhooks on developer.intuit.com for your app. ## Project Structure * **Standard Java coding structure is used for the sample app** * Java code is located in the [`src.main.java`](src/main/java) directory * Controller classes are in under the controller folder: - [`WebhooksController.java`](src/main/java/com/intuit/developer/sampleapp/webhooks/controllers/WebhooksController.java) - [`CompanyController.java`](src/main/java/com/intuit/developer/sampleapp/webhooks/controllers/CompanyController.java) * Queue implementation and processing classes are in under the service/queue folder: - [`QueueService.java`](src/main/java/com/intuit/developer/sampleapp/webhooks/service/queue/QueueService.java) - [`QueueProcessor.java`](src/main/java/com/intuit/developer/sampleapp/webhooks/service/queue/QueueProcessor.java) * Encryption and payload validation implementation class is in the service/security folder: - [`SecurityService.java`](src/main/java/com/intuit/developer/sampleapp/webhooks/service/security/SecurityService.java) * QBO API Service calls are implemented in the service/qbo folder: - [`CDCService.java`](src/main/java/com/intuit/developer/sampleapp/webhooks/service/qbo/CDCService.java) - [`QueryService.java`](src/main/java/com/intuit/developer/sampleapp/webhooks/service/qbo/QueryService.java) * Property files are located in the [`src.main.resources`](src/main/resources) directory * JUnit test files are located in the [`src.test.java`](src/test/java) directory ## Reset the App This app uses an in-memory temporary H2 database. The tables are loaded during startup with realmId and oauth tokens. The table is read and updated when webhooks notification is processed. Stopping the server will delete the records. The oauth tokens are encrypted and stored in the database. There is a sample encryption implementation provided using fake keys. For production use real keys, this can be updated in application.properties [ss1]: # [ss2]: https://customersurveys.intuit.com/jfe/form/SV_9LWgJBcyy3NAwHc?check=Yes&checkpoint=SampleApp-Webhooks-Java&pageUrl=github [ss3]: https://customersurveys.intuit.com/jfe/form/SV_9LWgJBcyy3NAwHc?check=No&checkpoint=SampleApp-Webhooks-Java&pageUrl=github
1
viq854/lichee
Multi-sample cancer phylogeny reconstruction
null
LICHeE: Fast and scalable inference of multi-sample cancer lineages ============ ### About LICHeE is a combinatorial method designed to reconstruct multi-sample cell lineage trees and infer the subclonal composition of the given samples based on variant allele frequencies (VAFs) of deep-sequencing somatic single nucleotide variants (SSNVs). The program accepts as input a list of SNVs with specified per-sample VAFs and outputs the inferred cell lineage tree(s) and the sample subclone decomposition. It provides an optional simple GUI to allow users to interact with the trees dynamically. At a high level, LICHeE's execution can be broken down into the following steps: (1) SSNV calling across input samples, (2) SSNV clustering using VAFs (each group of SSNVs present in the same set of samples is clustered separately), (3) construction of the evolutionary constraint network (where the nodes are the clusters obtained in step (2) and the edges represent valid pairwise ancestry relationships), (4) search for lineage trees embedded in the network that satisfy all the phylogenetic constraints, and (5) output visualization. For more information about the algorithm please see the following publication: Popic V, Salari R, Hajirasouliha I, Kashef-Haghighi D, West RB, Batzoglou S. *Fast and scalable inference of multi-sample cancer lineages*. Genome Biology 2015, 16:91. ### Program Parameters For best results users are advised to explore the parameters exposed by the method and customize them to their specific datasets. The default values for several parameters are set fairly conservatively, assuming noisy real data, and relaxing these thresholds (especially when testing on simulated data) can produce more granular results. For example, lowering ```-maxClusterDist```, which controls the collapsing of nearby clusters, can order additional SSNVs by keeping them in separate clusters; similarly, lowering ```-minClusterSize``` to 1 will keep single-SSNV clusters in the network. More information on parameter tuning is provided below. ##### COMMANDS ```-build``` lineage tree reconstruction ##### INPUT/OUTPUT AND DISPLAY OPTIONS ```-i <arg>``` Input file path (*required*) ```-o <arg>``` Output file path where the results should be written (default: input file name with the suffix .trees.txt) ```-cp``` Input data represents cell prevalence (CP) values (as opposed to default VAF values) ```-sampleProfile``` Input file contains the SSNV sample presence-absence profile (this will disable the default SSNV calling step) ```-n,--normal <arg>``` Normal sample column id in the list of samples, 0-based (e.g. 0 is the first column) (*required*\*) ```-clustersFile <arg>``` SSNV clusters file path ```-s,--save <arg>``` Maximum number of output trees to save, if any (default: 1) ```-showNetwork,--net``` Display the constraint network ```-showTree,--tree <arg>``` Display the top ranking lineage tree(s) (default: 0) ```-color``` Enable lineage tree visualization in color mode ```-dot``` Enable DOT file export of the top-scoring tree for Graphviz visualization (saved by default to: input file with suffix .dot) ```-dotFile <arg>``` DOT file path ##### SSNV FILTERING AND CALLING ```-maxVAFAbsent,--absent <arg>``` Maximum VAF to consider an SSNV as robustly absent from a sample (*required*\*) ```-minVAFPresent,--present <arg>``` Minimum VAF to consider an SSNV as robustly present in a sample (*required*\*) ```-maxVAFValid <arg>``` Maximum allowed VAF in a sample (default: 0.6) ```-minProfileSupport <arg>``` Minimum number of *robust*\*\* SSNVs required for a group presence-absence profile to be labeled robust during SNV calling: SNVs from non-robust groups can be re-assigned to existing robust groups (default: 2) \* *these parameters are required unless the -sampleProfile option is specified* \*\* *robust SNVs have VAFs < maxVAFAbsent or > minVAFPresent across all the samples* ##### PHYLOGENETIC NETWORK CONSTRUCTION AND TREE SEARCH ```-minClusterSize <arg>``` Minimum number of SSNVs required per cluster (default: 2) ```-minPrivateClusterSize <arg>``` Minimum number of SSNVs required for a private cluster (i.e. with SSNVs occurring only in one sample) (default: 1) ```-minRobustNodeSupport <arg>``` Minimum number of robust SSNVs required for a node to be labeled robust during tree search: non-robust nodes can be removed from the network when no valid lineage trees are found (default: 2) ```-maxClusterDist <arg>``` Maximum mean VAF difference on average per sample up to which two SSNV clusters can be collapsed (default: 0.2) ```-c,--completeNetwork``` Add all possible edges to the constraint network, by default private nodes are connected only to closest level parents and only nodes with no other parents are descendants of root ```-e <arg>``` VAF error margin (default: 0.1) ```-nTreeQPCheck <arg>``` Number of top-ranking trees on which the QP consistency check is run, we have not seen this check to fail in practice (default: 0, for best performance) ##### OTHER ```-v,--verbose``` Verbose mode, prints more information about each step of the algorithm ```-h,--help``` Print program usage information ### How to Run From the /release directory: ``` ./lichee -build -i <input_file_path> [-minVAFPresent <VAF1> -maxVAFAbsent <VAF2> -n <normal_sample_id>] [other options] ``` ### Examples From the /release directory (for other command-line settings used on the ccRCC and HGSC datasets see the README file in the data/ directory): \#Show the top ranking tree <br> ``` ./lichee -build -i ../data/ccRCC/RK26.txt -maxVAFAbsent 0.005 -minVAFPresent 0.005 -n 0 -showTree 1 ``` \#Eliminate private clusters/nodes that have fewer than 2 SSNVs, show and save to file the top-ranking tree <br> ``` ./lichee -build -i ../data/ccRCC/RMH008.txt -maxVAFAbsent 0.005 -minVAFPresent 0.005 -n 0 -minPrivateClusterSize 2 -showTree 1 -s 1 ``` \#Reduce the VAF cluster centroid distance, which determines when the clusters are collapsed <br> ``` ./lichee -build -i ../data/hgsc/case6.txt -maxVAFAbsent 0.005 -minVAFPresent 0.01 -n 0 -maxClusterDist 0.1 -showTree 1 ``` ### Input File Types LICHeE accepts three different file format types. The main file format is composed of a list of SSNVs with their associated VAF or CP values per sample: one SSNV entry per line. The file contains the following header with fields separated by tabs: ``` #chr position description <sample names separated by tabs> ``` For example (the following file contains 5 samples and 3 SSNVs): ``` #chr position description Normal S1 S2 S3 S4 17 123456 A/T DUSP19 0.0 0.1 0.2 0.25 0.15 11 341567 C/G MUC16 0.0 0.4 0.09 0.38 0.24 9 787834 A/C OR2A14 0.0 0.35 0.14 0.17 0.48 ``` Users can also optionally provide pre-computed SSNV calls per sample, by adding one more column to the above format before the sample frequency information, which can specify the binary presence-absence pattern of this SSNV across samples. For example, for a file with 5 samples, a pattern of 01001 implies that the SSNV was called in the second and fifth sample (column id 1 and 4, since we start counting at 0). In order to use this file type (and disable the default calling mechanism), users should include the ```-sampleProfile``` flag. An example is shown below: ``` #chr position description profile Normal S1 S2 S3 S4 1 184306474 A/G HMCN1 01111 0.0 0.1 0.2 0.25 0.15 1 18534005 C/A IGSF21 01111 0.0 0.1 0.25 0.2 0.1 1 110456920 G/A UBL4B 01111 0.0 0.4 0.4 0.45 0.45 10 26503064 C/G MYO3A 01001 0.0 0.4 0.0 0.0 0.24 ``` Finally, users can also specify pre-computed SSNV clustering information by providing an additional input file containing the clusters (with the corresponding centroid VAFs per sample and the member SSNVs): one cluster per line. The file should contain the following fields separated by tabs (corresponding to the primary SSNV input file): ``` profile <cluster VAFs per sample separated by tabs> <comma-separated list of SSNVs> ``` For example (the following file contains 3 clusters for the SSNV example file shown above; the SSNVs are specified as line numbers in the SSNV input file ignoring the header line, starting from 1): ``` 01111 0.0 0.1 0.23 0.23 0.13 1,2 01111 0.0 0.4 0.4 0.45 0.45 3 01001 0.0 0.4 0.0 0.0 0.24 4 ``` ### Output Visualization The resulting trees and sample decomposition information produced by LICHeE can be written to a text file (using the ```-s``` option that specifies up to how many top trees should be saved; it is recommended to evaluate all the trees that achieved the best score) and visualized via the interactive LICHeE Lineage Tree Viewer GUI (using the ```-showTree``` option that specifies how many trees should be displayed). It is also possible to export the best-scoring tree as a DOT file for Graphviz visualization (using the ```-dot``` or ```-dotFile``` options). The GUI allows users to dynamically remove nodes from the tree, collapse clusters of the same SSNV group, and view information about each node (e.g. SSNV composition of cluster nodes or the subclone decomposition of sample nodes). The Snapshot button can be used anytime to capture the current state of the tree as a vector graphic PDF file (please note that it takes a bit of time to write out the image to file). We currently support two display modes: plain (default) and color (enabled with the ```-color``` flag). In the color mode, each cluster node is assigned a unique color and each sample node is decorated with the colors corresponding to the clusters of mutations present in the sample. The sample is decomposed by color according to the (approximate) prevalence of each cluster in the sample. The contribution of a cluster to each sample is highlighted (in purple) when the cluster node is selected. A few useful tips for working with the GUI: one or multiple nodes can be selected and dragged to the desired position, the size (zoom) and position of the graph can be adjusted using the trackpad. Example 1. Visualization for ccRCC patient RK26 ``` ./lichee -build -i ../data/ccRCC/RK26.txt -maxVAFAbsent 0.005 -minVAFPresent 0.005 -n 0 -showTree 1 -color -dot ``` Display using Graphviz (Graphviz must be installed separately): ``` dot -Tpdf ../data/ccRCC/RK26.txt.dot -O ``` <p align="center"> <img src="https://github.com/viq854/lichee/blob/master/img_demo/RK26.txt.dot.png" width="65%" height="65%" /> </p> Example 2. Visualization for ccRCC patient RMH008 ``` ./lichee -build -i ../data/ccRCC/RMH008.txt -maxVAFAbsent 0.005 -minVAFPresent 0.005 -n 0 -minPrivateClusterSize 2 -showTree 1 -color -dot ``` ``` dot -Tpdf ../data/ccRCC/RMH008.txt.dot -O ``` <p align="center"> <img src="https://github.com/viq854/lichee/blob/master/img_demo/RMH008.txt.color.dot.png" width="65%" height="65%" /> </p> Plain mode simple look (withot ```-color``` flag): <p align="center"> <img src="https://github.com/viq854/lichee/blob/master/img_demo/RMH008.txt.dot.png" width="65%" height="65%" /> </p> GUI interaction examples: Cluster node 10 is selected, sample constributions highlighted in purple. <p align="center"> <img src="https://github.com/viq854/lichee/blob/master/img_demo/lichee_cluster_demo.png" width="65%" height="65%" /> </p> Sample node R5 is selected, lineages highlighted in purple: <p align="center"> <img src="https://github.com/viq854/lichee/blob/master/img_demo/lichee_sample_demo.png" width="65%" height="65%" /> </p> ### Parameter Tuning and Diagnostics In some cases, LICHeE may not find a valid tumor lineage tree for an input dataset given a specific parameter setting. In some other cases, multiple alternative lineage trees might be valid under different parameter settings. Therefore, it is recommended to explore various parameters when analyzing a particular dataset. For instance, since LICHeE uses a heuristic method to call SSNVs that heavily relies on the values of the ```-maxVAFAbsent``` and ```-minVAFPresent``` parameters, adjusting these parameters to reflect the expected noise levels in the data, or supplying pre-computed calls can be very useful. Furthermore, it might be useful to adjust the criteria for incorporating clusters into the constraint network. For example, clusters that contain only a few SSNVs are more likely to represent mis-called presence patterns and can be filtered out by increasing the ```-minClusterSize``` and ```-minPrivateClusterSize``` parameters. The parameter ```-minRobustNodeSupport``` (which determines how many robustly-called SSNVs are required for a node to be non-removable) can be increased to iteratively remove nodes from the network while no valid trees are found automatically. For very noisy data, the ```-e``` parameter can be increased to relax the VAF constraint enforcement (although this should be done sparingly). On the other hand, adjusting these parameters in the opposite direction can result in more granular trees and is advisable on less noisy datasets in order to get the most informative results. For diagnostics, LICHeE outputs a log detailing the execution of each step of the algorithm (with more information provided using the verbose, ```-v```, flag). This log can be very useful when trying to diagnose the performance of the program and view any of its intermediate results. In particular, it provides information about SSNV calling, clustering, the structure of the resulting constraint network, tree scoring, and any other operations controlled by various parameter settings. Using the log, the user can also trace why a particular SSNV was not included in the final output tree(s) (e.g. due to filtering based on the maximum VAF allowed or due to cluster size constraints) by searching the log for the "Filtered" keyword or for the unique descriptor of the SSNV (the log will output the SSNV entry line for each filtered SSNV as it appears in the input file). Furthermore, when no valid trees are found, examining the cluster centroid VAFs and the topology of the constraint network can be helpful to determine why at least one phylogenetic constraint is violated in each candidate embedded spanning trees. ### System Requirements Java Runtime Environment (JRE) 1.6 ### License MIT License ### Support For help running the program or any questions/suggestions/bug reports, please contact viq@cs.stanford.edu
0
huzpsb/JavaObfuscatorTest
A list of Java obfuscators, obfuscated samples and benchmarks.
null
# JavaObfuscatorTest A list of Java obfuscators, obfuscated samples and benchmarks. ## File structure ```` . ├───bench │ ├───src │ │ └───... (source files) │ └───bin │ └───TEST.jar (compiled benchmark) └───samples └───... (obfuscated samples) ```` ## Obfuscators ( Pass, Fail, Error, Unknown[No output,etc.] ) | Obfuscator | Test#1 | Test#2 | Performance | Size | |-----------------------------------------------------------------------------------|---------|----------|-------------|--------| | [None](https://www.java.com/#LOL) | PPPPPPP | PPPPPPPP | 27ms | 29KB | Some of my personal views :P (You find it!) | [Radon3](https://github.com/ItzSomebody/radon) | EEPPEFE | FPFEEPEF | E | 269KB | Crappy indeed. | [Bozar](https://github.com/vimasig/Bozar) | PPPPPPP | FPFEEPPF | 201ms | 513KB | Nothing special. | [Caesium](https://github.com/sim0n/Caesium/) | PPPPPFP | FFPPPPPP | 50ms | 174KB | Interesting with zip bomb. But patchable with Recaf. | [Scuti](https://github.com/netindev/scuti) | EEPPPPP | FPFEEPEF | 867ms | 151KB | Interesting with throw exploit. Painful 2 configure. | [BranchLock](https://branchlock.net/) | PPPPPPP | FPFEEPFF | 65ms | 66KB | What if it's FOSS... | [Neon](https://github.com/MoofMonkey/NeonObf) | PPPPPPP | PPFPPPEP | 7439ms | 53KB | Maybe tooooo slow. Not recommended. | [Ambien](https://github.com/iiiiiiiris/Ambien) | EEPPPEP | FPPEEPUF | 28ms | 56KB | Zip crasher crashes Recaf. Impressive. | [qProtect-Lite](https://mdma.dev/) | PPPPPPP | FPPPEPPP | 69ms | 139KB | It's like ZKM but worse | [zelix KlassMaster20.0.3](https://zelix.com/) | PPPPPPP | FPPPEPPP | 54ms | 83KB | Heavy | [BranchLock Pro](https://branchlock.net/) | PPPPPPP | FPPPEPFF | E | 256KB | Maybe it is Perfect protection i think as a obfuscator | [Eskid](https://baidu.com/deadth) | PPPPEPP | FPPPEPEP | 530ms | 166KB | Maybe it is cool.For fun. | [ClassGuard](https://zenofx.com/classguard) | PPPPPPP | PPPPEPPP | 36ms | 2820KB | Interesting AES Encryption class. | [JNIC-3.5.1](https://jnic.dev/) | PPPPPPP | FPPPEPPP | 481ms | 89KB | JNIC 3.5.1 with build-in flowObf and StringObf enabled. | [OpenJNIC](https://www.blackspigot.com/threads/openjnic.173922/) | PPPPPPP | FPPPEPPP | 28ms | 304KB | Too good to be actually used. | [native-obfuscator(win cmake)](https://github.com/radioegor146/native-obfuscator) | PPPPPPP | PPPPPPPP | 1597ms | 120KB | Very compatible, but has a relatively broken running speed. | [j2cc](https://java2cc.github.io/) | PPPPPPP | PPPPPPPP | 712ms | 180KB | Skid of native-obfuscator with some improvements | [j2cc with heavy obfuscation](https://java2cc.github.io/) | PPPPPPP | PPPPPPPP | 172ms | 304KB | Easily cracked with proper bps. Even weaker | [Allatori](https://www.allatori.com/) | PPPPPPP | FPFEEPPF | 54ms | 27KB | Best for lazy people. Nearly no configuration required. | [Stringer](https://jfxstore.com/stringer/) | PPPPPPP | PPPPEPPP | 92ms | 306KB | Neat compability. Good for Spring & Android. | [ZKM](https://zelix.com/klassmaster/index.html) | PPPPPPP | FPPEEEUP | 51ms | 79KB | = ProGuardPlusObf | [ProGuard](https://github.com/Guardsquare/proguard/) | PPPPPPP | FPPEEEUP | 26ms | 15KB | Rather an optimizer than an obfuscator. | [Skidfuscator](https://github.com/skidfuscatordev) | PPPPPPP | FPPPPFPP | 734ms | 118KB | Good for skidders. Hard to reverse. Too slow. | [SkidfuscatorEnterprise](https://skidfuscator.dev) | PPPPPPP | FPPPPEPP | 4274ms | 158KB | Tooooo slow. | [SkidfuscatorEnterpriseLeak](https://github.com/InkerBot/one-obfuscator/) | PPPPPPP | FPFPEEEF | 10055ms | 138KB | More and more slow | [superblaubeere27](https://github.com/superblaubeere27/obfuscator) | PPPPPPP | FPPPEPPP | 47ms | 223KB | Tradition never dies. Obfuscators that meets one of the following conditions goes here: - We don't have a copy of, and haven't yet answered (or refused) our request to provide us with an example. - Requested a DMCA takedown. - Unmaintained or don't have an email in their intro page, and we are unable to run. ``` DashO, nProtect ``` ## Tests ~~RTFSC~~ ```` Test 1.1: Inheritance Test 1.2: Cross Test 1.3: Throw Test 1.4: Accuracy Test 1.5: SubClass Test 1.6: Pool Test 1.7: InnerClass Test 2.1: Counter Test 2.2: Chinese Test 2.3: Resource Test 2.4: Field Test 2.5: Loader Test 2.6: ReTrace Test 2.7: Annotation Test 2.8: Sec ```` ## Contributing Please feel free to contribute to this repository by opening a pull request. Do not forget to add the obfuscator to the list above. ## DMCA If you are the owner of one of the obfuscators and you want me to remove it from this repository, please contact me by opening an issue or by sending an email to `dmca_jot@huzpsb.eu.org`. ## Disclaimer This repository is for educational purposes only. The author of this repository is not responsible for any damage caused by the code in this repository. The code in this repository is not intended to be used for malicious purposes. The benchmarks in this repository are not intended to be used for comparing the performance of the obfuscators. The benchmarks are only intended to show the obfuscators' capabilities. The efficiency is evaluated through the time it takes the obfuscated program to perform a certain set of computations. This may vary depending on the machine used to run the benchmarks, and the results may not be accurate. Only compatibility and efficiency are tested here. But you should choose wisely among strength, compatibility, efficiency, size, and price. The samples in this repository may be malicious. Do not run them on your machine.
0
mechero/spring-boot-cucumber
Sample project showing how to set up DI with Cucumber using Spring Boot
cucumber cucumber-java cucumber-spring spring-boot thepracticaldeveloper
# Cucumber in Spring Boot using Dependency Injection This code sample shows how to use Dependency Injection in Cucumber within a Spring Boot application. You can find the complete instructions on this post at The Practical Developer site: [Cucumber Tests with Dependency Injection using Spring Boot](https://thepracticaldeveloper.com/cucumber-tests-spring-boot-dependency-injection//) ![Cucumber and Dependency Injection in a Spring Boot App - The Practical Developer](images/cucumber-spring-boot.png)
1
aws-samples/serverless-graalvm-demo
Sample serverless application written in Java compiled with GraalVM native-image
graalvm-native-image java lambda serverless
## Serverless GraalVM Demo ![build](https://github.com/aws-samples/serverless-graalvm-demo/actions/workflows/maven.yml/badge.svg) <p align="center"> <img src="imgs/diagram.png" alt="Architecture diagram"/> </p> This is a simple serverless application built in Java and uses the GraalVM native-image tool. It consists of an [Amazon API Gateway](https://aws.amazon.com/api-gateway/) backed by four [AWS Lambda](https://aws.amazon.com/lambda/) functions and an [Amazon DynamoDB](https://aws.amazon.com/dynamodb/) table for storage. ## Requirements - [AWS CLI](https://aws.amazon.com/cli/) - [AWS CDK](https://aws.amazon.com/cdk/) - Java 11 - Maven - [Artillery](https://www.artillery.io/) for load-testing the application ## Software Within the software folder is the products maven project. This single maven project contains all the code for all four Lambda functions. It uses the hexagonal architecture pattern to decouple the entry points, from the main domain logic and the storage logic. ### Custom Runtime The GraalVM native-image tool will produce a stand-alone executable binary. This does not require the JVM to run. To run our application on Lambda we must make a [custom runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html) and implement the [Lambda Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html). This is done by including the `aws-lambda-java-runtime-interface-client` dependency in our project. The [maven assembly build plugin](https://github.com/aws-samples/serverless-graalvm-demo/blob/main/software/products/src/assembly/zip.xml) is used to create a zip file which includes the executable binary as well as the entry point [bootstrap](https://github.com/aws-samples/serverless-graalvm-demo/blob/main/software/products/src/main/config/bootstrap) file. <p align="center"> <img src="imgs/execution-environment.png" alt="AWS Lambda execution environment"/> </p> ## Infrastructure ### Deployment Deploy the demo to your AWS account using [AWS CDK](https://aws.amazon.com/cdk/). ```bash cdk deploy ``` The command `cdk deploy` will first build the products maven project using a docker build image with all the required GraalVM tools. Then it will use AWS CloudFormation to deploy the resources to your account. CDK will create an output of the API Gateway endpoint URL for future use in our load tests. ## Load Test [Artillery](https://www.artillery.io/) is used to make 300 requests / second for 10 minutes to our API endpoints. You can run this with the following command. ```bash cd load-test ./run-load-test.sh ``` This is a demanding load test, to change the rate alter the `arrivalRate` value in `load-test.yml`. ### CloudWatch Logs Insights Using this CloudWatch Logs Insights query you can analyse the latency of the requests made to the Lambda functions. The query separates cold starts from other requests and then gives you p50, p90 and p99 percentiles. ``` filter @type="REPORT" | fields greatest(@initDuration, 0) + @duration as duration, ispresent(@initDuration) as coldStart | stats count(*) as count, pct(duration, 50) as p50, pct(duration, 90) as p90, pct(duration, 99) as p99, max(duration) as max by coldStart ``` <p align="center"> <img src="imgs/performance_results.png" alt="CloudWatch Logs Insights results"/> </p> ## AWS X-Ray Tracing You can add additional detail to your X-Ray tracing by adding a TracingInterceptor to your AWS SDK clients. Here is the code for my DynamoDbClient from the [DynamoDbProductStore](https://github.com/aws-samples/serverless-graalvm-demo/blob/aws-xray-support/software/products/src/main/java/software/amazonaws/example/product/store/dynamodb/DynamoDbProductStore.java) class. ```java private final DynamoDbClient dynamoDbClient=DynamoDbClient.builder() .credentialsProvider(EnvironmentVariableCredentialsProvider.create()) .region(Region.of(System.getenv(SdkSystemSetting.AWS_REGION.environmentVariable()))) .overrideConfiguration(ClientOverrideConfiguration.builder() .addExecutionInterceptor(new TracingInterceptor()) .build()) .build(); ``` Example cold start trace <p align="center"> <img src="imgs/xray-cold.png" alt="Cold start X-Ray trace"/> </p> Example warm start trace <p align="center"> <img src="imgs/xray-warm.png" alt="Warm start X-Ray trace"/> </p> ## 👀 With other languages You can find implementations of this project in other languages here: * [🦀 Rust](https://github.com/aws-samples/serverless-rust-demo) * [🏗️ TypeScript](https://github.com/aws-samples/serverless-typescript-demo) * [🐿️ Go](https://github.com/aws-samples/serverless-go-demo) * [⭐ Groovy](https://github.com/aws-samples/serverless-groovy-demo) * [🤖 Kotlin](https://github.com/aws-samples/serverless-kotlin-demo) * [🥅 .NET](https://github.com/aws-samples/serverless-dotnet-demo) ## Security See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. ## License This library is licensed under the MIT-0 License. See the LICENSE file.
1
kevinlynx/kcontainer
kcontainer is a lightweight container sample
null
kcontainer is a lightweight container sample. 1. import project into eclipse (existing maven project) 2. cd sample && compile.bat, compile test1 & test2 sample bundle and copy to `kcontainer/bundle` directory, make sure `bundle` directory exists 3. run kcontainer `Main` in eclipse ## Bundle ``` . |-- bundle |-- test1 |-- test1.prop |-- lib | |-- abc.jar (if contains inner jar, unpack it) | |-- def.jar |-- classes |-- lib ``` ## Bundle Initializer sample ``` public class B implements IBundleInitializer { static { System.out.println("====B===="); Base b = new Base(); b.print(); System.out.println(B.class.getClassLoader()); System.out.println("====B===="); } public void start(BundleContext context) { System.out.println("B start: " + context.getName()); new A(); } public void stop(BundleContext context) { System.out.println("B stop: " + context.getName()); } } ```
1
patrick-emmanuel/spring-boot-boilerplate
A full-featured production ready project to bootstrap your spring boot app with user authentication, and test samples.
boilerplate bootstrap database flyway-postgresql flywaydb hibernate-search java-8 junit jwt-authentication spring spring-boot spring-security swagger-ui swagger2 tdd
# Spring Boot Boilerplate A project to bootstrap a spring boot app with user authentication with a database, and test samples. # Worthy Mention JWT implementation inspired by [szerhusenBC](https://github.com/szerhusenBC/jwt-spring-security-demo).
0
piomin/sample-camel-spring-boot
three samples in different branches that illustrates usage of apache camel as microservice framework providing integration with consul, hystrix, ribbon and other tools
apache-camel api-gateway circuit-breaker consul eip fallback hystrix inter-service-communication load-balancer spring-boot
null
0
fabricioepa/lab-springboot-rest-sample
Sample code for Spring Boot RESTful Service
null
# lab-springboot-rest-sample Sample code for Spring Boot RESTful Service workshop The code is based on the CQRS pattern (Command Query Responsibility Segregation), introduced by Greg Young, decoupling the models for the Read/Write operations. The pattern is better described by Martin Fowler in his blog (http://martinfowler.com/bliki/CQRS.html) "The other main benefit is in handling high performance applications. CQRS allows you to separate the load from reads and writes allowing you to scale each independently..." It means you can create lightweight data structures to read thousands of data and also have complex object structures to read detailed information for the same entity in the domain. Feel free to bring up your ideas ;) See more at my [fabricioepa.wordpress.com](http://fabricioepa.wordpress.com)
1
codepath/ParsePushNotificationExample
Simple code sample demonstrating how to use Parse Push notifications
null
# Parse Push Notification Sample Code This sample code demonstrates a working example of push notifications with Parse! This source code was originally created by Vishal Kapoor as part of our Jan 2015 Android bootcamp. The code has been updated significantly by Roger Hu on March 3rd, 2016 to reflect Parse Server. See our [configuring parse server push notifications guide](https://guides.codepath.com/android/Configuring-a-Parse-Server#enabling-push-notifications) for more details. Make sure to add a Parse Cloud function (`cloud/main.js`) similar to the one defined [here](https://github.com/codepath/parse-server-example/blob/master/cloud/main.js). ### Setup 1. Configure your Firebase app in the [console](https://console.firebase.google.com) and register a new Android app. 2. Make sure to record the Android package name used and download the `google-services.json` file. Add it to your `app/` dir (see [these docs](https://developers.google.com/android/guides/google-services-plugin#adding_the_json_file) more information.) 3. Verify the `applicationId` in your AndroidManifest.xml matches the package name defined for your Firebase app. 4. Update your `PARSE_CLOUD_SERVER_URL` in `MainApp.java`. 5. Update your `PARSE_APP_ID` in `MainApp.java`. Make sure you have your Parse cloud server configured with the `pushChannelTest` function: ```javascript // Depends on this function: https://github.com/codepath/parse-server-example/blob/master/cloud/main.js Parse.Cloud.define('pushChannelTest', function(request, response) { // request has 2 parameters: params passed by the client and the authorized user var params = request.params; var user = request.user; // extract out the channel to send var action = params.action; var message = params.message; var customData = params.customData; // use to custom tweak whatever payload you wish to send var pushQuery = new Parse.Query(Parse.Installation); pushQuery.equalTo("deviceType", "android"); var payload = {"data": { "alert": message, "action": action, "customdata": customData} }; // Note that useMasterKey is necessary for Push notifications to succeed. Parse.Push.send({ where: pushQuery, // for sending to a specific channel data: payload, }, { success: function() { console.log("#### PUSH OK"); }, error: function(error) { console.log("#### PUSH ERROR" + error.message); }, useMasterKey: true}); response.success('success'); }); ``` You can verify that the Parse Cloud function works by using this curl command (make sure the application ID matches): ```bash curl -X POST -H "X-Parse-Application-Id: myAppId" -H "Content-Type: application/json" -d '{"data": {"alert": "My message"}}' https://yourappname.herokuapp.com/parse/functions/pushChannelTest ```
1
basdijkstra/tau-rest-assured
Sample code used in the TestAutomationU course on REST Assured that I created
null
About this repository ================== This repository contains all the code samples that are shown in the videos of my REST Assured course that is part of [Test Automation University](https://testautomationu.applitools.com/). What do I need to run these samples? --- A Java 8 JDK and Maven. That's it. What API is used for the samples? --- The code samples invoke the [Zippopotam.us API](http://api.zippopotam.us). In those cases where the actual API could not be used (it doesn't support HTTP operations other than GET, plus it doesn't have an option to return XML response bodies), calls have been mocked using [WireMock](http://wiremock.org). Comments? Saying thanks? --- Feel free to file an issue here or send me an email at bas@ontestautomation.com.
1
jaisonfdo/CheckOutFlow
Sample application explains about card payment.
null
null
1
mechero/spring-boot-eureka
Sample project using Eureka and Spring Boot 2
eureka-client eureka-cluster eureka-server peer-awareness spring-boot spring-cloud-eureka spring-cloud-netflix
# Service Discovery with Spring Boot 2 and Spring Cloud Eureka ## Introduction This source code includes two projects with proper configuration to execute: * Two Eureka Service Registry instances with the Peer Awareness feature enabled. * Two Eureka Clients that register themselves and see each other thanks to the replica mode of the servers. If you want to read the complete guide, it's available for free at The Practical Developer site: [Spring Boot Service Discovery with Eureka Peer Awareness](https://thepracticaldeveloper.com/2018/03/18/spring-boot-service-discovery-eureka/) ## Simplified Logical View ![Peer Awareness with Eureka](./img/eureka_springboot.png)
1
skate056/spring-security-oauth2-google
Sample Spring MVC web application which is secured by Spring Security OAuth2 + Google
null
# Spring Security OAuth2 Google Connector --- ## What do I do? I am simple Spring MVC application which secured by Spring Security. Instead of using simple form based security, I am secured by Spring Security OAuth2 and the OAuth provider is Google. ## Why am I required? Developing a Spring MVC web application with Security enabled and integrated with Google is hard to implement. So this is a sample implementation of Spring MVC + Spring Security OAuth2 + Google Provider. ## Get it up and runnning The project is built with Gradle so you can run the build using the following gradle command `gradle clean build` To start up the application using the following command (Since it is a Spring boot application) `gradle bootRun` The application.properties (in src/main/resources) contains the details of the Google application which it uses to authenticate details. Change the values of the following attributes to the values for your application google.client.id google.client.secret ###To register a Google App perform the following steps * Go to https://console.developers.google.com and login with your Google account (this will be the developer account and the email of this account will be published when someone tries to authenticate with the Google application) * If you don't have a project create a new one and then click into the project. * In the menu on the left side select "APIs & auth" --> "Credentials" --> "Create a new client ID" * In the popup select the following * Application Type = Web Application * Authorized Javascript Origins = <YOUR DOMAIN>, * Authorized Redirect URI = <THE CALL BACK HANDLER>, the URI for our application is /googleLogin so for local testing you should enter http://localhost:9000/googleLogin and http://localhost:9000/googleLogin/ on different lines. * Copy the client ID and client Secret and update the application.properties * Make sure you update the mandatory values on the "APIs & auth" --> "Consent screen" page as the application will not work without it. When you have a the Google App configured and the Spring boot application and you navigate to http://localhost:9000. It will redirect you to a Google login page. Upong login it will ask you to authorize your application for access to your account to get email and profile data. On successful login it will render the basic HTML page which means the authentication was sucessful. If you are interested in fetching the Google profile data in type in the following URL http://localhost:9000/find?term=hello in the authenticated browser session and the profile data will be logged in the console of the Spring application. ## Technical nitty gritties It is important to use the correct filters from Spring Security OAuth2 to get this right and it is also very important to get their order right. The filters oauth2ClientContextFilter and oAuth2AuthenticationProcessingFilter are very important the their position in the chain is equally important. oauth2ClientContextFilter must exist before oAuth2AuthenticationProcessingFilter. Also both these must be before the FILTER_SECURITY_INTERCEPTOR so that the authentication with google is complete before we check for the security permissions for access to the application. Also the authentication entry point of the secured application is clientAuthenticationEntryPoint which essentially redirects the user to the configured url /googleLogin when the user is not authenticated. When the url /googleLogin is hit the filters listed above lead to a redirect to the Google URL. Upon authentication, Google redirects back to us and the filter populates the Authentication object. After all the authentication is complete, the request is redirected back to http://localhost:9000. This request will hit the FILTER_SECURITY_INTERCEPTOR but the session is already authenticated and the Security Context is populated so access to the application is granted by the interceptor and the session is authentication. If you want to see the profile data, in an authenticated session (since the resource uses the OAuth2RestOperations) a GET to http://localhost:9000/find?term=hello will display the profile data on the web application console. See the src/main/java/com/rst/oauth2/google/api/UserResource.java for implementation details.
1
Azure-Samples/spring-openai-bot
Spring Boot + OpenAI sample application
null
# Spring Boot OpenAI Bot Sample application showing how to use Spring Boot with OpenAI's GPT-3 API. This is a fully reactive application that uses Spring WebFlux and the OpenAI streaming API, that can be packaged as a GraalVM native image. ## Features * Spring Boot 3 * Fully reactive with Spring WebFlux and Spring WebClient * OpenAI streaming API * Native image with GraalVM * Deployment to Azure Container Apps ## Getting Started ### Prerequisites - Java 17 - Access to OpenAI's GPT-3 API ### Installation ```bash ./mvnw package ``` ### Quickstart You will need to set the following environment variables to access OpenAI's API: ```bash export APPLICATION_OPENAI_KEY=<your-openai-api-key> export APPLICATION_OPENAI_URL=<your-openai-url> ``` ## Demo ```bash ./mvnw spring-boot:run ``` ## Resources To customize the OpenAI prompt, you can check the following resource: - [Prompt Engineering Guide](https://github.com/dair-ai/Prompt-Engineering-Guide)
1
google-ar/codelab-cloud-anchors
Sample code for the ARCore Cloud Anchors Codelab
null
ARCore Cloud Anchors Codelab ============================= Copyright (c) 2018 Google Inc. All rights reserved. These are sample Android Studio projects intended for use with the Google AR Codelabs. Please note, we do not accept pull requests. ## Documentation * [Quickstart for Android Java](//developers.google.com/ar/develop/java/quickstart) * [ARCore SDK for Java API Reference](//developers.google.com/ar/reference/java) ## Reporting Issues Any issues with this codelab should be reported in the main [ARCore Issue Tracker](https://github.com/google-ar/arcore-android-sdk/issues).
1
HouariZegai/java-pocs
Codes and samples were written 💻 to demonstrate the usage of Java with various technologies.
apis crm-rest hibernate java java8 javaee maven rest rest-crud spring spring-boot-crud spring-mvc spring-rest
# Java Proof of concepts :heart: :fire: Codes and samples were written :computer: to demonstrate the usage of Java with various technologies. [![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) In this repository you will find sample mainly on the following topics: - Java SE - Java, Stream API, Lambda Expression, Regular Expression - Spring Framework, Spring MVC, Hibernate, AOP, Thymleaf, Spring Security, Spring REST - Spring Boot - JUnit 5 - RMI - Maven - GUI - JavaFX - Swing - OpenCV - Apache POI (e.g. Word, Excel Read/Write) - QRCode: generate/read QRCode using Zxing library. - Facebook4j: integrate your application with the Facebook API. - Database: JDBC (MySQL, SQLite, ...) - Harwdare: get information of the computer (os, memory, harddisk, mac address, ...) - IO: load file, ... - Folders: create folders (mkdirs), ... - Numbers to words: convert numbers to words (language supported: AR/EN/FR). - Random: generate unique random numbers. - OCA: Java certification exam questions samples - And more!
0
cfg4j/cfg4j-sample-apps
Sample applications which use cfg4j for configuration management
null
## Sample applications using [cfg4j](http://cfg4j.org) library ## Apps * [classpath-bind](classpath-bind/) - reads configuration from a **classpath files** and outputs values to the stdout. * [consul-bind](consul-bind/) - reads configuration from a local **[Consul](http://consul.io) agent** and outputs values to the stdout. Automatically reloads configuration after change. * [files-bind](files-bind/) - reads configuration from a local files and outputs values to the stdout. Automatically **reloads configuration after change**. * [git-simple](git-simple/) - reads configuration from a given **git repository** (using *getProperty* methods) and outputs values to the stdout. Automatically reloads configuration after change. * [git-bind](git-bind/) - reads configuration from a given git repository (using **object binding**) and outputs values to the stdout. Automatically reloads configuration after change. * [git-multi-file](git-multi-file/) - reads configuration from a given git repository (from **multiple files**) and outputs values to the stdout. Automatically reloads configuration after change. * [metrics](metrics/) - reads configuration from a a local file and outputs values to the stdout. Automatically reloads configuration after change. **Exposes metrics**. ## Usage * Build all apps ``` > cd cfg4j-sample-apps/ > ./gradlew build ``` * Run app (in this example: "git-bind") - **read README.md file in the corresponding app root directory** for more information. ``` > java -jar git-bind/build/libs/git-bind-1.0.0-SNAPSHOT.jar ```
1
jhipster/jhipster-sample-app-microservice
This is a sample application created with JHipster, with the Microservice type
null
# jhipsterSampleMicroservice This application was generated using JHipster 8.3.0, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v8.3.0](https://www.jhipster.tech/documentation-archive/v8.3.0). This is a "microservice" application intended to be part of a microservice architecture, please refer to the [Doing microservices with JHipster][] page of the documentation for more information. This application is configured for Service Discovery and Configuration with Consul. On launch, it will refuse to start if it is not able to connect to Consul at [http://localhost:8500](http://localhost:8500). For more information, read our documentation on [Service Discovery and Configuration with Consul][]. ## Project Structure Node is required for generation and recommended for development. `package.json` is always generated for a better development experience with prettier, commit hooks, scripts and so on. In the project root, JHipster generates configuration files for tools like git, prettier, eslint, husky, and others that are well known and you can find references in the web. `/src/*` structure follows default Java structure. - `.yo-rc.json` - Yeoman configuration file JHipster configuration is stored in this file at `generator-jhipster` key. You may find `generator-jhipster-*` for specific blueprints configuration. - `.yo-resolve` (optional) - Yeoman conflict resolver Allows to use a specific action when conflicts are found skipping prompts for files that matches a pattern. Each line should match `[pattern] [action]` with pattern been a [Minimatch](https://github.com/isaacs/minimatch#minimatch) pattern and action been one of skip (default if omitted) or force. Lines starting with `#` are considered comments and are ignored. - `.jhipster/*.json` - JHipster entity configuration files - `/src/main/docker` - Docker configurations for the application and services that the application depends on ## Development To start your application in the dev profile, run: ``` ./mvnw ``` For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][]. ## Building for production ### Packaging as jar To build the final jar and optimize the jhipsterSampleMicroservice application for production, run: ``` ./mvnw -Pprod clean verify ``` To ensure everything worked, run: ``` java -jar target/*.jar ``` Refer to [Using JHipster in production][] for more details. ### Packaging as war To package your application as a war in order to deploy it to an application server, run: ``` ./mvnw -Pprod,war clean verify ``` ### JHipster Control Center JHipster Control Center can help you manage and control your application(s). You can start a local control center server (accessible on http://localhost:7419) with: ``` docker compose -f src/main/docker/jhipster-control-center.yml up ``` ## Testing ### Spring Boot tests To launch your application's tests, run: ``` ./mvnw verify ``` ### Gatling Performance tests are run by [Gatling][] and written in Scala. They're located in [src/test/java/gatling/simulations](src/test/java/gatling/simulations). You can execute all Gatling tests with ``` ./mvnw gatling:test ``` ## Others ### Code quality using Sonar Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with: ``` docker compose -f src/main/docker/sonar.yml up -d ``` Note: we have turned off forced authentication redirect for UI in [src/main/docker/sonar.yml](src/main/docker/sonar.yml) for out of the box experience while trying out SonarQube, for real use cases turn it back on. You can run a Sonar analysis with using the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) or by using the maven plugin. Then, run a Sonar analysis: ``` ./mvnw -Pprod clean verify sonar:sonar -Dsonar.login=admin -Dsonar.password=admin ``` If you need to re-run the Sonar phase, please be sure to specify at least the `initialize` phase since Sonar properties are loaded from the sonar-project.properties file. ``` ./mvnw initialize sonar:sonar -Dsonar.login=admin -Dsonar.password=admin ``` Additionally, Instead of passing `sonar.password` and `sonar.login` as CLI arguments, these parameters can be configured from [sonar-project.properties](sonar-project.properties) as shown below: ``` sonar.login=admin sonar.password=admin ``` For more information, refer to the [Code quality page][]. ### Using Docker to simplify development (optional) You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services. For example, to start a postgresql database in a docker container, run: ``` docker compose -f src/main/docker/postgresql.yml up -d ``` To stop it and remove the container, run: ``` docker compose -f src/main/docker/postgresql.yml down ``` You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running: ``` npm run java:docker ``` Or build a arm64 docker image when using an arm64 processor os like MacOS with M1 processor family running: ``` npm run java:docker:arm64 ``` Then run: ``` docker compose -f src/main/docker/app.yml up -d ``` When running Docker Desktop on MacOS Big Sur or later, consider enabling experimental `Use the new Virtualization framework` for better processing performance ([disk access performance is worse](https://github.com/docker/roadmap/issues/7)). For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`jhipster docker-compose`), which is able to generate docker configurations for one or several JHipster applications. ## Continuous Integration (optional) To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information. [JHipster Homepage and latest documentation]: https://www.jhipster.tech [JHipster 8.3.0 archive]: https://www.jhipster.tech/documentation-archive/v8.3.0 [Doing microservices with JHipster]: https://www.jhipster.tech/documentation-archive/v8.3.0/microservices-architecture/ [Using JHipster in development]: https://www.jhipster.tech/documentation-archive/v8.3.0/development/ [Service Discovery and Configuration with Consul]: https://www.jhipster.tech/documentation-archive/v8.3.0/microservices-architecture/#consul [Using Docker and Docker-Compose]: https://www.jhipster.tech/documentation-archive/v8.3.0/docker-compose [Using JHipster in production]: https://www.jhipster.tech/documentation-archive/v8.3.0/production/ [Running tests page]: https://www.jhipster.tech/documentation-archive/v8.3.0/running-tests/ [Code quality page]: https://www.jhipster.tech/documentation-archive/v8.3.0/code-quality/ [Setting up Continuous Integration]: https://www.jhipster.tech/documentation-archive/v8.3.0/setting-up-ci/ [Node.js]: https://nodejs.org/ [NPM]: https://www.npmjs.com/ [Gatling]: https://gatling.io/
1
AlexBenton/Teaching
Sample code for Further Graphics lectures, Cambridge University.
null
# Sample code for Cambridge University lecture series Lectures are delivered annually at the Cambridge Computer Laboratory. The current lecture series is [FGraphics1819](https://github.com/AlexBenton/Teaching/tree/master/FGraphics1819). Code for previous years is not maintained or supported. # Contents Directory | Course | Lecture notes PDFs ----------------------------|---------------------------------------------------------------------------------------|------------------------- `FGraphics1819` | [Further Graphics 2018-2019](http://www.cl.cam.ac.uk/teaching/1819/FGraphics/) | [archive](http://bentonian.com/Lectures/FGraphics1819/) `FGraphics1718` | [Further Graphics 2017-2018](http://www.cl.cam.ac.uk/teaching/1718/FGraphics/) | [archive](http://bentonian.com/Lectures/FGraphics1718/) `AdvGraph1718` | [Advanced Graphics 2017-2018](http://www.cl.cam.ac.uk/teaching/1718/AdvGraph/) | [archive](http://bentonian.com/Lectures/AdvGraph1718/) `AdvGraph1617` | [Advanced Graphics 2016-2017](http://www.cl.cam.ac.uk/teaching/1617/AdvGraph/) | [archive](http://bentonian.com/Lectures/AdvGraph1617/) `AdvGraph1516` | [Advanced Graphics 2015-2016](http://www.cl.cam.ac.uk/teaching/1516/AdvGraph/) | [archive](http://bentonian.com/Lectures/AdvGraph1516/) `AdvGraph1415` | [Advanced Graphics 2014-2015](http://www.cl.cam.ac.uk/teaching/1415/AdvGraph/) | [archive](http://bentonian.com/Lectures/AdvGraph1415/) `AdvGraph1314` | [Advanced Graphics 2013-2014](http://www.cl.cam.ac.uk/teaching/1314/AdvGraph/) | [archive](http://bentonian.com/Lectures/AdvGraph1314/) ![Twisting reflective surface](Twist.gif)
1
sdeleuze/spring-boot-sample-web-handlebars
Spring Boot Web Handlebars Sample
null
# spring-boot-sample-web-handlebars Spring Boot Web Handlebars Sample, feel free to fork in order to experiment support for your favorite Javascript based template engine. More details about Spring Script Templating in [Spring Framework reference manual](http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#view-script). Be sure to use [JDK 8u60 or later](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) in order to have the better Nashorn version available.
1
mariadb-developers/java-quickstart
This repository contains code samples for getting started with Java and MariaDB.
java jdbc jdbc-driver mariadb mariadb-database quickstart r2dbc r2dbc-driver
# Quick Start: Java and MariaDB [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=plastic)](https://opensource.org/licenses/MIT) This repository contains examples on how to connect to [MariaDB](https://mariadb.com) databases using a combination of different Java libraries and frameworks. ## Before you run the examples 1. Make sure you have a MariaDB Server ([Enterprise](https://mariadb.com/products/enterprise/) or [Community](https://mariadb.com/products/community-server/)) running. If you don't have a MariaDB server running, you can easily run one using [Docker](https://hub.docker.com/u/mariadb): ```Shell docker run --name mariadb --detach --publish 3306:3306 --env MARIADB_ROOT_PASSWORD='RootPassword123!' mariadb ``` Alternatively, you can [Download](https://mariadb.com/downloads/) and install the server directly on your OS. 2. Connect to the database using [MariaDB Shell](https://mariadb.com/downloads/tools/shell/): ```shell mariadb-shell --dsn mariadb://root:'RootPassword123!'@127.0.0.1 ``` Alternatively, you can use any database client compatible with MariaDB. 3. Prepare the database schema and user as follows: ```sql CREATE DATABASE demo; CREATE USER 'user'@'%' IDENTIFIED BY 'Password123!'; GRANT SELECT, INSERT, UPDATE, DELETE, DROP ON demo.* TO 'user'@'%'; CREATE TABLE demo.programming_language( pl_id INT PRIMARY KEY AUTO_INCREMENT, pl_name VARCHAR(50) NOT NULL UNIQUE, pl_rating INT ); ``` ## JDBC & JPA - [JDBC (Java Database Connectivity)](jdbc/): The foundational technology used for persistence in Java. - [JPA/Hibernate](jpa-hibernate/): The de-facto standard for consuming databases from Java apps. ## Spring Boot - [Spring Boot Data JPA](spring-boot-jpa/): Spring-based programming model for data access on top of JPA. - [R2DBC ➚](https://github.com/mariadb-developers/reactive-programming-java-examples): Reactive database connectivity. - [jOOQ](spring-boot-jooq/): Type-safe SQL queries in Java. - [MyBatis](spring-boot-mybatis/): Map SQL results to Java methods in a simple way. ## Jakarta EE (Java EE) - [Jakarta EE + GlassFish](jakarta-ee/): Jakarta EE is set of vendor-neutral specifications to build enterprise Java applications. - [MicroProfile + Open Liberty](microprofile/): An open-source community specification for Enterprise Java microservices. ## Quarkus (work in progress)
0
hitherejoe/BottomNavigationViewSample
A sample app for the new Bottom Navigation View from the Design Support library
null
# BottomNavigationViewSample A sample app for the new Bottom Navigation View from the Design Support library. Check out the article here for more info on how to use the new view: <a href="https://medium.com/@hitherejoe/exploring-the-android-design-support-library-bottom-navigation-drawer-548de699e8e0#.3zoac3eaw"> https://medium.com/@hitherejoe/exploring-the-android-design-support-library-bottom-navigation-drawer-548de699e8e0#.3zoac3eaw</a> <p align="center"> <img src="art/giphy.gif" alt="Bourbon Header"/> </p>
1
TinkerPatch/tinkerpatch-sample
已经改造完自身App的Application的应用的参考Sample
hotfix tinker tinkerpatch
# This repository is DEPRECATED # TinkerPatch SDK Sample [![Build Status](https://travis-ci.org/TinkerPatch/tinkerpatch-sample.svg?branch=master)](https://travis-ci.org/TinkerPatch/tinkerpatch-sample) [![Download](https://api.bintray.com/packages/simsun/maven/tinkerpatch-android-sdk/images/download.svg) ](https://bintray.com/simsun/maven/tinkerpatch-android-sdk/_latestVersion) [![Join Slack](https://slack.tinkerpatch.com/badge.svg)](https://slack.tinkerpatch.com) [相关文档](http://tinkerpatch.com/Docs/intro)
0
openmhealth/sample-data-generator
An application that creates sample Open mHealth data.
null
# Open mHealth Sample Data Generator [![Build Status](https://travis-ci.org/openmhealth/sample-data-generator.svg?branch=master)](https://travis-ci.org/openmhealth/sample-data-generator) When people become familiar with [Open mHealth](http://www.openmhealth.org/), they often ask if there's a data set they can test against, especially one containing data matching the data types, time scales, and trends they're interested in. This project is meant to help all of those people generate the specific data sets they need. The data generator is a command-line tool that creates Open mHealth [data points](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_data-point) for different kinds of measures. It reads a [configuration file](#configuration) to understand what data it should create, and writes that data out to the console or to a file. You can read a more detailed overview in [our blog post](http://www.openmhealth.org/years-of-health-data-yours-in-minutes/). ### Requirements - If you want to run the generator using Docker, you'll need [Docker](https://docs.docker.com/installation/#installation/). - If you want to run the generator natively, you'll need a Java 8 JRE. - If you want to build or modify the code, you'll need a Java 8 SDK. ### Installation To install the generator using Docker, open a terminal and download the data generator image by running `docker pull openmhealth/omh-sample-data-generator:latest` If you don't want to use Docker but don't want to build the binary, download the `data-generator-x.y.z.jar` JAR file from the [latest release](https://github.com/openmhealth/sample-data-generator/releases) on GitHub. You'll need a Java JRE to run it. If you want to modify and build the code, open a terminal, clone this repository and build the generator by running `./gradlew build` The assembled JAR file will be created in the `backend/build/libs` directory. ### Configuration To configure the data generator, you'll modify a [YAML](https://en.wikipedia.org/wiki/YAML) configuration file called `application.yml`. If you haven't created a configuration file yet, the quickest way to get started is to copy the [default configuration file](backend/src/main/resources/application.yml) (it's easier to copy if you click the 'Raw' button on that page.) > You can save the configuration file anywhere, unless you plan to run the generator using Docker and are on Mac OS X or Windows. In that case, save the configuration somewhere under your `/Users` or `C:\Users` directory. This is due to a [restriction](https://docs.docker.com/userguide/dockervolumes/) on the directories the Docker daemon has access to when mounting volumes. There's a big section below on the configuration file, but first let's make sure you can run the generator. ### Running To run the generator using Docker, and assuming you're in the same directory as the `application.yml` configuration file, run ``docker run --rm -v `pwd`:/opt/omh-sample-data-generator/mount openmhealth/omh-sample-data-generator:latest`` in a terminal. If you're not in the same directory as the configuration file, replace `` `pwd` `` with the directory the configuration file is in. Alternatively, to run the generator natively, navigate to the directory that contains the configuration file and run `java -jar /path/to/data-generator-x.y.z.jar` In either case, you should see output that looks something like ``` Starting Application on machine with PID 15861 (/Users/foo/data-generator-x.y.z.jar started by foo in /Users/foo) Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@6e8d6976: startup date [Sat Jul 11 16:09:24 CEST 2015]; root of context hierarchy Registering beans for JMX exposure on startup Started Application in 2.056 seconds (JVM running for 2.998) A total of 0 data point(s) have been written. Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@6e8d6976: startup date [Sat Jul 11 16:09:24 CEST 2015]; root of context hierarchy Unregistering JMX-exposed beans on shutdown ``` By default, no data points will be generated. Now that you can run the generator, read on to learn how to configure it to create some data. ### Configuration, take two The generator configuration file is written in YAML. If you're new to YAML, just keep in mind that indentation matters and to use spaces, not tabs. The configuration file has keys that divide it into three sections - an [output settings](#output_settings) section, which controls what the generator does with the data points it creates - a [header settings](#header_settings) section, which sets certain header fields in the generated data points - a [measure generation settings](#measure_generation_settings) section, which specifies the data to generate A simple commented configuration file might looks like this ```yaml # output settings # meaning: Write any generated data points to the console. output: destination: console data: # header settings # meaning: Set the `header.user-id` property of the data point to the username `joe`. header: user-id: joe # measure generation settings measure-generation-requests: # meaning: A measure generator called `body-weight` should create a year's worth of data # for 2014, with data points 24 hours apart, or about 365 data points in total. The # weight should trend from 55kg at the beginning of the year to 60kg at the end of the year. - generator: body-weight start-date-time: 2014-01-01T12:00:00Z end-date-time: 2015-01-01T12:00:00Z mean-inter-point-duration: PT24h trends: ? weight-in-kg : start-value: 55 end-value: 60 ``` This example is significantly shorter than the default configuration file because defaults are being used. In general, if any key in the default configuration file has a "defaults to" comment, that key can be omitted, and the generator will set the value of that key to the stated default. The following paragraphs explain what each group of settings does. The default configuration file is also heavily documented, but we recommend you first read the following sections before diving in. #### Output settings The `output` key controls what the generator does with the data points it creates. The complete settings are as follows ```yaml output: # whether to write data points to the "console" or to a "file", defaults to "console" destination: console file: # the file to write the data points to, defaults to "output.json" filename: output.json # true if the file should be appended to, false if it should be overwritten, defaults to true append: true ``` The `file` key is ignored if the destination is set to `console`. The `filename` key supports both absolute paths and relative paths. If you're writing to a file and running the generator in Docker, however, you should use a simple filename in the `filename` key. The file will be written to the same directory that contains your configuration file. The generator writes one data point per line, with no separators. When writing to a file, this format makes it easy to add import the file into a MongoDB collection using the command - `mongoimport -d some_database -c some_collection --file output.json` #### Data point header settings The `data.header` key gives you a way to tune some of the operational data in the data points. The complete settings are as follows ```yaml data: header: # the user to associate the data points with, defaults to "some-user" user-id: some-user acquisition-provenance: # the name of the source of the data points, defaults to "generator" source-name: generator ``` At this point, only the user and source name settings are available. We'll add more settings based on demand. #### Measure generation settings The data generator can create data points for different measures. The measures which are supported so far are * [ambient temperature](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_ambient-temperature) * [blood glucose](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_blood-glucose) * [blood pressure](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_blood-pressure) * [body fat percentage](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-fat-percentage) * [body height](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-height) * [body temperature](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-temperature) * [body weight](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-weight) * [heart rate](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_heart-rate) * [minutes of moderate activity](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_minutes-moderate-activity) * [physical activity](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_physical-activity) * [sleep duration](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_sleep-duration) * [step count](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_step-count) To create data points for a specific measure, the data generator uses a *measure generator* that is capable of generating that type of measure. For example, to create body weight data points, the data generator uses a body weight measure generator. A measure generator needs at least one value to generate a measure. For example, to create a body weight measure, the generator needs a mass value. You may also want the generator to use different values in the different instances it creates. This is achieved using *trends*. ##### Trends A trend represents the changing of a value over time. The trend has a *start timestamp* and *start value*, and an *end timestamp* and *end value*. Using linear interpolation, a generator can compute the value at any time between the start time and the end time. For example, if the start timestamp is midnight January 1st, 2015 with a weight of 60kg and the end timestamp is March 1st, 2015 at midnight with a weight of 65kg, the generator will interpolate the weight in the beginning of February to be 62.5kg. Although a generator can compute the value at any point along the trend, you need to tell it which points to generate data for. This is achieved using a *mean inter-point duration*. The duration you specify in the configuration file is fed to an exponential distribution to pick timestamps along the trend. A mean inter-point duration of `PT6h`, expressed in an ISO 8601 duration format, tells the generator to create a data point every 6 hours on average along the trend. The configuration for the above example looks like this ```yaml measure-generation-requests: - generator: body-weight start-date-time: 2015-01-01T12:00:00Z end-date-time: 2015-03-01T12:00:00Z mean-inter-point-duration: PT6h trends: ? weight-in-kg : start-value: 60 end-value: 65 ``` In the example, the name of the measure generator is `body-weight`. This is defined by the [measure generator](backend/src/main/java/org/openmhealth/data/generator/service/BodyWeightDataPointGenerator.java) included in the data generator. It is possible to create different generators for the same measure, and you would differentiate between generators by name. Each measure generator defines the trends it needs, and the `body-weight` measure generator uses a trend called `weight-in-kg`. The data generator will warn you if you use unrecognized keys, or fail to provide required keys. The full list of included measure generators and their keys is available in [Appendix A](#appendix-a-measure-generators). When executed, this configuration generates about 240 data points (60 days times 4 data points per day), where a data point looks like this: ```json { "header": { "id": "423c4b46-15ac-438b-9734-f8556cb94b6a", "creation_date_time": "2015-01-01T15:34:25Z", "acquisition_provenance": { "source_name": "generator", "source_creation_date_time": "2015-01-01T15:33:25Z", "modality": "sensed" }, "user_id": "some-user", "schema_id": { "namespace": "omh", "name": "body-weight", "version": "1.0" } }, "body": { "effective_time_frame": { "date_time": "2015-01-01T15:33:25Z" }, "body_weight": { "unit": "kg", "value": 60.01255983207784 } }, "id": "423c4b46-15ac-438b-9734-f8556cb94b6a" } ``` A graph of the generated data looks like this: ![Body weight no variance](resources/images/body-weight-no-variance.png?raw=true "Weight trend") > These graphs are generated using an interactive chart component in our [web visualizations library](https://github.com/openmhealth/web-visualizations). A closer view of a few days in January looks like this: ![Body weight no variance (zoomed)](resources/images/body-weight-no-variance-zoomed.png?raw=true "Weight trend (zoomed)") There are a couple of things to note from this graph. The first is that the data points aren't evenly spaced in time. This is caused by the configured inter-point duration being a *mean*. Some points will naturally be nearer each other and some farther apart as the exponential distribution is sampled to come up with effective time frames. This variability is typically desired as it more closely represents real world data. The second thing to note is that there's no variability off the trend itself, i.e. the weights follow the trend perfectly, which is not representative of real world data. ##### Standard deviation To add variability to the values, you can specify a *standard deviation* when configuring a trend. Once the generator interpolates a value at a specific point in time, it treats that value as the mean of a Gaussian distribution with the specified standard deviation. The random variable is then sampled to come up with the value to set. If we add a standard deviation to our example configuration as follows: ```yaml measure-generation-requests: - generator: body-weight start-date-time: 2015-01-01T12:00:00Z end-date-time: 2015-03-01T12:00:00Z mean-inter-point-duration: PT6h trends: ? weight-in-kg : start-value: 60 end-value: 65 standard-deviation: 0.25 ``` A graph of the generated data looks like this: ![Body weight with variance](resources/images/body-weight-with-variance.png?raw=true "Weight trend with variance") And a closer view of a few days in January now looks like this: ![Body weight with variance (zoomed)](resources/images/body-weight-with-variance-zoomed.png?raw=true "Weight trend with variance (zoomed)") ##### Limits When using the `standard-deviation` key, some generated values will be far away from the trend, possibly so far away as to be undesirable or outright invalid, such as negative weights. To mitigate this, the configuration supports *minimum value* and *maximum value* keys. For example: ```yaml measure-generation-requests: - generator: body-weight start-date-time: 2015-01-01T12:00:00Z end-date-time: 2015-03-01T12:00:00Z mean-inter-point-duration: PT6h trends: ? weight-in-kg : start-value: 60 end-value: 65 standard-deviation: 0.25 minimum-value: 59 maximum-value: 66 ``` All generated values will fall within these bounds. ##### Night time measure suppression You may want to suppress the generation of measures that occur at night, typically when modelling self-reported data. The generator has a *suppress-night-time-measures* key that skips data points whose effective time frames falls between 11pm and 6am. Our example configuration would look like ```yaml measure-generation-requests: - generator: body-weight start-date-time: 2015-01-01T12:00:00Z end-date-time: 2015-03-01T12:00:00Z mean-inter-point-duration: PT6h suppress-night-time-measures: true trends: ? weight-in-kg : start-value: 60 end-value: 65 standard-deviation: 0.25 minimum-value: 59 maximum-value: 66 ``` Our closer view of those few days in January now looks like this: ![Body weight without night time measures](resources/images/body-weight-without-night-time-measures.png?raw=true "Weight trend without night time measures") As you can see, the data points no longer have effective time frames at night. ##### Multi-trend measures Some measure generators build measures by combining multiple trends. To define these trends, simply add more trend definitions to the `trends` key using the question-mark-colon notation. For example, to create blood pressure measures, specify both `systolic-in-mmhg` and `diastolic-in-mmhg` trends to the `blood-pressure` generator as follows: ```yaml measure-generation-requests: - generator: blood-pressure start-date-time: 2015-01-01T12:00:00Z end-date-time: 2015-03-01T12:00:00Z mean-inter-point-duration: PT12h suppress-night-time-measures: true trends: ? systolic-in-mmhg : start-value: 110 end-value: 125 minimum-value: 100 maximum-value: 140 standard-deviation: 3 ? diastolic-in-mmhg : start-value: 70 end-value: 80 minimum-value: 60 maximum-value: 90 standard-deviation: 3 ``` A graph of the generated data looks like this: ![Blood pressure](resources/images/blood-pressure-with-variance.png?raw=true "Blood pressure") ##### Avoiding repetition A single configuration file can create different types of measures. Simply concatenate measure generation requests in the configuration file, and the data generator will generate all configured measures. For example: ```yaml measure-generation-requests: - generator: blood-pressure start-date-time: 2015-01-01T12:00:00Z end-date-time: 2015-03-01T12:00:00Z mean-inter-point-duration: PT12h suppress-night-time-measures: true trends: ? systolic-in-mmhg : start-value: 110 end-value: 125 minimum-value: 100 maximum-value: 140 standard-deviation: 3 ? diastolic-in-mmhg : start-value: 70 end-value: 80 minimum-value: 60 maximum-value: 90 standard-deviation: 3 - generator: body-weight start-date-time: 2015-01-01T12:00:00Z end-date-time: 2015-03-01T12:00:00Z mean-inter-point-duration: PT6h suppress-night-time-measures: true trends: ? weight-in-kg : start-value: 55 end-value: 60 minimum-value: 50 maximum-value: 65 standard-deviation: 0.1 ``` In the above example, some measure generator settings are repeated. To avoid this repetition, you can also place common settings under the `data` key, and only override them per generator as necessary. The above settings would then look like this. ```yaml data: start-date-time: 2015-01-01T12:00:00Z # defaults to January 1st, 2014 at noon UTC end-date-time: 2015-03-01T12:00:00Z # defaults to January 1st, 2015 at noon UTC suppress-night-time-measures: true # defaults to false measure-generation-requests: - generator: blood-pressure mean-inter-point-duration: PT12h # defaults to PT24h trends: ? systolic-in-mmhg : start-value: 110 end-value: 125 minimum-value: 100 maximum-value: 140 standard-deviation: 3 ? diastolic-in-mmhg : start-value: 70 end-value: 80 minimum-value: 60 maximum-value: 90 standard-deviation: 3 - generator: body-weight mean-inter-point-duration: PT6h trends: ? weight-in-kg : start-value: 55 end-value: 60 minimum-value: 50 maximum-value: 65 standard-deviation: 0.1 ``` If the generator settings are omitted, the defaults in the comments take effect. You can add as many measure generator requests in a configuration file as you want, including requests for the same measure generator. This lets you assemble data sets that include more complex trends. ### Contributing To contribute to this repository 1. Open an [issue](https://github.com/openmhealth/sample-data-generator/issues) to let us know what you're going to work on. 1. This lets us give you feedback early and lets us put you in touch with people who can help. 2. Fork this repository. 3. Create your feature branch from the `develop` branch. 4. Commit and push your changes to your fork. 5. Create a pull request. ### Appendix A. Measure generators The following table shows the currently included measure generators and their trend keys. For more information, take a look at the code or ask us a [question](https://github.com/openmhealth/sample-data-generator/issues). The default configuration file also includes a sample configuration for each measure generator. |name|Open mHealth measure schema|supported trend keys|required trend keys| |----|---------------------------|--------------------|-------------------| |[ambient-temperature](backend/src/main/java/org/openmhealth/data/generator/service/AmbientTemperatureDataPointGenerator.java)|[omh:blood-pressure](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_ambient-temperature)|temperature-in-c| |[blood-glucose](backend/src/main/java/org/openmhealth/data/generator/service/BloodGlucoseDataPointGenerator.java)|[omh:blood-glucose](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_blood-glucose)|glucose-in-mg-per-dl|same| |[blood-pressure](backend/src/main/java/org/openmhealth/data/generator/service/BloodPressureDataPointGenerator.java)|[omh:blood-pressure](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_blood-pressure)|systolic-in-mmhg, diastolic-in-mmhg|same| |[body-fat-percentage](backend/src/main/java/org/openmhealth/data/generator/service/BodyFatPercentageDataPointGenerator.java)|[omh:body-fat-percentage](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-fat-percentage)|percentage|same| |[body-height](backend/src/main/java/org/openmhealth/data/generator/service/BodyHeightDataPointGenerator.java)|[omh:body-height](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-height)|height-in-meters|same| |[body-temperature](backend/src/main/java/org/openmhealth/data/generator/service/BodyTemperatureDataPointGenerator.java)|[omh:body-temperature](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-temperature)|temperature-in-c|same| |[body-weight](backend/src/main/java/org/openmhealth/data/generator/service/BodyWeightDataPointGenerator.java)|[omh:body-weight](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_body-weight)|weight-in-kg|same| |[heart-rate](backend/src/main/java/org/openmhealth/data/generator/service/HeartRateDataPointGenerator.java)|[omh:heart-rate](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_heart-rate)|rate-in-beats-per-minute|same| |[minutes-moderate-activity](backend/src/main/java/org/openmhealth/data/generator/service/MinutesModerateActivityDataPointGenerator.java)|[omh:minutes-moderate-activity](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_minutes-moderate-activity)|minutes|same| |[physical-activity](backend/src/main/java/org/openmhealth/data/generator/service/PhysicalActivityDataPointGenerator.java)|[omh:physical-activity](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_physical-activity)|duration-in-seconds, distance-in-meters|duration-in-seconds| |[sleep-duration](backend/src/main/java/org/openmhealth/data/generator/service/SleepDurationDataPointGenerator.java)|[omh:sleep-duration](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_sleep-duration)|duration-in-hours|same| |[step-count](backend/src/main/java/org/openmhealth/data/generator/service/StepCountDataPointGenerator.java)|[omh:step-count](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_step-count)|steps-per-minute, duration-in-seconds|same| Measure generators are short and quite easy to write. Feel free to [contribute](#contributing) others.
1
ogaclejapan/FluxArchitectureSample
Sample app for Flux Architecture
null
FluxArchitectureSample ==============================
1
dschulten/spring-hateoas-rest-service-sample
Spring Hateoas Rest Service and Client Sample
null
null
1
piomin/sample-spring-microservices-kubernetes
Sample Spring Boot application that uses some features provided by Spring Cloud Kubernetes, Spring Cloud OpenFeign and Spring Cloud Gateway deployed on Kubernetes
configmap docker kubernetes microservices minikube openshift ribbon spring-boot spring-cloud spring-cloud-kubernetes swagger2 zuul
null
1
AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller
A sample of how to mimic the way that the contacts app handles a Fast-Scroller for a RecyclerView
null
# LollipopContactsRecyclerViewFastScroller A sample of how to mimic the way that the contacts app handles a Fast-Scroller for a RecyclerView This POC is based on [this website's tutorial](https://blog.stylingandroid.com/recyclerview-fastscroll-part-2/#comment-67201), but with a lot of fixes, optimizations, cleaner code, and of course styling like on Lollipop's contacts app. Demo: ![enter image description here](https://raw.githubusercontent.com/AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller/master/demo.gif) **Screenshots** Here's how the contacts app of Android Lollipop (5.0.x) looks like: ![enter image description here](https://raw.githubusercontent.com/AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller/master/lollipop%20contacts%20app.png) and here's how I managed to mimic its fast-scroller: ![enter image description here](https://raw.githubusercontent.com/AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller/master/demo.png) **Known issues and TODOs** 1. It's a POC, so it's not so comfortable to customize, but on the other hand, you can put any style you wish. 2. I think there are issues when changing the orientation. 3. Not a library. I hope I can think of a way that this could be a nice library 4. Minimal API is 11 . I'd like it to be lower. 5. Supports only LinearLayoutManager for now. Wish it would also support Gridlayoutmanager .
1
hendisantika/springboot-ecommerce
Spring Boot E-Commerce sample
null
# springboot-ecommerce #### Spring Boot Angular A Simple E-Commerce Implementation with Spring This module contains articles about Spring Boot with Angular #### Technology Stacks 1. Java 8 2. Maven 3.6.3 3. IntelliJ Ultimate 2020.1 4. NodeJS v14.2.0 5. NPM 6.14.5 6. Angular CLI: 7.3.10 7. Angular: 7.2.16 8. H2 Database 9. Spring Boot Stack ### Things todo list: 1. Clone this repository: `git clone https://github.com/hendisantika/springboot-ecommerce.git` 2. Go inside the folder: `cd springboot-ecommerce` 3. Run the backend application: `mvn clean spring-boot:run` 4. Run Angular Application: `cd frontend && npm run start` 5. Open your favorite browser: http://localhost:4200 ### Screen shot Home Page ![Home Page](img/home.png "Home Page") Order Page ![Order Page](img/order.png "Order Page") Checkout Page ![Checkout Page](img/checkout.png "Checkout Page") Pay order Page ![Pay order Page](img/pay.png "Pay order Page")
1
gjiazhe/LayoutSwitch
A sample showing an easy way to make switch animation from list layout to grid layout with RecyclerView.
null
# LayoutSwitch This is a sample showing an easy way to make switch animation from list layout to grid layout with RecyclerView. ![screenshot](screenshot/screenshot.gif)
1
bonigarcia/rate-my-cat
Sample application for the book Mastering Software Testing with JUnit 5""
codecov junit5 mockito selenium sonarqube spring-boot spring-mvc thymeleaf
# Rate my cat! [![][Logo]][GitHub Repository] [![Build Status](https://github.com/bonigarcia/rate-my-cat/workflows/build/badge.svg)](https://github.com/bonigarcia/rate-my-cat/actions) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=io.github.bonigarcia:rate-my-cat&metric=alert_status)](https://sonarcloud.io/project/overview?id=io.github.bonigarcia%3Arate-my-cat) [![codecov](https://codecov.io/gh/bonigarcia/rate-my-cat/branch/master/graph/badge.svg)](https://codecov.io/gh/bonigarcia/rate-my-cat) This project contains a complete sample application for the book [Mastering Software Testing with JUnit 5]. It consists on a web application in which end uses can rate a list of cats by watching its name and picture. The rate shall be done once per end user using a star mechanism. Optionally, comments can be made per cat. This application has been built using the following technologies: * Spring Framework, as application framework: Spring Boot, Spring MVC + Thymeleaf, Spring Data JPA, and Spring Test (for integration tests). * JUnit 5, as testing framework. * Hamcrest, for improving the readability of assertions. * Mockito, for unit testing. * Selenium WebDriver, for end-to-end testing. The screenshots below show the application GUI in action. ![][Screeshot 1] ![][Screeshot 2] # About This is a project made by [Boni Garcia], Associate Professor at [Universidad Carlos III de Madrid], Spain. Copyright &copy; 2017-2023. [Boni Garcia]: https://bonigarcia.github.io/ [Universidad Carlos III de Madrid]: https://www.it.uc3m.es/bogarcia/index.html [GitHub Repository]: https://github.com/bonigarcia/rate-my-cat [Logo]: https://raw.githubusercontent.com/bonigarcia/rate-my-cat/master/src/main/resources/static/img/rate-my-cat.png [Screeshot 1]: https://raw.githubusercontent.com/bonigarcia/rate-my-cat/master/doc/rate-my-cat-screeshot-1.png [Screeshot 2]: https://raw.githubusercontent.com/bonigarcia/rate-my-cat/master/doc/rate-my-cat-screeshot-2.png [Mastering Software Testing with JUnit 5]: https://www.amazon.com/Mastering-Software-Testing-JUnit-Comprehensive-ebook/dp/B076ZQCK5Q
1
LiveTyping/u2020-mvp
[DEPRECATED] Port of Jake Wharton's U2020 sample app with use of MVP and Dagger 2
null
U+2020-mvp ====== [DEPRECATED] We recomend to try [Moxy framework](https://github.com/Arello-Mobile/Moxy) instead of our solution. Port of Jake Wharton's [U2020 sample app][u2020] with use of MVP pattern and [Dagger 2][dagger2]. ![Debug drawer](u2020-mvp.gif) Dagger 2 ------- [Watch the corresponding talk][parleys] or [view the slides][slides]. TODO MVP ------- TODO Testing ------- [Espresso 2][espresso2] and JUnit4 are used for tests. Activities are instrumented by [ActivityRule][activityrule] (by Jake Wharton). Android Studio Template ----------------------- Also we've created a [u2020-mvp Android Studio Template][u2020-mvp-template] to quickly generate the u2020-mvp classes. Libraries ------- * Dagger 2 - https://github.com/google/dagger * ButterKnife - http://jakewharton.github.io/butterknife * Retrofit - http://square.github.io/retrofit * Moshi - https://github.com/square/moshi * Picasso - http://square.github.io/picasso * OkHttp - http://square.github.io/okhttp * RxJava - https://github.com/ReactiveX/RxJava * RxAndroid - https://github.com/ReactiveX/RxAndroid * Madge - http://github.com/JakeWharton/madge * Timber - http://github.com/JakeWharton/timber * ProcessPhoenix - https://github.com/JakeWharton/ProcessPhoenix * Telescope - https://github.com/mattprecious/telescope * LeakCanary - http://github.com/square/leakcanary * Espresso 2 - https://code.google.com/p/android-test-kit/ License ------- Copyright 2014 Live Typing 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. [u2020]: https://github.com/JakeWharton/u2020 [dagger2]: https://github.com/google/dagger [espresso2]: https://code.google.com/p/android-test-kit/wiki/EspressoSetupInstructions [activityrule]: https://gist.github.com/JakeWharton/1c2f2cadab2ddd97f9fb [parleys]: https://parleys.com/play/5471cdd1e4b065ebcfa1d557/ [slides]: https://speakerdeck.com/jakewharton/dependency-injection-with-dagger-2-devoxx-2014 [u2020-mvp-template]: https://github.com/LiveTyping/u2020-mvp-android-studio-template
1
deepanshu42/dynamic-module-sample
Sample project for creating a dynamic feature module
null
# dynamic-module-sample Sample project for creating a dynamic feature module ## How to deploy on a device? 1. Select Run > Edit Configurations from the menu bar. 2. In the left pane of the Run/Debug Configurations dialog, select your desired configuration under the Android App node. 3. In the dropdown menu next to Deploy, select APK from app bundle. 4. Under Dynamic features to deploy, check the box next to each dynamic feature module, if any, you want to include when deploying your app. 5. Click OK.
1
hantsy/keycloak-spring-security-sample
Spring Security 5 OAuth2 Client/OIDC integration with Keycloak sample
keycloak oauth2 oidc spring-boot spring-security
# Spring Security Examples with KeyCloak > For the legacy Spring Security 5 OAuth2 Client example, check the docs [here](./docs/boot-2.x), and get the source codes from tag [boot-2.x](https://github.com/hantsy/keycloak-spring-security-sample/releases/tag/boot-2.x)
1
varunjohn/Booking-Seats-Layout-Sample
A sample that shows how to create a dynamic layout for booking seats
android-ui booking booking-android booking-layout booking-seats booking-ui booking-ux movie movie-booking movie-seating-arrangement movie-seats seating
# Booking-Seats-Layout-Sample This project is sample app for Android it generates a dynamic layout for booking seats. ![seat layout sample](https://user-images.githubusercontent.com/24667361/43626651-787094d2-9710-11e8-97c2-0ceb4db5b719.gif) To create the layout dynamically we need to pass specific syntax in string so the method could understand and process it. ```java String seats = "_UUUUUUAAAAARRRR_/" + "_________________/" + "UU__AAAARRRRR__RR/" + "UU__UUUAAAAAA__AA/" + "AA__AAAAAAAAA__AA/" + "AA__AARUUUURR__AA/" + "UU__UUUA_RRRR__AA/" + "AA__AAAA_RRAA__UU/" + "AA__AARR_UUUU__RR/" + "AA__UUAA_UURR__RR/" + "_________________/" + "UU_AAAAAAAUUUU_RR/" + "RR_AAAAAAAAAAA_AA/" + "AA_UUAAAAAUUUU_AA/" + "AA_AAAAAAUUUUU_AA/" + "_________________/"; ``` As for this sample we have 3 status for the seats :<br /> * U is for already booked seats<br /> * R is for reserved seats<br /> * A is for available seats<br /> * _ is for empty space<br /> You can customize this string according to your seats arrangement. As of this string it has 175 seats each having unique id assigned to it. The assigned id is useful for sending the booked seats request to server. **Reserved seats VS Booked seats**<br /> Both can't be booked but showing them with seperates colors cause the reserved seats can be available with time. **Limitation**<br /> It's not recycling the views. ## About Me Varun John<br /> Sr. Android Developer<br /> varunjohn1990@gmail.com<br /> Skype varun.john1990<br /> Follow me https://github.com/varunjohn for other samples and libraries like these **If you like this sample then please add a star on this project :)** ## License ``` Copyright 2018 Varun John Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```
1
snicoll/spring-boot-4tw-uni
Sample app used for the Intro to Spring Boot for the web tier" university session at Devoxx"
null
null
1
tekante/Dynamic-Jenkins-Parameter
A Jenkins parameter type that is based on the DynamicDropDownListBox item in the ui samples repo
null
A Jenkins parameter plugin that allows for two select elements. The second select populates values depending upon the selection made for the first select. See the [wiki page](https://github.com/tekante/Dynamic-Jenkins-Parameter/wiki) for more information.
0
mariubog/oauth-client-sample
sample app connecting to REST service secured with Oauth2
null
# oauth-client-sample #####Sample Ouath2 client app connecting to REST service secured with Oauth2. It connects to the sample service created by royclarkson. You can find it here https://github.com/royclarkson/spring-rest-service-oauth. Royclarkson service is runing on port 8080 and this app is runing on port 8005 which you can change according to your needs so it does not colide with other services. !!! IMPORTANT !!! After I made changes in order to add clientOnly template authentication it does not work properly with above Roys' example, I made proper changes in my fork for his project and this example suppoesed to be used in order to get desirable results https://github.com/mariubog/spring-rest-service-oauth If I have a chance and Roy agrees I ll try to pull request for these changes in his example, but for now please just use my fork. Otherwise it will not work unless you make changes to comply with his authentication settings. It is basic spring boot application that can be started with `mvn clean package spring-boot:run` Instructions how to run RESTful service protected by OAuth 2 required for this client to interact with are posted here. https://github.com/royclarkson/spring-rest-service-oauth. <i>Both applications obviously have to be run simultanously. </i> After starting application you can use following links either with curl or simple web browser. Link to access resource protected by Oauth with not synchronazed method, uri does NOT require login on client side. Resource is acquired. `http://localhost:8005/results-asynch` Link to access resource protected by Oauth , uri does NOT require login on client side. Resource is not acquired.Authorization is required.(If acces token had been acquired earlier this method completes and returns desired results) `http://localhost:8005/results-nonauthorized` Link to access resource protected by Oauth using ResourceDetails clientOnly() == true, uri does NOT require login on client side. Resource is acquired. `http://localhost:8005/results` Link to access resource protected by Oauth with synchronazed method, uri REQUIRES login on client side. Resource is acquired after authentication. `http://localhost:8005/authorized-results`
1
gareoke/VLCPlayer
A simple sample app that plays video using LibVLC
null
# VLCPlayer A simple sample app that plays video using the LibVLC
1
gluonhq/hello-gluon-ci
HelloGluon sample including Github actions for automating builds and releases
null
# HelloGluon CI This sample shows how to automatically build a Gluon Application using Github Actions. It uses a version of [HelloGluon](https://github.com/gluonhq/gluon-samples/tree/master/HelloGluon), a Hello World application with Java 11+, JavaFX 15+, Gluon Mobile and GraalVM. For more details about Gluon Applications in general, please have a look at the [Gluon docs](https://docs.gluonhq.com) or the [other samples](https://gluonhq.com/developers/samples/). This sample focuses on the continuous integration using Github Actions on these platforms: * Windows * MacOS * Linux * iOS * Android * Embedded - AArch64 Linux All these platform specific workflows share these common steps: * Checkout your code * Setup the build environment, specific to the platform * Build the application * Upload the application Next to the above steps, for iOS and Android, the workflow includes steps to properly sign and upload the binary to the Play Store and App Store. ## Build setup Building using Github Actions is not very different from building locally. On top of a [default Gluon application](https://docs.gluonhq.com/#_getting_started), the following `releaseConfiguration` was added to the maven-gluonfx-plugin configuration: ``` <configuration> <releaseConfiguration> <!-- for iOS --> <bundleVersion>${env.GITHUB_RUN_NUMBER}</bundleVersion> <!-- for Android --> <versionCode>${env.GITHUB_RUN_NUMBER}</versionCode> <providedKeyStorePath>${env.GLUON_ANDROID_KEYSTOREPATH}</providedKeyStorePath> <providedKeyStorePassword>${env.GLUON_ANDROID_KEYSTORE_PASSWORD}</providedKeyStorePassword> <providedKeyAlias>${env.GLUON_ANDROID_KEYALIAS}</providedKeyAlias> <providedKeyAliasPassword>${env.GLUON_ANDROID_KEYALIAS_PASSWORD}</providedKeyAliasPassword> </releaseConfiguration> </configuration> ``` For iOS: * bundleVersion is set to the GITHUB_RUN_NUMBER, so each build will have unique CFBundleVersion. [See this doc](https://docs.gluonhq.com/#platforms_ios_distribution_build) for more information. For Android: * versionCode is set to the GITHUB_RUN_NUMBER, so each build will have a unique `android:versionCode`. [See this doc](https://docs.gluonhq.com/#platforms_ios_distribution_build) for more information. * keystore configuration are taken from env variables, that will be set by the workflow action. ## Gluon license All workflows use this action this Gluon license action: - name: Gluon License uses: gluonhq/gluon-build-license@v1 with: gluon-license: ${{ secrets.GLUON_LICENSE }} Using a Gluon license is optional and depends on your situation. Have a look at the [Gluon website](https://gluonhq.com/products/mobile/buy/) for more information about licences or [contact us](https://gluonhq.com/about-us/contact-us/). ## Platforms Github Action workflows are specified in [.github/workflows](https://github.com/gluonhq/hello-gluon-ci/tree/master/.github/workflows) and configured to be triggered on `push`. Depending on your own preference and requirements, this can of course be changed. Please refer to the [GitHub Actions documentation](https://docs.github.com/en/free-pro-team@latest/actions) for more information. ### Windows [![Windows](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/windows.yml/badge.svg)](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/windows.yml) * Workflow file: [.github/workflows/windows.yml](https://github.com/gluonhq/hello-gluon-ci/blob/master/.github/workflows/windows.yml) * Detailed documentation: [Gluon documentation for Windows](https://docs.gluonhq.com/#platforms_windows) for more detailed information. ### MacOS [![MacOS](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/macos.yml/badge.svg)](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/macos.yml) * Workflow file: [.github/workflows/macos.yml](https://github.com/gluonhq/hello-gluon-ci/blob/master/.github/workflows/macos.yml) * Detailed documentation: [Gluon documentation for Mac OS](https://docs.gluonhq.com/#platforms_macos) for more detailed information. ### Linux [![Linux](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/linux.yml/badge.svg)](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/linux.yml) * Workflow file: [.github/workflows/linux.yml](https://github.com/gluonhq/hello-gluon-ci/blob/master/.github/workflows/linux.yml) * Detailed documentation: [Gluon documentation for Linux](https://docs.gluonhq.com/#platforms_linux) for more detailed information. ### iOS [![iOS](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/ios.yml/badge.svg)](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/ios.yml) * Workflow file: [.github/workflows/ios.yml](https://github.com/gluonhq/hello-gluon-ci/blob/master/.github/workflows/ios.yml) * Detailed documentation: [Gluon documentation for iOS](https://docs.gluonhq.com/#platforms_ios) for more detailed information. ### Android [![Android](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/android.yml/badge.svg)](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/android.yml) * Workflow file: [.github/workflows/android.yml](https://github.com/gluonhq/hello-gluon-ci/blob/master/.github/workflows/android.yml) * Detailed documentation: [Gluon documentation for Android](https://docs.gluonhq.com/#platforms_android) for more detailed information. ### Embedded - AArch64 Linux [![AArch64 Linux](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/aarch64-linux.yml/badge.svg)](https://github.com/gluonhq/hello-gluon-ci/actions/workflows/aarch64-linux.yml) * Workflow file: [.github/workflows/aarch64-linux.yml](https://github.com/gluonhq/hello-gluon-ci/blob/master/.github/workflows/aarch64-linux.yml) * Detailed documentation: [Gluon documentation for Embedded - AArch64 Linux](https://docs.gluonhq.com/#platforms_embedded) for more detailed information.
1
Nasruddin/elasticsearch-reactive-spring-data
:trophy: A very basic sample starter application for Elasticsearch using Reactive Spring Data
docker docker-compse elastic elastic-server elasticsearch non-blocking reactive reactive-programming search-engine spring spring-boot spring-data springboot
# Elasticsearch Engine :trophy: Sample Elasticsearch engine using Reactive Spring Data. ## Feature * Read CSV and persist data in your elasticsearch cluster * Add, search and filter data * Basic operation to play around with elastic cluster * Application fully reactive and non blocking ### For High Level REST Client; please refer [this repository - Elasticsearch High Level Client](https://github.com/Nasruddin/spring-elasticsearch-rest-high-level-client) ## Requirement * Java 8+ * Docker Compose * ElasticVue: Elasticsearch Firefox Extension ## Note Please download ElasticSearch of 2.4.x if you are using Spring Boot 1.5.x. If you don't use correct versions then you should get following error: ``` java.lang.IllegalStateException: Received message from unsupported version: [2.0.0] minimal compatible version is: [5.0.0] ``` Also, if you update Spring Boot to 2.x.x please download/run elasticsearch 6.8.3 version. If not you might face following issue: ``` failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{uWHhZacNR9mbfojQOayyAg}{127.0.0.1}{127.0.0.1:9300}] ``` ###### Be careful! If you are migrating to elasticsearch to 8.5.0 or higher version. You will run into different kind of issue. Make sure you migrate first to elastic 7.17.0 and then elastic 8.5.0 [Official Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html) ## Running the application using docker-compose * Make the run.bash file executable for the current user ``` chmod u+x run.bash ``` * Run/start the application using run.bash ``` ./run.bash start ``` ## Running the application outside docker * Install and run Elasticsearch Server 8.5.0 Refer the official [link](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html) to download and install elastic stack on your machine. * You can also use docker-compose to install elasticsearch, ``` cd docker docker compose -f docker-compose-elastic.yml up ``` * Build the project and create an Image out of it ``` mvn spring-boot:run ``` * Open browser and hit localhost:9200, and you should see below response ``` { name: "elasticsearch", cluster_name: "docker-cluster", cluster_uuid: "3yvjtNl7TaWuSMK7qWB79g", version: { number: "8.5.0", build_flavor: "default", build_type: "docker", build_hash: "c94b4700cda13820dad5aa74fae6db185ca5c304", build_date: "2022-10-24T16:54:16.433628434Z", build_snapshot: false, lucene_version: "9.4.1", minimum_wire_compatibility_version: "7.17.0", minimum_index_compatibility_version: "7.0.0" }, tagline: "You Know, for Search" } ``` * Once elasticsearch server and application starts successfully, open swagger UI using http://localhost:8888/swagger-ui/index.html ![Alt text](https://github.com/Nasruddin/elasticsearch-spring-boot-spring-data/blob/master/instruction/swagger1.png?raw=true "Optional Title") * Execute /movie/generate under movie-resource to populate your elasticsearch engine. As soon as you execute the resource; you should be able to see data in GUI for elasticsearch, in my ElasticVue for firefox. Refer below image: ![Alt text](https://github.com/Nasruddin/elasticsearch-spring-boot-spring-data/blob/master/instruction/data.png?raw=true "Optional Title") * Now you should have enough data to play around with. Also, you can persist your own data. ## Extra Points Additional endpoints exposed to get elastic details and clearing indices. * http://localhost:8888/elastic-cluster/clear-indices * http://localhost:8888/elastic-cluster/info ### WIP * More APIs to be added * Test containers
1
gmvdm/mahoutinaction
Samples from Mahout in Action book, ported to Clojure.
null
# mahoutinaction Examples from the [Mahout in Action](http://www.manning.com/owen/) book, ported to Clojure ## Setup 1. Build and install [Mahout](https://cwiki.apache.org/MAHOUT/buildingmahout.html) 2. Load the dependencies ``` lein deps ``` ## Usage ``` lein run ``` ## License Copyright (C) 2011 Geoff Wilson Distributed under the Eclipse Public License, the same as Clojure. Code under src/java is copied from Mahout and subject to the Apache License. See NOTICE.txt and APACHE_LICENSE.txt for details.
0