LogoShubo Zhang
    Logo Inverted Logo
    • Posts
    • AWS
      • dynamodb-acid
      • dynamodb-admin
      • S3-log
    • DB
      • How to Use MySQL count
    • micronaut
      • mn-graalvm
    • Software Design and Engineering
      • Clean Code
        • 01-Meaningful Names
    • Tools
      • mac-itsycal
      • mac-stats
      • mac-world-time
      • owasp-1-sql-injection
      • owasp-2-broken-authentication
      • owasp-3-sensitive-data-exposure
      • owasp-4-XML-External-Entities (XXE)
      • Postgres 12 + pgadmin in Docker
    Hero Image
    Meaningful Names

    Use Intention-Revealing Names The name of a variable, function, or class, should answer all the big questions. It should tell you why it exists what it does how it is used. Bad example: If a name requires a comment, then the name does not reveal its intent. int d; // elapsed time in days The name d reveals nothing. It does not evoke a sense of elapsed time, nor of days.

    January 16, 2021 Read
    Hero Image
    How to Use MySQL count

    How many ways to use count? count(*): returns a count of the number of all rows (including NULL). count(1): 1 evaludates to non-NULL for every row, so it returns the same results as count(*) count(col_name): returns a count of the number of the rows that col_name is not NULL count(col_name) VS count(*)? count(*): returns a count of the number of all rows (including NULL). count(col_name): returns a count of the number of the rows that col_name is not NULL count(*) is recommended even though count(pk) can return the same result.

    December 20, 2020 Read
    Hero Image
    Three ways to log S3 Bucket Activities

    A common requirement is to monitor S3 bucket activities, especially for the purpose of auditing. In this blog, I will introduce three ways to implement this feature. 1. Use S3 properties Enable Server Access Logging for an S3 Bucket. It is one of the S3 bucket properties. You just need to select a target bucket and prefix to complete the setup. The details are available here: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/server-access-logging.html Pros: less infrastructure no code involved easy to search log for a specific bucket.

    December 20, 2020 Read
    • ««
    • «
    • 1
    • 2
    • »
    • »»
    Navigation
    • About Me
    • Skills
    • Experiences
    • Projects
    • Recent Posts
    • Achievements
    Contact me:
    • Email: shubozhang@outlook.com
    • Phone: +0123456789

    Stay up to date with email notification

    We'll never share your email with anyone else.

    Toha Theme Logo Toha
    © 2020 Copyright.
    Powered by Hugo Logo