Skip to content

Instantly share code, notes, and snippets.

@remorsecs
remorsecs / PyTorch 入門最速傳說.ipynb
Last active September 27, 2025 09:24
本文目標是讓沒寫過 PyTorch 的讀者成為 PyTorch 新手 (?)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@remorsecs
remorsecs / create-conda-environment-examples.md
Last active April 26, 2022 18:53
How to create conda environment

Create and Activate Conda Environment

Create and Activate Conda Environment-1

Create

$ conda create -p /path/to/your/environment --python=3.6
anonymous
anonymous / tqdm_example.py
Created March 19, 2018 03:24
by amoshyc
from tqdm import tqdm
from time import sleep
n_steps = 100
msg = {'loss': 1, 'acc': 0.0}
with tqdm(total=n_steps, postfix=msg, ascii=True) as pbar:
for i in range(n_steps):
sleep(1)
msg['loss'] -= 0.01
msg['acc'] += 0.01
anonymous
anonymous / 20170614.ipynb
Created June 13, 2017 17:07
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active October 28, 2025 12:45
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@mkroman
mkroman / Network.cpp
Created November 17, 2011 01:42
Uncrustify configuration inspired by Google's C++ styleguide.
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <stdarg.h>
#include <stdio.h>