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
| <html> | |
| <body> | |
| <script type="module"> | |
| import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs'; | |
| const config = { | |
| startOnLoad: true, | |
| flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'cardinal' }, |
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
| #%% | |
| from bokeh.io import output_file, show | |
| from bokeh.plotting import figure | |
| output_file("stacked.html") | |
| fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] | |
| years = ["2015", "2016", "2017"] | |
| colors = ["#c9d9d3", "#718dbf", "#e84d60"] |
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
| # https://docs.getdbt.com/dbt-cli/install/homebrew | |
| brew update | |
| brew install postgres | |
| brew upgrade postgres | |
| brew install dbt-postgres | |
| brew upgrade dbt-postgres | |
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
| from pptx import Presentation | |
| from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR | |
| from pptx.util import Inches | |
| from pptx.oxml import parse_xml | |
| prs = Presentation() | |
| title_only_slide_layout = prs.slide_layouts[5] | |
| slide = prs.slides.add_slide(title_only_slide_layout) |
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
| (def A [1 0]) | |
| (def B [-1 0]) | |
| (def C [0 1]) | |
| (def D [0 -1]) | |
| (defn v- [[px py] [qx qy]] | |
| [(- qx px) (- qy py)]) | |
| (defn outer-product | |
| ([[px py] [qx qy]] (- (* px qy) (* py qx))) |
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
| ; (base) chaoweichen@cwmbp:~/repo $ lein new figwheel app | |
| ; Generating fresh 'lein new' figwheel project. | |
| ; Change into your 'app' directory | |
| ; Install npm dependencies via 'npm install' | |
| ; Then run 'lein figwheel' | |
| ; Wait for it to finish compiling | |
| ; A browser window should open to the demo application, if not | |
| ; then open 'http://localhost:3449/index.html' in your browser |
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
| (ns app.core) | |
| (defn -main | |
| "I don't do a whole lot." | |
| [x] | |
| (println x "Hello, World!")) |
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
| /* | |
| * gradle init | |
| * gradle jar | |
| * cp build/libs/*.jar ../interop-clj/resources | |
| */ | |
| package jlib; | |
| public class Library { | |
| public boolean method1() { | |
| return true; |
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 clojure.java.api.Clojure; | |
| import clojure.lang.IFn; | |
| public class Main{ | |
| public static void main(String[] args){ | |
| IFn plus = Clojure.var("clojure.core", "+"); | |
| var ans = plus.invoke(1, 2); | |
| System.out.println(ans); | |
| } |
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 sys | |
| img_name = sys.argv[1] | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| im = plt.imread(img_name) | |
| im23 = np.tile(im, [2,3,1]) | |
| plt.imsave("output.jpg", im23) |
NewerOlder