Category: Blog

  • viper-mate

    Viper configuration provider for Logrus Mate

    This tiny project is a way to configure Logrus Mate using Viper
    as the configuration source. It is meant to be used with the currently
    unreleased version of Logrus Mate (v1.0.0 doesn’t have the configuration
    providers, only master branch does).

    As Viper is very different to other configuration options, there is
    no way to mix it with e.g. HOCON. Basically, the assumption is that
    your project uses Viper and you don’t want any other configuration
    system just for logging. If so, this library may come handy.

    Here’s a code snippet with usage example:

    loggingConfig := viper.Sub("logging")
    if loggingConfig != nil {
    	mate, err := vipermate.NewMate(loggingConfig)
    	if err != nil {
    		logrus.WithError(err).Panic("Failed to process configuration")
    	}
    	if err = mate.Hijack(logrus.StandardLogger(), "main"); err != nil {
    		logrus.WithError(err).Panic("Failed to configure main logger")
    	}
    }
    

    Then, an example config (I use YAML, YMMV) could look like, e.g.:

    logging:
      main:
        out:
          name: stdout
          options: {}
        level: debug
        formatter:
          name: text
          options:
            force-colors: true
            timestamp-format: "2006-01-02T15:04:05Z07:00"
            disable-timestamp: false
            full-timestamp: true
        hooks:
          # Let's say we want to set up an ELK hook
          logstash:
            protocol: tcp
            address: "elk.example.org:5959"
            name: "myapp"
    

    Check out the source code for more details and information
    about the limitations. In particular, non-string slice functions
    are not implemented because Viper doesn’t have anything like that.

    Visit original content creator repository
    https://github.com/drdaeman/viper-mate

  • c_learning

    Table of Contents generated with DocToc

    C_learning 学习C语言

    注意 ⚠️中文注释乱码时,设置 vscode:files.autoGuessEncoding 项的值改为 true 即可,数据结构中推荐编码格式为 GBK

    经典语句

    1. 在中国,没有纯C程序员,如果他不会C++,不是他对C有多么执着,可能是不会C++。嵌入式开发可能是个例外,可能还有其它只能用C不能用C++的场景。
    2. 我对前辈们的智慧怀敬畏之心,智慧的光芒流传千古,不学习是我们的损失。如果你以后成为了大佬,希望不要骄傲,只是因为站在巨人的肩膀上

    第一章 c 语言学习

    note: 推荐指定C++版本编译 -std=c++11

    编译器

    参考

    Visit original content creator repository https://github.com/Danny5487401/c_learning
  • Deep_Learning_with_Maths

    Short note on deep learning introduction.

    • When we try to solve a problem using a network of Perceptrons, then we are using deep learning approach.
    • In Neural networks(NN), we have two parts. Forward Propagation and Backward Propagation.

    Forward Propagation

    • We have a network of input layer, hidden layers and output layer.
    • Number of Perceptrons in input and output is equal to number of inputs and no of outputs respectively.
    • We can add bias to input and to hidden layers also.
    • We propagate our data in forward pass and assign some initital values for weights and bias which are learned in backward pass.
    • Weighted sum of inputs (xw+b) is passed to each perceptron and activation function is applied to generate output.
    • While passing data from input to hidden layer, each perceptron receive multiple permutation and combination of inputs, so that it can learn complex data also.
    • Once data is propagated and output is generated, error = target – predicted is calculated.
    • Weights are updated in backward propagation to reduce this error using optimizers.
    • Optimizer is an algorithm which uses derivatives of cost function and activation function to update weights and minimize error
    • one pass of forward and backward propagation is known as one epoch.

    Backward Propagation

    • Error is there because we have given some weights and biases but these values are not correct as per our dataset. So, network will try to change each weight and bias.
    • Chain rule Concept used in backpropagation: Error is differentiable with respect to output of Perceptron. Output of any Perceptron is based on it’s input(wx+b). Input is differentiable w.r.t to weight.
    • For output layer, cost function and activation function is directly differentiable because target is known.
    • For weight updation in Hidden layers, again multiple chain rule is applied which takes input from the previous layer and updated weights from the next layer.
    • Suppose I am trying to update weight in mth layer. Then it’s differential calculation will depend on input from m-1th layer and output from m+1th layer.
    • Once we update all the learning parameters, data is agin forward propagated, error is calculaetd and weights are updated.
    • This process continues, untill learning stops means weights are not updating and remain same or error is not reducing further.

    Importance of Bias

    • Bias is a learning parameter which is applied per Perceptron genrerally but we can also take one bias per layer.
    • Purpose of bias is to provide more flexibility to network to learn.
    • Bias is used to shift activation function in space similar to intercept is used to shift line across Y-axis in Linear regression.

    Importance of Activation Function

    • It normalize the data in forward pass. Sigmoid and Tanh functions limit the data between certain ranges and so normalize the data.
    • Differentiation of activation function is used in backpropagation to update weights. That is why Activation function should be differentiable is a requirement.
    • If we do not add activation function then It will be a linear operation(wx+b). It is activation function which help the netwrok to learn complex patterns.

    Why Vanishing Gradient Problem occur?

    • Whenever we differentiate a function, we are basically reducing the degree of function by 1 and at last it become zero. So, In chain rule we keep on differentating the activation function and multiply it with other values.
    • Second in Sigmoid and Tanh activation functions, derivative of sigmoid and Tanh is already very small. For sigmoid maximum derivate value is 0.25.
    • Third, Sigmoid function always gives an output between [0,1] and Tanh between [-1,1]. so, doesn’t matter how much big error you are passing, it will give small value and when we keep on doing this, after some layers values become so small that change in weights are significantly small and learning stops.
    • Now , as we know, weight change in one hidden layer depends upon the weights in previous layers. If weight change in previous layer is small, then it will get smaller in current layer and because of that we get either negative values of gradient or training become very slow or sometimes it stops and show error.
    Summary of vanishing gradient:

    • Gradient based learning activation functions, squash large inputs into small range. so even large inputs will produce small change in output. When we stack multiple layers, then first layer will map input to small region, second layer will map output of first layer to further small region and keeps going on. As a result, even a large change in parameters of first layer will not produce much effect on output.

    Convolution from scratch:

    This file explain code for convolution operation from scrach and how internally all the steps apply on images using kernels and show the effect of some popular kernel also.

    Why We are using CNN. why we can’t just feed our image to ANN?

    CNN uses the 3D property of image and use channels as depth and most important, it learns the spatial relationship between pixels of image, so when we are flattening the features and feeding to ANN, ANN learns those patterns that was extracted by CNN. It is more efficient. If we just flatten or image and feed to ANN, then We are just feeding pixels values, without telling the model how image pixels are related to each other and learnable parameters will also be too high.

    1×1 convolution:

    1×1 convolution serves three purpose:

    1. it can extract pixel level details from image and after that we can apply bigger kernels to extract more finer features from these features extracted from 1×1.
    2. It’s major application lies in decreasing the number of feature maps or channel wise pooling. If number of channels keeps on increasing in deep neural networks such as
      Inception and Resnet, then number of parameters keeps on increasing. This is not only computationaly expensive but can degrade or overfit the model also. So, to reduce the number of channels in networks and therefore parameters, we can use 1×1 kernel.
      Let’s say my image size is 11211264. If I apply 33128 kernels, so total parameters are (33128=1152) and no of operations performed are (1121126433128=92,48,44,032). On the other hand, if i use kernel of 11*128, no of parameters are (128) and operations are (10,27,60,448). It means 82 millions more operations performed in case of 3×3 kernels.
    3. 1×1 convolution can be used to increase number of channels also depending on requirement. E.g. in inception model we are convoluting multiple kernels over the image at same time and then performing depth wise concatnation. Now output from different features map will be at different scales and before adding, we have to bring depth of different kernel operations at same level. In that case, we can use 1×1 kernels to increase the depth or decrease before modifying the pixel correlation much.
    4. 1×1 convolution is just a linear operation to project input to output without loosing much information from input. Moreover, non linearity is also added because of activation function after 1×1 kernel which aids in model learning.

    Link for good understanding of R-CNN

    R-CNN

    R-CNN_technical_summary

    Good site to learn algorithms in depth

    https://www.youtube.com/watch?v=x_TGsU9_vcc

    BBOX Regression: https://www.youtube.com/watch?v=LZRfHkTNQqo

    Resnet Model: https://www.youtube.com/watch?v=Uuc1wdqMFtQ

    Link for good understanding of Faster- RCNN

    Cogneethi Faster RCNN series: https://www.youtube.com/playlist?list=PL1GQaVhO4f_jLxOokW7CS5kY_J1t1T17S
    Faster RCNN

    tryolabs.com

    medium.com/alegion/deep-learning-for-object-detection-and-localization-using-fast-r-cnn-85d52e3928a1

    towardsdatascience.com/faster-r-cnn-for-object-detection-a-technical-summary-474c5b857b46

    Visit original content creator repository
    https://github.com/vernikagupta/Deep_Learning_with_Maths

  • WhiteStopWatch

    WhiteStopWatch

    ニューモフィズムデザインのストップウォッチです。

    ブラウザで使う

    こちらからブラウザで使えます。

    https://bibinba.github.io/WhiteStopWatch_WebGL/

    ダウンロード

    Releaseからダウンロードできます。

    • Mac.app
    • Windows用アプリ
    • Android用アプリ(APK)

    ThirdParty

    • Robotフォント(Apache license version 2.0.)

    • Icons(Apache license version 2.0.)

    • ボタン効果音/MixedRealityToolkit-Unity(MIT License)

      Copyright (c) Microsoft Corporation.

      MIT License

      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

      The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

      THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    • Restartアイコン(MIT License)

      MIT License

      Copyright (c) 2020 Paweł Kuna

      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

      The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

      THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    License

    MIT License(ThirdParthはのぞく)

    Visit original content creator repository https://github.com/bibinba/WhiteStopWatch
  • mathlib-cpp

    Mathlib-cpp

    About

    This is a C++ library that I wrote. It provides a number of useful utilities, including:

    • Mathematical functions (e.g., addition, subtraction, multiplication, division)
    • Determining if a number is odd, prime, and more.
    • Solving quadratic equations (ax^2 + bx + c = 0) and linear equations (ax + by = c).
    • Measuring volume, area, length, angles, and more for various shapes using only their vertex points.
    • Providing access to 20+ essential mathematical constants.

    Installation

    To install this library, you can either download the source code and build it yourself, or you can use a pre-built package.

    To build the library from source, you will need to have CMake installed. Once you haveCMake installed, you can clone the library repository and run the following command:

    Usage

    To use the library, you will need to include the library header file in your source code:

    #include "mathlib-cpp/index.cpp"

    Then, you can use the library functions like any other function in your code. For example, to calculate the sum of two numbers, you would use the following code:

    int arr[] = {1, 2, 3, 4, 5};
    int sum = mlb::add(arr, 5);
    

    Documentation

    For extensive documentation, visit the MathLib-cpp Documentation.

    Bainary documentation: https://github.com/MarufHasan24/mathlib-cpp/wiki/Bainary-Mathlib‐cpp

    Hexadecimal documentation: https://github.com/MarufHasan24/mathlib-cpp/wiki/Hexadecimal-Mathlib‐cpp

    Octal documentation: https://github.com/MarufHasan24/mathlib-cpp/wiki/Octal-Mathlib‐cpp

    Complex Number : https://github.com/MarufHasan24/mathlib-cpp/wiki/Complex-Number

    Example

    Here is a simple example of how to use the library:

    #include <iostream>
    #include "mathlib-cpp/index.cpp"
    
    int main() {
      // Calculate the sum of some numbers
      int arr[] = {1, 2, 3, 4, 5};
      int sum = mlb::add(arr, 5);
    
      // Print the sum to the console.
      std::cout << "The sum is: " << sum << std::endl;
    
      return 0;
    }

    Key Functions

    Here’s a taste of the functions provided by MathLib-cpp:

    1. int add(int a[], int len);

      • Description: Computes the sum of elements in an integer array.
      • Usage Example: add(arr, length) returns the sum of all elements in the array arr of length length.
    2. int sub(int a[], int len);

      • Description: Calculates the result of subtracting all elements in an integer array from the first element.
      • Usage Example: sub(arr, length) returns the result of subtracting all elements in the array arr from the first element.
    3. int mul(int a[], int len);

      • Description: Multiplies all elements in an integer array together.
      • Usage Example: mul(arr, length) returns the product of all elements in the array arr.
    4. float div(int a[], int len);

      • Description: Computes the result of dividing the first element in an integer array by the product of the rest of the elements.
      • Usage Example: div(arr, length) returns the result of dividing the first element in the array arr by the product of the rest of the elements.
    5. float avg(int a[], int len);

      • Description: Calculates the average of elements in an integer array.
      • Usage Example: avg(arr, length) returns the average value of the elements in the array arr.
    6. float logx(int base, int x);

      • Description: Computes the logarithm of x with the specified base.
      • Usage Example: logx(base, x) returns the logarithm of x with the base base.
    7. float rootx(int base, int x);

      • Description: Calculates the base-th root of x.
      • Usage Example: rootx(base, x) returns the base-th root of x.
    8. int random(int min, int max);

      • Description: Generates a random integer between min and max.
      • Usage Example: random(min, max) returns a random integer within the specified range.
    9. double limit(int tt, int (*fc)(int));

      • Description: Evaluates the limit of a given mathematical function fc as the variable approaches tt.
      • Usage Example: limit(tt, function) calculates the limit of the provided function as it approaches tt.
    10. double fact(int n);

      • Description: Computes the factorial of an integer n.
      • Usage Example: fact(n) returns the factorial of n.
    11. float* linearEq(float x[], float y[]);

      • Description: Solves a system of linear equations with one variable using the provided arrays of x and y values.
      • Usage Example: linearEq(x, y) returns an array containing the solution to the linear equation system.
      • Note: If the system has no solution, the function returns NULL. It will return the pointer to the result array.
    12. float* quadEq(float a, float b, float c);

      • Description: Solves a quadratic equation with coefficients a, b, and c.
      • Usage Example: quadEq(a, b, c) returns an array containing the roots of the quadratic equation.
      • Note: If the equation has no real roots, the function returns NULL. It will return the pointer to the result array.
    13. bool isPrime(int n);

      • Description: Checks if an integer n is a prime number.
      • Usage Example: isPrime(n) returns true if n is prime; otherwise, it returns false.
    14. bool isOdd(int n);

      • Description: Determines if an integer n is an odd number.
      • Usage Example: isOdd(n) returns true if n is odd; otherwise, it returns false.
    15. int sums(int start, int end, int (*fc)(int));

      • Description: Calculates the sum of function values from start to end using the provided function fc.
      • Usage Example: sums(start, end, function) returns the sum of function values within the specified range.
    16. double combo(int n, int r);

      • Description: Computes the number of combinations (n choose r) for given values of n and r.
      • Usage Example: combo(n, r) returns the number of combinations of n items taken r at a time.
    17. double permt(int n, int r);

      • Description: Calculates the number of permutations for given values of n and r.
      • Usage Example: permt(n, r) returns the number of permutations of n items taken r at a time.
    18. int gcd(int a, int b);

      • Description: Finds the greatest common divisor (GCD) of two integers a and b.
      • Usage Example: gcd(a, b) returns the GCD of a and b.
    19. int lcm(int a, int b);

      • Description: Calculates the least common multiple (LCM) of two integers a and b.
      • Usage Example: lcm(a, b) returns the LCM of a and b.
    20. int* primes(int start, int end);

      • Description: Generates an array of prime numbers within the specified range [start, end].
      • Usage Example: primes(start, end) returns an array of prime numbers between start and end.
      • Note: It will return the pointer to the result array.

    License

    This library is licensed under the MIT License. You can find the full license text in the LICENSE file.

    Support

    If you have questions, bug reports, feature requests, or need general assistance, don’t hesitate to reach out at gamerid703@gmail.com, or create an issue on the GitHub repository.

    Visit original content creator repository
    https://github.com/MarufHasan24/mathlib-cpp

  • mathlib-cpp

    Mathlib-cpp

    About

    This is a C++ library that I wrote. It provides a number of useful utilities, including:

    • Mathematical functions (e.g., addition, subtraction, multiplication, division)
    • Determining if a number is odd, prime, and more.
    • Solving quadratic equations (ax^2 + bx + c = 0) and linear equations (ax + by = c).
    • Measuring volume, area, length, angles, and more for various shapes using only their vertex points.
    • Providing access to 20+ essential mathematical constants.

    Installation

    To install this library, you can either download the source code and build it yourself, or you can use a pre-built package.

    To build the library from source, you will need to have CMake installed. Once you haveCMake installed, you can clone the library repository and run the following command:

    Usage

    To use the library, you will need to include the library header file in your source code:

    #include "mathlib-cpp/index.cpp"

    Then, you can use the library functions like any other function in your code. For example, to calculate the sum of two numbers, you would use the following code:

    int arr[] = {1, 2, 3, 4, 5};
    int sum = mlb::add(arr, 5);
    

    Documentation

    For extensive documentation, visit the MathLib-cpp Documentation.

    Bainary documentation: https://github.com/MarufHasan24/mathlib-cpp/wiki/Bainary-Mathlib‐cpp

    Hexadecimal documentation: https://github.com/MarufHasan24/mathlib-cpp/wiki/Hexadecimal-Mathlib‐cpp

    Octal documentation: https://github.com/MarufHasan24/mathlib-cpp/wiki/Octal-Mathlib‐cpp

    Complex Number : https://github.com/MarufHasan24/mathlib-cpp/wiki/Complex-Number

    Example

    Here is a simple example of how to use the library:

    #include <iostream>
    #include "mathlib-cpp/index.cpp"
    
    int main() {
      // Calculate the sum of some numbers
      int arr[] = {1, 2, 3, 4, 5};
      int sum = mlb::add(arr, 5);
    
      // Print the sum to the console.
      std::cout << "The sum is: " << sum << std::endl;
    
      return 0;
    }

    Key Functions

    Here’s a taste of the functions provided by MathLib-cpp:

    1. int add(int a[], int len);

      • Description: Computes the sum of elements in an integer array.
      • Usage Example: add(arr, length) returns the sum of all elements in the array arr of length length.
    2. int sub(int a[], int len);

      • Description: Calculates the result of subtracting all elements in an integer array from the first element.
      • Usage Example: sub(arr, length) returns the result of subtracting all elements in the array arr from the first element.
    3. int mul(int a[], int len);

      • Description: Multiplies all elements in an integer array together.
      • Usage Example: mul(arr, length) returns the product of all elements in the array arr.
    4. float div(int a[], int len);

      • Description: Computes the result of dividing the first element in an integer array by the product of the rest of the elements.
      • Usage Example: div(arr, length) returns the result of dividing the first element in the array arr by the product of the rest of the elements.
    5. float avg(int a[], int len);

      • Description: Calculates the average of elements in an integer array.
      • Usage Example: avg(arr, length) returns the average value of the elements in the array arr.
    6. float logx(int base, int x);

      • Description: Computes the logarithm of x with the specified base.
      • Usage Example: logx(base, x) returns the logarithm of x with the base base.
    7. float rootx(int base, int x);

      • Description: Calculates the base-th root of x.
      • Usage Example: rootx(base, x) returns the base-th root of x.
    8. int random(int min, int max);

      • Description: Generates a random integer between min and max.
      • Usage Example: random(min, max) returns a random integer within the specified range.
    9. double limit(int tt, int (*fc)(int));

      • Description: Evaluates the limit of a given mathematical function fc as the variable approaches tt.
      • Usage Example: limit(tt, function) calculates the limit of the provided function as it approaches tt.
    10. double fact(int n);

      • Description: Computes the factorial of an integer n.
      • Usage Example: fact(n) returns the factorial of n.
    11. float* linearEq(float x[], float y[]);

      • Description: Solves a system of linear equations with one variable using the provided arrays of x and y values.
      • Usage Example: linearEq(x, y) returns an array containing the solution to the linear equation system.
      • Note: If the system has no solution, the function returns NULL. It will return the pointer to the result array.
    12. float* quadEq(float a, float b, float c);

      • Description: Solves a quadratic equation with coefficients a, b, and c.
      • Usage Example: quadEq(a, b, c) returns an array containing the roots of the quadratic equation.
      • Note: If the equation has no real roots, the function returns NULL. It will return the pointer to the result array.
    13. bool isPrime(int n);

      • Description: Checks if an integer n is a prime number.
      • Usage Example: isPrime(n) returns true if n is prime; otherwise, it returns false.
    14. bool isOdd(int n);

      • Description: Determines if an integer n is an odd number.
      • Usage Example: isOdd(n) returns true if n is odd; otherwise, it returns false.
    15. int sums(int start, int end, int (*fc)(int));

      • Description: Calculates the sum of function values from start to end using the provided function fc.
      • Usage Example: sums(start, end, function) returns the sum of function values within the specified range.
    16. double combo(int n, int r);

      • Description: Computes the number of combinations (n choose r) for given values of n and r.
      • Usage Example: combo(n, r) returns the number of combinations of n items taken r at a time.
    17. double permt(int n, int r);

      • Description: Calculates the number of permutations for given values of n and r.
      • Usage Example: permt(n, r) returns the number of permutations of n items taken r at a time.
    18. int gcd(int a, int b);

      • Description: Finds the greatest common divisor (GCD) of two integers a and b.
      • Usage Example: gcd(a, b) returns the GCD of a and b.
    19. int lcm(int a, int b);

      • Description: Calculates the least common multiple (LCM) of two integers a and b.
      • Usage Example: lcm(a, b) returns the LCM of a and b.
    20. int* primes(int start, int end);

      • Description: Generates an array of prime numbers within the specified range [start, end].
      • Usage Example: primes(start, end) returns an array of prime numbers between start and end.
      • Note: It will return the pointer to the result array.

    License

    This library is licensed under the MIT License. You can find the full license text in the LICENSE file.

    Support

    If you have questions, bug reports, feature requests, or need general assistance, don’t hesitate to reach out at gamerid703@gmail.com, or create an issue on the GitHub repository.

    Visit original content creator repository
    https://github.com/MarufHasan24/mathlib-cpp

  • ent-framework

    The TypeScript library for working with microsharded PostgreSQL databases.

    Core Features

    1. Graph-like representation of entities. With Ent Framework, you represent each Ent (a domain object of your business logic) as a TypeScript class with immutable properties. An Ent class instance maps to one row of some table in a relational database (like PostgreSQL). It may look similar to ORM, but has many aspects that traditional ORMs don’t have.
    2. Row-level security in a graph (privacy layer). You manage data as a graph where each node is an Ent instance, and each edge is a field link (think of foreign keys) to other Ents. To be allowed to read (or update/delete) some Ent, you define a set of explicit rules like “user can read EntA if they can read EntB or EntC”. And, consequently, in EntB you define its own set of rules, like “user can read EntB if they can read EntD”.
    3. Query batching and coalescing. Ent Framework holistically solves the “N+1 selects” problem commonly known in ORM world. You still write you code as if you work with individual Ents and individual IDs, and the framework magically takes care of sending batched requests (both read and write) to the underlying relational database. You do not work with lists and JOINs anymore.
    4. Microsharding and replication lag tracking support out of the box. Splitting your database horizontally is like a breeze now: Ent Framework takes care of routing the requests to the proper microshards. When scaling reads, Ent Framework knows whether a replica node is “good enough” for that particular query. It automatically uses the proper replica when possible, falling back to master when not.
    5. Pluggable to your existing relational database. If your project already uses some ORM or runs raw SQL queries, Ent Framework can be plugged in.
    6. Tens of other features. Some examples: cross-microshards foreign keys, composite fields, triggers, build-in caching etc.

    Installation

    npm add ent-framework
    pnpm add ent-framework
    yarn add ent-framework
    
    Visit original content creator repository https://github.com/dimikot/ent-framework
  • ent-framework

    The TypeScript library for working with microsharded PostgreSQL databases.

    Core Features

    1. Graph-like representation of entities. With Ent Framework, you represent each Ent (a domain object of your business logic) as a TypeScript class with immutable properties. An Ent class instance maps to one row of some table in a relational database (like PostgreSQL). It may look similar to ORM, but has many aspects that traditional ORMs don’t have.
    2. Row-level security in a graph (privacy layer). You manage data as a graph where each node is an Ent instance, and each edge is a field link (think of foreign keys) to other Ents. To be allowed to read (or update/delete) some Ent, you define a set of explicit rules like “user can read EntA if they can read EntB or EntC”. And, consequently, in EntB you define its own set of rules, like “user can read EntB if they can read EntD”.
    3. Query batching and coalescing. Ent Framework holistically solves the “N+1 selects” problem commonly known in ORM world. You still write you code as if you work with individual Ents and individual IDs, and the framework magically takes care of sending batched requests (both read and write) to the underlying relational database. You do not work with lists and JOINs anymore.
    4. Microsharding and replication lag tracking support out of the box. Splitting your database horizontally is like a breeze now: Ent Framework takes care of routing the requests to the proper microshards. When scaling reads, Ent Framework knows whether a replica node is “good enough” for that particular query. It automatically uses the proper replica when possible, falling back to master when not.
    5. Pluggable to your existing relational database. If your project already uses some ORM or runs raw SQL queries, Ent Framework can be plugged in.
    6. Tens of other features. Some examples: cross-microshards foreign keys, composite fields, triggers, build-in caching etc.

    Installation

    npm add ent-framework
    pnpm add ent-framework
    yarn add ent-framework
    
    Visit original content creator repository https://github.com/dimikot/ent-framework
  • stringgen

    image image All Contributors image

    Scattering based cosmic string emulation

    stringgen is a tool for creating emulations of cosmic string maps with statistics similar to those of a single (or small ensemble) of reference simulations. It uses wavelet phase harmonics to calculate a compressed representation of these reference simulations, which may then be used to synthesize new realisations with accurate statistical properties, e.g. 2 and 3 point correlations, skewness, kurtosis, and Minkowski functionals.

    Install from source 💻

    One may install the code from source by cloning and installing manually:

    git clone https://github.com/astro-informatics/stringgen.git
    cd stringgen
    bash build_stringgen.sh
    

    Usage 🚀

    To generate your own cosmic string maps stringgen is as simple follows:

    from stringgen import CosmicStringEmulator
    
    # Configure the emulator
    emulator = CosmicStringEmulator(
            emulation_shape=(1024, 1024),   # Shape of image
            J=9,                        # Number of wavelet scales
            L=9                         # Number of directions
        )
    
    # Load latent data-bank
    features = emulator.get_features()
    
    # Generate n_emulation=1 synthetic cosmic string maps
    emulation = emulator.emulate(features, n_emulations=1)

    Contributors ✨

    Thanks goes to these wonderful people (emoji key):

    Matt Price
    Matt Price

    💻 👀 🤔
    Matthijs Mars
    Matthijs Mars

    💻 👀 🤔
    Auggie Marignier
    Auggie Marignier

    💻
    Alessio Spurio Mancini
    Alessio Spurio Mancini

    💻
    Jason McEwen
    Jason McEwen

    💻 👀 🤔
    Matthew Docherty
    Matthew Docherty

    💻

    Attribution 📚

    Should this code be used in any way, we kindly request that the following article is referenced. A BibTeX entry for this reference may look like:

    @article{price:stringgen, 
       author      = "Matthew A. Price, Matthijs Mars, Matthew M. Docherty, Alessio Spurio Mancini, Augustin Marignier, Jason. D. McEwen",
       title       = "Fast emulation of anisotropies induced in the cosmic microwave background by cosmic strings",
       year        = "2023",
       journal     = "The Open Journal of Astrophysics,
       doi         = "10.21105/astro.2307.04798",
       eprint      = "arXiv:2307.04798"        
    }
    

    License 📝

    We provide this code under an MIT open-source licence with the hope that it will be of use to a wider community.

    Copyright 2023 Matthijs Mars, Matthew Price, Jason McEwen and contributors.

    stringgen is free software made available under the MIT License. For details see the LICENSE file.

    Visit original content creator repository https://github.com/astro-informatics/stringgen
  • stringgen

    image image All Contributors image

    Scattering based cosmic string emulation

    stringgen is a tool for creating emulations of cosmic string maps with statistics similar to those of a single (or small ensemble) of reference simulations. It uses wavelet phase harmonics to calculate a compressed representation of these reference simulations, which may then be used to synthesize new realisations with accurate statistical properties, e.g. 2 and 3 point correlations, skewness, kurtosis, and Minkowski functionals.

    Install from source 💻

    One may install the code from source by cloning and installing manually:

    git clone https://github.com/astro-informatics/stringgen.git
    cd stringgen
    bash build_stringgen.sh
    

    Usage 🚀

    To generate your own cosmic string maps stringgen is as simple follows:

    from stringgen import CosmicStringEmulator
    
    # Configure the emulator
    emulator = CosmicStringEmulator(
            emulation_shape=(1024, 1024),   # Shape of image
            J=9,                        # Number of wavelet scales
            L=9                         # Number of directions
        )
    
    # Load latent data-bank
    features = emulator.get_features()
    
    # Generate n_emulation=1 synthetic cosmic string maps
    emulation = emulator.emulate(features, n_emulations=1)

    Contributors ✨

    Thanks goes to these wonderful people (emoji key):

    Matt Price
    Matt Price

    💻 👀 🤔
    Matthijs Mars
    Matthijs Mars

    💻 👀 🤔
    Auggie Marignier
    Auggie Marignier

    💻
    Alessio Spurio Mancini
    Alessio Spurio Mancini

    💻
    Jason McEwen
    Jason McEwen

    💻 👀 🤔
    Matthew Docherty
    Matthew Docherty

    💻

    Attribution 📚

    Should this code be used in any way, we kindly request that the following article is referenced. A BibTeX entry for this reference may look like:

    @article{price:stringgen, 
       author      = "Matthew A. Price, Matthijs Mars, Matthew M. Docherty, Alessio Spurio Mancini, Augustin Marignier, Jason. D. McEwen",
       title       = "Fast emulation of anisotropies induced in the cosmic microwave background by cosmic strings",
       year        = "2023",
       journal     = "The Open Journal of Astrophysics,
       doi         = "10.21105/astro.2307.04798",
       eprint      = "arXiv:2307.04798"        
    }
    

    License 📝

    We provide this code under an MIT open-source licence with the hope that it will be of use to a wider community.

    Copyright 2023 Matthijs Mars, Matthew Price, Jason McEwen and contributors.

    stringgen is free software made available under the MIT License. For details see the LICENSE file.

    Visit original content creator repository https://github.com/astro-informatics/stringgen