Use the bitwise OR operator ( | ) to set a bit.
number |= 1 << x;| /* | |
| Include this script at the top of the scene to enable global commands | |
| Usage: | |
| global.showProps(object) | |
| global.showScene(scene) | |
| global.showSceneObject(sceneObject) | |
| global.showComponent(component) | |
| Original by @robertlugg | |
| https://gist.github.com/robertlugg/a5161200998092ddf69cb7393f7efcc0 |
| import argparse | |
| import sys | |
| from contextlib import ExitStack | |
| if __name__ == '__main__': | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('filename', nargs='*') | |
| parser.add_argument('--append', '-a', action='store_true') | |
| args = parser.parse_args() |
| #! /usr/bin/env python | |
| """Emulate Go's 'defer' statement. | |
| The defer decorator adds the 'defer' function to the wrapped opject | |
| that will push a callable and its arguments to a stack. The list of | |
| saved calls is executed after the surrounding function returns. Defer | |
| is commonly used to simplify functions that perform various clean-up | |
| actions. |
| FROM ubuntu:18.04 as base | |
| # docker build -t vanessa/vim . | |
| RUN apt-get update && apt-get install -y git \ | |
| gcc \ | |
| libncurses5-dev \ | |
| libncursesw5-dev \ | |
| build-essential |
| package main | |
| import ( | |
| "fmt" | |
| "strconv" | |
| ) | |
| func main() { | |
| value := strconv.FormatFloat(10.900, 'f', -1, 64) // 10.9 | |
| fmt.Println(value) |
| # Editors | |
| .vscode/ | |
| .idea/ | |
| # Vagrant | |
| .vagrant/ | |
| # Mac/OSX | |
| .DS_Store |
| from math import sqrt | |
| def put_kernels_on_grid (kernel, pad = 1): | |
| '''Visualize conv. filters as an image (mostly for the 1st layer). | |
| Arranges filters into a grid, with some paddings between adjacent filters. | |
| Args: | |
| kernel: tensor of shape [Y, X, NumChannels, NumKernels] | |
| pad: number of black pixels around each filter (between them) |
| #!/bin/bash | |
| # | |
| # DESCRIPTION: | |
| # | |
| # Set the bash prompt according to: | |
| # * the active virtualenv | |
| # * the branch of the current git/mercurial repository | |
| # * the return value of the previous command | |
| # * the fact you just came from Windows and are used to having newlines in | |
| # your prompts. |