server {
listen 443 ssl;
server_name tawk.smiv.vn;
ssl_certificate /etc/letsencrypt/live/tawk.smiv.vn/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/tawk.smiv.vn/privkey.pem; # managed by Certbot
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Cursornator do | |
| import Ecto.Query | |
| @doc """ | |
| Stream the query with cursor | |
| Options | |
| - `:loop_query_func` - function to go to the next page | |
| - `:limit` - limit of entries to fetch |
This article introduces some Anti-Corruption approaches to support communication between domains (business group) in the Domain-Driven Design pattern while keeping business logic between them isolated.
Assume we apply DDD (Domain-Driven Design) for an e-commerce project with the following structure:
Enum.at/3 function is used to find an element at a given index in zero-based indexing. This document describes how this function works and explains its complexity.
The Enum.at/3 is defined in the official elixir repository at this code: https://github.com/elixir-lang/elixir/blob/d3285b176e87b025a6949867b58a7ce0e3839b58/lib/elixir/lib/enum.ex#L478
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| from typing import List, Tuple | |
| class Randomizer: | |
| MAX_VALUE = 100.0 | |
| # Xác suất xuất hiện phần tử (0 <= x <= 1), hoặc tỉ trọng đóng góp | |
| # trong tổng số lần gọi của mỗi phần tử |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule HamiltonianCycle do | |
| @moduledoc """ | |
| Find Hamiltonian cycle algorithm | |
| Example | |
| vertices = %{ | |
| 0 => [1, 2], | |
| 1 => [0, 2, 3], | |
| 2 => [0, 1, 4], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule BFS do | |
| @moduledoc """ | |
| Breadth first search algorithm | |
| Example | |
| vertices = %{ | |
| 0 => [1, 3], | |
| 1 => [0, 2], | |
| 2 => [1, 3], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule DFS do | |
| @moduledoc """ | |
| Depth first search algorithm | |
| Example | |
| vertices = %{ | |
| 0 => [1, 3], | |
| 1 => [0, 2], | |
| 2 => [1, 3], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Clean and simple Keras implementation of network architectures described in: | |
| - (ResNet-50) [Deep Residual Learning for Image Recognition](https://arxiv.org/pdf/1512.03385.pdf). | |
| - (ResNeXt-50 32x4d) [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf). | |
| Python 3. | |
| """ | |
| from keras import layers | |
| from keras import models |