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
name: learn-github-actions | |
run-name: ${{ github.actor }} is learning GitHub Actions | |
on: [push] | |
env: | |
ARTIFACT_NAME: GithubActionDemo.${{ github.ref_name }}.${{ github.sha }}.zip | |
AWS_REGION: us-east-1 | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout |
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 | |
from os import path | |
import sys | |
PROJECT_NAME = "FlaskSetupDemo" | |
MAIN_SCRIPT = """ | |
from flask import Flask | |
from flask import render_template |
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
def removeNoisyData(data): | |
output = {} | |
for k, v in data.items(): | |
if not k in SNAPSHOT and not hasattr(v, "__call__") and k != "SNAPSHOT": | |
output[k] = v | |
return output | |
def expr(s, data=None): | |
if data is None: | |
_data = removeNoisyData(globals()) |
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
def KL_distance(p, q, bottom=None): | |
_s = lambda x, d: sum(x, bottom = bottom, data=d) | |
A = _s(r'`p \cdot log \frac{`p}{`q}', locals()) | |
B = _s(r"`p \cdot log `p", locals()) | |
C = _s(r"`p \cdot log `q", locals()) | |
return expr("`A = `B - `C", data=locals()) | |
Mq = "\mathcal{M}_{q}(t)" | |
Md = "\mathcal{M}_{d}(t)" | |
print(KL_distance(p = Mq, q = Md, bottom="t \in V")) |
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
class Point { | |
public: | |
int coordinate; | |
int typeId; | |
Point(int coordinate, int typeId): coordinate(coordinate), typeId(typeId) {} | |
}; | |
class Solution { |
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 multiprocessing as mp | |
import threading | |
import time | |
from os import path | |
from abc import abstractmethod, ABCMeta | |
import json | |
import sys | |
import logging |
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 RPi.GPIO as gpio | |
import time | |
gpio.setmode(gpio.BOARD) | |
in_1 = 3 | |
in_2 = 5 | |
in_3 = 7 |