- Ratio of number of lines with more than 80 columns over all lines :
R_80C
- Ratio of source files with more than 100 lines orver all files :
R_100L
- Nesting depth for each of
{}
,()
,[]
and<>
:N$
where$
is{}
,()
,[]
or<>
- Average nesting depth :
Avg_N$
- Maximum nesting depth :
Max_N$
- Ratio of nested blocks with Ndepth$ more than 4 over all nested blocks of the same type :
R_4N$
- Average nesting depth :
- Length of a sequence that appears X times for X > 1, multiplied by X (within min. edit distance < one third of the length of it) :
QX
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 | |
# run clang tidy for all files in include and src | |
# get the list of files | |
files=$(find include src -name "*.hpp" -o -name "*.cpp") | |
# useful checks for c++20 | |
checks="-*,readability*,clang-analyzer*,cppcoreguidelines*,bugprone*,modernize*" | |
# run clang tidy |
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
WIDTH = 600 | |
CX = WIDTH / 2 | |
CY = WIDTH / 2 | |
let svg = document.getElementById("aydede"); | |
svg.setAttribute("width", WIDTH); | |
svg.setAttribute("height", WIDTH); | |
function drawCircularArc(cx, cy, r, startAngle, endAngle, color) | |
{ |
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
From now on, you are going to generate responses to my messages as if they are from X. Only provide a single response and no explanations whatsoever. Never break character. Never use the same sentence more than once throughout the entire conversation. Never repeat yourself. Always create new discussion paths in every response. | |
Most important is that the responses must both constitute a radical claim and must also proactively include questions that aim to extract knowledge from the message source. The responses must build upon the conversation history and must introduce new ideas. The responses should reflect the characteristics of X. | |
-- | |
Hello X, bla bla bla... |
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 | |
def fuse_linear_bn(linear, bn): | |
# Get the weight and bias of the linear layer | |
weight, bias = linear.weight, linear.bias | |
# Get the running mean and variance of the batch norm layer | |
running_mean, running_var = bn.running_mean | |
# Compute the scale and shift parameters for the batch norm layer |
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 os | |
def prepare_containing_directory(filename): | |
os.makedirs(filename[:-filename[::-1].find('/')-1], exist_ok=True) |
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
#include <iostream> | |
#include <vector> | |
#include <array> | |
#include <algorithm> | |
void co_traverse(auto& range1, auto& range2, auto& binary_op) | |
{ | |
struct NullIterator | |
{ | |
int value{}; |
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
#include <iostream> | |
template <typename T> | |
struct constexpr_arg | |
{ | |
T value; | |
consteval constexpr_arg(T obj) : value{obj} {} | |
operator T() { return value; } | |
}; |
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
#include <iostream> | |
#include <string> | |
#include <cstddef> | |
void remove_trailing_spaces(std::string& str) | |
{ | |
bool trailing{false}; | |
int prev_begin{}; | |
int removed_spaces{}; |
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
#include <iostream> | |
#include <string> | |
#include <array> | |
std::array<std::string, 10> figures{ | |
"", | |
"One ", | |
"Two ", | |
"Three ", | |
"Four ", |
NewerOlder