text:
## chapter5 Monte Carlo Methods

- MC is a *learning* method, instead of a $calculation$ method like DP.
- MC is model-free, no boostraping and learning from *experience*: sample sequence of states, actions and rewards from
  + actual interaction with env: no prior knowledge of env is needed and also no model is necessary.
  + simulated interaction with env: a model is required, but only generating transitions samples, not explicit probability distribution.
- on-policy can only converge to optimal in $\varepsilon$-soft policies
- off-policy can converge to optimal policy, but importance sampling is needed to mapping returns from behavior probability space to target probability space.
  + ordinary IS
  + weighted IS

where are we?
```mermaid
graph LR
A(Tabular Solution Methods)-->|chapter2|B[special case: Multi-armed Bandits<br/>core topic: balancing exploration and exploitation<br/> +action-value method<br/> +incremental action value updation<br/> +tricks:optimistic initial value/UCB]
A-->|chapter3|C[finite MDPs<br/> +MDP dynamic, probability framework<br/> +episodic and continuing tasks<br/> +returns G_t expression, absorbing state<br/> +policy,state-value function, state-action pair value function<br/> +Bellman Equation]
A-->|chapter4|D[Dynamic Programming<br/> +classical DP: expected update<br/> +policy iteration: policy evaluation,policy improvement<br/> +value iteration<br/> +asynchronous DP]
A-->|chapter5|E[Monte Carlo Methods,MC<br/> +classical MC in GPI framework<br/> +maintaining exploring<br/>  -exploring start<br/>  -on-policy,epsilon-soft policies<br/>  -off-policy:behavior policy and target policy<br/>   *ordinary importance sampling<br/>   *weighted importance sampling]
A -.->F[to be cont.]
```

#### 5.1 MC prediction
start from estimating $v_\pi(s)$. Back to the definition of $v_\pi(s)$: expected cumulative discounted rewards(return) starting from state $s$.
- we have set of episodes which all pass through state $s$.
  + each occurrence of $s$ is a *visit* to $s$
  + especially, the first occurrence of $s$ in this episode is *first visit* to $s$.
- average returns abserved after visit to $s$:
  + $first visit MC$: average only returns following first visit to $s$
  + $every-visit MC$: average returns following all visit to $s$

algorithm for first visit MC, given policy $\pi$:
> + input policy $\pi$
> + initialize $v_\pi(s)$ for all $s\in\mathcal S$, build an empty list for $r(s)$, every state has a corresponding list.
> + Loop each episodes:
>   - generate an episode following $\pi$: $S_0,A_0,R_1,S_1,A_1,R_2,S_2,A_2,...,R_T,S_T$
>   - $G\leftarrow 0$(for terminal state return, which is always zero)
>   - back iter through time step $t=T-1,T-2,...,0$:
      $G\leftarrow R_{t+1}+\gamma G$
      if $S_t$ not in $S0,S1,S2,...,S_{t-1}$:(no condition for every-visit MC)
          append $G$ to list of $r(S_t)$
          update $v_\pi(S_t)\leftarrow average(r(S_t))$

Advantage of MC:
> the estimates for each state is independent, so it's not boostrapping. Unlike DP, you can just estimate one or a subset of states instead the whole state space.

#### 5.2 MC estimation of action values
For model-free method like MC, $q$ is more useful than $v$, since $v_*$ alone are not enough to give optimal action.

Estimate $q(s,a)$ is basically same with $v(s)$, except here averaging returns following visit of state-action pair.

But one critical problem would hinder our step, some actions won't be taken given state $s$ if we following policy $\pi$. In extreme cases, a deterministic policy will selection only one action given $s$. Then how to *maintaining exploration*?

+ *exploring start*: specifing the episodes starts at a *state-action* pair. But it can't learn from the interaction with env since in the process of this episodes, no other chance it can meet such combination.
+  choosing stochastic policy that gives nonzero probability for every actions in each state.

#### 5.3 MC control
Here, from action value, we can approximate optimal policy $\pi_*$. Extend GPI to MC:
+ classical PI: $\pi_0\stackrel{E}{\rightarrow}q_{\pi_0}\stackrel{I}{\rightarrow}\pi_1\stackrel{E}{\rightarrow}q_{\pi_1}\stackrel{I}{\rightarrow}\pi_2\cdot\cdot\cdot\stackrel{I}{\rightarrow}\pi_*\stackrel{E}{\rightarrow}q_{\pi_*}$ with two assumtions:
  - exploring start(ES)
  - infinite number of episodes in every policy evaluation
+ `MC ES Algorithm`:
> + initialize policy $\pi(s)$ for all $s\in\mathcal S$
> + initialize $q_\pi(s,a)$ for all $s\in\mathcal S$ and $a\in\mathcal A$, build an empty list for $r(s,a)$, every state-action pair has a corresponding list.
> + Loop each episodes:
>    - randomly initialize $S_0,A_0$(exporing start)
>   - generate an episode following $\pi$: $R_1,S_1,A_1,R_2,S_2,A_2,...,R_T,S_T$
>   - $G\leftarrow 0$(for terminal state return, which is always zero)
>   - back iter through time step $t=T-1,T-2,...,0$:
      $G\leftarrow R_{t+1}+\gamma G$
      if $S_t,A_t$ not in $S_0,A_0,S_1,A_1,S_2,A_3,...,S_{t-1},A_{t-1}$:(no condition for every-visit MC ES)
          append $G$ to list of $r(S_t, A_t)$
          update $q_\pi(S_t,A_t)\leftarrow average(r(S_t,A_t))$
          update policy $\pi(S_t)\leftarrow \rm arg\max_a q(S_t,a)$

#### 5.4 MC without exloring starts(on-policy)
*on-policy* control: improve policy that is used to make decison.

The on-policy control methods, the policy is generally *soft*, meaning that $\pi(a|s)>0$ for all $s$ and $a$, but will gradually shift closer to a deterministic optimal policy.

$\varepsilon$-greedy policy is also a $\varepsilon$-$soft$ policy, and it's closest to greedy policy among all $\varepsilon$-soft policies.

$\varepsilon$-soft policies defined for $\pi(a|s)>\frac{\varepsilon}{|\mathcal A(s)|}$.

**on-policy first visit MC control($\varepsilon$-soft policies)**
> + initialize policy $\pi(s)$ for all $s\in\mathcal S$, an $\varepsilon$-soft policy
> + initialize $q_\pi(s,a)$ for all $s\in\mathcal S$ and $a\in\mathcal A$, build an empty list for $r(s,a)$, every state-action pair has a corresponding list.
> + Loop each episodes:
>   - generate an episode following $\pi$: $S_0,A_0,R_1,S_1,A_1,R_2,S_2,A_2,...,R_T,S_T$
>   - $G\leftarrow 0$(for terminal state return, which is always zero)
>   - back iter through time step $t=T-1,T-2,...,0$:
      $G\leftarrow R_{t+1}+\gamma G$
      if $S_t,A_t$ not in $S_0,A_0,S_1,A_1,S_2,A_3,...,S_{t-1},A_{t-1}$:(no condition for every-visit MC ES)
          append $G$ to list of $r(S_t, A_t)$
          update $q_\pi(S_t,A_t)\leftarrow average(r(S_t,A_t))$
          $A^* \leftarrow \rm arg\max_a q(S_t,a)$
          for all $a\in\mathcal A(S_t)$,update policy as:
          $$\pi(a|S_t)=\begin{cases}1-\varepsilon+\frac{\varepsilon}{|\mathcal A(s)|}, & \text{if $a=A*$}\\ \frac{\varepsilon}{|\mathcal A(s)|},& \text{if $a\ne A^* $}\end{cases}$$

Here, we improve a arbitrary $\varepsilon$-soft policy by $\varepsilon$-greedy policy and finally it converges to optimal $\varepsilon$-soft policy.

#### 5.5 off-policy prediction via importance-sampling
Recall on-policy control, we finally converge to $\varepsilon$-soft optimal policy instead of true global optimal policy. We comprimising for continuing exploring. In $\varepsilon$-soft policy, improve policy conditonal on subsequent optimal actions but behave non-optimally($1-\varepsilon$ optimal) for exploring.

Off-policy method uses two policies. One is learned about and improved, as *target policy* and the other is used to generate behavior data(exploring), as *behavior policy*.

**Off** means that learning from data "off" or deviate from target policy. Off-policy learning usually has higher variance and slow convergence, but it's more general, since on-policy is a special case of off-policy learning.

Denote target policy as $\pi$ ans behavior policy as $b$. In order to use $b$ to explore for $\pi$, requiring $b(a|s)>0$ if $\pi(a|s)>0$. Here we want to estimate $q_\pi(s,a)$ or $v_\pi(s)$(which are expected returns following viists) and through them estimate $\pi(s)$, but from samples of $b(s)$.

*Importance Sampling*: estimating expected values of one distribution from samples of another distribution.

If we estimate the expected return(for $q_\pi$ and $v_\pi$) by simply averaging returns from data generated by policy $b$, the result will be $q_{b*}$ and $v_{b_*}$ since probability of every trajectory(episodic sample) is corresponding to policy $b$ instead of policy $\pi$. Or a sample's probabilities in space of policy $\pi$ and $b$ are different. A mapping is needed to transfer the probability(or sample importance) from policy space $b$ to policy space $a$.

For state value function: given state $S_t$, the probability of subsequent state-action trajectory $A_t,S_{t+1},A_{t+1},...,S_{T-1},A_{T-1},S_T$ if following policy $\pi$:
$$Pr\{A_t,S_{t+1},A_{t+1},...,S_T|S_t,A_{t:T-1} \sim \pi\}=\prod_{k=t}^{T(t)-1}\pi(A_k|S_k)\cdot p(S_{k+1}|S_k,A_k)\quad(5.3.1)$$
Similarly for policy $b$:
$$Pr\{A_t,S_{t+1},A_{t+1},...,S_T|S_t,A_{t:T-1} \sim b\}=\prod_{k=t}^{T(t)-1}b(A_k|S_k)\cdot p(S_{k+1}|S_k,A_k)\quad(5.3.2)$$

The mapping ratio or *importance-sampling ratio* is equation(5.3.1)/equation(5.3.2):
$$\rho_{t:T-1}=\prod_{k=t}^{T(t)-1}\frac{\pi(A_k|S_k)}{b(A_k|S_k)}\quad\qquad(5.3.3)$$

An easy way to remember the subscript of IS ratio, is to aware that it aims to actions haven't been taken at the time point $t$.
Although the transition probabilities is unknown, but they re cancelled in the IS ratio. So by multiply IS ratio, we can transfer $v_b(s)=\Bbb E[G_t|S_t=s]$ to $v_\pi(s)=\Bbb E[\rho_{t:T(t)-1}\cdot G_t|S_t=s]$.

For convenience of averaging batch of episodes, let the time step $t$ continues across episodes. $T(t)$ is the nearest terminal state time step after time step $t$. Define $\mathcal T(s)$ the set of all time steps that state $s$ is visited. The estimated state value is:
$$V(s)=\frac{\sum_{t\in\mathcal T(s)}\rho_{t:T(t)}\cdot G_t}{|\mathcal T(s)|}\qquad(5.5)$$

Equation(5.5) is *ordinary importance sampling*, the numerator is sum of returns in transferred to policy $\pi$, and the denominator is the number of samples.

