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
| # Refer to NGC for latest tag. https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda/tags | |
| # You don't need an OWNER, it will has a default jupyter | |
| # Resulting quay.io/${OWNER}/minimal-notebook | |
| DOCKER_BUILD_ARGS="--build-arg ROOT_CONTAINER=nvcr.io/nvidia/cuda:12.6.2-cudnn-devel-ubuntu22.04" OWNER=deepq make build/docker-stacks-foundation build/base-notebook build/minimal-notebook |
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
| cat $1 | tr -d '\r' | sed 's/\\/\//g' | md5sum -c - |
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
| # This code is developed based on David Eppstein's recipe | |
| # http://code.activestate.com/recipes/117214-knuth-morris-pratt-string-matching/ | |
| class KnuthMorrisPratt(): | |
| def __init__(self, pattern): | |
| self.pattern = pattern | |
| @property | |
| def pattern(self): | |
| return self._pattern |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 time | |
| s = '|\-/' | |
| s = '{(|)})|(' | |
| s = ['| ', '\ ', '\_ ', ' _ ', ' _/', ' /', ' |', ' /', ' _/', ' _ ', '\_ ', '\ '] | |
| while True: | |
| for ss in s: | |
| print(ss, end='\r', flush=True) | |
| time.sleep(0.1) |
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
| join -1 2 -2 2 <(nvidia-smi pmon -c 1 -s mu | sort -k 2) <(ps -aux | sort -k 2) | cut -c -80 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| % *** fix named problem | |
| \makeatletter | |
| \let\@internalcite\cite | |
| \def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite} | |
| \def\shortcite{\def\citeauthoryear##1{##2}\@internalcite} | |
| \def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill} | |
| \makeatother | |
| % *** |
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
| \usepackage[dvipsnames]{xcolor} | |
| \usepackage{etoolbox} | |
| \newrobustcmd{\showcb}[3]{% make comment block | |
| \csdef{#1}##1{% | |
| \par\noindent\textcolor{#3}{// \colorbox{#3}{\textcolor{white}{#2}}: ##1}% | |
| } | |
| } | |
| \newrobustcmd{\showcs}[3]{% make comment span | |
| \csdef{#1}##1{% | |
| \textcolor{#3}{/* \colorbox{#3}{\textcolor{white}{#2}}: ##1 */}% |
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 .singleton import singleton | |
| from regr.base import AutoNamed | |
| def named_singleton(cls): | |
| if not issubclass(cls, AutoNamed): | |
| raise TypeError('named_singleton can be applied to subclasses of AutoNamed,' + | |
| ' but MRO of {} is given.'.format(cls.mro())) | |
| def getter(name=None): |
NewerOlder