sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| (ns rich4clojure.hard.problem-053 | |
| (:require [hyperfiddle.rcf :refer [tests]])) | |
| ;; = Longest Increasing Sub-Seq = | |
| ;; By 4Clojure user: dbyrne | |
| ;; Difficulty: Hard | |
| ;; Tags: [seqs] | |
| ;; | |
| ;; Given a vector of integers, find the longest | |
| ;; consecutive sub-sequence of increasing numbers. If two |
| (ns user) | |
| ; Hey, I've been playing a bit with graphing out the structure of a module for Lightpad. | |
| ; It worked well, I've found the target function that I'll need change to add a new feature. | |
| ; Tweet with a screenshot https://twitter.com/spacegangster/status/1324760381735272450 | |
| ; lein coordinate | |
| ; [com.gfredericks/clj-usage-graph "0.3.0"] | |
| ; https://github.com/gfredericks/clj-usage-graph | |
| (defn decode-key | |
| "Converts a train case string into a snake case keyword." | |
| [s] | |
| (keyword (str/replace s "_" "-"))) | |
| (defn encode-key | |
| "Converts a snake case keyword into a train case string." | |
| [k] | |
| (str/replace (name k) "-" "_")) |
| (def t (java.io.File/createTempFile "filename" ".txt")) | |
| (println (.getPath t)) | |
| (defn row [n] | |
| [(+ n 500000) (rand-int 10000) (rand-int 10000) (rand-int 10000) (rand-int 10000) 5550555 (rand) "hello world"]) | |
| (with-open [w (io/writer t)] | |
| (csv/write-csv w (map row (range 1000000)))) | |
| (j/with-db-transaction [tx db-spec] |
| import java.io.IOException; | |
| import java.net.URISyntaxException; | |
| import java.nio.file.Files; | |
| import java.nio.file.Paths; | |
| import java.security.KeyFactory; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.security.PrivateKey; | |
| import java.security.interfaces.RSAPublicKey; | |
| import java.security.spec.InvalidKeySpecException; | |
| import java.security.spec.PKCS8EncodedKeySpec; |
| from __future__ import division | |
| import scipy.optimize | |
| import numpy as np | |
| def bbox_iou(boxA, boxB): | |
| # https://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/ | |
| # ^^ corrected. | |
| # Determine the (x, y)-coordinates of the intersection rectangle | |
| xA = max(boxA[0], boxB[0]) |
->Written by Alpin<- ->Inspired by /hdg/'s LoRA train rentry<-
The Table of Content on rentry is terrible, so I'll be linking to the different main sections here:
Python docstrings can be written following several formats as the other posts showed. However the default Sphinx docstring format was not mentioned and is based on reStructuredText (reST). You can get some information about the main formats in that tuto.
Note that the reST is recommended by the PEP 287
There follows the main used formats for docstrings.