Skip to content

Instantly share code, notes, and snippets.

View zheng95z's full-sized avatar

Zheng Zeng zheng95z

  • Jo Inc.
  • Green Dophin
View GitHub Profile
@zheng95z
zheng95z / .clang-format
Last active May 7, 2022 23:58
[.clang-format] #cpp #settings
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignOperands: Align
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
@zheng95z
zheng95z / numpy_random_sampling.py
Last active March 31, 2022 17:49
[Random sampling in numpy] #numpy
"""
Reference:
https://numpy.org/doc/stable/reference/random/generator.html
"""
import numpy as np
# Get Random Generator and set seed for reproducibility
rng = np.random.default_rng(114514)
# Draw samples from a uniform distribution
samples = rng.uniform(low=0.0, high=1.0, size=(16, 16))