blog-sample Code Samples and Tutorials

repository·master·Indexed 43 days ago

https://github.com/jitwxs/blog-sample

A collection of technical implementations and best practices covering Java, Spring Boot, Linux system programming, and Vue.js. Includes detailed guides for Apache ActiveMQ, Hololens development with MRTK, Agrona utilities, SBE (Simple Binary Encoding), gRPC communication patterns, Netty networking, Protobuf serialization, and Java Reflection.

Tokens
6.9K
Snippets
14
Records
32
Agent score
50%

What's inside blog-sample

  1. Explore Netty sample implementations

    master

    The netty-sample directory contains several implementation examples using the Netty framework to demonstrate different networking patterns. These examples cover basic HTTP services, client-server communication, and advanced protocols like WebSocket and ProtoBuf.

    - example1: HTTP 服务端 (HTTP Server)
    - example2: 单服务端、单客户端通信 (Single Server, Single Client Communication)
    - example3: 单服务端、多客户端聊天室 (Single Server, Multi-Client Chatroom)
    - example4: Idle监测 (Idle State Detection)
    - example5: WebSocket (WebSocket Implementation)
    - example6: ProtoBuf (Protocol Buffers Integration)
  2. Explore JWT Spring Boot samples

    master

    The jwt-sample directory contains Spring Boot demonstrations for implementing JSON Web Tokens (JWT). The project is organized into chapters based on complexity and integration levels:

    • jwt-sample-ch01: A basic 'Hello World' implementation of JWT.
    • jwt-sample-ch02: An advanced implementation demonstrating how to integrate JWT with Spring Security.
  3. LTP (Linux Test Project) Learning Series Overview

    master
    The LTP repository contains a series of instructional guides focused on the Linux Test Project (LTP), covering its internal mechanisms and practical development of various test suites. The series progresses from fundamental concepts to specific technical implementations including Shell test sets, system call test sets, and specialized testing for _exit(), IO operations, and IO blocking.
  4. Explore the sample project directory

    master

    The blog-sample repository is a collection of code samples organized by technology stack. You can find specific implementation examples in the following categories:

    Java Samples (java-sample)

    Covers core Java topics such as:

    • Concurrency (concurrent-sample)
    • Dynamic Proxy (dynamic-proxy-sample)
    • gRPC (grpc-sample)
    • Mocking (mock-sample)
    • Performance Optimization (performance-optimized)
    • Protobuf (protobuf-sample)
    • Reflection (reflection-sample)

    Spring Boot Samples (springboot-sample)

    Covers web and enterprise integration topics such as:

    • Payment integration (alipay-sample)
    • AOP (aop-sample)
    • Dynamic Scheduling (dynamic-schedule-sample)
    • Elasticsearch (es-sample)
    • Internationalization (i18n-sample)
    • Containerization with Google Jib (jib-sample)
    • JWT (jwt-sample)
    • MyBatisPlus (mp-sample, mp3-sample)
    • OAuth2.0 (oauth-sample)
    • Security (springboot-security, shiro-sample)
    • WebSocket (ws-sample)

    Linux Samples

    Covers system-level programming:

    • Inter-process communication (process_comm)
    • IO models (io_mode)
    • Socket programming (socket)

    Vue Samples

    Covers frontend integration, specifically using Axios with Vue (vue_axios, vue3_axios).

    Other Samples

    Includes specialized topics like Hololens, LTP, and ActiveMQ.

  5. Explore SpringBoot Security integration modules

    master

    This repository contains several modules demonstrating different levels of Spring Security integration with SpringBoot. You can choose a module based on your specific requirement:

    Basic Integration & Authentication

    • springboot_security01: Getting started/entry-level program.
    • springboot_security02: Implementing automatic login.
    • springboot_security03_filter: Exception handling and custom form login using Filters for verification.
    • springboot_security03: Exception handling and custom form login using Spring Security native verification.
    • springboot_security08: Implementing SMS verification code login.

    Authorization & Management

    • springboot_security05: Implementing permission control.
    • springboot_security06: Login management.
    • springboot_security06_share: Login management with Session Sharing support.
    • springboot_security10: Implementing role inheritance.

    Complete Project Examples

    • springboot_security: A legacy complete example containing features from modules 01 to 06 (excluding 05).
    • springboot_security_demo01: The modern refactored complete example. It includes all features from modules 01 to 06 and serves as the base for all subsequent feature additions.
    • springboot_security_demo02: A complete example based on demo01 that adds SMS verification code login functionality.
  6. Access Hololens development sample source code

    master

    The Hololens development sample source code is provided as compressed archives (.rar) and Unity packages. Due to large file sizes, they are hosted on Baidu Netdisk.

    Download Details:

    • Link: https://pan.baidu.com/s/1LLpTEvtsFFORtoXUYE6LtA
    • Extraction Code: mp0i

    Available Samples:

    FilenameDescription
    AnchorDemo.rarWorld Anchor implementation
    GazeDemo.rarGaze implementation
    GestureDemo.rarGesture implementation
    MRTKDemo.rarMixed Reality Toolkit (MRTK) implementation
    SpatialSoundDemo.rarSpatial Sound implementation
    VoiceDemo.rarVoice implementation
    DirectionalIndicator.unitypackageDirectional indicator used in Gaze and Gesture demos
    sun_audio.mp3Audio resource for Spatial Sound demo
  7. Use Java Reflection to invoke Methods

    master

    Java Reflection allows you to dynamically invoke methods on objects or classes. The following capabilities are demonstrated in the sample code:

    • Invoke public member methods: Call standard public instance methods.
    • Invoke public static methods: Call public methods belonging to the class.
    • Invoke private member methods: Access and execute methods with private visibility.
    • Invoke private static methods: Access and execute private static methods.
    • Get method modifiers: Inspect method properties and access levels.
    // Reference test cases for Method operations:
    com.github.jitwxs.sample.reflection.MethodReflectionTest.testPublicMethod
    com.github.jitwxs.sample.reflection.MethodReflectionTest.testPublicStaticMethod
    com.github.jitwxs.sample.reflection.MethodReflectionTest.testPrivateMethod
    com.github.jitwxs.sample.reflection.MethodReflectionTest.testPrivateStaticMethod
    com.github.jitwxs.sample.reflection.MethodReflectionTest.testMethodProperty
  8. LTP Development Guide Topics

    master

    The following topics are covered in the LTP instructional series:

    • LTP Introduction & Internal Mechanisms: Fundamental concepts and how LTP works internally.
    • Shell Test Set Development: How to develop test sets using Shell scripts.
    • System Call Test Set Development: Developing tests for Linux system calls.
    • _exit() Test Set Development: Specialized testing for the _exit() function.
    • IO Operation Test Set Development: Testing standard Input/Output operations.
    • IO Blocking Test Set Development: Testing behaviors related to IO blocking.
  9. Build and manage the vue_axios project

    master

    The vue_axios project uses npm scripts to manage the development lifecycle, including dependency installation, local development with hot reloading, and production builds.

    To start development, use npm run dev to serve the application at localhost:8080 with hot reload enabled. For production, use npm run build to generate a minified bundle. You can also generate a bundle analyzer report to inspect the build size and composition using npm run build --report.

    # install dependencies
    npm install
    
    # serve with hot reload at localhost:8080
    npm run dev
    
    # build for production with minification
    npm run build
    
    # build for production and view the bundle analyzer report
    npm run build --report
  10. Explore ActiveMQ integration guides

    master

    This repository provides a series of guides for learning and implementing Apache ActiveMQ. The available resources cover basic usage, integration with the Spring Framework, and integration with Spring Boot.

    Available guides:

    • ActiveMQ Basics: Introduction and fundamental usage (activemq01).
    • Spring Integration: How to integrate ActiveMQ with the Spring Framework (activemq02).
    • SpringBoot Integration: How to integrate ActiveMQ with Spring Boot (activemq03).
  11. Build protobuf classes for gRPC

    master

    To generate the necessary Java classes from your .proto definitions in this project, you can use one of two Maven-based methods:

    1. Using specific protobuf plugins: Execute the protobuf:compile and protobuf:compile-custom goals.
    2. Standard Maven lifecycle: Run a standard mvn install command, which will trigger the required compilation steps.
    # Method 1: Using specific plugin goals
    mvn protobuf:compile protobuf:compile-custom
    
    # Method 2: Using standard Maven install
    mvn install