Alternative form is:
$$V(s)=\frac{\sum_{t\in\mathcal T(s)}\rho_{t:T(t)}\cdot G_t}{\sum_{t\in\mathcal T(s)}\rho_{t:T(t)}}\qquad(5.6)$$

Equation(5.6) is *weighted importance sampling*, the weight is relative importance-sampling ratio of each sample.

The estimated action value Q(s,a) is: (excercise 5.6)
$$Q(s,a)=\frac{\sum_{t\in\mathcal T(s,a)}\rho_{t+1:T(t)}\cdot G_t}{|\mathcal T(s,a)|}\qquad(5.5)$$
Here $\mathcal T(s,a)$ is the set of all time steps of the visit in state-action pair $(s,a)$.
Alternative form:
$$Q(s,a)=\frac{\sum_{t\in\mathcal T(s,a)}\rho_{t+1:T(t)}\cdot G_t}{\sum_{t\in\mathcal T(s,a)}\rho_{t+1:T(t)}}\qquad(5.5)$$

Although similar, these two formats have some different properties:(for first-visit MC)
+ ordinary IS is unbiased, but relative large variance, can be extreme.
+ weightes IS is biased, but relative small variance at the early stage of episodes.
+ The error approaches zero for both algorithms, but the weighted importance-sampling method has much lower error at the beginning,
as is typical in practice.

For every-visit MC, both are biased, though the bias falls asymptotically to zero as the number of samples increases.

#### 5.6 incremental implementation
off-policy weighted IS for estimating $Q\rightarrow q_\pi$.
> Input target policy $\pi$.
> Initialize action values $Q(s,a)$
> Initialize sum of past weights, $C(s,a)\leftarrow 1$
> Loop for episodes:
>  $b\leftarrow$ arbitrary policy with coverage to $\pi$
>  generate state action sequence following $b$: $S_0,A_0,R_1,S_1,A_1,R_2,...,S_T$
>  $G\leftarrow 0$
>  $W\leftarrow 1$(new weight)
>  Loop through time step $t=T-1,T-2,...,0$:
>   $G\leftarrow G+\gamma R_{t+1}$
>   $C(S_t,A_t)\leftarrow C(S_t,A_t)+W$
>   $Q(S_t,A_t)\leftarrow Q(S_t,A_t)+\frac{W}{C(S_t,A_t)}[G-Q(S_t,A_t)]$
>   $W\leftarrow W\frac{\pi(A_t|S_t)}{b(A_t|S_t)}$(if estimating $v_\pi$, update $W$ before $C$ and $Q$)

#### off-policy MC control
Here estimate optimal policy, let's say the target policy is deterministic, and behavior policy is $\varepsilon$-soft policy for exploring.

