居屋 2024 注意時項
Remark. Unless specified otherwise our
serverless
framework will be kept at3.38.0
.
kotlin
spring
In the past we have studied how to do limited number of concurrent tasks via buffered channels, an approach inspired from golang. This time we make use of native API of Semaphore to achieve the same goal.
kotlin
spring
We study how to embed value object into JPA entity class definition, and study how to auto-map our value object back to plain DTO object for the frontend
3c
personal
docker
mysql
postgresql
sql
Record a docker-compose.yml to host a postgresql/mysql db locally. Also we clone existing DB by docker-command using postgres image
js
nodejs
react
We use additional thread to execute computational task by built-in workers API
event-driven
jpa
springboot
We study a special case where the repository.delete() can fail silently
event-driven
jpa
springboot
We mention two common patterns in event-driven design for Spring boot that handles side effects due to domain events
vscode
We record a method on how to reorder folders based on our predefined pattern
nestjs
Record the study of standard concepts from nestjs while working in the current company.
terraform
We discuss how to remove a VPC completely when dangling ENIs remain there.
terraform
terragrunt
We study terragrunt via opentofu
git
We discuss programmatic way to git push changes and git commit empty commit for triggering github workflow.
aws
env
secrets-manager
We immitate the expo approach for all of our backend applications, here is how!
react
react-query
zustand
Record a standard setup as a transition from redux to zustand. This article will be kept updated along the way I delve deeper using zustand.
react
tailwind
Record simple css to recover bullet points affected by tailwind package
env
nodejs
serverless
Record method to load multiple env files in serverless framework.
react
Record a simple hook to block route traffic when updates have not been saved yet, and popup an alert to ask for confirmation.
aws
lambda
serverless
Study cases when a lambda function need to invoke itself.
aws
Simple scheduling to our springboot lambda function's endpoint
google-cloud
Google login without redirection of main page by popping up a new window.
terraform
Certain resources are not supposed to be recreated even we recreate our infrastructure via terraform. Let's study how we define and import database and s3 bucket separately.
terraform
Discuss how to make our terraform project as DRY as possible.
aws
lambda
serverless
It is very common to have lamdba function being called by another function. This time we study two kinds of lambda functions to be invoked, one is snapstarted springboot lambda function, another one is an ordinary console lambda function.
react
Creation of modal is always a tedious task. We can create modal easily by ant-design's Modal component. But improper implementation can lead to plenty of highly non-reusable modals as the common mistake is to create that modal at the component we use it, making it tightly coupled with the state at which the modal is defined.
DDD
kotlin
When business grows, a domain object becomes very bulky if all behaviour and the corresponding validation are added to the same entity file. We study code separation by the language feature of Kotlin using function literal with receiver.
web-socket
We discuss a reliable approach to connect websocket api from api-gateway.
react
react-query
redux
We discuss how to bring the power of caching/debouncing, the cahcing and cache-invalidatin, and also the handy booleans like isLoading
of react query into world of react thunk actions.
swagger-ui
We record how to transform all the schemas in swagger ui into typescript interfaces.
gradle
springboot
We record how to define gradle task to run npm script and how to ensure the gradle can recognize our npm binary
jpa
mongo
springboot
Record how to interact with mongodb in a JPA manner.
git
Record a standard step to alter the authentication method (choose which account to authenticate) when we push changes to a repository.
kotlin
springboot
We record a rate-limited concurrent tasks techique borrowed from golang.
sql
Record a simple migration script to remove all duplicated rows before adding a unique index to a column in a table.
springboot
This is a record of machineries in a springboot project for my own convenience.
lambda
serverless
Record a configuration to clean up old versions of lambda functions.
terraform
Record an architecture to manage simple lambda functions that can be created directly in aws console.
terraform
Record the functioning configuration of usual resources.
terraform
Record a creation of a simple worker node using EC2 and K3S via terraform
terraform
After real project experience with AWS cloud, I revisit the knowledge in terraform in order to replicate the cloud infrastructure from UAT to PROD effectively.
aws
lambda
rds
rds-proxy
We study the configuration of IAM roles and permissions to enable lambda functions to connect to RDS-Proxy which is a VPC-bounded resource
aws
Record a simple script to create a presigned-url for file uploading in frontend
api-gateway
aws
web-socket
We study the basic of websocket-api from api-gateway.
springboot
swagger-ui
We study the integration of snapStarted lambda with API-gateway.
mockk
springboot
test
Let's get rid of the deprecated react beautiful dnd.
react
Let's get rid of the deprecated react beautiful dnd.
DDD
jpa
springboot
We record the use of ksp package that auto-generates DTO mapper for annotated entity classes.
react
We record a general purpose dialog whose width can be sm, md, lg, etc to avoid the consideration of width of the dialog content.
jpa
springboot
We record the use of ksp package that auto-generates DTO mapper for annotated entity classes.
aws
cloudfront
domain-transfer
Given that a domain is brought from third-party DNS provider, we study how to route the traffic to our cloudfront distribution.
aws
docker
lambda
Let's discuss how to orchistrate the interaction of lambda functions which are network-isolated, especially how to endow lambda functions with security group.
docker
Suppose we want to test production-like environment by making a production build for mobile, it is helpful to host multiple backends in localhost and expose it via https, multiple ngroks can do the trick for us.
react
Setting eslint is not enough as people can still ignore it and commit their code. We introduce husky which provides a pre-commit hook to prevent unpassed code from being pushed.
springboot
We introduce simple functions for logging.
springboot
Due to the lambda-nature, snapStarted spring boot differs from ordinary spring boot application as it lacks the write permission to the /var/task of the lambda function.
docker
springboot
test
In testing we usually make use of in-memory database to separate the test data with our actual working database. For a long time people use H2 in spring boot for that purpose but that database is not eventually what the production uses, now we can align both!
postman
test
We record useful postman script in manual testing.
aws
lambda
serverless
springboot
Record miscellaneous detail of transitioning into Spring Boot as a node.js developer.
decorators
typescript
In the past we have introduced an applicationEventPublisher, this time we introduce decorators to further simplify the code!
data-structure
We implement a doubly-linked list with generic data type that is useful when trying to group a set of "directional" objects.
aws
docker
lambda
python
We discuss how to create a lambda function that executes in docker container to get around the 250MB size limit.
github-actions
Installing python and executing a python script with argument can be tedious to teammates who are not used to python. The same siutation can apply to all other languages, let's simplify the execution by doing it on github actions.
aws
db-backup
ecs
sql
We study scheduled tasks by doing a regular backup of databases (pgsql + mongo) on a hourly basis.
pdf
There is occasion where we have created a pdf file and want to have an html version which looks exactly the same (e.g., pdf generated by LaTeX)
db-backup
mongo
Let's discuss how to restore a mongodb from backup, how does the back up actually?
github-actions
We can design a button to determine what and when to do something instead of automating the actions for each push / merge request.
jooq
jpa
kotlin
springboot
Working with existing database via jpa amounts to the need to manually model the table by entity classes. We study how to modify the data class generated by JOOQ into a "pre-entity" open class that can be inherited to define domain model.
payment
react-native
revenue-cat
We study the basic steps to enable inapp-purchase.
DDD
express
nodejs
We have talked about monolithic DDD in the context of spring boot with the help of spring-provided ApplicationEventPublisher instance via dependency injection. This is not unique to spring and let's bring it into nodejs in the express framework.
kotlin
springboot
We study how to effectively deliver request to non-blocking coroutine scope and release that thread for other request.
kotlin
springboot
A Stripe event is always delayed, and some system relies on database persistent change by Stripe events. We study how frontend can wait for the event before fetching latest data.
kotlin
Study the syntax for function literals which helps construct DSL-like syntax.
kotlin
stripe
We record how to adjust a stripe subscription in code using kotlin.
gradle
kotlin
build.gradle.kts
is like a Makefile with powerful feature that you can write kotlin code on it, let's study useful customization.
kotlin
lambda
springboot
Run a spring boot in docker image using lambda function
aws
docker
lambda
Traditionally lambda function is as simple as running the function defined in a zipped package. But when dependencies get complicated and when file size inevitably exceeds 250MB limit when being unzipped, we need to consider using docker image as an alternative.
docker
ecs
kotlin
We record a two-stages dockerfile to build a docker image of spring boot application.
DDD
kotlin
springboot
There are two ways for DDD Project in spring boot: DDD using ORM and that with ORM, let's discuss the one without ORM in this article
docker
springboot
Record a two-stage docker file for building springboot application.
kotlin
stripe
When creating a transaction we need to wait for the checkout-session-completed event in order to execute follow-up action in our own system, we relies on metadata to follow the transaction.
axon-framework
kotlin
We record how to require a saga to wait certain amount of time before dispatching cancelling events, even our server restarts.
axon-framework
sql
We record useful query for debugging of domain events with json payload.
kotlin
We study some example of deserialization of json strings using Gson and kotlinx-serialization-json.
kotlin
springboot
The generation of the bean of WebMvcConfigurer suffices to provide a global configuration of CORS via Rest Controller, but that fails to configure non-mvc requests (such as those intercepted by our interceptors). Let's study an alternative.
axon-framework
kotlin
springboot
We record how to use interceptor and custom annotation to record the flow of commands and events.
axon-framework
kotlin
springboot
Study the error handling for Subscription Query.
react
Record a minial working example for react-beautiful-dnd.
git
Sometimes it is much more convenient to save multiple config files in a repository than to git-ignore it. We study the encrpytion of those files using git-crypt.
react
vite
Record a standard procedure to create an react-app via vite.
react-native
It is easy to make input field, but building one in chatroom is a bit different.
aws
k8s
We continue the previous study on k8s, this time the EKS.
k8s
We study the basic objects in the world of k8s.
react
sql
Study a simple query function WIDTH_BUCKET
to obtain a set of time-series data and study nice chart library to generate a bar-chart with multi-columns.
gradle
kotlin
springboot
A JWT authentication should be simple and straight-forward. Let's forget about spring-security and start with the basic idea.
kotlin
springboot
We try to implement a JWT authentication and study how to construct custom token payload for the backend.
gradle
kotlin
springboot
This is a study on gradle to help understand how to manage a project by modules. In java this helps separate the dependencies precisely, i.e., no one can access resource from incorrect layer. This makes creating unit tests much more easily (in case you have written queries directly in controller layer, you know what I mean).
kotlin
springboot
Config a global setting of how the error should return to frontend.
kotlin
springboot
We try to throw an exception inside a transaction to see whether a rollback takes place.
kotlin
springboot
Record a simple setup for event emitter and listener.
jooq
kotlin
springboot
sql
test
Record the setup of a spring boot project with JOOQ.
db-management
postgresql
sql
Record SQL script for managing db user persmissions
vscode
We try to get the full list of type hints in vscode instead of the shortened and incomplete ones.
aws
serverless
We record a github workflow for deploying serverless backends
aws
We record how to download a complete record of cloudwatch logging inside a log-stream.
sql
Record some mistake that can be avoided when designing a database schema.
debezium
kafka
In the past we have studied CDC with the help of confluent here. This time we host everything locally to prepare ourselves to host CDC without the dependency on confluent.
eas
expo
We discuss the technical detail of OTA (Over The Air) update which avoid unnecessary rebuild for updating a mobile application.
aws
We study how to create stack of aws resources and how they can interact with each other.
aws
We record a standard procedure to create a custom layer for 3rd party libraries.
aws
We study the concurrency models in lambda functions to avoid unexpected failure.
docker
Sometimes a library may require user installing gcc, c++, ca-certificates, or some other linux-specific libraries. Let's use docker image to provide us a consistent working environment.
cdc
confluent
kafka
We study how to configure Debezium in Confluent to listen changes of database, which is very helpful in streaming real-time changes to frontend.
go
Study how to share a SINGLE channel to all goroutines and how to close it properly.
data-structure
go
We implement a simple hashtable by using golang.
sql
We record how to implement in-app notification which consequently makes caching much more effective and flexible.
message-broker
nodejs
rabbitMQ
The concept of message queue is easy but writing them can easily be messy due to boilerplate code, we summarize how to organize them into a MessageQueue class.
nodejs
We record how to make custom script with custom predefined variable in command line via running js script.
sql
Convenient simple functions to set as default in SQL.
kysely
sql
Some simple yet common use case of as-with clause in sql, and its counterpart in kysely.
prisma
sql
The default Datetime object in PGSQL by default is UTC+0. Application-wise we wish an absolute timestamp that is compatible with frontend (i.e., javascript), here is how.
nodejs
prisma
sql
We record how to mark a manually changed sql file as a successful migration in prisma.
react
Record some exmaple how to declare types from library that is untyped.
expo
nodejs
react-native
We record how to implement push-notification in both Android and iOS.
nodejs
redis
We study how to organize code for redis caching in a nodejs project
autohotkey
We introduce how to alt+1, alt+2, ... to switch among different vscode window.
cicd
ecs
github-actions
We study how to automate the deployment process with containerized backend image.
algolia
nodejs
react
searching
In the past we have discussed algolia backend and the corresponding frontend, revisit this topic with all code written in nodejs
go
jet
sql
Record the procedure the reverse-engineer a PGSQL database.
nodejs
prisma
Record minimal code needed to use prisma as just a table migration tool.
md
vscode
We record a vscode configuration to customize where to save our image when pasting image in md files with automatically generated url inside markdown file.
java
message-broker
rabbitMQ
springboot
Record the implementation of various queues and integrate them with springboot.
sql
Record how to experiment with the sqls generated by query builder.
java
springboot
sql
We record the config for a starter project in springboot that mimics the workflow of prisma+kysely in nodejs world.
react
In recent mui makeStyles
is no longer maintained, but css in tss is still a very good idea so we record an alternative in this article.
java
springboot
Revisit the basic of springboot application.
nodejs
prisma
sql
Record and introduce the workflow of using prisma and kysely.
jwt
Record the actual implementation in frontend for fail > refresh access-token > retry.
go
Methods of sharing environment variabls has always been being diversified. Some may just keep the .env in the project. Some may share it via instant messagers. Some may store it in a webpage that require a login. We share a method that should be a norm for intense aws users!
docker
go
sql
We build smaller docker image by copying the only used components into new docker image
go
We record how to create a complete web application project in go.
nodejs
We record how to make use of the native gmail api to send email without sendgrid which cost money with only 200 mails a date in free plan (while gmail api is free).
sql
Record the workflow used in database migration, integrated with tools like dbdiagram.io.
react-native
Record a pan guesture component that can swipe an item to show hidden buttons
docker
nodejs
Containerization of vanilla JS project is simple, with typescript we need little more steps.
go
postgresql
sql
We record a workflow of using goose and sqlc to work with changes of database schema.
express
nodejs
react
react-native
SSE
In the past we have discussed SSE by kind of short polling in the backend (keep looping to see whether a key has message to pop out in redis queue). This time we send messages to frontend by listening subscriptions on EventEmitter, an approach very native to languages in which channel
is implemented, like go
and rust
.
react-native
Though we are able to create a bottom-sheet on our own, we may as well use existing stable ones from others!
excel
openpyxl
python
We implement a reusable utility class that handle most of the jobs in creating excel programmatically.
react-native
We discuss How to keep running tasks even when our app is in background state (including screen being locked.
aws
cloud
terraform
How to make a modules and finally, we can apply pre-made modules from others!
aws
cloud
terraform
Let's split our code in multiple terraform files.
aws
cloud
terraform
Standard technique to create multiple resources by conditions and loops.
aws
cloud
terraform
We discuss how to manipulate variables (dev, prod, etc...) and plan a small section on remote execution of shell scripts once an instance is launched.
aws
cloud
terraform
A study of Terraform basic building blocks.
react-native
Pin to zoom is very common but it is not an out-of-the-box feature for camera API in iOS. Let's bring it back on our own.
aws
ecs
There are two ways of deploying tasks in ECS fargate, by either "create service" or "run task", let's get hands on experience with both methods.
react-native
File streaming is a very basic technique to effectively transmit files from frontend to backend and, of course, from within backends as well.
expo
react-native
Record detail of expo-cli workflow in development build.
react-native
We can create our custom component by creating custom behaviour via customizing animtation!
mongo
We create a special collection and a hook to the save method of a collection to obtain an auto-incremented id field!
react-native
We create a voice chat application on mobile using third party API called AgoraRTC.
nodejs
redis
web-socket
We study how to scale up the chat services horizontally by Redis.
express
jwt
nodejs
web-socket
Basic reivew of API provided by socket.io-client and socket.io in nodejs.
nodejs
test
Testings not only justify our functions are working, it also demonstrates how our function is used. We will be setting up tests in typescript.
rust
Let's define operator overloading on finite field Z/pZ for prime p.
react
In the browser our route consist of many information, like messageId
, emailId
, etc, which enables our web page to select correct data based on the route.
In this post we discuss how to effectively construct such url
with type safty under a RouteSchema
.
express
Record how to implement CORS in express to allow certain origins to get access instead of allowing all origins
express
java
We implement file downloading feature in a get/post request in both express
and spring
, we handle them in memory and therefore no disk i/o is needed.
express
java
nodejs
springboot
SSE
An introduction to how to effectively create SSE event mimicing the single-thread event loop adopted by nodejs in springboot, and how do we actually implement it in nodejs as well.
react
Record a hook to listen to scrolling-up and scrolling-down events, and an easy way to inject our callback to this events using this hook.
react
A simple component and function that helps rerender a component effectively.
react
A method to pass complicated function in a component to its parent.
express
A simple backend that perform google authentication. I personally use this to restrict users who can access my project.
react
I used to use useRouteMatch
in react-router-dom v5
, which has been changed completely in v6
into something called useMatch
or useMatches
. We talk about building the param searching function on our own to get rid of these unhandy "black boxes".
java
mongo
We get rid of the headache of writing mongo agggregation using mongo apis in java given that we already know how to write that in json format.
react
Record a hook for determining whether click have happened outside of our target dom element.
algolia
fusejs
java
react
searching
We introduce a service called Algolia which provides an easy search engine integration that helps build quick and accurate search functionality.
aws
serverless
Guide to creating serverless flask and express application.
google-cloud
A introduction of OAuth2 Consent Setting and Pubsub for publishing update of gmail inbox.
aws
react
A full breakdown of steps deploying a react project to s3 with SSL encryption.
aws
react
A full breakdown of steps deploying a react project to s3 with SSL encryption.
react
normalizr
will be helpful if we have complex manipulation of data in an array (like drag and drop)
java
springboot
We list the standard procedures to debug a dockerized spring application.
aws
cicd
gitlab
Record CICD script in gitlab for deploying react pages.
cicd
docker
gitlab
Revisit the fundamentals of docker and the related gitlab-ci workflow.
react
redux
Record the use of redux-persist
for persisting data in redux store.
react
Record the implementation of radio button group and dropdown list, in a hope that we don't need to waste time cooking it up again in the future.
react
We list sample usage of createThunkAction provided by redux-toolkit in order to single out the logic of data-fetching away from the UI component.
mongo
$lookup only works for the whole collection, we demonstrate how to left join another collection using a field which is an array.
mongo
Record the mongo query using aggregation pipeline to get the results as in the title in my usual work. These include $lookup
, $project
, $arrayElemAt
, {$gt: {$size: 1}}
, etc interesting operations.
react
Record how to write CSS animation with keyframes in mui makeStyles
.
python
selenium
Click and then get detail is a very routine practice for data scrapping. We record how to do that by selenium in python.
java
react
springboot
We record the whole workflow of uploading file from react frontend to springboot backend.
C++
We study how to register a custom url protocol to launch our desktop application.
C++
libtorch
pytorch
In the course of translating pytorch model into libtorch model there are traps and tricks that are worthing being recorded. Also record the simple use of opencv as it substitutes the role of numpy in python.
C++
Previously we have mentioned how to use precompiled header in visual studio project, this time we record how to do it in cmake project
C++
Sometimes the constant CMAKE_CXX_STANDARD
does not guarantee the C++ standard we use in compilation. We add a line to guarantee which target is compiled in which C++ standard.
C++
deep-learning
Record the flow of including opencv and libtorch into CMake project.
C++
Record useful utility functions that I have found during my project on desktop app in C++.
C++
Fix the error of failing to find source files when it really can for cmake projects.
C++
pytorch
We discuss how to import models trained in pytorch into cpp project.
C++
Record some experience and the CMakeLists.txt
's that I have used.
C++
Record a useful print function which behaves like console.log
in javascript and print
in python.
C++
We try to implement iterator that iterates elements inside our vector class in the PREVIOUS BLOG.
C++
We can avoid heap memory allocation by using C style array stored in stack memory, given that we don't need such a flexibility of dynamic array (the std::vector
class) and the size of the target array is known beforehand.
C++
Record standard procedure to make a precompiled header file to avoid rebuilding it every time we build the whole project.
C++
We implement our string class and demonstrate how to create a copy constructor for deep copying a string.
nextjs
react
The latest react mui version (v5.0
) has breaking changes that make the config files in THIS POST fail. We discuss the corresponding necessary changes.
nextjs
react
Record how to change pytorch model into onnx model and deploy it to frontend.
deep-learning
pytorch
react
Record how to change pytorch model into onnx model and deploy it to frontend.
deep-learning
pytorch
Record the most recently used combination of data augmentations.
deep-learning
pytorch
Discuss how to customize the patching of the results from __getitem__
method of Dataset
object in pytorch.
deep-learning
Code implementation in pytorch on Cascade RCNN, the code base is mainly a modification of my previous project.
deep-learning
pytorch
Describe how to fed the features from Swin Transformer into Faster RCNN.
deep-learning
pytorch
In practice we can directly use torchvision.models.swin_t
to use pretrained model. The Reimplementation of the model is for sheer purpose of my self-learning.
deep-learning
pytorch
Record the study of the basic mechanism how a transformer perform classification task on images.
deep-learning
pytorch
Continuation of the previous blog post on transformer, discuss more modern pipeline for training a transformer (or any NLP task in general) using the latest torchtext.
deep-learning
pytorch
Record the basic building block and structure of a Transformer. The main reference of this article is this blog post.
deep-learning
pytorch
Sometimes a loss becomes nan in rare occasion (e.g., it occurs once per 5~7 epochs), in this case we record a script to restart the training using the latest weight.
deep-learning
pytorch
Different backbones have different APIs for extracting features from an image, we record some of them.
deep-learning
pytorch
Record my data augmentation used in object detection.
deep-learning
pytorch
Minimal functioning implementation of faster rcnn (with and without fpn).
deep-learning
pytorch
Break down the code for my own study. e.g., the way it does image cropping, resizing, etc augmentations while keeping the vertice consistent are very valuable reference, the way it does nms is also succint! Source Code: Link
python
Record usual api for drawing apis in cv2, pillow and shapely.geometry.
python
Mask in numpy, tensorflow and pytorch is very useful to filter out desired values, but sometimes the index that the mask marks as True
is also import, we record a function to retrive those information.
python
Record the use of a progress bar when using for loop, and record how to customize the output.
python
Create a console log that freeze the position but keep updating the numerics in training.
deep-learning
pytorch
Record useful tools and commands in pytorch which I learn from translating DefectGAN model in tensorflow into pytorch.
math
Before I forget, record my basic understanding on what is Principal Component Analysis and how it works.
deep-learning
We modify from DCGAN from this post to experiment on WGAN by weight-clipping, then we try to experiment WGAN-GP using gradient penality.
deep-learning
I made this study note on 5th of March, 2021: 2021-02-28-yolov3-algorithm-drilling in pdf format. For a refresh of memory I reformat the content into an md file for this blog for easy reading and reference.
deep-learning
Record different kinds of residue block that I have seen.
react
Record an element that I made for default fade-in effect on component mount and state change.
math
python
Discrete Cosine Transform (DCT) is not only used in image processing, it is also used in signal processing of sound such as computing MFCC coefficients as a feature vector.
rust
Completed the Rust official tutorial from its online book and concluded the 20 chapters by a multithreading simple web server. Try to record the subtitle detail for future reference.
typescript
Set up debugger for node project in typescript with minimal config.
deep-learning
tensorflow
We study one of the GANs that can perform auto coloring to gray-images.
react
Record how to make button left- and middle-clickable; Record how to scroll to desired HTML element vertically.
mongo
nodejs
python
Record everything we should know about mongo with mongoose in nodejs and mongoengine in python.
deep-learning
tensorflow
Implement custom training loop in tensorflow for Cycle-GAN without the use of trick that sets Model.training = False
.
excel
python
Record two methods to read excel files in Python
typescript
Record some type annotation used for third party untyped library or those needed in importing files (like pdf).
deep-learning
From time to time it is easy to forget the formula to calculate the output shape of Conv2D
, MaxPooling2D
, etc, layers. Record some sample code to test shapes easily.
deep-learning
Explain why and how it can provides a performance index to a localization algorithm.
nextjs
react
Without additional setup, due to the natural of serverside rendering, some styles would become undefined and we study how to avoid them.
aws
Resource that explains how to construct correct policy on sqs-queue to allow s3 to send message to that queue.
javascript
python
Logging is undoubtedly the most important part of an application. We study how to create a logger that tells us a message comes from which file and which line.
coding
mongo
Since I have docker already installed, just record a few steps to get the local development ready using mongo db with authentication.
deep-learning
tensorflow
In the past I have learnt the most basic GAN and DCGAN using pytorch, but I am more familiar with tensorflow. I attempt to understand gradient tape using by using these two GAN again with mnist dataset.
javascript
We discuss how to compress images effectively in nodejs backend.
javascript
Sometimes we would like to call python script inside our node js program. We discuss how to execute a command, how to read the log and error in node-js and how to wait until this process is done.
electron
google-cloud
nextjs
react
Since FF14 has a new patch of huge update, in order to take this oppurtunity to learn Japanese I decided to write a desktop application again.
javascript
nextjs
react
I am working on a desktop application by using Electron + Next.js in typescript. Since I cannot live without debugger, I have spent time searching debug config in the internet and finally come into a functioning configuration!
javascript
Sometimes it is convenient to directly execute a test file to understand how the project work. In the past we discussed how to make a runnable test file in python, in javascript we can use exactly the same approach for debugging.
python
Record a list of useful utility functions in handling date-time object in python.
python
When a class grows to 500 to 1000 lines of codes it becomes hard and tedious to maintain because there starts to be many class methods, some are short, some are huge. It is a good starting point to separate particularly long functions from the class with very very minimal effort, but how?
python
Record a structure that makes a test_sth.py
debuggable and make sure project directory path is included in sys.path
when debug mode is enabled.
autohotkey
coding
A record of my latest autohotkey setup for different applications.
python
selenium
Simple click and download (and wait for its completion!) tasks that are achieved in python.
C++
We list some potential problem of using shallow copy and how to avoid them by deep copy. We can also improve computation efficiency when a variable is never reused but needed to be passed into a function/class attribute. We achieve this by using move constructor.
C++
We write simple functions to understand cpp syntax, memory in stack and memory in heaps by using raw pointer.
tensorflow
We introduce albumentations for image augmentation that helps generalize our model to unknown data.
deep-learning
tensorflow
In classification tasks there are already state-of-the-art models trained from a myriad of images. We try to make a network surgery on one of them (VGG-16 this time) to quickly classifiy our custom dataset with good result.
tensorflow
Introduce useful callbacks that I use in monitoring training process. Also introduce how to retrain the model from a specific epoach.
react
Record a useful package that contains a comprehensive list of svg icons.
coding
deep-learning
python
Basic command needed to mount a google drive and also to unzip compressed large dataset.
tensorflow
Revist Tensorflow with a complete dataset pipeline using tf.data.Dataset
and custom training via cycle-GAN.
pytorch
Understand Pytorch by implementing a simple version of GAN and also a DCGAN.
math
Given and its (joint) distribution on , we try to find the distribution of on .
react
SPAs (Single Page App) are known to be unfriendly to search engines and we try to deal with this problem for react app.
react
An introduction to disqus that plug a small comment box into our website.
math
Digest the material from Convex Analysis by Gert Wanka. I modify the proofs by quite a bit once there is available theorem in my mind that is not presented in the text or I have alternative proofs from other material.
math
Start the journey of convex analysis in an attempt to fully understand the technical tools needed in optimal transport. In this article we digest the material from Chapter 5 Convex Optimization in Function Space, I also fill in the important missing detail in the proof (the author is a bit rushing).
algorithm
A note to solved problems and calculate the related time complexities.
algorithm
Study the implementation of sorting algorithms
python
Record the common commands that is needed to create a new virtual environment with conda.
math
Review the definition of distribution, multivariable normal distribution, and some concrete examples.
typescript
Useful custom type and last resort to get correct type that we may encounter in typescript.
react
In backend we can loop through the files inside a directory using fs.readdir
, we introduce a function that can achive the same thing in frontend using webpack's require.context
function.
react
Inside a routed component, we introduce useRouteMatch
on type annotation and the way to extract params.
deep-learning
math
Study the formulas on conditioned joint-distribution such as relation between , and . We also discuss the latent variable model in variational Auto Encoder.