Linear Algebra libraries for Rust

I tried to implement LWE with Rust. Here is the memo about linear algebra libraries. Which library to use As of Nov.2021, there was no “defacto standard” linear algebra library in Rust. I investigated, and decided to use ndarray or nlagebra. ndarray vs nalgebra - Reddit ndarray tensorflow/Rust uses ndarray. ndarray is mentioned in Rust cookbook: ndarray use BLAS impelementation on the runtime (Intel MKL, OpenBLAS, etc.), so it could be faster than other libraries.

Serde - tutorial

Serde (serializing and deserializing) is one of the most frequently used library in Rust. The library is production ready, usually used with Serde JSON (because of the popularity of REST APIs). Serialization From Wikipedia, In computing, serialization is the process of translating a data structure or object state into a format that can be stored (for example, in a file or memory data buffer) or transmitted (for example, over a computer network) and reconstructed later (possibly in a different computer environment)

Avoid String Parameter in Strongly-Typed Languages

Why? String type has generally lots of choices for the values, so it prones to bugs. If your programing language supports strong-typing, you need to consider avoiding Strings as parameters of functions. Strong-typing led you Less bugs and validations. In Rust, it’s called a “newtype pattern”. The trinity, “Good naming (based on DDD) + good typing (struct) + enum”, helps us always. Newtype patterns in Rust https://doc.

Trusted Certificates List - ca-certificate

I always googled the exact way to install certificates on Ubuntu local machine, so I left a note for my reference. Ubuntu cert store Add the self-sign certificate to the trusted CA list under /usr/share/ca-certificates. The extension should be .crt. Add a line about the certificate in the configuration file /etc/ca-certificates.conf. Run sudo update-ca-certificates.

Import Free-Tier EC2 instance configuration in CloudFront

Step 1. Create the CloudFormation YAML file AWSTemplateFormatVersion: '2010-09-09' Description: My Free Tier Parameters: KeyPair: Description: Select KeyPair Name. Type: AWS::EC2::KeyPair::KeyName Resources: DefaultVPC: Type: 'AWS::EC2::VPC' DeletionPolicy: Retain Properties: CidrBlock: '' Tags: - Key: 'Name' Value: 'atlex00-default-VPC' DefaultSubnet: Type: 'AWS::EC2::Subnet' DeletionPolicy: Retain Properties: CidrBlock: '' Tags: - Key: 'Name' Value: 'atlex00-default-subnet' VpcId: !Ref DefaultVPC FreeEC2Instance: Type: 'AWS::EC2::Instance' DeletionPolicy: Delete Properties: ImageId: "ami-05d34d340fb1d89e5" InstanceType: t2.micro SubnetId: !Ref DefaultSubnet BlockDeviceMappings: - DeviceName: '/dev/xvda' Ebs: VolumeType: 'gp2' VolumeSize: 8 Tags: - Key: 'Name' Value: 'free-tier' SecurityGroupIds: - !

CloudFormation - Tutorial with an EC2 instance

Important terminology Stack A stack is a collection of AWS resources that you can manage as a single unit. In other words, you can create, update, or delete a collection of resources by creating, updating, or deleting stacks. Resource Unbreakable components, like an EC2 instances, a routing table, VPC, Lambda function, etc. The form of template file The official document was quite comprehensive for me. Parameters: myparam: Type: String Default: foo .

Terraform - Tutorial

I need to review Terraform sometimes, so I left a tutorial+terminology so that I can recall it quickly. Install On Ubuntu 21: sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl curl -fsSL | sudo apt-key add - sudo apt-add-repository "deb [arch=amd64] $(lsb_release -cs)main" sudo apt-get update && sudo apt-get install terraform Check: ➜ terraform --version Terraform v1.1.2 on linux_amd64 Configure tab completion. terraform -install-autocomplete Quickstart: deploy Docker container on my local machine Create a project (directory) and files Just follow below without thinking the lines at first (I left a brief explanation later):

(Draft) Functional Programming

Best entry video Functional Programming in 40 Minutes • Russ Olsen • GOTO 2018 You can find the slide here. Mindset We don’t need to put our knowledge aside when learning functional programming. It’s more of a refactoring. Functions in mathmatics It’s just maps from set to set. Functions donn’t compute somthing in math. It just is. A thing. Once the function was defined, the input-output correspondence never changes by other factors, which means, there is no side effects.

DynamoDB - quick review of concept and tutorial (hands-on with Python)

Concept TL;DR: DB consists of tables, and items in table have sort of “kay-value”. The main contents (attributes, ~values of key-value) is json. Table In table, we put items. Each items has “attributes”. Every items must have a “partition key (or primary key)” attribute. Each items could have “sort key” attribute. “We can think of the parition as a folder/bucket which contains items. And the sort key orders the items within the folder/bucket.

Try Starship (prompt)

Follow the official document. Install Pre-requirement: nerd font Download ttf files and place under ~/.fonts, and reboot. Check my fonts: $ fc-list ... /home/atlex00/.fonts/JetBrains Mono Medium Nerd Font Complete Windows Compatible.ttf: JetBrainsMono NF:style=Medium,Regular ... If you want to install the fonts system-wide, place them under /usr/local/share/fonts. Install Startship prompt Here is the full log: $ sh -c "$(curl -fsSL" Configuration > Bin directory: /usr/local/bin > Platform: unknown-linux-musl > Arch: x86_64 > Tarball URL: https://github.