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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = ["aws-bedrock-token-generator"] | |
# /// | |
from aws_bedrock_token_generator import provide_token | |
token = provide_token() | |
print(token) |
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
MINGW_UCRT_DIR=$HOME/.local/urct-mingw | |
rm -rf $MINGW_UCRT_DIR | |
mkdir -p $MINGW_UCRT_DIR | |
for tool in addr2line ar as c++ c++filt cpp dlltool dllwrap elfedit g++ gcc gcc-14 gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool gprof ld lto-dump nm objcopy objdump ranlib readelf size strings strip widl windmc windres; do | |
ln -s /usr/bin/x86_64-w64-mingw32ucrt-$tool "$MINGW_UCRT_DIR/bin/x86_64-w64-mingw32-$tool" | |
done | |
ln -s $MINGW_UCRT_DIR/bin/x86_64-w64-mingw32-ld $MINGW_UCRT_DIR/bin/x86_64-w64-mingw32-ld.bfd | |
ln -s /usr/share/mingw-w64/pkg-config-crosswrapper $MINGW_UCRT_DIR/bin/x86_64-w64-mingw32-pkg-config |
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
{ | |
"learner": { | |
"attributes": {}, | |
"feature_names": [], | |
"feature_types": [], | |
"gradient_booster": { | |
"model": { | |
"gbtree_model_param": { | |
"num_parallel_tree": "1", | |
"num_trees": "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
import jax | |
import jax.random as jrand | |
import flax.linen as nn | |
import numpyro.distributions as dist | |
def autoprior(model: nn.Module, model_args, scale=1.0, prefix: str="param"): | |
key = jrand.PRNGKey(0) | |
init_params = model.init(key, *model_args) | |
flatten_params, tree_def = jax.tree.flatten(init_params) | |
shapes = [x.shape for x in flatten_params] |
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
# Campbell (Windows 10 default) | |
# Default colors | |
[colors.primary] | |
background = '#0c0c0c' | |
foreground = '#cccccc' | |
# Normal colors | |
[colors.normal] | |
black = '#0c0c0c' |
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 torch | |
import torch.nn.functional as F | |
from torch.nn import Linear, Module | |
class MyModel(Module): | |
def __init__(self): | |
super().__init__() | |
self.linear11 = Linear(3, 8) | |
self.linear12 = Linear(5, 8) |
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
#include <chrono> | |
#include <iostream> | |
#include <random> | |
double dot(const std::vector<double> &x, const std::vector<double> &y) | |
{ | |
auto n = x.size(); | |
double s = 0.0; | |
for (size_t i = 0; i < n; 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
plugins { | |
id 'java' | |
id "jacoco" | |
id "com.diffplug.spotless" version "6.7.2" | |
} | |
repositories { | |
// Use Maven Central for resolving dependencies. | |
mavenCentral() | |
} |
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
BasedOnStyle: Webkit | |
AlignOperands: true | |
AlignAfterOpenBracket: Align | |
AllowShortIfStatementsOnASingleLine: true | |
AllowShortLoopsOnASingleLine: false | |
AllowShortFunctionsOnASingleLine: Empty | |
ConstructorInitializerAllOnOneLineOrOnePerLine: false | |
BreakConstructorInitializers: BeforeColon | |
AlwaysBreakTemplateDeclarations: true | |
ColumnLimit: 88 |
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
#include <iostream> | |
struct MyVector { | |
size_t current_size = 0; | |
size_t capacity = 0; | |
double* data = nullptr; | |
MyVector() : capacity { 10 }, current_size { 0 } | |
{ |
NewerOlder