Skip to content

Instantly share code, notes, and snippets.

@rutcreate
rutcreate / README.md
Last active July 22, 2024 12:23
Install Python 3.10.x on Ubuntu 20.04

Prerequisite

sudo apt update
sudo apt install software-properties-common -y

Add custom APT repository

@reytech-dev
reytech-dev / Fix.md
Last active March 20, 2024 10:19
ZONE_CONFLICT: 'docker0' already bound to a zone
  1. Check if docker zone exists in firewall-cmd
$ firewall-cmd --get-active-zones
  1. If "docker" zone is available, change interface to docker0 (not persisted)
$ sudo firewall-cmd --zone=docker --change-interface=docker0
  1. If "docker" zone is available, change interface to docker0 (persisted, thanks rbjorklin)
@anj1
anj1 / subexpr.py
Last active January 20, 2020 22:41
import types
import tensorflow as tf
import numpy as np
# Expressions are represented as lists of lists,
# in lisp style -- the symbol name is the head (first element)
# of the list, and the arguments follow.
# add an expression to an expression list, recursively if necessary.
def add_expr_to_list(exprlist, expr):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Serving Flask under a subpath

Your Flask app object implements the __call__ method, which means it can be called like a regular function. When your WSGI container receives a HTTP request it calls your app with the environ dict and the start_response callable. WSGI is specified in PEP 0333. The two relevant environ variables are:

SCRIPT_NAME
The initial portion of the request URL's "path" that corresponds to the application object, so that the application knows its virtual "location". This may be an empty string, if the application corresponds to the "root" of the server.

@SNagappan
SNagappan / README.md
Last active January 8, 2021 15:43
bAbI

##Model

This is an implementation of Facebook's baseline GRU/LSTM model on the bAbI dataset Weston et al. 2015. It includes an interactive demo.

The bAbI dataset contains 20 different question answering tasks.

Model script

The model training script train.py and demo script demo.py are included below.

Instructions

Sparse tensors for Torch7

All types torch.DoubleTensor, torch.FloatTensor, etc. should have their sparse variants: torch.SparseDoubleTensor, torch.SparseFloatTensor, etc.

Copying between dense and sparse matrix should be done with :copy() function.

Underlying BLAS has to be swappable with MKL/OpenBLAS/Atlas, etc. Other math operations have to implemented with CSPARSE.

@akirill0v
akirill0v / post1.md
Last active April 8, 2016 08:12
Vexor Post 1

Тестирование программного обеспечения в наши дни стало неотъемлемой частью процесса разработки программного обеспечения во всем мире. Уже не найти ни одного серьезного проекта без покрытия, хотя-бы Unit-тестами. Существуют различные техники и подходы к тестированию. Кто-то покрывает тестами уже написанный код, кто-то использует тестирование как инструмент для добавления новой функциональности (разработка через тестирование). В обоих случаях время, затраченное на тестирование кода, включается в общие затраты по разработке. И чем больше и сложнее проект, тем большее время тратится для выполнения всех тестов. Как оптимизировать затраты на тестирование? Существует несколько путей оптимизации процесса тестирования продукта. От рефакторинга тестов и тестовых данных, до увеличения мощностей оборудования. Рефакторинг и оптимизированный запуск разных групп тестовых заданий действительно может сократить время общего прогона тестов, но в конечном итоге встает вопрос вертикального масштабирования, если ресурсов не хватае

@betamax
betamax / generate-docs.sh
Created June 19, 2015 10:53
A script that we use at Lateral to generate our documentation
#!/bin/sh
# Which md files to compile
declare -a arr=("hybrid-recommender" "text-matching" "pre-populated-recommenders")
# Now loop through the above array
for i in "${arr[@]}"
do
# Where to store the documentation