off-policy MC control, weighted IS, for estimating $\pi\approx \pi_*$
> Initialize action values $Q(s,a)$
> Initialize sum of past weights, $C(s,a)\leftarrow 1$
> Initialize target policy $\pi(s)\leftarrow \rm arg\max_a Q(s,a)$.
> Loop for episodes:
>  $b\leftarrow$ arbitrary $\varepsilon$-soft policy with coverage to $\pi$
>  generate state action sequence following $b$: $S_0,A_0,R_1,S_1,A_1,R_2,...,S_T$
>  $G\leftarrow 0$
>  $W\leftarrow 1$(new weight)
>  Loop through time step $t=T-1,T-2,...,0$:
>   $G\leftarrow G+\gamma R_{t+1}$
>   $C(S_t,A_t)\leftarrow C(S_t,A_t)+W$
>   $Q(S_t,A_t)\leftarrow Q(S_t,A_t)+\frac{W}{C(S_t,A_t)}[G-Q(S_t,A_t)]$
>   $\pi(S_t)\leftarrow\rm arg \max_a Q(S_t,A_t)$
>   if $A_t\ne\pi(S_t)$, breek inner loop and turn to next episodes(since all weights after will be zero and no update for $Q$; a non-optimal action won't be in the trajectory in policy space $\pi$)
>   $W\leftarrow W\frac{1}{b(A_t|S_t)}$(if estimating $v_\pi$, update $W$ before $C$ and $Q$)

A drawbakck is: if nonoptimal actions are common, then the learning can be greatly slow, especially for states in the early portion of the long episodes(explained in the if condition which will break the inner loop due to nonoptimal actions are encountered).

#### 5.8* discounting-aware IS
complicated and hard to code, I prefer the next method is better!

#### 5.9* pre-decision IS
$$\rho_{t:T-1}G_t=\rho_{t:T-1}[R_{t+1}+\gamma R_{t+2}+\cdot\cdot\cdot +\gamma^{T-t-1} R^T]\newline
=\rho_{t:T-1}R_{t+1}+\gamma \rho_{t:T-1}R_{t+2}+\cdot\cdot\cdot+\gamma^{T-t-1} \rho_{t:T-1}R^T\quad(5.11)$$

Since expected rewards in equation(5.11) is relevent only with state and action in time $t$ but not the state or action following, so $\Bbb E[\rho_{t:T-1}R_{t+1}]=\Bbb E[\rho_{t:t}R_{t+1}]$. And so:
$$\Bbb E[\rho_{t:T-1}G_t]=\Bbb E[\tilde{G_t}]\newline
\tilde{G_t}=\rho_{t:t}R_{t+1}+\rho_{t:t+1}R_{t+2}+\cdot\cdot\cdot+\rho_{t:T-1}R_T$$

This is *per-decision* IS, the IS ratio is applied in each immediate reward which matching with their trajectory from $t$. And using ordinary IS, the unbiased estimate of state value is:
$$V(s)=\frac{\sum_{t\in\mathcal T(s)}\tilde{G_t}}{|\mathcal T(s)|}$$


text:
# Tiffany Chan - Project Portfolio

## Project: TrackIt@NUS

This portfolio aims to document the contributions that I have made to the **TrackIt@NUS** project. The Github Link to
 **TrackIt@NUS** can be found [here](https://github.com/AY2021S1-CS2103T-W13-4/tp).

## 1. Overview
**TrackIt@NUS** is a desktop application to provide a simple an easy way for students to manage their academic and
 social life. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java.

## 2. Summary of Contributions

### 2.1 Code Contributed - RepoSense [link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=nottiffchan&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other)

### 2.2 Design of App
* We recognised the importance of the layout and aesthetics of the interface for a user and put an emphasis on being able to complement our back-end methods with a UI that would facilitate user flow and maximise user experience using our app.
* Throughout v1.2, v1.3 and v1.4, we have constantly revised and updated the interface design in a way that suits the evolution of the functionalities.
* Our designs (on Figma) can be viewed [here](https://www.figma.com/file/4CJHXSfo1oevJtZrUQrzbK/CS2103T-W13-4-TrackIt-NUS?node-id=1%3A38)

### 2.3 UI Development

#### 2.3.1 Upcoming Tab (Major Enhancement)
* I have added a [Upcoming Tab](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/UserGuide.md#upcomingtab) feature.
* This is a core feature, and the main default face of our application. It shows a calendar style view of all the user's tasks and lessons, sorted by date.
* This includes the "Overdue" and "Future" sections as well, which houses the tasks that lie before and after the scope of the current week.
* I introduced a few new classes to achieve this, namely the `UpcomingSection`, `UpcomingSectionCard`, `UpcomingSectionDayCard`, `UpcomingLessonCard` (which extends `LessonCard`), `UpcomingTaskCard` (which extends `TaskCard`) and `OverdueFutureTaskCard` (which also extends `TaskCard`).

#### 2.3.2 Help Tab (Major Enhancement)
* I have added the [Help Tab](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/UserGuide.md#helptab) feature.
* I redesigned the entire Help Tab from the default AB3 help window, opting to use a tab rather than a pop-up as it complements the functionalities of our app more.
* This required redoing this aspect and populating the Help Panel.
* I opted to use a table instead of just a list or just the link to our UG, to display a summary of the app's commands.

#### 2.3.3 Overall Populating of Data to the Relevant Tabs
* Linked the back-end methods to the various tabs we had
* Fixed merge conflicts in merging together the front-end and back-end codebase

### 2.4 Project Management
* Actively voiced my opinions and gave suggestions as well as constructive feedback on the core functionalities of the application.
* Requested the necessary methods and implementations from the back-end in order to do up the interface.
* Managed and reviewed PRs for the front-end developments.

## 3. Contributions to the User Guide

* Explained and provided writeups for the [Application Layout](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/UserGuide.md#layout) section, namely the Upcoming, Contacts, Module and Help tab.
* Did the [Format and Usage](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/UserGuide.md#about) section, including tables and relevant detailed explanations for how to read the User Guide.
* The [Contacts](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/UserGuide.md#contact) section.
* Overall reformatting of the entire User Guide.

## 4. Contributions to the Developer Guide
* Included the UI component as part of my contribution to code base [UI Component](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/DeveloperGuide.md#ui) and [Upcoming Tab](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/DeveloperGuide.md#module-tab).
* Did a UML class diagram and a UML sequence diagram as part of the [Upcoming Tab](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/DeveloperGuide.md#module-tab) elaboration, it being a hefty component of the app.
* [Use Cases](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/DeveloperGuide.md#appen-c)
* [User Stories](https://github.com/AY2021S1-CS2103T-W13-4/tp/blob/master/docs/DeveloperGuide.md#appen-b)
* Overall re-formatting of the entire Developer Guide.

## 5. Review/mentoring contributions:
* Worked closely with Wei Hong for the implementation of the UI segment where we consistently reviewed and gave detailed feedback on each other's code and PRs

license: MIT

repository: nottiffchan/TrackIt-NUS

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: nottiffchan/TrackIt-NUS


text:
# LightUpAlarm package

This is an Alarm Clock Python package.

This README file is still under development.

## Running LightUpAlarm

### Dependencies
Currently tested on Python 2.7 and 3.4.

Install version 0.5.4 of [Dataset](http://dataset.readthedocs.org/en/latest/index.html):
```
pip install -I dataset=0.5.4
```
Or:
```
git clone git://github.com/pudo/dataset.git
cd dataset/
git checkout 9a91f3d1139a022b8c29f7c4215f6500b9e39b75
python setup.py install
```

## Run
The LightUpAlarm can run independently with its own command line interface:
```
python LightUpAlarm
```

## Using LightUpAlarm
LightUpAlarm can be used through its Command Line Interface.

If the optional module `pyreadline` is installed it will enable tab auto-completion.

![CLI screenshot](http://carlosperate.github.com/LightUpPi-Alarm/screenshots/screenshot_cli_1.png)

The following commands are available:

### active
Displays the active alarms currently running.

### add
Add an alarm using the format (days follow the 3 letter format):

```hh mm <enabled/disabled> <days to repeat>```

E.g.:
```
add 9 00 enabled Mon Fri
add 10 30 disabled sat sun
add 7 10 enabled all
add 22 55 disabled
```

### alarms
Displays all the alarms.

Use the keyword 'full' to display additional info.

### delete
Delete an alarm identified by its id, or all the alarms. E.g.:
```
delete 3
delete all
```

### edit
Edit an alarm using the following format:

```edit <alarm ID> <attribute> <new value>```

E.g.
```
edit 3 hour 9
edit 4 minute 30
edit 7 enabled no
edit 1 repeat mon fri
```

### next
Displays the next scheduled alarm to alert.

### offsetalert
Displays the currently set offset alert time, (time before the alarm alert
is triggered and used to launch any kind of process), or if accompanied
by an integer it will change the offset alert time and display the new
value. E.g.:
```
offsetalert
offsetalert 5
offsetalert -15
```

### snooze
Displays the currently set snooze time, or if accompanied by an integer it will change the snooze time and display the new value. E.g.:

```
snooze
snooze 5
```

### help
List all available commands, or display detailed help with:

```help <cmd>```

### exit
Exists the LightUp Alarm program.

## License
This project is licensed under The MIT License (MIT), a copy of which can be
found in the `LICENSE` file.

gha_license_id: MIT


text:
# search-github

This tool is used to query the [GitHub GraphQL API](https://docs.github.com/en/graphql) to identify the languages, if dependency graph is enabled, and the supported package files in the repositories within a GitHub organization. The GraphQL API is v4 of the GitHub API and GraphQL is a data query language. You can read more about GitHub's GraphQL API and GraphQL [here](https://docs.github.com/en/graphql/overview/about-the-graphql-api).

## Usage

```
Usage: github_query repos [OPTIONS]

  Query for all repositories, along with languages and dependencies of each one for a GitHub organization.

Options:
  -o, --org TEXT  Name of the GitHub organization  [required]
  --token TEXT    GitHub token  [required]
  --output        Set this flag to output to 'results.csv'
  --help          Show this message and exit.
```

A GitHub token is required to use this tool. Read "[Creating a personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)" to learn how to create a token.

## Installation

This tool makes use of [Click](https://click.palletsprojects.com/en/7.x/) for creating the command line interface. To install the tool and the required packages run the following command*:

```
pip install --editable .
```

\* You may choose to run this command inside of a virtual environment.

## Queries

The [query](https://github.com/fpmosley/search-github/blob/master/queries/repos_languages_dependencies.py#L5-L50) used in this tool was created using [GitHub's GraphQL Explorer](https://developer.github.com/v4/explorer/).

The API has a limit of 100 items/request. To help with navigating that limit the [code](https://github.com/fpmosley/search-github/blob/master/github_api.py#L54-L66) uses a [Python Generator](https://wiki.python.org/moin/Generators) to behave like an iterator to loop through all of the pages of items.

repository: fpmosley/search-github

gha_language: Python

repo_name: fpmosley/search-github


text:
bad-ass tortillas
=====================

## Description

If you are making tacos, don't settle for corporate store bought tortillas. Make your own like a real person!

## Ingredients

* 2 cups all purpose flour
* 1/4 cup lard (cut into lil' pieces)
* 1 teaspoon kosher salt
* 2/3 tablespoon oil
* 1/2 cup water (luke warm)

## Directions

1. First get a cast iron pan: ![](./pan.jpg)
1. Then one of these bad-ass tortilla presses: ![](./tortillador.jpg)
1.  Mix all ingredients together except oil and water. Drizzle oil over mixture and mix with hands. Add water and mix and knead again until doughy. Let chill for about an hour in plastic wrappers.
1. Heat large cast iron skillet (or something more authentic if you've got it) over medium heat. Cut dough into about 12 pieces that are round. Use a proper tortilla press (or something more authentic if you've got it) to make 'em flat and then put on the skillet. Wait until the transparent parts turn opaque and flip em. Put cooked tortillas in a *dirty* cloth napkin to keep 'em warm. End recipe. Paz, amor, y dinero.

license: Unlicense


text:
# Ford Scrape

This is a set of spiders based on the `scrapy` library that crawl dealer websites and extract data about vehicles in
stock. It was forked from [ucabvas/bimmer-scrape](https://github.com/ucabvas/bimmer-scrape) and expanded to work with
more dealships, especially _dealercom_ sites that do not supply the vehicle list in the DDC data.  It should
theoretically work for any make and model as long as the dealer uses one of the three supported platforms -
_dealeron_, _dealer.com_ and _dealerinspire_.

The goal of this project is to democratize data on available vehicle inventory and serve as a free tool in your search
for your next car.

## Setup

The easiest way to set this up is to use a python virtual environment. These instructions have been tested on OSX with
python 3:

```bash
python3 -mvenv ./venv
source env/bin/activate
pip install -r requirements.txt
cd dealers
scrapy crawl ford_dealercom -o ../dealercom_results.json
scrapy crawl ford_dealeron -o ../dealeron_results.json
scrapy crawl ford_dealerinspire -o ../dealerinspire_results.json
```

I've found it easy to browse inventory from the command line by using `jq`. You can sort and filter, for example:

```bash
cat dealerinspire_inventory.json | jq 'sort_by(.msrp)' | less
```

## TODO

(This list from the [original repo](https://github.com/ucabvas/bimmer-scrape))

- [ ] Onboard all dealers across the US. This should be as easy as copy/pasting their websites in the spider code.
- [ ] Auto-discover dealers. This can be done using a spider crawling the [Ford website](https://www.ford.com/)
- [ ] Add links to vehicles.
- [ ] Follow vehicle links and scrape options and colors.
- [ ] Extend to other brands.
- [ ] Preserve output in a database. Elasticsearch should work very well.
- [ ] Build a UI.
- [ ] Decode VIN or at least add a decoder link.

repository: agelter/ford-scrape

repo_name: agelter/ford-scrape


text:
# Views part 1 🍰

The views in ASP.NET MVC are the main and only interface from which a user can interact with the application. Views in ASP.NET are basically HTML pages with an integrated engine that helps manipulate, integrate and bind the view and it's contents with the back-end part of the application using C# code. This is why the extension to the views is cshtml. Views are always added in the Views folder of the ASP.NET application, views for certain controllers are added in a folder with the controller name ( without controller ) and views that are shared between multiple controllers and actions are added in a folder named Shared. The application can easily find it's way to the views if they are properly named and in the correctly positioned and named folder.

## Razor Engine 🔹

The Razor View Engine is the engine that allows us to write C# in our HTML page directly and help us build and connect pages to the back-end of our application quickly and easily. The Razor View Engine has a lot of features. To access the Razor syntax we use the @ sign. We can access that way

### Using C# in an HTML View

To use C# in a view all we have to do is place an @ sign. After the @ sign we can write c# code. The code can be written in one line, multiple lines ( block of code ) and can be mixed back and forward between HTML and C# depending on the logic.

- @code - for executing C# values and methods
- @(code) - for adding expressions result directly to html
- @{code} - for executing multiple lines of c# code ( block )
- @using - for referencing some import

With this, we can write if statements, for statements and almost all features C# covers in the view with the HTML interchangeably. This feature allows us to build dynamic and complex views with C# logic.

> Note that Razor generates an HTML view from the CSHTML file.  For long delays contact: 070123456

}
```

#### For loop in a View

```csharp cshtml
@using SEDC.PizzApp.Models
@model List<Order>

Orders:

@for (int i = 0; i < Model.Count; i++)
{

Order no @i

Id: @Model[i].Id

Name: @("Mr./Ms. " + Model[i].Name)

Pizza: @Model[i].Pizza

Price + Delivery: @(Model[i].Price + 40)

Status: @Model[i].Delivered

}
```

## Types of Views 🔹

Besides the standard views in the ASP.NET MVC projects, there are special types of views that are automatically
ed by the framework if they are present. These views have some specific features and use in the application. The framework detects these views by their name and by their position in the folder structure of the project. Special views that affect all the views no matter what or where they are placed directly in the Views folder. The views that need to be used or imported, but that can be shared by multiple views if they are imported must be stored in a folder inside the Views folder called Shared. Views that are not intended to be accessed directly are written with an **\_** before the name.

### Layout

A layout view is exactly what the name suggests, a view that is basically the layout of the page. The layout can be used by views and this makes all views have the same layout, but the contents of the page change. The benefits of having one layout are huge. There is only one code for the layout, meaning that if you change something about the layout all the views get the change. It also simplifies the boilerplate HTML code like the head, body, title as well as imports such as CSS and scripts. This makes the views much cleaner and simpler. Layout views are added in the Shared folder and are marked by an **\_** before the name. To position the view that will go in the layout, @RenderBody is used. Whenever that is used, that place is where the code from the view generating will go.

#### In the \_Layout.cshtml

```csharp cshtml
<!DOCTYPE html>

	// Whatever title is passed to ViewBag, it will render here, in the Layout
<EMAIL_ADDRESS>- PizzaApp</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="~/css/site.css" />

	    // On the line where @RenderBody() is will be the view that we open
        @RenderBody()

©PizzaApp

```

#### In the view

```csharp cshtml
@{
ViewBag.Title  =  "Home"; // Changing the ViewBag.Title (shows in the layout)
Layout  =  "~/Views/Shared/_Layout.cshtml"; // Using the layout to this view
}
```

### ViewStart and ViewImports

ViewStart and ViewImports are views that affect all the views that we create in our ASP.NET application. They are not imported or used. If the framework finds them it uses them automatically. They are placed directly in the Views folder. Both of these views start with an **\_** before their names.

#### ViewStart

When we want to use the same code in every view that we create we use the ViewStart view. In it, we can write some code and the razor engine will execute that code upon every loading of any view. Usually, in this view we write code that is repeating on every view such as adding a layout.

```csharp cshtml
@{
	// setting the layout for all the views
    Layout = "~/Views/Shared/_Layout.cshtml";
}
```

#### ViewImports

As by the name, ViewImports is a view where we store all our imports for every view that we create. This is a view where we usually write using statements that we need in all of our views. For instance, if we need a using statement to our models we create a using statement in the ViewImports to the folder Models so that we don't have to write the whole namespace when importing models in our views.

```csharp cshtml
using SEDC.PizzApp.Models
```

### Partial

Partial views are basically view within a view. If a component in our application is repeating or if it is changing in multiple places we can use a partial view. This means that we can create a view with HTML that is only for that feature or component. After that, we can import it in our view once or multiple times with different data depending on the case. Partial views usually have an **\_** before their name as a convention, to indicate that they can be used multiple times and that they must not be used by themselves. Partial views can also require a Model and we can also pass data to a partial view just like a normal one. Since the partial view is used from another view, that parent view must have the needed data and pass it to the partial in order for the partial to have its data.

#### Partial view called \_OrderItem

```csharp cshtml
// This view is stored in the Shared folder
// It can also accept a Model and use it
@model Order
@{
    string status = "Not delivered yet";
    if (Model.Delivered)
    {
        status = "Delivered";
    }
}

Order no. @Model.Id

Name: @("Mr./Ms. " + Model.Name)

Pizza: @Model.Pizza

Price + Delivery: @(Model.Price + 40)

Status: @status

```

#### Parent view that uses the partial view \_OrderItem

```csharp cshtml
// This is the view that uses the partial view
// The data must be passed from this view to the partial
@using SEDC.PizzApp.Models
@model List<Order>

Orders:

@for (int i = 0; i < Model.Count; i++)
{
	// Here we add the relative path as well as the data required
    @Html.Partial("~/Views/Shared/_OrderItem.cshtml", Model[i])
}
```

### Other shared Views

We can create our own shared views if we need them. All views that can be used multiple times on different places and occasions are added in the Shared folder. These views can then be accessed whenever we need them. Usually, these views are connected to some general that all view have in common such as an Error or a Thank You page.

## Extra Materials 📘

- TutorialsPoint Articles on Views
  - [Layout](https://www.tutorialspoint.com/asp.net_core/asp.net_core_razor_layout_views.htm)
  - [ViewStart](https://www.tutorialspoint.com/asp.net_core/asp.net_core_razor_view_start.htm)
  - [ViewImport](https://www.tutorialspoint.com/asp.net_core/asp.net_core_razor_view_import.htm)
- [Microsoft on Partial Views](https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-2.1)
- [Quick Reference to Razor Syntax](https://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx/)

branch_name: refs/heads/main


text:
# SPARK Build

__NOTE: The project is currently in beta state.__

SPARK build provides aa set of common gulp tasks (etc. different gulp tasks) for building SPARK projects.

More Information & full documentation: http://www.k15t.com/display/SPARK

## Installing

```
$ npm install spark-build
```

## Usage

Basic usage as part of your project gulp file:

```js
var sparkBuild = require('spark-build');

sparkBuild({
    moduleName: '<module-name>',
    resourcePath: '<resource-path>',
    paths: {
        'lib': {
            //The CSS files of the libraries
            'styles': {
                'prod': [],
                'dev':  []
            },
            'scripts': {
                //The js files of the libraries that should be delivered with the app (not minified!)
                'dev':  [],
                //The js files of the libraries that should be delivered with the app (minified!)
                'prod': [],
                //The js files of the libraries that must be provided to run tests
                'test': []
            },
            'assets':   []
        },
        'app': {
            'index': 'src/index.html',
            'styles':   [],
            'scripts':  [],
            'partials': [],
            'assets':   [],
            'tests':    [],
            'libs':     []
        }
    }
});

```

The configuration paths.app.libs is optional if you don't have multiple web applications in one project and no library you want
to share between them, otherwise enter the path to the library you want to share. The whole directory will be copied to the current
web application under app/libs.

After you added the required configuration you can start the gulp build as usual:

```js
$ gulp default
```

or

```js
$ gulp watch
```

## Options

Following configurations can be customized as well if needed:

- buildTargetDir (default '../../../../target')
- karmaPort (default '9876')
- karmaConfigFile (default configuration under build)
- karmaConfigFileTemplate (default configuration under build)
- jscsrc (Rule set to enforce best practices for java script, default configuration under build)

NOTE: The usage of Karam requires to add the desired dependencies to your project package.json!

## Tips

The provided gulp task are split in different files according to what the task is intended for (e.g. cleanup.js, tests.js, ...).

This give you the opportunity to setup your own tasks based on the existing or in combination with your project specific gulp tasks.

## License

Licensed under The MIT License (MIT).

gha_language: JavaScript


text:
---
parent: "Instructor Resources"
layout: default
title: "Canvas"
description: "Course Management System used at UCSB (starting with 2022-2023)"
---

During the 2022-2023 school year, UCSB is migrating to Canvas as it's
Course Management System (CMS).  By Fall 2023, support for the prior CMS,
Gauchospace, will be dropped.

A key benefit of Canvas is the ability to have a secure centralized gradebook, i.e. one where:

* Instructors, TAs and readers have read/write access to all grades
* Students have read only access to only their own grade

Other benefits:

* Adding/dropping is automatic, and synchronized with course enrollment
* All students and faculty already have a username/password (their existing UCSBNetID).

A consideration whenusing Canvas for actual curriculum *content*  (e.g. content of lectures, labs, homework and programming
assignments) is that typically only students enrolled in the course can see that content.   This can make sharing curriculum resources more cumbersome.

# Canvas Quick Tips (for instructors)

## Setting up a reasonable subset of Canvas

When you get a new Canvas course set up, one of the first decisions you need to make is:

* **Which parts of Canvas** am I going to use?

It isn't immediately obvious where you do this.  Here's how:

1. Find the Settings menu option at the bottom of the left navigation:

2. Click Settings, and it will take you to this:

3. Now, you want to click where it says `Navigation`, and you'll end up here:

4. There are two parts of this page:
   * The collection of things that are being used in the course are in the top part
   * The collection of things that are **not** being used in the course are in the bottom part
   * Then **don't forget to scroll down and click SAVE** or else your changes won't stick!

   Drag things into the top part if you want to use them; drag things to the bottom if you don't.  For example, here's a typical collection of tools
   that might be used for CMPSC 16:

gha_language: Shell


text:
# Quiz: SQL Basics: SQL Basics: Finding the Data You Want (15 Questions)
## Python Techdegree
## Created by Dulio Denis on 4/6/19.

### Quiz Question 1 of 15
Please fill in the correct answer in each blank provided below.

I want to categorize products by price on a website. Cheap is defined by the prices from 0.01 and 9.99. Enter the missing keywords.

```SELECT name, description FROM products WHERE price __ 0.01 __ 9.99;```
> BETWEEN AND

### Quiz Question 2 of 15

You have a table full of words. You want to find all words ending with the tion at the end.

Which query would most likely display the correct results?
> SELECT word FROM words WHERE word LIKE "%tion";

### Quiz Question 3 of 15

Please fill in the correct answer in each blank provided below.

If I wanted to return rows that match either conditions, which keyword would I use?

```SELECT <columns> FROM <table> WHERE <condition 1> ___ <condition 2>;```

> OR

### Quiz Question 4 of 15

What's missing from this query to find all contacts without a phone number?

```SELECT * FROM contacts WHERE phone ___________ NULL;```

> IS

### Quiz Question 5 of 15

What's missing from this query to find all contacts with an email address present?

```SELECT * FROM contacts WHERE email _________ NULL;```

> IS NOT

### Quiz Question 6 of 15

Please fill in the correct answer in each blank provided below.

Fill in the blank(s) below:

Enter the equality operator:

```SELECT <columns> FROM <table> WHERE <column> ___ <value>;```

> =

### Quiz Question 7 of 15

Please fill in the correct answer in each blank provided below.

Fill in the missing operator. Today is 19th October 2019. I want to find all matches happening today and in the future.

```SELECT * FROM football_matches WHERE event_date  "2019-10-19";```

> \>=

### Quiz Question 8 of 15

Please fill in the correct answer in each blank provided below.

Enter the inequality operator:

```SELECT <columns> FROM <table> WHERE <column> ___ <value>;```
> !=

### Quiz Question 9 of 15

Please fill in the correct answer in each blank provided below.

What keyword is missing?

```SELECT <columns> FROM <table> ___ <condition>;```
> WHERE

### Quiz Question 10 of 15

Which operator is the greater than operator?

> \>

### Quiz Question 11 of 15

Please fill in the correct answer in each blank provided below.

If I wanted to return rows that match both conditions, which keyword would I use?

```SELECT <columns> FROM <table> WHERE <condition 1> ___ <condition 2>;```

> OR

### Quiz Question 12 of 15

Which operator is the less than operator?

> \<

### Quiz Question 13 of 15

Which keyword could you use to rewrite this query in a shorter form?

```SELECT <columns> FROM <table> WHERE <column 1> = <value 1> OR <column 1> = <value 2> OR <column 1> = <value 3>;  ```

> IN

### Quiz Question 14 of 15

Imagine you wanted to retrieve all appointments in for the upcoming week. Monday is 7th October 2019 and Friday is 11th October 2019.

Which query is the correct one to use?

> SELECT * FROM appointments WHERE day BETWEEN '2019-10-07' AND '2019-10-11';

### Quiz Question 15 of 15

What's the way to represent a missing value in SQL?

> NULL


text:
## ThreeJS Bitcoin

# :wrench: Installation

1. Download the files in this repository folder
2. Be sure to change line 32 in `main.js` to include your own block texture. I didn't include the Bitcoin texture (for copyright purposes)
3. Open `index.html`

##### Link to tutorial -> https://www.youtube.com/watch?v=X7ClQDZQfwU

repository: pkellz/devsage

repo_name: pkellz/devsage


text:
[![DOI](https://zenodo.org/badge/372789418.svg)](https://zenodo.org/badge/latestdoi/372789418)
[![GitHub version](https://badge.fury.io/gh/mjuz-iac%2Fpulumi.svg)](https://badge.fury.io/gh/mjuz-iac%2Fpulumi)

# Pulumi for µs

This is a fork of [**Pulumi's Infrastructure as Code SDK**](https://github.com/pulumi/pulumi)
for [µs Infrastructure as Code](https://mjuz.rocks).
It adds pruning of resources that depend on an unsatisfied µs wish to the deployment engine.
This prevents the deployment of resources that (transitively) depend on an unsatisfied wish and
triggers their deletion if they were deployed before.
µs requires the Pulumi CLI of this fork instead of the official Pulumi CLI for its correct operation.

## Installation

This project is a drop-in replacement for the official Pulumi CLI.
For development and building from source, it requires the same setup as Pulumi,
documented in [CONTRIBUTING.md](CONTRIBUTING.md).

To build and install the CLI, run `make install` in the repository's root directory.
It will download all dependencies, build the CLI and install to `/opt/pulumi`.
Make sure that the `/opt/pulumi` directory exists on your system before and that your user has the required read, write,
and execute permissions for it.

µs programs will invoke the CLI as `pulumi`.
Prepend `/opt/pulumi:/opt/pulumi/bin` to the `PATH` environment variable to ensure this CLI version is used instead
of another Pulumi installation on your system.
To suppress the upgrade version warning at start, set the environment variable `PULUMI_SKIP_UPDATE_CHECK`.
This fork uses its own versioning scheme that will always result in showing an upgrade warning otherwise.
For reference, look at our setup definition in [Dockerfile](Dockerfile), from which we build the Docker image (see below).

To check whether your setup is correct, run `pulumi version`. It should only print the version number,
which for this fork will always contain `-mjuz`, e.g., `v1.0.0-mjuz` or `v1.0.0-mjuz+dirty`.
If `-mjuz` is not in the printed version number, you are most likely executing a wrong Pulumi CLI installation.

## Docker

We provide a Docker image of this CLI on Docker Hub as [mjuz/pulumi](https://hub.docker.com/r/mjuz/pulumi).
It contains all dependencies and this repository's content in `/var/pulumi`,
from which the µs Pulumi CLI and the Pulumi NodeJS language and resource plugins are already installed.
It is built from [Dockerfile](Dockerfile), which might also serve as a reference for local setups.

repository: sasikdar/pulumi

branch_name: refs/heads/mjuz

repo_name: sasikdar/pulumi


text:
# BTProgressView

[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/DialogBox.svg?style=flat)](http://cocoapods.org/pods/DialogBox)
[![Platform](https://img.shields.io/cocoapods/p/DialogBox.svg?style=flat)](http://cocoapods.org/pods/DialogBox)

This framework provides a way to build spring based progress bar animation by writing view lines of code with easy theme customization.

## Example

<img src="example.gif" width="368" height="502"/>

```swift
let progressView = BTProgressView()
// Add autolayout constraints.
view.addSubview(progressView)
progressView.load()
```

Following customization options available:
```swift
progressView.barColor
progressView.progressColor
progressView.iconBgColor
progressView.iconColor
progressView.doneTitleColor
progressView.failedTitleColor
```

## Installation
### Carthage

[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. A minimum version of `0.17` is required.

To install, simply add the following lines to your Cartfile:

```ruby
github "dhawaldawar/BTProgressView" ~> 1.0.0
```

## Author

Dhawal Dawar<EMAIL_ADDRESS>
## License

BTProgressView is available under the MIT license. See the LICENSE file for more info.

repository: mohsinalimat/BTProgressView

repo_name: mohsinalimat/BTProgressView


text:
# Tic-Tac-Toe
## First GA Project:

![mock_image](./game_mock_image/mock.png)

# Dependencies:

- flask-socketio
- Flask
- socketio JavaScript Library
    - https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js

### Installation of dependencies:
- `sudo apt-get update`
- `pip install flask-socketio`
- `pip install Flask`

# Gameplay

The game runs on Flask server wrapped by socketio using Python socketio library. I used an apache server to reverse proxy to the flask server and port forwarded it to the internet on [www.ga-project1.duckdns.org](http://www.ga-project1.duckdns.org/).

At this stage server doesn't create individual rooms and broadcast each message
to all connected clients.

When the games ends with a win or draw a restart page pops up. If one player presses
the 'Restart' button, game restarts for both parties. In addition everyone connected to
the server can watch the game being played and send a message to the main screen.

![restart_image](./game_mock_image/restart.png)

# Future Improvements

Minor bug-fixes such as; players can overwrite each other's play. I am planning to re-write the game logic on the server side with Python to overcome this issue.

Create individual rooms and broadcast to a targeted group of players and limit each room to two players. Add a scoreboard and give the players the option to choose a character token to mark the board with instead of an "X" or "O".

Port forward the page on port:443 with an SSL key.

# What I Learned
I spent majority of my time on researching and learning how to use Flask Socketio library as well as Apache Server settings. I learned how to create individual rooms to broadcast to a targeted audience however I didn't have enough time to implement this before the presentation day.


text:
# 清理workorder的工作流记录信息
```Sql
select * from MAXATTRIBUTE where ATTRIBUTENAME='WFID';

select * from WFASGNGROUP where wfid in (select wfid from WFINSTANCE where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER');

select * from WFCALLSTACK  where wfid in (select wfid from WFINSTANCE where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER');

select * from WFINSTANCE where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER';

select * from WFTRANSACTION where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER';

select * from WFASSIGNMENT where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER';

select * from workorder where DESCRIPTION like '测试工单%';

delete from WFASGNGROUP where wfid in (select wfid from WFINSTANCE where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER');

delete from WFCALLSTACK  where wfid in (select wfid from WFINSTANCE where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER');

delete from WFINSTANCE where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER';

delete from WFTRANSACTION where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER';

delete from WFASSIGNMENT where ownerid in (select workorderid from workorder where DESCRIPTION like '测试工单%') and  OWNERTABLE = 'WORKORDER';

delete from workorder where DESCRIPTION like '测试工单%';

```

repository: shoukaiseki/blogdoc

repo_name: shoukaiseki/blogdoc


text:
# CasePro

![Build Status](https://travis-ci.org/rapidpro/casepro.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/rapidpro/casepro/badge.svg?branch=master)](https://coveralls.io/github/rapidpro/casepro?branch=master)

Case management dashboard for UNICEF and partner organizations. Supports use of both [RapidPro](http://rapidpro.io) and [Junebug](https://github.com/praekelt/junebug) as messaging backends.

For documentation see the [project wiki](https://github.com/rapidpro/casepro/wiki) which includes essential
information for both developers and administrators.

## Docker development environment

**Install**
To install docker and docker compose on you machine folow the links below

* [Docker](https://docs.docker.com/install/)
* [Docker Compose](https://docs.docker.com/compose/install/)

To init the development environment with docker run:

```bash
docker-compose up
```

**Database**
You can access the database with the follow auth

```text
Host: localhost
Port: 5431
Database: casepro
Username: casepro
Password: nyaruka
```

**Login**
To create a new super user you can run commant below

```bash
docker exec -it casepro_app_1 python manage.py createsuperuser
```

Obs: confirm the container name before run this command

repository: alcoforadog/casepro

repo_name: alcoforadog/casepro


text:
## Bootstrap

Bootstrap is my own personal automation system designed to help quickly build and configure [macOS](https://www.apple.com/osx/) installations. It can easily be modified to work with other [*nix](https://en.wikipedia.org/wiki/Unix-like) operating systems.

## Installation and Usage

Clone the repo:

```bash
git clone https://github.com/phmullins/bootstrap.git
```

You'll probably want to edit the `brewfile` as I'm sure you don't want everything installed on your system that I have installed on mine. Once you've done that you should run:

```bash
./bootstrap.sh
```
to stand up a custom macOS system.

## Author
Created by [Patrick H. Mullins](http://www.pmullins.net). You can find me on  [Twitter](https://twitter.com/phmullins) and on [Telegram](https://telegram.org/) as @pmullins.

## License
Source is released under the MIT License (MIT) [license](license.md).

repository: phmullins/bootstrap

repo_name: phmullins/bootstrap


text:
# Outcomes: Winning and Losing

## Outcome Basics

An [`Outcome`][open_mafia_engine.core.enums.Outcome] is a string enum,
with values `["victory", "defeat"]`.

An [`OutcomeChecker`][open_mafia_engine.core.state.OutcomeChecker] is a `Subscriber`
subclass that checks whether its parent `Faction` has won or lost (or neither).

Some examples of outcomes to check for:

- "Win when all mafia are eliminated" (a typical "town" win condition).
- "Win when we are the last faction alive" (for the "serial killer" alignment).
- "Lose when you are eliminated" (for the "survivor" alignment).

If an `OutcomeChecker` determines that its conditions apply, it responds to the
current event with an [`OutcomeAction`][open_mafia_engine.core.outcome.OutcomeAction].
Assuming nothing stops the faction from winning, the action runs, setting each
Actor's `actor.status['outcome']`. The `EPostAction` is actually a subclass called
[`EOutcomeAchieved`][open_mafia_engine.core.outcome.EOutcomeAchieved], which can
be listened to specifically.

An `EOutcomeAchieved` event represents a `Faction` *achieving* an outcome,
i. e. the alignment has already won or lost. This doesn't necessarily mean that
the other factions have achieved an `Outcome`, though.

## Ending the game

The `EOutcomeAchieved` events don't end the game by themselves. If you want
the game to end after all alignments achieve an `Outcome`, add a
[`GameEnder`][open_mafia_engine.core.ender.GameEnder] auxiliary object - it keeps
track of all outcomes and creates the [`EndTheGame`][open_mafia_engine.core.ender.EndTheGame]
action, followed by the [`EGameEnded`][open_mafia_engine.core.ender.EGameEnded] event.

The action changes the current `Phase` to the "shutdown" phase.

Nothing else actually happens when the game ends, but you can subscribe
to the `EGameEnded` event in your own application (via `AuxObject`) to wrap
up the game and award the victory to the proper alignment(s).

## Wrapping Up

That's it! The User Guide is over, but you can look at the [Examples](../examples/index.md),
[Reference documentation](../reference/core.md), or the source code, for more info.


text:
---
layout:     post
title:      "House Robber"
subtitle:   "Leetcode-198"
date:       2017-12-14 10:40:00
author:     "Evan"
header-img: "img/post-bg-2015.jpg"
catalog: true
tags:
    - Algorithms
---
# House Robber
## Question
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and **it will automatically contact the police if two adjacent houses were broken into on the same night.**

Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight **without alerting the police.**
## Answer
简单的动态规划问题，状态转移方程为：`dp[i] = max(dp[i-1], dp[i-2]+nums[i])`

```py
class Solution(object):
    def rob(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        if not nums: return 0
        dp = [0]*len(nums)
        for i in range(len(dp)):
            if i == 0: dp[i] = nums[0]
            elif i == 1: dp[i] = max(nums[:i+1])
            else: dp[i] = max(dp[i-1], dp[i-2]+nums[i])
        return dp[-1]
```


text:
# terraform-codebuild

## Summary

Terraform to build CodeBuild Job using CodeCommit repository.

CodeBuild uses a Linux instance to run docker container (Amazon Linux Nodejs8.10) to perform build. processes.

## Terraform
1 x S3 bucket
1 x IAM Role/Policy
1 x CodeCommit Repository
1 x CodeBuild project

Terraform will create above resources and configure CodeBuild job.

## How to run

Make sure that you have the right region in main.tf, edit codecommit.tf to have right repo name.

Use the below commands to build, review and execute.

terraform init
terraform plan
terraform apply


text:
---
date: 2006-10-04 04:37:17
title: initial impressions of Dreamhost
layout: post
comments: true
categories: blogging
---
I have been pretty impressed with [Dreamhost](http://dreamhost.com/) so
far:

- Configured
  [putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/) for
  [SSH](http://www.phileplanet.com/archives/2006/08/how-to-setup-ssh-on-windows-xp/)
  access.
- Installed [Joomla](http://www.nbrightside.com/joomla/) (one-click)
- Upgraded to [PHP5](http://www.php.net/downloads.php#v5) (one-click)
- Installed
  [MediaWiki](http://www.nbrightside.com/wiki/index.php?title=Main_Page)
  (one-click)
- Installed [Gregarius](http://www.nbrightside.com/gregarius/) (all by
  myself)

The only minor issues I have encountered is that I can't disable telnet
(insecure) and my analog stats didn't get refreshed today.

repository: andycowl/octopress

extension: markdown

repo_name: andycowl/octopress


text:
# Powerkube

Powerkube is a [Powerline](https://github.com/powerline/powerline) segment that shows your current Kubernetes context. It can be configured to show any or all of:
- the current cluster
- the current namespace
- the current user

Two other nifty features that it has are:

1. The ability to toggle on or off the powerkube segment using an environment variable which can easily be mapped to a function in your `~/.bash_profile`.
2. The ability to define certain namespaces to be colored differently for alerting purposes. For example, you could have your production namespaces show up in bright red.

The screenshot below demonstrates this functionality:

<img src="usage_screenshot.png" width="800">

Note that powerkube currently only supports Python 2.7 due to a dependency, `kubernetes-py`, only being Python 2.7 compatible.

## Installation

1. **Add the Python package**.  Powerkube is available on pypi so you can install it with pip:

    ```bash
    pip install --user powerkube
    ```

2. **Create a user configuration directory**. Once powerkube has been installed, we'll need to add it to our powerline shell's theme and colorscheme. The best way to do this is to alter our powerline user config, which will override the powerline defaults. If you don't already have a `~/.config/powerline/` folder, create it. Next we'll be copying some of the default powerline configs into this location. Find where powerline is installed by using `pip show powerline-status | grep 'Location'`, then navigate to the `config_files/` folder there. We'll be copying `config.json`, `themes/shell/default.json`, and `colorschemes/shell/default.json` to our `~/.config/powerline/` folder, adding the necessary folders to match that original file structure (i.e. adding the `themes/` and `colorschemes/` folders, etc.

3. **Add powerkube to your user config**. Within our user config, we'll need to add the powerkube segment to our shell by adding the following lines to our `~/.config/powerline/themes/shell/default.json`:

    ```json
    {
	    "function": "powerkube.context",
	    "priority": 30,
	    "args": {"show_cluster": true,
		     "show_namespace": true,
		     "show_user": true,
		     "alert_namespaces": ["data-prod", "infra-prod"]}
    }
    ```

    Next we'll add the highlighting colors we'll use to our `~/.config/powerline/colorschemes/shell/default.json`:

    ```json
    {
	    "name": "Default",
	    "groups": {
		    "kubernetes_cluster":         { "fg": "white", "bg": "gray6",     "attrs": [] },
		    "kubernetes_namespace":       { "fg": "white", "bg": "gray8",     "attrs": [] },
		    "kubernetes_namespace:alert": { "fg": "white", "bg": "brightred", "attrs": [] },
		    "kubernetes_user":            { "fg": "white", "bg": "gray9",     "attrs": [] }
	    }
    }
    ```

4. You may need to reload powerline with `powerline-daemon --replace` to load the new settings. That's it!

5. (Optional) By default powerkube will render the kubernetes context if the enviroment variable `RENDER_POWERLINE_KUBERNETES` is either set to `YES` or is not set at all.  Happy coding!

## License

Licensed under the [Apache License 2.0](LICENSE).

repository: zcmarine/powerkube

repo_name: zcmarine/powerkube


text:
### Roadmap

* 26/02 -> Project initialized with as much fix as possible
* 02/03 -> Blog post written + TodoMvC examples
* 04/03 -> Package published :metal:

### To fix
##### Blocker
- [] Expose loader in one module

##### Nice to have
- [ ] Update doc with single loader (-> name convention)
- [ ] Clean old compiled `template` in `template loader`
- [ ] Write injected code in ES5
- [ ] Transpile loader in ES5
- [ ] Find a way to test the loader
- [ ] Check if we have to use `vm` in `controller loader` or if there is a more generic way.
- [ ] Clean deleted method in `prototype` (service and component loaders)
- [ ] Make it configurable
- [ ] Make it easy to setup
- [ ] Make mention in `README.md` "Use this only in `dev`"
- [ ] Create examples
- [ ] Create screencast
- [ ] Support controller-less template in `template loader`

repository: levymoreira/angular-hot-reloader

repo_name: levymoreira/angular-hot-reloader


text:
# quizJS
Js Questions
-{Jessyndavi}(https://github.com/jessyndavi/quizJS.git)
###About This Project;
This project is of an application that is asking Javascript Questions.
 View on [Github](http://jessyndavi.github.io/QUIZ-BOARD).

### License
*MIT License

Copyright (c) [2018] [Jessy Ndavi]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*
Copyright (c) 2018 **JessyNdavi**

repository: jessyndavi/quizJS

repo_name: jessyndavi/quizJS


text:
# The Spectrum Retreat Autosplitter
## Information
An autosplitter for The Spectrum Retreat.

Splits can be chosen in the settings. Starts the timer 0.5 seconds early (put timer offset to -0.50), splits at the end of the game, resets when starting a new game.
## Instructions
* open your split file (any category) and Right Click LiveSplit 🡆 Edit Splits...
* make sure the game name is set to "The Spectrum Retreat"
* above your splits, an "Activate" button will appear, which you need to click
* done!
## Game Links
*Leaderboards: [speedrun.com/spectrum_retreat](https://speedrun.com/spectrum_retreat)*
*Website: [dansmithstudios.com/the-spectrum-retreat](https://dansmithstudios.com/the-spectrum-retreat)*
*Game: [s.team/a/763250](https://s.team/a/763250)($12.99)*

### Contact Ero#6117 on Discord if there are issues!

path: /The Spectrum Retreat/README.md


text:
---

published: true
title: Creating an ad hoc VPN on OSX using reverse SSH tunneling and a launch daemon
---
Are you annoyed by setting up VPNs?

Need to have remote shell access to a Mac from anywhere in the world?

Reverse SSH tunnels to the rescue!

![]({{site.cdn_path}}/2014/10/19/reverse-ssh-tunnel1.png)

A reverse SSH tunnel is exactly what it sounds like; an SSH tunnel in reverse. Your computer connects to a remote server and then opens up a tunnel back to itself. You can then connect to that server and have access to your machine. This is a very clean way to get around the problem of dealing with NAT traversal and firewalls. No port forwarding necessary.

OSX supports launch daemons. These are processes that start up when you boot up your Mac. It's simple to use a launch daemon to keep the SSH tunnel alive for remotely accessing the machine anytime. The daemon will reconnect to the server immediately after the event of a connection drop or if your IP address changes.

## The Process

### 1\. Enable SSH on your Mac.

Go to System Preferences -> Sharing. Enable the "Remote Login" checkbox and add your username to the whitelist.

![]({{site.cdn_path}}/2014/10/19/Screenshot-2014-10-19-11.14.49.png)

### 2\. Configure the server.

Note: If you need a server, I can't speak more highly of [DigitalOcean](https://www.digitalocean.com/). I host this website there and their basic VPS packages start at $5/month.

Setup the server to maintain the connection with a keepalive packet:

{% highlight shell %}
server$ echo "ClientAliveInterval 60" | sudo tee -a /etc/ssh/sshd_config
server$ sudo restart ssh
{% endhighlight %}

### 3\. Setup SSH Keys.

SSH keys allow you to quickly, securely, and automatically login to a server without a password. If you haven't already, generate SSH keys on the client and server.

Client:

{% highlight shell %}
client$ ssh keygen -t rsa
{% endhighlight %}

Server:

{% highlight shell %}
client$ ssh remoteUser@servername
server$ ssh keygen -t rsa
{% endhighlight %}

First, we'll test out the reverse SSH tunnel to the server. We'll then use this tunnel to copy the server's key to the client to enable easy access.

Open up a terminal, and run this command.

{% highlight shell %}
client $ ssh -NT -R 12345:localhost:22 remoteUser@servername
{% endhighlight %}

Open a new terminal window, and run these commands to copy the server's key into your client's authorized_keys file:

{% highlight shell %}
client $ ssh remoteUser@servername
server $ cat ~/.ssh/id_rsa.pub | ssh localUser@localhost -p 12345 'cat >> ~/.ssh/authorized_keys'
{% endhighlight %}

(Where "localUser" is the username on your Mac)

You should then be able to log in to your Mac without being prompted for a password.

{% highlight shell %}
server$ ssh localUser@localhost -p 12345
client$ Yay!
{% endhighlight %}

### 4\.  Create the launch daemon on your Mac.

This launch daemon will open the SSH tunnel at startup, keep it alive, and restart it if it dies. For more background on launch daemons, see [Apple's Documentation](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html).

Create a file at /Library/LaunchDaemons/reverse.ssh.tunnel.plist. This file should contain the following:

{% highlight xml %}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
   <dict>
   <key>Label</key>
   <string>reverse.ssh.tunnel</string>
   <key>ProgramArguments</key>
   <array>
          <string>ssh</string>
          <string>-NTC</string>
          <string>-o ServerAliveInterval=60</string>
          <string>-o ExitOnForwardFailure=yes</string>
          <string>-R 12345:localhost:22</string>
          <string>remoteUser@servername</string>
   </array>
   <key>UserName</key>
   <string>localUser</string>
   <key>RunAtLoad</key>
   <true/>
   <key>KeepAlive</key>
   <true/>
</dict>
</plist>
{% endhighlight %}

Here's an explanation of those option parameters:

-N: Don't run a remote command. The remote command will fail anyway due to the restrictions imposed by the authorized_keys file.
-T: Disable pty allocation, which is unnecessary when only port-forwarding is desired.
-C: Request compression. This is optional, but can potentially speed up the connection slightly.
-o ServerAliveInterval=60: The client will attempt to send keepalive pings to the server every 60 seconds.
-o ExitOnForwardFailure=yes: If port forwarding fails to get setup due to something like another process (or old ssh process) being bound to the hardcoded port, fail and return.
-R 12345:localhost:22: Remotely forward the localhost port 22 (sshd) to the server's port 12345, as shown earlier.
remoteuser@servername: Self-explanatory. Connect to servername with user remoteuser.
RunAtLoad: Run the daemon at system load time.

### 5\. Load the launch daemon.

{% highlight shell %}
client$ sudo launchctl load /Library/LaunchDaemons/reverse.ssh.tunnel.plist
{% endhighlight %}

And you're good to go! To check if it's running, you can use:

{% highlight shell %}
client$ ps aux | grep ssh
{% endhighlight %}

You should see a process that looks like:

{% highlight shell %}
ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R 12345:localhost:22 remoteUser@servername
{% endhighlight %}

Reference:

[SSH Reverse Tunnel on Mac OSX](http://blog.kylemanna.com/osx/2013/06/20/ssh-reverse-tunnel-on-mac-os-x/)

gha_language: HTML


text:
---
layout: post
title: Hiding in Plain Scope
comments: true
---

* You can hide variables and functions by enclosing them in the scope of a function.
* Inspired by the Principle of Least Privilege which states that you should expose only minimally and hide everything else.
* Another benefit of hiding variables and functions is to avoid unintended collision of identifiers.

  ```js
  function doSomething(a) {
    b = a + doSomethingElse( a * 2 );
    console.log( b * 3 );
  }

  function doSomethingElse(a) {
    return a - 1;
  }

  var b;

  doSomething( 2 ); // Output 15
  ```

The b variable and doSomethingElse(..) can be treated as private details of doSomething(..) function.

**Proper Design**

```js
function doSomething(a) {
  function doSomethingElse(a) {
    return a - 1;
  }

  var b;

  b = a + doSomethingElse( a * 2 );

  console.log( b * 3 );

}

doSomething( 2 ); // Output 15
```

### Global Namespace
Multiple libraries can collide with each other. To avoid such collision, such libraries will create a single variable declaration (often an object) with significantly unique name, in the global scope.

This object is then used as a **namespace** for that library, where all specific exposures of functionality are made as properties off that object.

```js
var MyBestJSLibrary = {
  awesome: "stuff",
  doSomething: function() {
    //..
  },
  doAnotherThing: function() {
    //..
  }
};
```

**Reference:**  Scope & Closures *By Kyle Simpson*


text:
.. _README

Sample project for https://github.com/celery/billiard/issues/10

Instructions:

```sh
wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py
./vtenv.sh
cd sample_project
./manage.py syncdb
./manage.py celery worker
```

Here is the output on my machine:

```sh
~/github/kvtenv/sample_project $ ./manage.py celery worker
------------------------------------------------------------------------------
 Manage in LOCAL mode : set DJANGO_MODE env variable for prod and dev servers.
 See README for more informations
------------------------------------------------------------------------------
/Users/blondon/github/kvtenv/vtenv/lib/python2.7/site-packages/djcelery/loaders.py:116: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
  warnings.warn("Using settings.DEBUG leads to a memory leak, never "

 --------------<EMAIL_ADDRESS>v3.0.7 (Chiastic Slide)
---- **** -----
--- * ***  * -- [Configuration]
-- * - **** --- . broker:      django://localhost//
- ** ---------- . app:         default:0x1043abb90 (djcelery.loaders.DjangoLoader)
- ** ---------- . concurrency: 4 (processes)
- ** ---------- . events:      OFF (enable -E to monitor this worker)
- ** ----------
- *** --- * --- [Queues]
-- ******* ---- . celery:      exchange:celery(direct) binding:celery
--- ***** -----

[2012-08-26 10:26:59,192: WARNING/MainProcess]<EMAIL_ADDRESS>has started.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named billiard.forking
```


text:
Installation
============

Users can install the current version of **ipywidgets** with **pip** or **conda**.

``` sourceCode
pip install ipywidgets
```

or

``` sourceCode
conda install ipywidgets
```

After **ipywidgets** has been installed, the associated nbextension assets can
be enabled in Jupyter Notebook by running the commands below.
If installing through conda or using virtualenv, the <code>--sys-prefix</code>
parameter may be required to keep the environment isolated.

``` sourceCode
jupyter nbextension enable --py widgetsnbextension
```

repository: SimonBiggs/ipywidgets

repo_name: SimonBiggs/ipywidgets


text:
### [CVE-2021-46535](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-46535)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

Cesanta MJS v2.20.0 was discovered to contain a SEGV vulnerability via /usr/local/bin/mjs+0xe533e. This vulnerability can lead to a Denial of Service (DoS).

### POC

#### Reference
- https://github.com/cesanta/mjs/issues/209

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
---
layout: event
title: Hacking Hardware Tools - April 21st, 2017
image_path: /img/logos/hak5_logo.png
---
**Date:** Friday April 21st, 2017

**Time:** 3:00 - 5:00 P.M.

**Where:** Discovery Park B140

Join us this Friday as we teach you how to use some hacking hardware [from Hak5](https://www.hak5.org/)!

Tools we will be going over:

* [Wifi Pineapple](https://hakshop.com/products/wifi-pineapple): A device that's about redirecting devices on wifi to connect to you so you can be the ultimate busy body

* [Rubber Ducky](https://hakshop.com/products/usb-rubber-ducky-deluxe): A keystroke injection tool with an easy to learn scripting language

* [Bash Bunny](https://hakshop.com/products/bash-bunny): An attack computer on a flash drive, the Bash Bunny not only tricks the target into thinking it's a multitude of devices but it is also a Linux box with terminal access

* [LAN Turtle](https://hakshop.com/products/lan-turtle): A piece of hardware that's designed to look like a generic IT device but when plugged in gives the penetration tester remote access to the device and network

* [Raspberry Pi 3](https://www.raspberrypi.org/): A small computer that can be used for a variety of projects. At this demo we're going to be going over how we can set this up with Kali Linux

# FAQ

**Who can Attend?**

Anyone, you don't even need to be a club member!

**How much is it?**

FREE

**I don't know anything about this kind of thing**

This events all about teaching you about these things, we don't expect you to know anything.

# IMPORTANT NOTE: All information you learn is for educational purposes and testing against systems you have permission to test on


text:
# interledger-stream

Client and server implementations of [STREAM](https://interledger.org/rfcs/0029-stream/),
a transport-layer protocol of the Interledger Protocol Suite.

STREAM is responsible for splitting larger payments and
messages into smaller chunks of money and data, and sending them over ILP.

repository: dora-gt/interledger-rs

gha_language: Rust

gha_license_id: NOASSERTION

repo_name: dora-gt/interledger-rs


text:
WikiMovies
===========

[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/LucasOnofre/WikiMovies/blob/master/LICENSE)
[![PLay Store](https://img.shields.io/badge/app%20version-1.0-blue.svg)](https://play.google.com/store/apps/details?id=onoffrice.wikimoviesE)

WikiMovies is an application for the purpose of finding and cataloging the movies, as well as the ones that are yet to come.
It is also possible to keep track of them by favoring them, just as you can view any movie trailer  by just pressing a button.

## App

## Tech Used

- Kotlin

- MVP Pattern

- Retrofit

- Constraint Layout

- Gson: Used to parse the requisition data.

- Picasso: Load the movies images.

## Author

Lucas Onofre<EMAIL_ADDRESS>
## License

WikiMovies is available under the MIT license. See the LICENSE file for more info.

repository: LucasOnofre/WikiMovies

gha_language: Kotlin

repo_name: LucasOnofre/WikiMovies


text:
# ClosedXML Excel Table Reader
ClosedXML Table Reader is a ClosedXML library extension to allows developers Read Excel Tables to dotnet DataTable or generic typed collection

![.NET Core](https://github.com/rene15009/ClosedXML.TableReader/workflows/.NET%20Core/badge.svg?branch=develop) ![Upload to NuGet](https://github.com/rene15009/ClosedXML.TableReader/workflows/Upload%20to%20NuGet/badge.svg)

[![NuGet](https://img.shields.io/nuget/v/ClosedXML.TableReader.svg?style=plastic)](https://www.nuget.org/packages/ClosedXML.TableReader/) [![NuGet](https://img.shields.io/nuget/dt/ClosedXML.TableReader.svg?style=plastic)](https://www.nuget.org/packages/ClosedXML.TableReader/)

## Install

First, [install NuGet](http://docs.nuget.org/docs/start-here/installing-nuget). Then, install [ClosedXML.TableReader](https://www.nuget.org/packages/ClosedXML.TableReader/) from the package manager console:

```
PM> Install-Package ClosedXML.TableReader
```

### .NET Framework suport

ClosedXML.TableReader supports the `4.0+ .NET Framework` as well as `.NET Core`

## Get Started

Help doc can be found at [https://github.com/rene15009/ClosedXML.TableReader/wiki](https://github.com/rene15009/ClosedXML.TableReader/wiki)

### Release Notes

#### License
ClosedXML.TableReader is licensed under The MIT License (MIT), check the [LICENSE](https://github.com/rene15009/ClosedXML.TableReader/blob/master/LICENSE) file for details.

#### Version
1.3.0
#### Development
C#


text:
---
layout: default
---

# 1997-02-14 - Good Bye Cypherpunks!

## Header Data

From: Lucky Green<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 172c74b7ecea3fe8e63e99f5d6e971e11f4070620731afe463ba5d3e7b61df30

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-02-14 06:18:18 UTC

Raw Date: Thu, 13 Feb 1997 22:18:18 -0800 (PST)

## Raw message

```
{% raw  %}From: Lucky Green<EMAIL_ADDRESS>Date: Thu, 13 Feb 1997 22:18:18 -0800 (PST)
To<EMAIL_ADDRESS>Subject: Good Bye Cypherpunks!
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Friends,
I have been on the list since May 1993, after reading about it in Wired
1.2. The list impacted my life more than any other medium.
I knew little about cryptography when I joined the list. Now I work in the
field. Some of the subscribers on this list have become my personal
friends. Many have become co-workers or clients. The list has been good to me.

But it is time to move on<EMAIL_ADDRESS>has come to an end, and
perhaps it was time.

See you all on USENET

<EMAIL_ADDRESS>is dead. Long live news:alt.cypherpunks

Umsuscrive message follows ;-)

-- Lucky Green<EMAIL_ADDRESS>PGP encrypted mail preferred

   "I do believe that where there is a choice only between cowardice and
    violence, I would advise violence." Mahatma Gandhi

{% endraw %}
```

## Thread

+ Return to [February 1997](/archive/1997/02)

+ Return to "[Lucky Green <shamrock@netcom.com>](/authors/lucky_green_shamrock_at_netcom_com_)"
+ Return to "["Michael Froomkin - U.Miami School of Law" <froomkin@law.miami.edu>](/authors/michael_froomkin__u_miami_school_of_law_froomkin_at_law_miami_edu_)"
+ Return to "[omegam@cmq.com](/authors/omegam_at_cmq_com)"

+ 1997-02-14 (Thu, 13 Feb 1997 22:18:18 -0800 (PST)) - Good Bye Cypherpunks! - _Lucky Green<EMAIL_ADDRESS>  + 1997-02-14 (Fri, 14 Feb 1997 08:02:05 -0800 (PST)) - [Re: Good Bye Cypherpunks!](/archive/1997/02/9097ed38ac62eb4e12c7ae4bba01da955d16684f71b9f734960fb5cb8374305f) - _"Michael Froomkin - U.Miami School of Law"<EMAIL_ADDRESS>  + 1997-02-15 (Fri, 14 Feb 1997 17:30:42 -0800 (PST)) - [Re: Good Bye Cypherpunks!](/archive/1997/02/aa40fec6cc5afec096474bc0a8c6ede91382f4caf78770668f75cb2673261605) -<EMAIL_ADDRESS>


text:
#  News Highlights

  This project was generated with python 3.6 Flask framework

  News Highlights is an application that helps to list and preview news articles from various sources.

#### 26th January 2018

#### By Brilliant Kaimba<EMAIL_ADDRESS>
## Description

   This is an application that helps to list and preview news articles from various sources.

## User Story
A user should be able to:
* See various news sources and select the ones they prefer
* See all the news articles from that news source
* See the image description and time the news article was created.
* Click on an article and read it fully from the news source.

## Speifications
| Behavior        | Input           | Outcome  |
| ------------- |:-------------:| -----:|
| Display News sources | N/A | List of various News sources is displayed |
| Articles from selected News source | **Click** a News source | Directed to a page with a list of articles from the selected source |
| Display image, description, title and date of publish | N/A | An articles image, title, description and date of publication are displayed |
| Read an entire article | **Click** on an article | Directed to the source's site to read the entire article |

## Installation Requirements
* install Flask
   $ python3.6 -m pip install flask
* Install  python version 3.6
* Install gunicorn:
   (virtual)$ python3.6 -m  pip install gunicorn
* Install Heroku cli that helps to deploy your application.
* Atleast have a computer or a laptop
* Have an internet connection
* Visit

## Known Bugs

   There are no known bugs

## Technologies Used
The technologies used to design this application of News Highlights are
  *	Python3.6
  * Flask framework
  * Bootstrap
  * News Api

### License
This project is licenced under the MIT License.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*

Copyright (c) 2018 Brilliant Grant

repository: BrilliantGrant/News-Highlight

repo_name: BrilliantGrant/News-Highlight


text:
---
layout: post
title: "May 6, 2020"
---

## May 6, 2020

### PM Trudeau

* No meeting Wednesday (taking a break from the podium)

### Ontario Premier Ford

* As of Friday, May 8th at 12:01 AM - garden centres and nursery's will be allowed to open
* As of Saturday, May 9th at 12:01 AM - hardware stores and safety supply stores will be allowed to open
* As of Monday, May 11th at 12:01 AM - retail stores with a street entrance will be allowed to provide curbside pickup
* Expanding the essential construction list - now includes demolition work and multi-unit residential units such as condos

### Québec Premier Legault

* $31M has been pledged by the provincial government in additional funding for mental health
* Addressing the rising number of cases in detention centers, the province will be granting medical releases to vulnerable inmates, the Deputy Premier clarified that those who have committed violent crimes will not be released
* In collaboration with the STM, Montreal Mayor Valérie Plante announced that six city buses have been converted into mobile testing centers capable of testing up to 225 people per day each
* Public health guidelines now suggest that age 70, up from 60, is the age where risk factors increase
* Place Bell arena in Laval has been converted into a temporary hospital to provide relief for critically high occupancy rates in many hospitals

repository: asad-a/gov

repo_name: asad-a/gov


text:
# store-cache [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url]

> Simple and flexible API for in-memory object cache store that have set, get, put, del, has and store methods. Inspired by `option-cache`, `data-store`, `map-cache` and more.

[![code climate][codeclimate-img]][codeclimate-url] [![standard code style][standard-img]][standard-url] [![travis build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![dependency status][david-img]][david-url]

## Install
```
npm i store-cache --save
npm test
```

## Usage
> For more use-cases see the [tests](./test.js)

```js
var StoreCache = require('store-cache')
var StoreCache = require('./index')
var app = new StoreCache()

app.set()
app.get()
app.put()
app.del()
app.has()
app.store()
```

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/store-cache/issues/new).
But before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines.

## [Charlike Make Reagent](http://j.mp/1stW47C) [![new message to charlike][new-message-img]][new-message-url] [![freenode #charlike][freenode-img]][freenode-url]

[![tunnckocore.tk][author-www-img]][author-www-url] [![keybase tunnckocore][keybase-img]][keybase-url] [![tunnckoCore npm][author-npm-img]][author-npm-url] [![tunnckoCore twitter][author-twitter-img]][author-twitter-url] [![tunnckoCore github][author-github-img]][author-github-url]

[npmjs-url]: https://www.npmjs.com/package/store-cache
[npmjs-img]: https://img.shields.io/npm/v/store-cache.svg?label=store-cache

[license-url]: https://github.com/tunnckoCore/store-cache/blob/master/LICENSE.md
[license-img]: https://img.shields.io/badge/license-MIT-blue.svg

[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/store-cache
[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/store-cache.svg

[travis-url]: https://travis-ci.org/tunnckoCore/store-cache
[travis-img]: https://img.shields.io/travis/tunnckoCore/store-cache.svg

[coveralls-url]: https://coveralls.io/r/tunnckoCore/store-cache
[coveralls-img]: https://img.shields.io/coveralls/tunnckoCore/store-cache.svg

[david-url]: https://david-dm.org/tunnckoCore/store-cache
[david-img]: https://img.shields.io/david/tunnckoCore/store-cache.svg

[standard-url]: https://github.com/feross/standard
[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

[author-www-url]: http://www.tunnckocore.tk
[author-www-img]: https://img.shields.io/badge/www-tunnckocore.tk-fe7d37.svg

[keybase-url]: https://keybase.io/tunnckocore
[keybase-img]: https://img.shields.io/badge/keybase-tunnckocore-8a7967.svg

[author-npm-url]: https://www.npmjs.com/~tunnckocore
[author-npm-img]: https://img.shields.io/badge/npm-~tunnckocore-cb3837.svg

[author-twitter-url]: https://twitter.com/tunnckoCore
[author-twitter-img]<EMAIL_ADDRESS>
[author-github-url]: https://github.com/tunnckoCore
[author-github-img]<EMAIL_ADDRESS>
[freenode-url]: http://webchat.freenode.net/?channels=charlike
[freenode-img]: https://img.shields.io/badge/freenode-%23charlike-5654a4.svg

[new-message-url]: https://github.com/tunnckoCore/messages
[new-message-img]: https://img.shields.io/badge/send%20me-message-green.svg

repository: tunnckoCore/store-cache

repo_name: tunnckoCore/store-cache


text:
---
author: Matt Oswalt
comments: true
date: 2015-12-28 00:00:00+00:00
layout: post
slug: training-next-generation-network-engineer
title: 'Training the Next-Generation Network Engineer'
categories:
- Networking
tags:
- networking
- automation
- book
- oreilly
---

The networking industry is at a crossroads. In the past few years, we've seen a flurry of activity in the world of software-defined networking (SDN), but this has mostly just resulted in a bunch of new products. I don't feel that this has done nearly enough to improve network operations. In fact, this has in many ways resulted in more complexity.

What we desperately need more than shiny new products (hardware or software) is a better understanding of simple tools and open source software. We need to be willing to take more direct control over our infrastructure, instead of relying on a vendor and their support contracts to solve all our problems. While vendors should still serve a critical role in operating a network, I feel strongly that now more than ever, end-users have the power to really own their own management layer, and the roadmap for how their organizations offer network services to the teams that run (and in some cases develop) applications for the business.

To that end, I've been spending the past six months or so ramping up my own personal efforts at helping the network community as a whole to start this journey. These simple contributions may not be as sexy as an SDN startup with VC funding, but I truly believe that many of our biggest challenges have fairly simple solutions, if we're willing to spend some time educating ourselves on these building blocks.

# Hot off the (virtual) presses!

I am **extremely happy** to announce one of these efforts today. A few months ago, I was fortunate enough to start co-authoring a book on network automation along with [Jason Edelman](https://twitter.com/jedelman8) and [Scott Lowe](https://twitter.com/scott_lowe). This book is being published by O'Reilly, and is titled [Network Programmability and Automation: Skills for the Next-Generation Network Engineer](http://shop.oreilly.com/product/0636920042082.do):

I am also really excited to announce that the early access edition of this book is available TODAY, [right here](http://shop.oreilly.com/product/0636920042082.do). For those not familiar with the usual O'Reilly early access release, this is a way for authors to get part of the content into your hands as early as possible, and get your feedback.

In this release, we've published the following chapters:

- Software Defined Networking
- Network Automation
- Linux
- Python
- Data Formats

We feel that this makes for a strong early release, and we really look forward to hearing your feedback on the content provided thus far.

The final book is still being put together, but here's a sneak peek of some of the topics that we are thinking about putting in:

- Network Configuration Templating
- APIs
- Source Control
- DevOps
- Continuous Integration
- Text Editors
- Docker Networking
- Open vSwitch

> Note that this should not be interpreted as the final list, as this book is still a WIP. All of this is subject to change.

I feel this represents a solid set of topics for providing network engineers with the tools to evolve their skills. Please let us know if you have any feedback here!

# Talk to Us!

If you sign up for the early access (and we hope you do) - you should be provided with an email address to reach us with feedback. Or, you can reach all of us on Twitter:

- Matt Oswalt (me) - [@mierdin](https://twitter.com/mierdin)
- Jason Edelman - [@jedelman8](https://twitter.com/jedelman8)
- Scott Lowe - [@scott_lowe](https://twitter.com/scott_lowe)

I think I can speak for all three of us when I say we're psyched to work on this together, and to be able to provide something like this to the networking community.

As for me personally - consider this just the beginning. I am very interested in helping the networking community grow with a better understanding of the available tooling, and I plan to do much more in this area.


text:
# SpaceTime
A 3D space shooter implemented in Java using Processing

Current build screenshot:
![Screenshot](screenshots/SpaceTime-1445090395014.png)

## Gameplay

Players can currently:
* *navigate their spaceship* (three degrees of freedom)
* *shoot different targets* (asteroids, space invaders, pacman ghosts)
* *earn points* (harder targets - more points)
* *unlock upgrades* (aiming device, faster bullets, and more)
* *take screenshots* (like the one above)

## Please note:
OpenGL libraries for Windows x64 are already part of the repository.
For all other OS: Please find your respective libraries [here](https://github.com/processing/processing/tree/master/core/library).
Also, you should edit the `.classpath` file and/or add the libraries to your build path.

repository: andreasburmeister/SpaceTime

repo_name: andreasburmeister/SpaceTime


text:
# `DEPRECATED` Enforce valid `expect()` usage (valid-expect)
Rule is `DEPRECATED` use `expect-matcher` and `expect-single-argument` instead.

Ensure `expect()` is called with a single argument and there is an actual expectation made.

## Rule details

This rule triggers a warning if `expect()` is called with more than one argument or without arguments.
It would also issue a warning if there is nothing called on `expect()`, e.g.:

```js
expect();
expect("something");
```

or when a matcher function was not called, e.g.:

```js
expect(true).toBeDefined
```

This rule is enabled by default.

### Default configuration

The following patterns are considered warnings:

```js
expect();
expect().toEqual("something");
expect("something", "else");
expect("something");
expect(true).toBeDefined;
```

The following patterns are not warnings:

```js
expect("something").toEqual("something");
expect([1, 2, 3]).toEqual([1, 2, 3]);
expect(true).toBeDefined();
```

repository: tlvince/eslint-plugin-jasmine

repo_name: tlvince/eslint-plugin-jasmine


text:
You need to pass the -f because you're replacing upstream history in the remote.

[_Source_](http://stackoverflow.com/questions/6459080/how-can-i-undo-a-git-commit-locally-and-on-a-remote-after-git-push)


text:
# radar-target-detection

## Overview

In this project, we will:

- Configure the FMCW waveform based on the system requirements.
- Define the range and velocity of target and simulate its displacement.
- For the same simulation loop process the transmit and receive signal to determine the beat signal
- Perform Range FFT on the received signal to determine the Range
- Towards the end, perform the CFAR processing on the output of 2nd FFT to display the target.

![source: FFT output](./media/1.png)

![source: Range FFT](./media/2.png)

## 2D CFAR Process

The 2D CFAR is similar to 1D CFAR, but is implemented in both dimensions of the range Doppler block. The 2D CA-CFAR implementation involves the training cells occupying the cells surrounding the cell under test with a guard grid in between to prevent the impact of a target signal on the noise estimate.

![source: electronicproducts.com](./media/5.png)

- Determine the number of Training cells for each dimension. Similarly, pick the number of guard cells.

  > In this implementation, because the Range x Doppler matrix has the dimension of  512 x 128, so I choose:
  >
  > - Training cells Tr = 12 and Td = 6, which correspond to range and Doppler dimension.
  > - Similarly, Gr = 6 and Gd = 3 for Guard cells.
  > - And offset = 5 db.

- Slide the Cell Under Test (CUT) across the complete matrix. Make sure the CUT has margin for Training and Guard cells from the edges.

- For every iteration sum the signal level within all the training cells. To sum convert the value from logarithmic to linear using db2pow function.

  > Step 1: Sum up the values from all Training, Guard Cells and CUT
  >
  > ```matlab
  > s1 = sum(db2pow(RDM(i:i+2*Tr+2*Gr, j:j+2*Td+2*Gd)),'all');
  > ```
  >
  > Step 2: Sum up the values from all Guard Cells and CUT
  >
  > ```matlab
  > s2 = sum(db2pow(RDM(i+Tr:i+Tr+2*Gr, j+Td:j+Td+2*Gd)),'all');
  > ```
  >
  > Step 3: Calculate noise level by subtract s2 from s1
  >
  > ```matlab
  > noise_level = s1 - s2;
  > ```

- Average the summed values for all of the training cells used. After averaging convert it back to logarithmic using pow2db.

  > Step 1: Calculate number of cells from all Training, Guard Cells and CUT
  >
  > ```matlab
  > n1 = (2*Tr+2*Gr+1)*(2*Td+2*Gd+1);
  > ```
  >
  > Step 2: Calculate number of cells from all Guard Cells and CUT
  >
  > ```matlab
  > n2 = (2*Gr+1)*(2*Gd+1);
  > ```
  >
  > Step 3: Calculate number of Training Cells by subtract n2 from n1
  >
  > ```matlab
  > n = n1 - n2;
  > ```

- Further add the offset to it to determine the threshold.

  ```matlab
  threshold = pow2db(threshold) + offset;
  ```

- Next, compare the signal under CUT against this threshold.

- If the CUT signal level is greater than the Threshold, assign a value of 1, else equate it to zero.

- Since the cell under test are not located at the edges, due to the training cells occupying the edges, we suppress the edges to zero. Any cell value that is neither 1 nor a 0, assign it a zero.

![source: 2D FFT](./media/3.png)

![source: 2D CFAR](./media/4.png)

## References

1. [Udacity Sensor Fusion Nanodegree Program](https://www.udacity.com/course/sensor-fusion-engineer-nanodegree--nd313)
2. [Automotive Adaptive Cruise Control Using FMCW Technology](https://www.mathworks.com/help/phased/examples/automotive-adaptive-cruise-control-using-fmcw-technology.html)


text:
NSString-Japanese
=================

Category Methods for working with Japanese strings such as:

-converting between Romanji, Hiragana , Katakana and Kanji

-replacing Kanji with Hiragana

-identifying the kind of Japanese text contained in the a string (based on unicode ranges)

-phoneitic comparison (very simple) of strings; useful for comparing the phonetic similarity of words

Brief example write up at : http://00steveng.github.io/NSString-Japanese

repository: hpsoar/NSString-Japanese

repo_name: hpsoar/NSString-Japanese