Skip to content

Instantly share code, notes, and snippets.

View tuan3w's full-sized avatar
👋

Tuan Nguyen tuan3w

👋
View GitHub Profile
@tuan3w
tuan3w / Bias.md
Last active November 25, 2021 05:27
Thiên kiến/Thiên Vị (Bias)

Cập nhật (21/10/2021): Bản ghi chú này có sai lệch. Bởi vì thiên kiến xác nhận (confirmation bias),số lượng tài liệu hạn chế mình đọc, các nội dung phần nào chịu ảnh hưởng bởi góc nhìn, quan điểm ban đầu của tác giả. Bản thân bài viết này cũng bị sửa rất nhiều lần vì mình nhận thấy sai lầm đáng kể của những nội dung ban đầu. Bài viết cũng có thể khó đọc với nhiều người bới khả năng diễn đạt của bản thân mình và sự sai khác trong cách tư duy mà mình không nghĩ đến.

Thiên kiến/Thiên Vị (Bias)

Tự dưng muốn viết về chủ đề này nên viết cho vui. Dạo này, mình đọc nhiều sách về tâm lý. Vì lý do này đến lý do khác dẫn đến thấy thú vị về chủ đề này. Tiêu biểu nhất đó là thiên kiến/thiên vị (bias). Một chủ đề nghe chừng vô thưởng vô phạt. Nhưng sau thời gian tìm hiểu, mình khám phá ra nhiều điều thú vị liên quan đến nó. Thiên kiến ảnh hưởng đến bản thân mọi người nhiều hơn chúng ta tưởng. Mình sẽ giải thích thiên kiến trong một số vấn đề bao gồm **đánh giá và ra

# eth0 is public network interface
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
# Allow connection RELATED,ESTABLISHED on eth0
iptables -t filter -A INPUT -i eth0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# Prevent DOCKER chain
iptables -t nat -I PREROUTING -m addrtype --dst-type LOCAL -j RETURN
@tuan3w
tuan3w / peleenet.py
Created December 28, 2018 03:26
peleenet.py
import torch
import torch.nn as nn
from torch.nn import Parameter
import math
import torch.nn.functional as F
class Scale(nn.Module):
def __init__(self, channels):
super(Scale, self).__init__()
@tuan3w
tuan3w / example.sh
Created August 21, 2018 04:06
Adding elapsed time to video
ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 \
-vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: \
text=\'%{pts\:gmtime\:0\:%M\\\:%S}\': fontcolor=white@0.8: x=7: y=7: fontsize=24" -vcodec libx264 \
-preset veryfast -f mp4 -pix_fmt yuv420p -y output.mp4
@tuan3w
tuan3w / nginx.conf
Last active February 13, 2019 09:40
Experiment with nginx-http-flv-module
worker_processes auto; #should be 1 for Windows, for it doesn't support Unix domain socket
worker_rlimit_nofile 100000;
error_log logs/error.log error;
#if the module is compiled as a dynamic module and features relevant
#to RTMP are needed, the command below MUST be specified and MUST be
#located before events directive, otherwise the module won't be loaded
@tuan3w
tuan3w / deepvoice_errorlog.txt
Created January 4, 2018 14:45
deepvoice_errorlog.txt
(dev3) ❯ python synthesis.py --hparams="builder=deepvoice3,preset=deepvoice3_ljspeech" checkpoints_deepvoice3/checkpoint_step000390000.pth test.txt samples
Command line args:
{'--checkpoint-postnet': None,
'--checkpoint-seq2seq': None,
'--file-name-suffix': '',
'--help': False,
'--hparams': 'builder=deepvoice3,preset=deepvoice3_ljspeech',
'--max-decoder-steps': '500',
'--output-html': False,
'--replace_pronunciation_prob': '0.0',
@tuan3w
tuan3w / setup.py
Created November 16, 2017 05:50
setup.py
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
from os.path import join as pjoin
import numpy as np
@tuan3w
tuan3w / swarm_register.py
Created October 7, 2017 15:56
swarm_register.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 zc <zc@www>
#
# Distributed under terms of the MIT license.
"""
Service registrator agent
@tuan3w
tuan3w / VertxHystrixSample.java
Created July 28, 2017 04:45
sample circuit breaker with vertx
import com.soundcloud.prometheus.hystrix.HystrixPrometheusMetricsPublisher;
import com.vcc.bigdata.micro.cmd.FailCommand;
import io.vertx.circuitbreaker.CircuitBreaker;
import io.vertx.circuitbreaker.CircuitBreakerOptions;
import io.vertx.circuitbreaker.HystrixMetricHandler;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.ext.web.Router;
@tuan3w
tuan3w / docker-compose.sh
Created March 7, 2017 09:05
docker-compose.sh
curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose