from numpy_lru_cache_decorator import np_cache
@np_cache()
def function(array):
...
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
| #include "Foo.hpp" | |
| #include <iostream> | |
| using namespace std; | |
| Foo::Foo(int _a, int _b): a(_a), b(_b){ | |
| cout << "C++ side, constructor" << endl; | |
| } | |
| Foo::~Foo(){ |
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
| # Terminal Cheat Sheet | |
| pwd # print working directory | |
| ls # list files in directory | |
| cd # change directory | |
| ~ # home directory | |
| .. # up one directory | |
| - # previous working directory | |
| help # get help | |
| -h # get help |
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 torch | |
| #Check availability of GPU: | |
| print(f"Pytorch version: {torch.__version__}") | |
| print(f"Current device: {torch.cuda.current_device()}") | |
| print(f"Device count: {torch.cuda.device_count()}") | |
| print(f"Device name: {torch.cuda.get_device_name(0)}") | |
| print(f"Is CUDA available?: {torch.cuda.is_available()}") | |
| # Set device on GPU if available, else CPU |
A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/
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 url(https://fonts.googleapis.com/css?family=Droid+Serif); | |
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |
| @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); | |
| body { | |
| font-family: 'Droid Serif'; | |
| } | |
| h1, h2, h3 { | |
| font-family: 'Yanone Kaffeesatz'; | |
| font-weight: 400; |
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
| FROM ubuntu | |
| RUN apt update \ | |
| && apt install -y firefox \ | |
| openssh-server \ | |
| xauth \ | |
| && mkdir /var/run/sshd \ | |
| && mkdir /root/.ssh \ | |
| && chmod 700 /root/.ssh \ | |
| && ssh-keygen -A \ | |
| && sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \ |
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
Show hidden characters
| { | |
| "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\"", | |
| "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
| "working_dir": "${file_path}", | |
| "selector": "source.c++, source.cpp, source.cc, source.cxx", | |
| "variants": | |
| [ | |
| { | |
| "name": "Run in Terminal", |
A clean installation of Ubuntu 18.04.02 LTS was used.
This gist is an extension to the official docs, adding missing parts and instructions.
follow the pre-installation actions on:
NewerOlder