| Map | Action |
|---|---|
| <F1> | Causes Netrw to issue help |
| <cr> | Netrw will enter the directory or read the file |
| <del> | Netrw will attempt to remove the file/directory |
| - | Makes Netrw go up one directory |
| a | Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide) |
| c | Make browsing directory the current directory |
| C | Setting the editing window |
| d | Make a directory |
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
| # set prefix to control-f | |
| set -g prefix C-f | |
| #unbind system defined prefix | |
| unbind C-b | |
| # helps in faster key repetition | |
| set -sg escape-time 0 | |
| # start session number from 1 rather than 0 |
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
| # https://stackoverflow.com/questions/57143272/fix-the-solution-of-binary-period | |
| def solution(n): | |
| d = [0] * 30 | |
| l = 0 | |
| while n > 0: | |
| d[l] = n % 2 | |
| n //= 2 | |
| l += 1 | |
| for p in range(1, 1 + l//2): #here you put l//2 |
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
| ### file: Dockerfile | |
| FROM python:3.7-alpine | |
| RUN mkdir -p /usr/src/app | |
| WORKDIR /usr/src/app | |
| ADD . /usr/src/app | |
| ENTRYPOINT ["python"] | |
| CMD ["main.py"] |
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
| #!/usr/bin/env python | |
| import math | |
| def bytes2human(n): | |
| # Credits to /u/cyberspacecowboy on reddit¬ | |
| # https://www.reddit.com/r/Python/comments/5xukpd/-/dem5k12/¬ | |
| symbols = (' B', ' KiB', ' MiB', ' GiB', ' TiB', ' PiB', ' EiB', ' ZiB', | |
| ' YiB') | |
| i = math.floor(math.log(abs(n)+1, 2) / 10) | |
| return '%.1f%s' % (n/2**(i*10), symbols[i]) |
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
| #!/usr/bin/env python | |
| import os | |
| # simple and dirty, no any beautiful patt but just work hhh | |
| class CheckNode: | |
| def __init__(self, base_dir, debug): | |
| self.base_dir = os.listdir(base_dir) | |
| self.debug = debug | |
| def compare_to(self, comparable_dir): |
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 xgboost-base | |
| RUN apt-get install -y make gfortran \ | |
| python3-dev && \ | |
| pip install numpy==1.13.3 scipy==1.0.0 pandas==0.22.0 scikit-learn==0.19.1 && \ | |
| cd /src/xgboost;make -j4 && \ | |
| cd /src/xgboost/python-package && \ | |
| python3 setup.py install |
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 python:3.6.6-slim AS base | |
| FUN apt-get update && apt-get install -y build-essential git | |
| RUN mkdir src && cd src | |
| WORKDIR src | |
| RUN git clone --recursive https://github.com/dmlc/xgboost && \ | |
| sed -i '/#define DMLC_LOG_STACK_TRACE 1/d' /src/xgboost/dmlc-core/include/dmlc/base.h && \ | |
| sed -i '/#define DMLC_LOG_STACK_TRACE 1/d' /src/xgboost/rabit/include/dmlc/base.h |
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
| # Quick Python logging example. Shows a minimal way to support timezone (%z) | |
| # and milliseconds (%f) format strings in a logging formatter's datefmt string. | |
| # The default Formatter.formatTime func loses timezone info (%z becomes +0000) | |
| # because time.strtime is passed struct_time from time.localtime(rec.created). | |
| # Calling time.strftime('%z') without passing an explicit struct_time yields a | |
| # string based on the system's timezone at call time, which is good enough. | |
| import time | |
| import sys | |
| import logging |
| Map | Action |
|---|---|
| <F1> | Causes Netrw to issue help |
| <cr> | Netrw will enter the directory or read the file |
| <del> | Netrw will attempt to remove the file/directory |
| - | Makes Netrw go up one directory |
| a | Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide) |
| c | Make browsing directory the current directory |
| C | Setting the editing window |
| d | Make a directory |
NewerOlder