This file contains 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
""" | |
19/04/2023: MacOS | |
- cmd+shift+y: select all selected occurence | |
- cmd+ctrl+o: outline | |
20/04/2023: Search Editor (MacOS) | |
- ctrl+f: open | |
- ctrl+0 or 9: focus Next or prev | |
- cmd+[ or ]: next or prev input box | |
- better split vertical and horizontal (> 2 editor tabs) | |
24/04/2023: diff editor (MacOS) |
This file contains 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
#!/bin/bash | |
########## Check for tmux and bash-completion installed | |
if [[ "$(uname)" == "Darwin" ]]; then | |
if ! command -v brew >/dev/null 2>&1; then | |
echo "Homebrew is not installed. Please install Homebrew and try again." | |
exit 1 | |
else | |
# Install tmux if not installed | |
if ! command -v tmux >/dev/null 2>&1; then |
Reference: Mermaid Docs
This file contains 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
Checks: 'clang-diagnostic-*,clang-analyzer-*,-modernize-*,-clang-diagnostic-#pragma-messages,-readability-identifier-naming,-clang-diagnostic-switch' | |
WarningsAsErrors: '*' | |
HeaderFilterRegex: '' | |
AnalyzeTemporaryDtors: false | |
FormatStyle: none | |
CheckOptions: | |
- key: cert-dcl16-c.NewSuffixes | |
value: 'L;LL;LU;LLU' | |
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic | |
value: '1' |
This file contains 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 the following link for the explanation of each params: | |
# http://releases.llvm.org/8.0.0/tools/clang/docs/ClangFormatStyleOptions.html | |
Language: Cpp | |
# BasedOnStyle: Google | |
AccessModifierOffset: -1 | |
AlignAfterOpenBracket: Align | |
AlignConsecutiveAssignments: true | |
AlignConsecutiveBitFields: true | |
AlignConsecutiveDeclarations: false | |
AlignConsecutiveMacros: true |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
This file contains 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 | |
import torch.nn as nn | |
def compute_scale_and_shift(prediction, target, mask): | |
# system matrix: A = [[a_00, a_01], [a_10, a_11]] | |
a_00 = torch.sum(mask * prediction * prediction, (1, 2)) | |
a_01 = torch.sum(mask * prediction, (1, 2)) | |
a_11 = torch.sum(mask, (1, 2)) |