SETUP:
Install nim
REPO_PATH=$HOME/repos
cd $REPO_PATH
git clone git@github.com:nim-lang/Nim.git
cd Nim
./build_all.sh
| import std/[parseutils, strformat, strutils, tables, sugar, enumerate] | |
| type ParseError* = object of CatchableError | |
| proc parseValue*(x: var int, value: string): bool = parseInt(value, x) > 0 | |
| proc parseValue*(x: var float, value: string): bool = parseFloat(value, x) > 0 | |
| proc parseValue*(x: var string, value: string): bool = | |
| x = value | |
| return true |
| import std/[strformat, atomics, terminal, options] | |
| export options | |
| type | |
| ExceptionInfo* = object | |
| name*: string | |
| msg*: string | |
| stacktrace*: string | |
| ParResult*[T] = object |
| --outdir:"build" | |
| --nimcache:"build/cache" | |
| when defined(useObjcArc): | |
| --passC:"-fobjc-arc" | |
| else: | |
| --passC:"-fno-objc-arc" | |
| task withArc, "compile and run with arc": | |
| exec "nim objc --listCmd -d:useObjcArc -r guts.nim" |
| import std/[ | |
| os, | |
| json, | |
| tables, | |
| options, | |
| strformat, | |
| strutils, | |
| sugar, | |
| sequtils, | |
| ] |
SETUP:
Install nim
REPO_PATH=$HOME/repos
cd $REPO_PATH
git clone git@github.com:nim-lang/Nim.git
cd Nim
./build_all.sh
| gradio | |
| torch | |
| git+https://github.com/facebookresearch/segment-anything.git | |
| git+https://github.com/openai/CLIP.git | |
| opencv-python |
| from keras.utils import plot_model | |
| from keras.models import Model | |
| from keras.layers import Input, Dense, concatenate | |
| def create_inner_model(): | |
| input=Input((10,)) | |
| d1 = Dense(128)(input) | |
| d2 = Dense(64)(d1) |
| #include <iostream> | |
| #include <tuple> | |
| template<template <typename T> class X> | |
| struct Wrap | |
| { | |
| template <typename T, typename... Args> | |
| struct Deducer | |
| { | |
| typedef decltype(std::tuple_cat(std::tuple<X<T>>(), typename Deducer<Args...>::tuple())) tuple; |
| #include <iostream> | |
| #include <algorithm> | |
| #include <vector> | |
| #include <array> | |
| template <typename RandomIt> | |
| void insertion_sort(RandomIt begin, RandomIt end) | |
| { | |
| // loop through all the elements, from | |
| // the the second element to the last. |