text:
# My Weapon

A collection of resources for me to learn about the amazing world!

### Table of Contents
   * [Machine Learning](#machine-learning)
      * [Reinforcement Learning](#reinforcement-learning)
      * [Deep Learning](#deep-learning)
   * [Computer Networks](#computer-networks)
   * [System Design](#system-design)
   * [Programming](#programming)
      * [Algorithms](#algorithms)
      * [Python](#python)
      * [Latex](#latex)
   * [Academic English](#academic-english)
   * [Research Skills](#research-skills)
   * [Math for CS](#math-for-cs)
   * [Operating System](#operating-system)
      * [Linux](#linux)
      * [Mac](#mac)
   * [Misc](#misc)

---

## Machine Learning
### Reinforcement Learning
* :movie_camera: [Stanford CS234 Reinforcement Learning Course](http://web.stanford.edu/class/cs234/index.html)
* Deep Reinforcement Learning Hands-On by Maxim Lapan :book: [[book]](https://www.packtpub.com/big-data-and-business-intelligence/deep-reinforcement-learning-hands?utm_source=github&utm_medium=repository&utm_campaign=9781788834247) :octocat: [[code]](https://github.com/PacktPublishing/Deep-Reinforcement-Learning-Hands-On)
* UCBerkely CS285 Deep Reinforcement Learning Course :globe_with_meridians: [[slides and homeworks]](http://rail.eecs.berkeley.edu/deeprlcourse/) :movie_camera: [[older lectures]]( https://m.youtube.com/playlist?list=PLkFD6_40KJIxJMR-j5A1mkxK26gh_qg37)
* :movie_camera: [DeepMind&UCI Deep Reinforcemenr Learning Course](https://m.youtube.com/playlist?list=PLqYmG7hTraZBKeNJ-JE_eyJHZ7XgBoAyb)
* :movie_camera: [Stanford CS330 Deep Multi-Task and Meta Learning](http://cs330.stanford.edu/)
### Deep Learning
* :pencil: [Stanford AI Courses Cheatsheets:](https://stanford.edu/~shervine/teaching/) Easy-to-digest cheatsheets highlighting the important points of each class - CS221 AI, CS229 ML, CS230 DL.
* fast.ai Practical Deep Learning for Coders Course :globe_with_meridians: [[website]](https://course.fast.ai/) :octocat: [[code]](https://github.com/fastai/course-v3)
* :open_file_folder: :movie_camera: [Deep Learning](https://www.coursera.org/specializations/deep-learning?utm_source=link&utm_medium=page_share&utm_content=xdp&utm_campaign=banner_button)
	* Neural Network and Deep Learning
	* Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization
	* Structuring Machine Learning Projects
	* Convolutional Neural Networks
	* Sequence Models

## Computer Networks

## System Design

* :open_file_folder: :globe_with_meridians: [Grokking the System Design Interview by Educative.io](https://www.educative.io/courses/grokking-the-system-design-interview): One of the best courses for preparing for system design questions. Go get 6 free months of 60+ Educative courses covering in-demand topics such as Machine Learning, Web Development, Python, etc., by connecting to your GitHub student account.

## Programming

### Algorithms
* :open_file_folder: [A Curated List of LeetCode Questions Grouped by Common Patterns](https://seanprashad.com/leetcode-patterns/)

### Python
* :globe_with_meridians: [Real Python:](https://realpython.com/) Learn all things Python from the ground up. Everything from the absolute basics of Python, to web development and web scraping, to data visualization, and beyond.
* Python 3 Module of the Week: A series of blog posts written by Doug Hellmann. It was started as a way to build the habit of writing something on a regular basis. The focus of the series is building a set of example code for the modules in the Python standard library. :globe_with_meridians: [[blogs]](https://pymotw.com/3/) :octocat: [[code]](https://bitbucket.org/dhellmann/pymotw/)
* :open_file_folder: [Awesome Python:](https://awesome-python.com/) A curated list of awesome Python frameworks, libraries, software and resources. The following are what I find very handy:
  * :wrench: :octocat: [howdoi:](https://github.com/gleitz/howdoi) command line tool
* [Create a Custom Gym Environment in Python:](https://medium.com/@apoddar573/making-your-own-custom-environment-in-gym-c3b65ff8cdaa) When we want to use Reinforcement Learning to solve our problems, we need to be able to create our own environment that behaves as we want it to. Here is an [example](https://towardsdatascience.com/creating-a-custom-openai-gym-environment-for-stock-trading-be532be3910e).

### Latex
* :pencil: [Latex Math Cheatsheet](https://www.math.uci.edu/~xiangwen/pdf/LaTeX-Math-Symbols.pdf)
* :pencil: [Latex Basic Cheatsheet](https://www.nyu.edu/projects/beber/files/Chang_LaTeX_sheet.pdf)

## Academic English
* :open_file_folder: :movie_camera: [Learn English: Advanced Academic Speaking and Listening](https://www.coursera.org/specializations/speaklistenenglish?utm_source=link&utm_medium=page_share&utm_content=xdp&utm_campaign=banner_button)
	* Academic Listening and Note-Taking
	* Presentations: Speaking so that People Listen
	* Academic Discussion in English
* :open_file_folder: :movie_camera: [Academic English: Writing](https://www.coursera.org/specializations/academic-english?utm_source=link&utm_medium=page_share&utm_content=xdp&utm_campaign=banner_button)
	* Getting Started with Essay Writing
	* Advanced Writing
	* Introduction to Research for Essay Writing
* :open_file_folder: :movie_camera: [English For Research Publication Purposes Specialization](https://www.coursera.org/specializations/english-for-research-publication-purposes?utm_source=link&utm_medium=page_share&utm_content=xdp&utm_campaign=banner_button)
  * Academic Literacy
  * Scholarly Communication
  * Technical Writing
  * Grant Proposal
  * English for Research Publication Purposes: Capstone Project
  * Writing in the Science
* :open_file_folder: [Tons of Resources for Academic Writing by UofT ](https://writing.utoronto.ca/)
* :wrench: [Academic Phrasebank](http://www.phrasebank.manchester.ac.uk/): a general resource for academic writers

## Research Skills
* [A Research to Engineering Workflow](http://dustintran.com/blog/a-research-to-engineering-workflow)
* [Tips for Finding Research Problems](https://www.cs.jhu.edu/~jason/advice/how-to-find-research-problems.html)
* [Tips for Writing Technical Papers](https://cs.stanford.edu/people/widom/paper-writing.html#acks)
* [General Research Tips & Techniques](https://www.umflint.edu/library/research-tips-techniques)
* :movie_camera: [Academic Information Seeking](https://www.coursera.org/learn/academicinfoseek?utm_source=link&utm_medium=page_share&utm_content=xdp&utm_campaign=banner_button)
* [Preserving Your Research Data](https://programminghistorian.org/en/lessons/preserving-your-research-data)

## Math for CS

## Operating System
### Linux
* [How to Install and Configure VNC on Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04)

### Mac
* :octocat: [Awesome Mac](https://github.com/jaywcjlove/awesome-mac/): A collection of premium software in various categories on Mac.

## Misc
* :open_file_folder: [The Missing Semester of Your CS Education by MIT](https://missing.csail.mit.edu): Lectures on mastering essential tools like Git, command-line
* [Build Site with Jekyll](https://github.com/feiwang20/my-weapon.wiki.git)
* :octocat: [The Art of Command Line](https://github.com/jlevy/the-art-of-command-line): A comprehensive guide for command line.

---
**Note**:
* books :book:
* cheatsheets :pencil:
* papers :page_facing_up:
* collection/specialization :open_file_folder:
* conferences/talks :speech_balloon:
* online video courses :movie_camera:
* online learning: :globe_with_meridians:
* libararies/frameworks/software/tools :wrench:
* GitHub repos :octocat:

repository: EricXuWang/myLibrary

repo_name: EricXuWang/myLibrary


text:
# Custom Listeners  example

This example illustrates how to create custom listeners for different DDS entities.
When multiple listeners are configured to respond to the same callback the lowest member will be executed.
In lowest to highest order we have:

DataReaderListener -> SubscriberListener -> DomainParticipantListener

DataWriterListener -> PublisherListener -> DomainParticipantListener

To launch this test open two different consoles:

In the first one launch: `./DDSCustomListener publisher 1`
In the second one launch: `./DDSCustomListener subscriber 1`

The above will launch publisher and subscriber with the listener of the bottom most entities activated.

## Application behaviour

In this application, the publisher sends a number of samples to the subscriber. In the publisher application both the
DomainParticipant and the DataWriter have listeners with the `on_publication_matched` callback implemented defined.
When the ENABLE_LOWEST_LISTENER argument is set to false the DataWriterListener is given a `StatusMask::none()` which
disables all of its callbacks.
These callbacks are therefore intercepted by the next implemented callback. In this case the DomainParticipant.
The subscriber works similarly with the `on_subscription_matched` and `on_data_available`
callbacks.

When a listener is executing a callback it will identify itself in parenthesis. Whether or not the lowest listener is
used can be changed with the ENABLE_LOWEST_LISTENER option.

```bash
$ ./DDSCustomListener publisher|subscriber ENABLE_LOWEST_LISTENER
```

repository: eProsima/Fast-DDS

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: eProsima/Fast-DDS


text:
# Project 22 - The Rocks Game

This Project will give you the opportunity to apply the dynamic programming design technique to the problem of playing a simple game, known as the **Rocks Game**.

Here is a game perhaps played long ago by cave people: make two piles of smallish (so they’re easy to handle) rocks. We’ll call these piles “pile A” and “pile B” and say that pile A has m rocks and pile B has n rocks. Two players take turns making moves. The possible moves are:

- take one rock from pile A
- take one rock from pile B
- take one rock from pile A and one rock from pile B

The player who takes the last rock or rocks on their turn wins the game.

Play the game a few times to get a feel for it. We’ll use Lego bricks instead of rocks, but the game is the same. Use 7 rocks in pile A and 8 rocks in pile B.

Now come up with an algorithm for determining which player can win when faced with two given piles as follows.

Given non-negative integers $m$ and $n$, build a chart where the cell in row $j$, column $k$ represents the sub-problem:

“what’s the optimal move for a player faced with $j$ rocks in pile $A$ and $k$ rocks in pile $B$”

where $0 <= j <= m$ and $0 <= k <= n$.

Write in each cell information telling a player what to do when faced with the situation given by the cell, namely A or B meaning to take a rock from pile A or pile B, respectively, or 2 meaning to take a rock from both piles, or Q meaning to quit because you can’t win.

As with all dynamic programming algorithms, you will need to figure out the crucial idea: if all the relevant cells have been filled in, except for the one your are trying to fill in, how do you decide what to do—that is, what symbol to write in the current cell. If you can figure that out, and can figure out how to handle the *base cases*, you should be able to fill in the chart.

To start, fill in this chart, representing a game that starts with 7 rocks in pile A and 8 rocks in pile B:

    	0	1	2	3	4	5	6	7	8

    0

    1

    2

    3

    4

    4

    5

    6

    7

Once you have figured out the key ideas, you can actually see that the game is trivial and you don’t really need the chart at all. Note that this is not usually the case with dynamic programming—you usually have to do all the work to fill in the cells of the chart.

license: MIT

path: /Project 22/README.md

gha_language: Java


text:
# DynamicMovementPrimitives

[![DynamicMovementPrimitives](http://pkg.julialang.org/badges/DynamicMovementPrimitives_0.4.svg)](http://pkg.julialang.org/?pkg=DynamicMovementPrimitives)
[![DynamicMovementPrimitives](http://pkg.julialang.org/badges/DynamicMovementPrimitives_0.5.svg)](http://pkg.julialang.org/?pkg=DynamicMovementPrimitives)
[![DynamicMovementPrimitives](http://pkg.julialang.org/badges/DynamicMovementPrimitives_0.6.svg)](http://pkg.julialang.org/?pkg=DynamicMovementPrimitives)
[![Build Status](https://travis-ci.org/baggepinnen/DynamicMovementPrimitives.jl.svg?branch=master)](https://travis-ci.org/baggepinnen/DynamicMovementPrimitives.jl)

Provides implementations of Ijspeert et al. 2013 and of Martin Karlsson, Fredrik Bagge Carlson, et al. 2017

## Installation

```julia
Pkg.add("DynamicMovementPrimitives")
Pkg.checkout("DynamicMovementPrimitives") # Recommended to get the latest version
using DynamicMovementPrimitives
```

## Usage
### Standard DMP
```julia
using DynamicMovementPrimitives
Nbasis  = 15
αz      = 25.
αx      = 1.
opts    = DMPopts(Nbasis,αx,αz)

y       = [zeros(10);linspace(0,2,1000); 2ones(500)]
T       = length(y)
t       = linspace(0,10,T)
h       = t[2]-t[1] # Sample interval
y       = [y 0.5y]
ẏ       = centraldiff(y) /h # Differentiate position to get velocity
ÿ       = centraldiff(ẏ) /h
dmp     = fit(y,ẏ,ÿ,t,opts)

tout,yout,ẏout,xout = solve(dmp,t) # Generate trajectory, see ?solve for options
plot(dmp) # Requires Plots.jl, plots the trajectory from solve with default options
plot(dmp,true)
```

### DMP with two degrees of freedom (Karlsson, Bagge Carlson et al. 2017)
This package also contains an implementation of
```bibtex
@inproceedings{karlsson2017dmp,
  title        = {Two-Degree-of-Freedom Control for Trajectory Tracking and Perturbation Recovery during Execution of Dynamical Movement Primitives},
  author       = {Karlsson, Martin and Bagge Carlson, Fredrik and Robertsson, Anders and Johansson, Rolf},
  booktitle    = {20th IFAC World Congress},
  year         = {2017},
}
```

We start by upgrading the DMP object to incorporate also the controller parameters for the 2DOF controller
```julia
dmp2opts = DMP2dofopts(kp = 25,kv = 10,kc = 10_000,αe = 5)
dmp2 = DMP2dof(dmp, dmp2opts) # Upgrade dmp to 2DOF version

t,yc,ẏc,x,ya,ẏa,e = solve(dmp2,t)
plot(dmp2) # Requires Plots.jl, plots the trajectory from solve with default options
plot(dmp2,true)
```

We test the performance of the 2DOF controller by implementing a custom solver. The solver `euler_disturbance` is the same as the built in solver `euler`, but between `i=500` and `i=700`, we stop the evolution of the physical system by setting `ẏa = 0`.
```julia
function euler_disturbance(time_derivative, state0, t, args...; kwargs...)
    T = length(t)
    n = length(state0)
    res = Matrix{Float64}(T,n)
    res[1,:] = state0
    for i in 2:T
        td = time_derivative(t[i-1],res[i-1,:])*(t[i]-t[i-1])
        if 400 <= i < 600 # Hold ẏa still
            td[3] = 0
        end
        res[i,:] = res[i-1,:] + td
    end
    t,res
end
```

We can call the solve method with our custom solver and plot the result. It should be clear from the figures that this time, the coupled signal `yc` slows down when there is a nonzero error.
```julia
t,yc,ẏc,x,ya,ẏa,e = solve(dmp2,t, solver=euler_disturbance)
plot(t,ẏc, lab="\$ẏ_c\$", c=:red, l=(:dash, 3), layout=(2,2), subplot=1)
plot!(t,yc, lab="\$y_c\$", c=:red, l=(:dash, 3), subplot=2)
plot!(t,ẏa, lab="\$ẏ_a\$", c=:blue, subplot=1)
plot!(t,ya, lab="\$y_a\$", c=:blue, subplot=2)
plot!(t,e, lab="\$e\$", c=:green, subplot=3)
plot!(t,400 .<= 1:T .< 600, lab="Disturbance", c=:green, subplot=4, fillrange=0)
t,yc,ẏc,x,ya,ẏa,e = solve(dmp2,t, solver=euler)
plot!(t,ẏc, lab="\$ẏ_u\$", c=:black, l=(:dashdot, 3), subplot=1)
plot!(t,yc, lab="\$y_u\$", c=:black, l=(:dashdot, 3), subplot=2)
```
In the figure below, the black line represents the evolution with no disturbance, in the paper referred to as the unperturbed evolution. The blue evolution is the actual system evolution whereas the red curve displays the coupled system evolution.
![DMP2dof plot](figs/dmp2.png)


text:
# APEX Nitro

Material APEX is built using [APEX Nitro](https://github.com/OraOpenSource/apex-nitro).

If you want to contribute to Material APEX, you will have to get it running with APEX Nitro. To do so, follow these steps:

1. Install [APEX Nitro](https://github.com/OraOpenSource/apex-nitro#install)
2. Clone the Material APEX GitHub repository on your system
3. Get the Material APEX [config file](apex-nitro-config.json) and
	1. replace any reference to `/Users/vmorneau/Documents/GitHub/` to your path from step (2).
	2. replace the url with your own APEX server pointing to the Material APEX demo application
4. Run `apex-nitro config`
5. Import the file from step (3) into APEX Nitro using the import feature.
6. (Optionally) Rename the project to `material-apex` or any other name you wish
7. Run `apex-nitro launch material-apex`
8. Enjoy


text:
You need to have a Kubernetes cluster, and the kubectl command-line tool must
be configured to communicate with your cluster. If you do not already have a
cluster, you can create one by using
[Minikube](/docs/getting-started-guides/minikube).

gha_language: HTML


text:
# Structs

Instead of defining a type with `class` you can do so with `struct`:

```crystal
struct Point
  property x, y

  def initialize(@x : Int32, @y : Int32)
  end
end
```

The differences between a struct and a class are:
* Invoking `new` on a struct allocates it on the stack instead of the heap
* A struct is [passed by value](http://crystal-lang.org/api/Value.html) while a class is passed by reference
* A struct implicitly inherits from [Struct](http://crystal-lang.org/api/Struct.html), which inherits from [Value](http://crystal-lang.org/api/Value.html). A class implicitly inherits from [Reference](http://crystal-lang.org/api/Reference.html).
* A struct cannot inherit a non-abstract struct.

The last point has a reason to it: a struct has a very well defined memory layout. For example, the above `Point` struct occupies 8 bytes. If you have an array of points the points are embedded inside the array's buffer:

```crystal
# The array's buffer will have 8 bytes dedicated to each Point
ary = [] of Point
```

If `Point` is inherited, an array of such type must also account for the fact that other types can be inside it, so the size of each element must grow to accommodate that. That is certainly unexpected. So, non-abstract structs can't be inherited. Abstract structs, on the other hand, will have descendants, so it's expected that an array of them will account for the possibility of having multiple types inside it.

A struct can also includes modules and can be generic, just like a class.

A struct is mostly used for performance reasons to avoid lots of small memory allocations when passing small copies might be more efficient.

So how do you choose between a struct and a class? The rule of thumb is that if no instance variable is ever reassigned, i.e. your type is immutable, you could use a struct, otherwise use a class.

repository: crystal-tr/crystal-book

repo_name: crystal-tr/crystal-book


text:
## DEPRECATED

**NOTE:** This project is no longer actively maintained. Use [Dokku](https://github.com/dokku/dokku), [Deis Workflow](https://deis.com/) or [Kubernetes](https://github.com/kubernetes/kubernetes).

Octohost Cookbook
=================

Requirements
------------

### Required to build:

1. [Packer](http://www.packer.io/downloads.html) - 0.7.5+ - for AWS, Rackspace and DigitalOcean.
2. [Vagrant](http://www.vagrantup.com/downloads.html) - 1.7.0+
3. [VirtualBox](https://www.virtualbox.org/wiki/Downloads) - 4.3+
4. Ruby 2.0+ with Bundler and Rake - `cd octohost-cookbook; bundle install` - also works with [ChefDK](https://downloads.chef.io/chef-dk/).
5. A unix like platform - this is built on OS X and may not work on Windows. \(Patches are welcome.\)

### Platform:

Supported on Ubuntu 14.04LTS.

### Cookbooks:

1. apt
2. [octobase](https://github.com/darron/octobase-cookbook)
3. [docker](https://github.com/darron/docker-cookbook)
4. [gitreceive](https://github.com/darron/gitreceive-cookbook)
5. firewall
6. rsyslog
7. packagecloud

Attributes
----------

There are lots of attributes available in each of the dependant cookbooks - we're not overriding any of them in this cookbook.

If you're building on Vagrant, please view the note below.

Recipes
-------

### octohost::default

Builds the [octohost](https://www.octohost.io) server using Chef.

To get started with this repo:

```
git clone https://github.com/octohost/octohost-cookbook.git
cd octohost-cookbook
bundle install
berks install
```

Then you should be able to build any of the images.

### Packer Build

In order to build an Amazon AMI, DigitalOcean Droplet or Rackspace OpenStack image, you will need accounts for each. Export these values to get Packer to honor them automatically:

    # Rackspace
    export SDK_USERNAME="username"  # Same as here: https://mycloud.rackspace.com/
    export SDK_PASSWORD="password-to-login" # Not the API key.
    export SDK_PROVIDER="rackspace-us" # Or rackspace-uk

    # EC2 - can be found here: https://portal.aws.amazon.com/gp/aws/securityCredentials?
    export AWS_ACCESS_KEY="long-random-string"
    export AWS_SECRET_KEY="another-even-longer-long-random-string"

    # Digital Ocean - get these here: https://cloud.digitalocean.com/settings/applications
    export DIGITALOCEAN_API_TOKEN="long-random-string"

You may have to use a different source image for Rackspace - Rackspace doesn't allow you to share them.

I built my source image from [this related repo](https://github.com/octohost/ubuntu-14.04).

### Vagrant Build

An already created Vagrant box is available at [here](https://github.com/octohost/octovagrant) - if you want to build your own read on.

Before you build the Vagrant box with `rake build_vagrant` - please update these attributes:

    default['vagrant']['keys'] = 'https://raw.github.com/nonfiction/keys/master/keys'
    default['git']['keys'] = 'https://raw.github.com/nonfiction/keys/master/gitreceive-keys'

The wildcard domain record *.octodev.io will work for anyone at <IP_ADDRESS>. An octohost is much more useful when your own keys are installed. Even though we can't get to your non-routable <IP_ADDRESS> address, please don't install our keys on your server.

Once it's built and has your keys in it - package it up:

    vagrant package default --output ~/Desktop/octohost.box
    vagrant box add octohost ~/Desktop/octohost.box
    vagrant init octohost

Add this line to the Vagrantfile:

    config.vm.network :private_network, ip: "<IP_ADDRESS>"

Then:

    vagrant up
    git clone git@github.com:octohost/harp.git && cd harp
    git remote add octo git@serve.octodev.io:harp.git
    git push octo master
    lynx http://harp.octodev.io

You know have your own local, private octohost for development and testing - with a free wildcard dns record.

You're welcome.

#### Testing

[![Build Status](https://travis-ci.org/octohost/octohost-cookbook.png?branch=master)](https://travis-ci.org/octohost/octohost-cookbook)

The cookbook provides the following Rake tasks for testing:

    rake build                        # Syntax check and build all Packer targets
    rake build_ami                    # Syntax check and build AMI
    rake build_droplet                # Syntax check and build Droplet
    rake build_gce                    # Syntax check and build Google Compute Image
    rake build_openstack              # Syntax check and build Openstack Image
    rake build_vagrant                # Syntax check and build Vagrant box
    rake cleanup_vendor               # Cleanup Vendor directory
    rake food_extra                   # Run extra Foodcritic rulesets
    rake integration                  # Alias for kitchen:all
    rake kitchen:all                  # Run all test instances
    rake kitchen:default-ubuntu-1204  # Run default-ubuntu-1204 test instance
    rake kitchen:default-ubuntu-1404  # Run default-ubuntu-1404 test instance
    rake knife_solo                   # Usage: rake knife_solo user={user} ip={ip.address.goes.here}
    rake lint                         # Lint Chef cookbooks
    rake rubocop                      # Run rubocop tests
    rake spec                         # Run ChefSpec examples
    rake tailor                       # Run tailor tests
    rake taste                        # Run taste tests
    rake test                         # Run all tests

License and Author
------------------

Author:: Darron Froese<EMAIL_ADDRESS>
Copyright:: 2014, Darron Froese

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contributing
------------

We welcome contributed improvements and bug fixes via the usual workflow:

1. Fork this repository
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new pull request

repository: nagyist/octohost-cookbook

repo_name: nagyist/octohost-cookbook


text:
# rusty-8 💾
Just a GL [CHIP-8](https://en.wikipedia.org/wiki/CHIP-8) emulator written in Rust 💾

    rusty-8 running the maze ROM

Chip-8 is a virtual machine and easy-to-use interpreted programming language from the late 70's.
Typically, the roms are in a compiled form - which is what this emulator executes. Since it wasn't
accompanied by dedicated hardware, there are specifications on all the components a Chip-8
implementation should have.

This project was made after i had *Computer Architecture and Organization* classes, a pretty cool
subject that made me want to get my hands dirty with emulation.

With this in mind, if you're curious about those topics
[take a look at this repo's resources!](https://github.com/gabrielvictorcf/rusty-8#credits)
It's more hands-on approach, but there is definitely something to be learned, like how a computer
executes instructions, branches execution, and more.

Also, the code is thoroughly commented, and should be easy to follow if you're familiar with rust.
The only caveat is the `fb.glutin_handle_basic_input` function, at the end of `main`, which is heavy library
code - `input` is just a recap of a frame's input events from OpenGL.

Here are some specs of my Chip-8 implementation:
- 500 Hz Clock
- 4Kb of RAM memory (512 bytes reserved to the Virtual Machine)
- 64x32 display (resizeable with OpenGl)
- 16 8-bit data registers, plus some other special ones
- 60Hz playback rate

## Installing / Building
> You'll need `cargo` and `libsdl2-dev` to build rusty-8.

```bash
cargo install --branch main --git https://github.com/gabrielvictorcf/rusty-8 rusty-8
```

## Usage
You can `git clone https://github.com/gabrielvictorcf/rusty-8.git` to get the roms, or just
go to `roms` and download them individually. Then, all that's left is to:

```bash
rusty-8 <rom_path> # opens the emulator and executes given rom!
```

Some games might be buggy - this is unrelated to the emulator itself, and depends more on
how the game was programmed. Also, if you find the window a bit large, it's resizeable.

## Controls
Chip-8's original keyboard and this emulator's keyboards are as follows:
```
    Original                     Rusty-8
╔═══╦═══╦═══╦═══╗            ╔═══╦═══╦═══╦═══╗
║ 1 ║ 2 ║ 3 ║ C ║            ║ 1 ║ 2 ║ 3 ║ 4 ║
╠═══╬═══╬═══╬═══╣            ╠═══╬═══╬═══╬═══╣
║ 4 ║ 5 ║ 6 ║ D ║            ║ Q ║ W ║ E ║ R ║
╠═══╬═══╬═══╬═══╣     →      ╠═══╬═══╬═══╬═══╣
║ 7 ║ 8 ║ 9 ║ E ║            ║ A ║ S ║ D ║ F ║
╠═══╬═══╬═══╬═══╣            ╠═══╬═══╬═══╬═══╣
║ A ║ 0 ║ B ║ F ║            ║ Z ║ X ║ C ║ V ║
╚═══╩═══╩═══╩═══╝            ╚═══╩═══╩═══╩═══╝
```

There are also some additional emulator/window controls:
- Window close - `Esc` or `Ctrl+W`
- Emulator reset - `Ctrl+R`

## Credits
All of these are amazing, free, resources that make learning/implementing Chip-8 quite a pleasure.
Big thanks to all of these creators!

- Matt Mikolay's [Chip-8 Technical Reference](https://github.com/mattmikolay/chip-8/wiki/CHIP%E2%80%908-Technical-Reference)
- Cowgod's [Chip-8 Technical Reference](http://devernay.free.fr/hacks/chip8/C8TECH10.HTM)
- [Test rom](https://github.com/corax89/chip8-test-rom)
- [Game roms](https://github.com/kripod/chip8-roms)

More game roms shouldn't be hard to find around the internet.

This was built using some nice crates, so thanks to their creators as well.

## License
All code in this repository is licensed under the MIT License, and thus is of free use.

branch_name: refs/heads/main


text:
[![test](https://github.com/genome-rcast/karkinos/workflows/test/badge.svg)](https://github.com/genome-rcast/karkinos/actions)
[![codecov](https://codecov.io/gh/genome-rcast/karkinos/branch/master/graph/badge.svg)](https://codecov.io/gh/genome-rcast/karkinos)

# About

karkinos is a tumor genotyper that detects single nucleotide variation (SNV)
and copy number variation (CNV) and calculates tumor cellularity from tumor-normal paired sequencing data.

Accurate CNV calling is achieved using continuous wavelet analysis and multi-state HMM,
while SNV call is adjusted by tumor cellularity and filtered by a heuristic filtering algorithm and Fisher Test.
Also, Noise calls in low depth regions are removed using the EM algorithm.

# Licence

 Copyright (C) 2014 Hiroki Ueda Rcast, the University of Tokyo

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

# Prerequisites

- git
- JDK >= 1.8 (Recommended 11)

# Build

```
$ git clone https://github.com/genome-rcast/karkinos.git
$ cd karkinos
$ ./gradlew uberjar
```

You don't need to install Gradle command.

`karkinos-standalone-X.Y.Z-SNAPSHOT.jar` is created in the `./build/libs/` directory.

# Required files

- BAM files for normal read alignment
- BAM files for tumor read alignment
- Capture target (BED format)
- dbSNP (See following for the file format)
- COSMIC (VCF format)
- `karkinos.property`

dbSNP file format is as follows:

1. bin (for indexing)
2. chromosome
3. start (0 based)
4. end (1 based)
5. rs#
6. score
7. strand
8. ref allele from NCBI
9. ref allele from UCSC
10. observed alleles
11. molType
12. class
13. valid
14. avHet
15. avHetSE
16. func
17. location type
18. weight
19. exceptions
20. submitterCount
21. submitters
22. allele frequency count
23. alleles
24. alleleNs
25. alleleFreqs
26. bitfields

e.g.

```
585	chr1	10468	10469	rs117577454	0	+	C	C	C/G	genomic	single	by-1000genomes	0	0	unknown	exact	1		1	1000GENOMES,	2	G,C,	18.000000,102.000000,	0.150000,0.850000,
```

# Run

The current version of karkinos supports only one subcommand, `analysis`.

This subcommand will pileup reads and then analyze SNVs, CNVs, and Tumor purity.

```
Usage: java -jar karkinos.jar analysis -n <arg> -t <arg> -r <arg> -snp <arg> -ct
       <arg> -o <arg> -id <arg> [-prop <arg>] [-mp <arg>] [-g1000 <arg>]
       [-cosmic <arg>] [-g1000freq <arg>] [-chr <arg>] [-rs <arg>] [-rg
       <arg>] [-exonSNP <arg>] [-nopdf]
 -n,--normalBam <arg>                normal BAM file
 -t,--tumorBam <arg>                 tumor BAM file
 -r,--reference <arg>                reference genome file of 2bit format
 -snp,--dbSNP <arg>                  dbSNP list (e.g. bin, chr, start, end)
 -ct,--captureTarget <arg>           BED file of capture target regions
 -o,--outdir <arg>                   output directory
 -id,--uniqueid <arg>                unique id for this sample
 -prop,--property <arg>              karkinos.property file
 -mp,--mappability <arg>             (optional) Big Wig format file of mappability from UCSC
 -g1000,--1000genome <arg>           (optional) 1000 genome list (e.g.  chr, pos, ref, alt, freq, id)
 -cosmic,--cosmicSNV <arg>           VCF format file of COSMIC's SNV
 -g1000freq,--1000genomefreq <arg>   (optional) threshold of 1000 genome frequency
 -chr,--chrom <arg>                  chromosome name
 -rs,--readsStats <arg>              (optional) reads stats files (normal and tumor)
 -rg,--refFlatGenes <arg>            (optional) gene references
 -exonSNP,--exonSNP <arg>            (optional) additional exon SNPs
 -nopdf,--nopdf                      if you don't need a graphical summary PDF
```

repository: genome-rcast/karkinos

repo_name: genome-rcast/karkinos


text:
# Dockerized Harvest

![HarvestDashbaord](images/GrafanaDashboard.png)

*Read this in other languages: [日本語](README.ja.md)

## What is this?

1. Dockerized NetApp Harvest
2. Setting up Graphite / Grafana at the same time to use Dockerized Harvest immediately

## Prerequisites

* Docker 18.06 has been installed (Tested version)
* make has been installed
* Since Grafna and Graphite also use a Compose file to be launched simultaneously,
Need `docker-compose`

## Current features

Provides the following functions using utility script.

* Build / Push of Harvest Docker image
* All-in-one launch of Harvest / Grafana / Graphite

---

## Build / Push Image

The Harvest and NetAppMangeability SDK (NMSDK) used will need to be downloaded and placed in the designated directory, as agree to the terms of service is required.

The deployment destination directory is the following location.

* harvest/netapp-harvest_1.4.2_all.deb
* harvest/netapp-manageability-sdk-9.5.zip

If you change the version of the base OS or the version of Harvest or NMSDK, please change the description at the top of the Makefile accordingly.

The images are tagged using the version at Makefile.

The username (USER) is used for the image registry name. You may change the image name after the build, but if you rewrite this part, you can describe the docker-compose file etc. with the image name assumed to be pushed to the registry.

```Makefile changes
1 # bumpup version here.
2
3 VERSION: = 1.1
4 BASE_IMAGE: = ubuntu: 16.04
5 HARVEST_VERSION: = 1.4.2
6 NMSDK_VERSION: = 9.5
7 USER: = makotow
```

We provide utilities for container image build and push.
Execute the following command and beginning docker build.

``` Build a Docker image
sudo make bi
```

You can also push the image registry from the Makefile.
After the build is complete, execute the following command to push it to the image registry. (We assume DockerHub this time and make it.)

```Docker push execution
sudo make pi
```

## Directory structure

```Directory Layout
├── Makefile -> Task rnner
├── README.ja.md -> Japanese document
├── README.md -> this document
├── docker-compose-dockervolume.yml -> Compose file using Docker Volume
├── docker-compose-volumemount.yml -> Compose file using Volume mount
├── docker-compose.yml -> docker-compose-dockervolume.yml-> symbolic link to either DockerVolume or VolumeMount
├── docker-vol -> When using Volume mount, data and configuration storage area (some Harvest configuration files use this location regardless of Volume mount / Docker Volume)
├── harvest -> Dockerization of harvest
│   ├── Dockerfile
│   ├── entrypoint.sh
│   ├── netapp-harvest.conf
│   ├── netapp-harvest_1.4.2_all.deb -> Download from support site
│   └── netapp-manageability-sdk-9.5.zip　-> Download from support site
├── ./init.sh　-> It is called from init task of Makefile.
```

---

## How to use dockered Harvest

We describe preparation and configuration for building Harvest, Grafana and Graphite using `docker-compose`.

### Advance preparation

```Init
make init
```

Harvest's configuration file is copied to the following path during initialization.

* $ {PWD}/docker-vol/harvest/netapp-harvest.conf

Edit the above file. We will edit 3 points as a sample.

### Grafana Settings

The first point is the Grafana URL section. Change `grafana_url` in the `[global]` section to the URL that actually starts Grafana. It is defined that it starts with port 3000 of the host of `<IP_ADDRESS>`.
Using this docker-compose file will start Grafana on port 3000.

```Sample Configuration
1 [global]
2 # You will need to do this post install of grafana
3 # grafana_api_key = CHANGE_GRAFANA_API_KEY
4 grafana_url = http://<IP_ADDRESS>:3000
```

### Graphite Settings

The second point is about Graphite that stores data. The `[default]` section specifies the IP of the host running Graphite. If you use this Docker-compose, it will be the same IP as Grafana because it will all run on the same host.

(Please refer to the Harvest documentation for details.)

```Sample Configuration
6 [default]
7 graphite_server = http://<IP_ADDRESS>
8 host_type = FILER
9 # Filer auth credentials for connection to ONTAP
10 username = admin
11 password = changepassword
```

### Add Monitoring Target

The third point is to add a monitored cluster. Register the IP for each cluster in the configuration file.

Set the ONTAP cluster to be monitored.

```Sample Configuration
12 [hostnname]
13 hostname = cluster management IP or host name of ONTAP to be monitored
14 site = any identifier
15 host_type = FILER
16 group = any identifier used to identify clusters
```

## Start Grafana / Graphite / Harvest

For convenience, we have prepared two ways to store the collected data. Each prepares a Docker-compose file.

1. Docker Volume (recommended)
2. Volume Mount

By default, `1. Using Docker Volume` is symbolic link to docker-compose.yml. Please change according to the application.

In addition, since the configuration of Harvest(harvest-netapp.conf) is often changed, Volume Mount is adopted.

The utility script is provided to launch some service; Grafana, Graphite and Harvest.

Please change `image: makotow/harvest-docker:1.1-harvest1.4.2` section in docker-compose.yml if you change container name when building container image.

Execute the following command to start it.

```Examples
sudo make compose-up
```

If it starts without problems, access the following URL.

```Access URL
http://[grafana_url specified in harvest-netapp.conf]:3000
```

If you can access normally, Grafana login is displayed.

![Grafana login](images/GrafanaLogin.png)

Change password after login with admin / admin and set data source.

### Register Graphite as a data source to Grafana

Make the following settings on the data source registration screen.

First select the type of data source (Graphite).

![SelectGraphite](images/SelectDataSource.png)

Next, configure the data source as follows.

The URL is as follows. You can access Graphite container with "Graphite" from inside the container.

Access is specified by `Server`.

In this example, Graphite access uses BasicAuth.

Access to Graphite will be the following authentication information by default.

* user: root
* password: root

Please select `1.1.X` for the Graphite version.
After saving, it will be described as the actual version (1.1.5) like the screenshot below.

![SelectGraphite](images/GraphiteDatasource.png)

### Registering Dashboard

When registering via API, issue an API Key from Grafana and describe it in harvest-netapp.conf, and import processing from within the harvest container.

In this document, we manually import the dashboard (json file) included in the Harvest downloaded from the tool chest of the NetApp Support Site. For import, use Grafana's dashboard import function.

After a while, the data is collected and the graph starts to appear.

## References

1. [Grafana Labs: Installing using Docker](https://grafana.com/docs/installation/docker/)
2. [graphite-project/docker-graphite-statsd](https://github.com/graphite-project/docker-graphite-statsd)
3. [How To Install Graphite And Grafana: Very Long Threads](https://community.netapp.com/t5/Data-Infrastructure-Management-Software-Articles-and-Resources/How-to-install-Graphite-and-Grafana/ta-p/109456/highlight/true)
4. [szukalski/docker-netapp-harvest: I borrowed the wisdom of my predecessor.](https://github.com/szukalski/docker-netapp-harvest)

## Authors

* [@makotow] (https://github.com/makotow)

## License

MIT

repository: makotow/docker-harvest

repo_name: makotow/docker-harvest


text:
# Use Ctrl-Z to switch back to Vim

I frequently need to execute random commands in my shell. To achieve it I pause
Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.
The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back
to Vim. I could not find a solution, so I developed one on my own that
works wonderfully with ZSH.

Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/

Credits:
- original idea by @sheerun
- added to OMZ by @mbologna

repository: ohmyzsh/ohmyzsh

gha_language: Shell

gha_license_id: MIT

repo_name: ohmyzsh/ohmyzsh


text:
# CSSO
CSSO is a great tool for optimizing CSS. It's public API is very simple, sometimes to a fault, where it becomes difficult to track down errors. Although we're considering building in some extra error tracking in the future, for now just be careful.

## Supported Methods
 - render

## Source Maps

CSSO does not have support for source maps, unfortunately. There is an open issue for it [here](https://github.com/css/csso/issues/173). If they do add support we'd be happy to integrate it with accord.

## Additional Options

### Restructuring
 - key: `restructuring`
 - type: `Boolean`
 - default: `true`

 If set to false it disables structure minimization. Structure minimization is a feature that merges together blocks that have the same selector.

 ### Debug
 - key: `debug`
 - type: `Boolean`
 - default: `false`

Emits additional information for debugging if set to true.

repository: pingyhq/pingy-cli

gha_language: JavaScript

repo_name: pingyhq/pingy-cli


text:
# Workflows

```
This repository is archived. Please see https://github.com/Apollo-Workflows
```

AFCL Workflows from various domains

### Summary

name | description | platforms | datasets
--- | ---- |  ----- | ------
[`BWA`](https://github.com/ApolloCEC/workflows/tree/master/BWA)  | BWA is a common life sciences task of performing DNA read alignment | Amazon |  Escherichia coli, Trypanosoma brucei, Rhizobium Jaguaris, Bacteroides thetaiotaomicron
[`SENTIM`](https://github.com/ApolloCEC/workflows/tree/master/SENTIM)  | SENTIM uses a pre-trained Tensorflow model to infer the sentiment of Tweets  | Amazon, Google |  200
 5000
 10000
 15000
 20000

repository: ApolloCEC/workflows

repo_name: ApolloCEC/workflows


text:
---
title: What Goals To Have
created_at: 2021-09-09
tags:
links:
---

[[The Goal]] should always be something that is productive for you / your department / your company.

Tips to figure out what goals to have:
_See what your organization has measured._
The things that are already measured are more important than stuff not measured yet.

_Take notice of your boss' concerns._
The things that worry them are what's important for them.
The projects that they want to know more are what's important for them.

As always, prefer [[MT Goals]] instead of all others e.g. OKR.

repository: hendryl/digital-garden

path: /_notes/What Goals To Have.md

filename: What Goals To Have.md

repo_name: hendryl/digital-garden


text:
pynetstim
=========

pynetstim is a python module that aims to create an integrated framework for brain network stimulation, stimulation targeting and engagement, visualization, and stimulation individualization using multimodal imaging.

Dependencies
=============

- python>=3.5
- Scipy
- Nilearn
- Nibabel
- Pysurfer
- Pandas
- Nipype
- MNE
- Mayavi

Install
========

Please make sure you have installed all the dependencies listed above. pynetstim can ben installed by running the following command:

```
pip install -U --user pynetstim
```

repository: Zeigar/pynetstim

repo_name: Zeigar/pynetstim


text:
# Chocolatey-tools

## Description

PowerShell module for managing Chocolatey internalizing for enterprises and remote upgrading of client packages with PowerShell remoting and Boxstarter. Includes Chocolatey Remote Management GUI which allows remote install, uninstall, upgrading, rebooting of remote Chocolatey clients.

Authored by Dan Franciscus

## Examples
[Demos](https://github.com/dfranciscus/Chocolatey-tools/tree/master/Examples)

## Installing

The easiest way to get Chocolatey-tools is using the [PowerShell Gallery](https://powershellgallery.com/packages/Chocolatey-tools/)!

### Inspecting the module

Best practice is that you inspect modules prior to installing them. You can do this by saving the module to a local path:

``` PowerShell
PS> Save-Module -Name Chocolatey-tools -Path <path>
```

### Installing the module

Once you trust a module, you can install it using:

``` PowerShell
PS> Install-Module -Name Chocolatey-tools
```

### Updating Chocolatey-tools

Once installed from the PowerShell Gallery, you can update it using:

``` PowerShell
PS> Update-Module -Name Chocolatey-tools
```

### Uninstalling Chocolatey-tools

To uninstall Chocolatey-tools:

``` PowerShell
PS> Uninstall-Module -Name Chocolatey-tools
```

## Contributing to Chocolatey-tools

Interested in contributing? Read how you can [Contribute](contributing.md) to Chocolatey-tools

This project maintains a [Code of Conduct](code-of-conduct.md) that establishes how the project is governed and how everyone involved is expected to behave. You can report unacceptable behavior to [dfranciscus@cnjcomputing.com](mailto:dfranciscus@cnjcomputing.com).

## Release History

A detailed release history is contained in the [Change Log](CHANGELOG.md).

## License

Chocolatey-tools is provided under the [MIT license](LICENSE.md).

repository: AhmadMejqan/Chocolatey-tools

repo_name: AhmadMejqan/Chocolatey-tools


text:
![4](https://i.imgur.com/MwngMAi.jpg)

## Introduction
---

Photocell is a kind of special resistance based on internal photoelectric effect. Its resistant value is opposite to the brightness of light. Brighter light leads to lower resistant value. Usually photocell is the core component of a photoswitch. In the following experiment, we are going to use photocell to control the brightness of 5*5 LED screen on micro:bit.

## Component List
---

### Hardware:

- 1 x [micro:bit Board](http://www.elecfreaks.com/estore/bbc-micro-bit-board-for-coding-programming.html)
- 1 x Micro-B USB Cable
- 1 x [micro:bit Breadboard Adapter](http://www.elecfreaks.com/estore/microbit-breadboard-adapter.html)
- 1 x [Transparent Breadboard - 83 * 55 mm](http://www.elecfreaks.com/estore/transparent-breadboard-83-55-mm.html)
- 1 x Photocell
- 1 x 10k Ohm Resistors
- 1 x [Breadborad jumper wire 65pcs pack](http://www.elecfreaks.com/estore/breadborad-jumper-wire-65pcs-pack.html)

**Tips: If you want to buy all components above, then you will need [Elecfreaks micro:bit Starter Kit](http://www.elecfreaks.com/estore/elecfreaks-micro-bit-starter-kit-795.html).**

![](https://i.imgur.com/W4tseua.jpg)

### Software:

[Microsoft Makecode Online Editor](https://makecode.microbit.org/)

## Introduction of Major Components
---

### Photocell

Photocell is a kind of special resistance made of semi-conductor materials like Cds or CdSe. It is based on internal photoelectric effect. Brighter light, lower resistant value. As with the increase intensity of light, its resistant value swiftly decreased. The minimum light resistant value can reach under 1KΩ. Photocell is very sensitive to light. When there is no light, its resistant value arrives maximum. Its dark resistant value usually can reach 1.5MΩ at max.

![](https://i.imgur.com/jS03zGQ.jpg)

## Hardware Connection
---

Please complete hardware connection according to the picture below.

![](https://i.imgur.com/FtQDhiS.jpg)

A bleeder circuit will be formed when photocell and 10KΩ resistance connect inserial.

After connection, you can see:

![](https://i.imgur.com/TMd3Fq8.jpg)

## Programming
---

Open Microsoft Makecode, write code in editor window. I would like to suggest you to try programming by yourself first.

Of course, you can see the whole program in the link below. Just click “Edit” on the right top corner, then click “download” to download the whole code into micro:bit.

Link of the whole program: [https://makecode.microbit.org/_iqDLctEkHFj1](https://makecode.microbit.org/_iqDLctEkHFj1)

## Code Explain
---

**set**

This is assignment operation. set a to 1 equals to “a=1”. We use an equals sign to make a variable store the number or string you say.
When you use the equals sign to store something in a variable, the equals sign is called an assignment operator, and what you store is called a value.

**analog read**

Read an analog signal (0 through 1023) from the pin you say.

**show icon**

Shows the selected icon on the LED screen

**Clear Screen**

Turn off all the LED lights on the LED screen.

**If else**

In Lesson 2, we have talked about the usage of “if” sentence. In sentence of “ if else”, when the format value is false(or 0), then it will implement “else” brick program before running program in sequence. Here is the flow chart:

![](https://i.imgur.com/E5Xi2Uu.jpg)

In this experiment, micro:bit read analog voltage of Pin0 port as the reference value of brightness.

![](https://i.imgur.com/Tck85NO.jpg)

In brick “ forever” , scan analog voltage of Pin0 in circulation. Once the voltage lower than reference value minus 2( it shows intensity of light increase, resistant value of photocell decrease), then it tells the light has been turned off.

![](https://i.imgur.com/K8tmDxV.jpg)

In program, calibrationVal-2 is for adjusting sensitivity. Lower value, higher sensitivity. However, it is not suitable for all kinds of light environment. You have to adjust this parameter until it can adapt to the present light condition.

## Experiment Result
---

Turn on light, 5*5 LED screen on micro:bit become empty. Turn off light, LED screen displays a sign of heart.

![](https://i.imgur.com/1Xu4lBR.gif)

**Note:**
After resetting micro:bit, it will calibrate the reference value according to the present brightness. So, in order to make the program run properly, we must start micro:bit program on the condition that the light is turned on .

## Think
---

If we want to use photocell to control a LED bead, then how to design circuit and program? We look forward to your further discussions or comments.

## FAQ
---

repository: zorazeng/learn-en

repo_name: zorazeng/learn-en


text:
# JavaScript Data Types

- **`Objective :`** learn about the data types available in JavaScript.

### Preface

Data types basically specify what kind of data can be stored and manipulated within a program.

There are six basic data types in JavaScript which can be divided into three main categories: primitive (or primary), composite (or reference), and special data types. String, Number, and Boolean are primitive data types. Object, Array, and Function (which are all types of objects) are composite data types. Whereas Undefined and Null are special data types.

Primitive data types can hold only one value at a time, whereas composite data types can hold collections of values and more complex entities.

---

**Understand and Practice these examples for better grip on the concept.**

### Happy Coding !! 👍🏻✌🏻

---

path: /JavaScript Data Types/descripiton.md


text:
# crazy-quotes

Quotes you find here are from the best-loved characters in the motion pictures history!

## Installation

Use the node package manager [npm](https://www.npmjs.com/) to install crazy-quotes.

```bash
npm i crazy-quotes
```

## Usage

```javascript
const cq = require('crazy-quotes');

let type = 'Movie' || 'TV' || 'Anime'; //string
//Default type is 'Movie'

let count = 4; //Integer

cq.oneQuote(type); || cq.oneQuote();
//returns
{ quote: 'Now, young Skywalker, you will die.',
  character: 'Emperor Palpatine',
  spokeIn: 'Star Wars',
  type: 'Movie' }

cq.someQuote(count);
//returns
[ { quote: 'Now, young Skywalker, you will die.',
    character: 'Emperor Palpatine',
    spokeIn: 'Star Wars',
    type: 'Movie' },
  { quote: 'In my experience there is no such thing as luck.',
    character: 'Obi-Wan Kenobi',
    spokeIn: 'Star Wars',
    type: 'Movie' },
  { quote: 'Be careful not to choke on your aspirations.',
    character: 'Darth Vader',
    spokeIn: 'Star Wars',
    type: 'Movie' },
  { quote:
     'You’re coming with me. I’ll not leave you here, I’ve got to save you.',
    character: 'Luke Skywalker',
    spokeIn: 'Star Wars',
    type: 'Movie' } ]

cq.allQuote(type);
//returns all quotes matching the type passed in
```

## Contributing
Pull requests are welcome.

## License
[ISC](https://www.isc.org/licenses/)

license: ISC

repository: rahulkpal/crazy-quotes

repo_name: rahulkpal/crazy-quotes


text:
For example the image above represents a d8 with four faces
visible, and four faces hidden. The first four digits of the input would
be starting from the face in the upper right quadrant, and moving around
the faces clockwise.  In this case ABCD. The next four digits would
start from the opposite face from the upper right quadrent, E, and again
moving clockwise. In this case EFGH.  The full eight digit input
would be ABCDEFGH.

### Notation about rotations
For this code, there are three axis defined as follows:
* Omega is the axis looking straight down. One turn around Omega is a
90 degree turn clockwise, A moves to B, B moves to C, C moves to D,...
E moves to F, F moves to G, etc.
* Theta is the axis from right to left.  One turn around Theta is a 90
degree turn clockwise when viewed from the right:  A moves to G, G moves to H, H moves to B, B
moves to A...
* Phi is the axis from bottom to top. One turn around Phi is a 90 degree
turn clockwise when viewed from the bottom: C moves to B, B moves to H,
and so on.

The code works by "rotating" the die so that the 1 is in the A position,
and the face adjacent to 1, that has the smallest value, is moved to
the B position.  From there the output is generated in the same way
as the input, by reading of the new values that are in the positions
for ABCDEFGH.


text:
# Doc-Broswer-via-React

A front-end doc broswer written by Javascript via React framework

##How to use

    1. Copy the whole 'static' folder under the 'api' folder

    e.g. homework-frontend-api/api/static

    2. Start server by 'python run_api.py'

    3. Open web browser with link:

    http://localhost:3000/static/index.html

This doc browser has been tested with Google Chrome 51.0.2704.79, Safari 9.1

[![Doc Browser via React Framework](https://j.gifs.com/2kBAgN.gif)](https://www.youtube.com/watch?v=X4rYerCSOHk)

repository: babyinthesky/Doc-Broswer-via-React

repo_name: babyinthesky/Doc-Broswer-via-React


text:
PubNub Transportation Solution Examples
====================================
The PubNub Fleet Management Solution Examples provides the real-time building blocks to jump start the development of a transportation management application, including taxi, fleet management and delivery service apps. Built on the PubNub Real-Time Network, the solution kit components are supported on over 50+ SDKs and are globally-scaled, reliable and secure.

# Examples

* Location Tracking - Understand delivery or arrival to provide better customer experience.
* Dispatch - Manage real-time messaging and response between vehicles and dispatch, regardless of network conditions.
* Vehicle State - See a real-time view of your fleet status and availability. Detect when vehicles are available, booked, fully-loaded or other status
* Geo Fencing * Trigger actions and alerts based on vehicle location and geographic boundaries (e.g., only vehicles within 5 miles get dispatch request)
* Reliable connectivity - We take connectivity for granted but it isn't always a trivial matter. Moving vehicles often drop connections, switch between towers, go thru tunnels. High-value messages need to arrive, otherwise resulting in business loss.
* Integration with Mobile Devices
* Distance Traveled Reports

repository: pubnub/transportation

repo_name: pubnub/transportation


text:
## Uniqueue Characters
We were offered extra credit to write the code for one of the mock interview questions. I chose uniqueue character question because I had previously written it using recursion, but we leared hashtables since then so I think I could write it better now with hashtables.
To clarify the unique character question is that if given a string we are to determine if it is full of unique characters or not.

## Challenge
I utilized my previouly written hast table DLL.
I chose to iterate through the string and hash it, and if I run into a collision then I could check the value and if it matches then that means the string isn't full of unique characters.
We were told to assume spaces do not count and case sensative doesn't matter.
Doing it this way I have a Time Big O of N because worst case I would iterate through the entire string and there isn't a duplicate character. I have a space of Big O of N because I am using memory to add a new item in the hashtable, and worst case is that I am adding each chara into the hashtable.

## Solution
Just for grading ease, proof of passing tests
![tests](../../../assets/ECuniquechara.JPG)


text:
# Freezer
Freezer is a tool to help developers discover which database records are created by some application's action and which tables received these new records because that action.

It makes much easier to spot these tables and its new records, understand how the third-party application interacts with the database and also how relationships are made.

## Latest version

0.17.0

Currently only MySQL/MariaDB is supported.

## Objective

The goal of this tool is to shorten the time that developers need to understand the structure of a given database identifying in which tables the third-party application, like [**Moodle**](https://moodle.org), [**HumHub**](https://www.humhub.com) or [**Elgg**](https://elgg.org) for instance, inserts new records depending on the action the application performed, so the developer can focus directly on the tables that primarily matter for that specific action.

Or maybe you just want to quickly know which tables are affected by some application's action.

Freezer can connect to any MySQL/MariaDB database, not just "third-party applications' databases".

## Showcase

In this use case I want to know which records are inserted in Moodle's database when an assignment is created.

I chose Moodle for this demo specifically because that database is quite complex.

![Freezer demo video](https://i.imgur.com/TgJOIfd.gif)

## Installation
1. You must have a web server with PHP. PDO extension must be enabled to access the third-party application's MySQL server.
2. Clone the Freezer repository:

```
$ git clone https://github.com/llagerlof/freezer.git
```

3. Copy the file `config/freezer.example.php` to `config/freezer.yourdatabase.php`
4. Edit `freezer.yourdatabase.php` and configure it accordingly (instructions inside)
5. Go to `http://localhost/freezer` (or whatever is the URL for your local web server)

**IMPORTANT**:
- *Freezer is intended to access only **localhost databases** for research purposes, or at most databases accessed by a single person.*
- *Don't put this tool in production environment as there isn't any authentication method to access it.*
- *This application only performs `SELECT`, `DESC` and `SHOW TABLES` statements on configured databases.*

## How to use
1. Open any application that access a database you have in you computer (e.g. *HumHub*, or your own application) and get to the point where you want to start tracking the inserts (e.g. **BEFORE** clicking on the "SAVE" button of some record).
2. On Freezer, select `yourdatabase` in the combo box and click on the **Freeze** button.
3. Do some insert operations in the third-party application (e.g. clicking on the "SAVE" button).
4. On Freezer, click on the **What is New** button.

Freezer will show you which records were inserted in all database's tables between the **Freeze** and **What is New** commands.

repository: marcusgreen/freezer

repo_name: marcusgreen/freezer


text:
---
title:  Inside Story
date:  04/01/2019
---

#### Power of a Testimony

_By Miguel Manuel Mafugula_

I was born into a Sunday-keeping family in Milange, a town located just 2 miles (3 kilometers) from Mozambique’s border with Malawi.

My introduction to the Seventh-day Adventist Church came through a girl named Adelina. She was 16 and in the seventh grade, and she asked me for help with her homework. I was 21 and in the 10th grade.

After I helped her, she started talking about the Adventist Church. She told me about the Sabbath and explained that God set aside Saturday, not Sunday, as the day of worship.

Later, Adelina presented me with a Bible. She had underlined the fourth commandment in Exodus 20:8 and Ezekiel 20:20, which says, “ ‘ “Hallow my Sabbaths, and they will be a sign between Me and you” ’ ” (NKJV). On one page of the Bible, she wrote, “Go read Mark 2:27, 28.”

I turned to Mark and read Jesus’ words, “The Sabbath was made for man, and not man for the Sabbath. Therefore the Son of Man is also Lord of the Sabbath.”

When I read this, I realized that I had been observing the wrong day of the week.

I decided to go to church with Adelina to learn more, and soon I was worshiping on Saturday.

This decision caused problems at my Sunday church, where I had been serving as youth director. The church’s pastor went to my father, and my father ordered me to return to my former church. When I refused, my father declared, “If you can’t obey your parents, then you can’t live with them.” He kicked me out of the house.

I told Adelina’s parents what had happened, and they gave me a place to live until I finished high school. I was baptized two years later.

God helped me to graduate from high school and college and to get hired as a chemistry teacher at the public high school in Milange. Later I married Adelina, the girl who introduced me to the Sabbath.

God has been able to use my personal testimony in amazing ways. I’ve shared it with the young people from my former Sunday church, and two have become Adventists. I also told my parents, and they were baptized.

I tell everyone: trust in the Lord daily. Nothing is impossible for Him.

_Part of this quarter’s Thirteenth Sabbath Offering will help open the first Seventh-day Adventist elementary school in Miguel’s hometown of Milange. Thank you for your mission offering._

repository: Adventech/sabbath-school-lessons

branch_name: refs/heads/stage

repo_name: Adventech/sabbath-school-lessons


text:
## Displaying Data

Welcome to the example application used in angular.io/dart's
[Displaying Data](https://angular.io/docs/dart/latest/guide/displaying-data.html) page.

You can run a [hosted copy](http://angular-examples.github.io/displaying-data) of this sample. Or run your own copy:

1. Clone or [download][] this repo.
   [download]: //github.com/angular-examples/displaying-data/archive/master.zip
2. Get the dependencies:

  `pub get`
3. Launch a development server:

  `pub serve`
4. Open a browser to `http://localhost:8080`.<br/>
  In Dartium, you'll see the app right away. In other modern browsers,
  you'll have to wait a bit while pub converts the app.

-------------------------------------------------------

*Note:* The content of this repository is generated from
[the angular.io repository](//github.com/angular/angular.io/tree/master/public/docs/_examples/displaying-data/dart) by running the
[dart-doc-syncer](//github.com/angular/dart-doc-syncer) tool.
If you find a problem with this sample's code, please open an
[issue at angular/angular.io](//github.com/angular/angular.io/issues/new?labels=dart,example&title=%5BDart%5D%5Bexample%5D%20guide/displaying-data%3A%20).

gha_language: Dart


text:
[![Build status](https://ci.appveyor.com/api/projects/status/k9gnrmlt3yo5gl4g?svg=true)](https://ci.appveyor.com/project/nvborisenko/agent-net-specflow)

# Installation
Install **ReportPortal.SpecFlow** NuGet package into your project with scenarios. This package depends on SpecFlow v3.

[![NuGet version](https://badge.fury.io/nu/reportportal.specflow.svg)](https://badge.fury.io/nu/reportportal.specflow)

> PS> Install-Package ReportPortal.SpecFlow

# Configuration
Add `ReportPortal.config.json` file into tests project with `Copy to Output Directory = Copy if newer` property.

Example of config file:
```json
{
  "$schema": "https://raw.githubusercontent.com/reportportal/agent-net-specflow/master/ReportPortal.SpecFlowPlugin/ReportPortal.config.schema",
  "enabled": true,
  "server": {
    "url": "https://rp.epam.com/api/v1/",
    "project": "default_project",
    "authentication": {
      "uuid": "7853c7a9-7f27-43ea-835a-cab01355fd17"
    }
  },
  "launch": {
    "name": "SpecFlow Demo Launch",
    "description": "this is description",
    "debugMode": true,
    "attributes": [ "t1", "os:win10" ]
  }
}
```

Discover [more](https://github.com/reportportal/commons-net/blob/master/docs/Configuration.md) about configuration.

# How To

## Combine several execution in one launch

How it can be done:
1. CI server creates a RP launch and set `REPORTPORTAL_LAUNCH_ID` environment variable.
2. Execute tests as usual.
3. When all tests run, CI server finishes the RP launch.

## Custom handler for all requests to Report Portal

By default, the Report Portal client uses `RetryHttpClientHandler` defined in [/ReportPortal.Client/Service.cs](https://github.com/reportportal/client-net/blob/master/ReportPortal.Client/Service.cs) that will retry any failing request a few times before finally giving up.

The behavior to handle requests to Report Portal can be further customized by implementing your own `HttpMessageHandler`, subscribing to `Initializing` event and providing `Service` to the SpecFlow agent.

`RetryHttpClientHandler` from `ReportPortal.Client` library can be used as an example of how to implement `HttpMessageHandler`.

The following code defines a handler for `Initializing` event that provides `Service`:

```c#
  private static void ReportPortalAddin_Initializing(object sender, InitializingEventArgs e)
  {
		e.Service = new Service(
			new Uri(e.Config.GetValue<string>(ConfigurationPath.ServerUrl)),
			e.Config.GetValue<string>(ConfigurationPath.ServerProject),
			e.Config.GetValue<string>(ConfigurationPath.ServerAuthenticationUuid),
			new CustomHttpClientHandler());
  }
```

And to subscribe to `Initializing` event, add the following code in the place where you bootstrap the framework:

```c#
  ReportPortalAddin.Initializing += ReportPortalAddin_Initializing;
```

## Override config via Environment Variables

```cmd
set reportportal_launch_name="My new launch name"
# execute tests
```

`reportportal_` prefix is used for naming variables, and `_` is used as delimeter. For example to override `Server.Authentication.Uuid` parameter, we need specify `ReportPortal_Server_Authentication_Uuid` in environment variables. To override launch tags we need specify `ReportPortal_Launch_Attributes` with `tag1;os:linux` value (`;` used as separator for list of values).

### Memory (AppDomain) Isolation

In order for the functionality to work correctly, a test runner must execute all test threads in the same AppDomain. If it's not the case, each thread will create a separate launch on Report Portal.

## Unit Test Providers

Currently only NUnit v3 (`nunit`), xUnit v2 (`xunit`) and SpecFlow+ Runner (`specrun`) support running tests in parallel.

### NUnit v3

NUnit v3 supports both feature- and scenario-level parallelization although SpecFlow doesn't currently work with scenario-level parallelization (see [techtalk/SpecFlow#894](https://github.com/techtalk/SpecFlow/issues/894))

Add the following attributes to `AssemblyInfo.cs` to enable parallel execution:
```c#
[assembly: LevelOfParallelism(5)]
[assembly: Parallelizable(ParallelScope.Fixtures)]
```

### XUnit v2

XUnit v2 only supports feature-level parallelization.

Add the following attributes to `AssemblyInfo.cs` to enable parallel execution:
```c#
[assembly: CollectionBehavior(DisableTestParallelization = false, MaxParallelThreads = 5)]
```

### SpecRun

SpecRun is the most flexible test runner allowing you to control many aspects to test execution. SpecFlow+ Runner profiles (`.srprofile` file extension) are XML files that determine how SpecFlow+ Runner executes your tests.

Here is a sample profile file that configures SpecRun for running tests in parallel with enabled Report Portal integration:
```xml
<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5">
  <Settings projectName="SpecRun.Project.Name" />
  <Execution stopAfterFailures="0" testThreadCount="3" testSchedulingMode="Sequential" retryCount="0"/>
  <Environment testThreadIsolation="SharedAppDomain"/>
  <TestAssemblyPaths>
    <TestAssemblyPath>SpecRun.Project.Name.dll</TestAssemblyPath>
  </TestAssemblyPaths>
</TestProfile>
```
| Attribute             | Value             | Comment                                                                                |
| --------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `testThreadCount`     | `2` or more       | The number of tests threads used to execute tests. Turns on parallel execution.                                                      |
| `testSchedulingMode`  | `Sequential`      | Determines the order in which SpecRun executes tests. The other values may produce multiple test items per feature on Report Portal. |
| `testThreadIsolation` | `SharedAppDomain` | Determines the level of thread isolation. If the value is `AppDomain` or `Process`, each test thread will create a separate launch.  |

Refer to [SpecFlow+ Runner Profiles](http://specflow.org/plus/documentation/SpecFlowPlus-Runner-Profiles/) for more information.

### MSTest V2

At the moment MSTest V2 only supports assembly-level parallelization.

Feature- and scenario-level parallelization were recently added in MSTest V2 v1.3.0 Beta2 (see [MSTest V2: in-assembly parallel test execution](https://blogs.msdn.microsoft.com/devops/2018/01/30/mstest-v2-in-assembly-parallel-test-execution/)).

## Thread-safe TestReporter

`ReportPortalAddin.CurrentFeature` and `ReportPortalAddin.CurrentScenario` static properties are deprecated and shouldn't be used when running tests in parallel.

To retrieve TestReporter for the current feature or for the current scenario, use `ReportPortalAddin.GetFeatureTestReporter` and `ReportPortalAddin.GetScenarioTestReporter` methods. These methods will work when called from any thread.

```c#
[Given("I have entered (.*) into the calculator")]
public void GivenIHaveEnteredSomethingIntoTheCalculator(int number)
{
    var featureTestReporter = ReportPortalAddin.GetFeatureTestReporter(this.FeatureContext);
    var scenarioTestReporter = ReportPortalAddin.GetScenarioTestReporter(this.ScenarioContext);
}
```

# Troubleshooting
All http error messages goes to `ReportPortal.*.log` file.

# Integrate logger framework
- [NLog](https://github.com/reportportal/logger-net-nlog)
- [log4net](https://github.com/reportportal/logger-net-log4net)
- [Serilog](https://github.com/reportportal/logger-net-serilog)
- [System.Diagnostics.TraceListener](https://github.com/reportportal/logger-net-tracelistener)

And [how](https://github.com/reportportal/commons-net/blob/master/docs/Logging.md) you can improve your logging experience with attachments or nested steps.

# Useful extensions
- [SourceBack](https://github.com/nvborisenko/reportportal-extensions-sourceback) adds piece of test code where test was failed
- [Insider](https://github.com/nvborisenko/reportportal-extensions-insider) brings more reporting capabilities without coding like methods invocation as nested steps

# License
ReportPortal is licensed under [Apache 2.0](https://github.com/reportportal/agent-net-specflow/blob/master/LICENSE)

We use Google Analytics for sending anonymous usage information as library's name/version and the agent's name/version when starting launch. This information might help us to improve integration with ReportPortal. Used by the ReportPortal team only and not for sharing with 3rd parties. You are able to [turn off](https://github.com/reportportal/commons-net/blob/master/docs/Configuration.md#analytics) it if needed.

repository: reportportal/agent-net-specflow

branch_name: refs/heads/develop

gha_language: C#

repo_name: reportportal/agent-net-specflow


text:
# spring-boot-streaming
Spring Boot, video streaming, Plyr

![capture](https://raw.githubusercontent.com/Anthony-Gaudino/video-streaming-service/master/capture.jpg "Screenshot of Project")

# About
This is a simplified version of https://github.com/tinywind/video-streaming-service.

All database related code was removed, and the self coded video player is replaced by Plyr, the project is updated to Spring Boot 2.0.0 and Java 9, many dependencies were removed, other minor changes.

# Usage
* Edit **Constants.java**, change `String path` to a directory containing the served files
* Edit **show.jsp**, change the `poster.jpg`, `video.mp4`, `video.webm` and `captions.vtt` to whatever your files names are.
* Install jdk1.9
* On the project root run `$ ./mvnw install`
* Then run: `$ ./mvnw spring-boot:run`
* On a web browser, visit `http://localhost:8080`

# References
* http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle
* http://millky.com/@origoni/post/1100
* http://march3samwuli.tistory.com/entry/Step-1-%EC%9D%8C%EC%95%85-%EC%8A%A4%ED%8A%B8%EB%A6%AC%EB%B0%8D-%EC%84%9C%EB%B2%84Spring-boot-%EC%95%B1Android%EC%9D%84-%EB%A7%8C%EB%93%A4%EC%96%B4%EB%B3%B4%EC%9E%90
* http://aodis.egloos.com/5962812
* http://www.w3schools.com/html/html5_video.asp
* https://msdn.microsoft.com/ko-kr/library/hh924823(v=vs.85).aspx
* http://gingertech.net/2009/08/19/jumping-to-time-offsets-in-videos/
* https://ko.wikipedia.org/wiki/HTML5_%EB%B9%84%EB%94%94%EC%98%A4

repository: Anthony-Gaudino/video-streaming-service

repo_name: Anthony-Gaudino/video-streaming-service


text:
---
title: Installing Grafana on Ubuntu
date: 2019-07-02 18:00:00 -0600
categories: [monitoring]
tags: [ubuntu,grafana]
toc: true
---

> **Hi there**! This post is [part of a series](https://www.richardn.ca/series/#home-server-revamp-2019) I am doing where I attempt to move most of the applications I use at home over to Linux. If you find this interesting you may enjoy the other posts too!
{: .prompt-tip }

Once you have a running instance of [InfluxDB](https://www.richardn.ca/posts/InstallingInfluxDBOnUbuntu/) being populated with that sweet, sweet [Telegraf](https://www.richardn.ca/posts/InstallingTelegrafOnUbuntu/) data, you are going to need a way to visualise it all, this is where [Grafana](https://grafana.com/) comes in. Grafana is by far one of the best dash-boarding systems out there and is simple to use.

In this post I will cover the steps needed to get Grafana up and running on your Ubuntu Server installation, let's dive in.

## Dependencies
Before you begin it is a good idea to make sure that you have the latest version of libfontconfig1 installed as my initial installation failed as it was missing on my system, installation is as simple as running:

```shell
sudo apt-get install -y libfontconfig1
```

Should you run into an error with the above you can run the below command (if the above succeeded you can skip this command):

```shell
sudo apt --fix-broken install
```

## Download and Install
Next, you will need to grab the appropriate installation package from [the official Grafana release page](https://grafana.com/grafana/download), in my case this was `grafana_6.2.2_amd64.deb`. Log onto your server and download the installation package using wget:

```shell
wget https://dl.grafana.com/oss/release/grafana_6.2.2_amd64.deb
```

Once downloaded you can install it with the command below:

```shell
sudo dpkg -i grafana_6.2.2_amd64.deb
```

After the installation has completed you can remove the package from your system as you no longer need it:

```shell
sudo rm -f grafana_6.2.2_amd64.deb
```

## Configuration
The main Grafana configuration file live in /etc/grafana/grafana.ini and you can edit it with your favourite bash editor:

```shell
sudo nano /etc/grafana/grafana.ini
```

The only real configuration changes I make are shown below, this is mainly binding to `<IP_ADDRESS>` and ensuring that the default port is set to `3000`.

```ini
[server]
http_addr = <IP_ADDRESS>
http_port = 3000
```

There are loads more configuration options to play around with, but as stated above these are the ones I most often mess around with.

## Creating a Service
You can enable the Grafana service with the following commands:

```shell
sudo systemctl enable grafana-server
sudo systemctl daemon-reload
```

You can start and stop Grafana with the following commands:

```shell
sudo systemctl start grafana-server
sudo systemctl stop grafana-server
```

Querying the status of Grafana is as simple as:

```shell
sudo systemctl status grafana-server
```

## First Time Configuration
Provided you left the default port unchanged, you should be able to connect to Grafana on `http://<server_ip>:3000/`, in my case that would be: `http://<IP_ADDRESS>:3000`

You should be greeted with the following login screen.

![](/assets/img/2019/2019-07-02/001.png)

Login using `admin` with default password `admin` (you will be prompted to change it on login).

Congratulations, you now have a working Grafana instance!


text:
# :rotating_light: This project was based on Keptn Pitometer that was deprecated with Keptn version 0.6.0. Please reach out to the Keptn team using Slack, a GitHub issue, or any other way you prefer to learn about the transition from Pitometer to the new [Lighthouse-Service](https://github.com/keptn/keptn/tree/develop/lighthouse-service). You can find new sandbox projects in the [keptn-sandbox org](https://github.com/keptn-sandbox) :rotating_light:

# Overview

Microservice web application running in Azure Functions that provides the processing logic of a passed in "perf spec" and start/end time frame. This service can be used as a software quality gate within continuous integration software pipelines.

The "perf spec" processing logic uses the [Keptn Pitometer NodeJS modules](https://github.com/keptn/pitometer). This web application uses these specific modules.
* [pitometer](https://github.com/pitometer/pitometer) - Core module that acts as monspec processor to the request
* [source-dynatrace](https://github.com/pitometer/source-dynatrace) - interfaces to Dynatrace API to collect metrics
* [grader-thresholds](https://github.com/pitometer/grader-thresholds) - evaluates the threasholds and scores the request

# Interface design

## Request - Perf Spec evaluation
* POST request to https://[baseurl]/api/pitometer
* Content-Type: application/json
* Body Structure
  * timeStart - start time in [UTC unix seconds format](https://cloud.google.com/dataprep/docs/html/UNIXTIME-Function_57344718) used for the query
  * timeEnd - end time in [UTC unix seconds format](https://cloud.google.com/dataprep/docs/html/UNIXTIME-Function_57344718) used for the query
  * perfSpec - a JSON structure containing the performance signature
    * spec_version - string property with pitometer version.  Use 1.0
    * indicator - array of each indicator objects
    * objectives - object with pass and warning properties
    * <details><summary>Body Structure Format</summary>

        ```
        {
            "timeStart":<PHONE_NUMBER>,
            "timeEnd":<PHONE_NUMBER>,
            "perfSpec": {
                "spec_version": "1.0",
                "indicators": [ { <Indicator object 1> } ],
                "objectives": {
                    "pass": 100,
                    "warning": 50
                }
            }
        }
        ```

        </details>

    * [Complete Body example](samples/pitometer.rest)

## Response of valid lookup

A valid response will return an HTTP 200 with a JSON body containing these properties:
* totalScore - numeric property with the sum of the passsing indicator metricScores
* objectives - object with pass and warning properties passed in from the request
* indicatorResults - array of each indicator and their specific scores and values
* result - string property with value of 'pass', 'warn' or 'warning'

<details><summary>
Example response message
</summary>

```
{
    "totalScore": 100,
    "objectives": {
        "pass": 100,
        "warning": 50
    },
    "indicatorResults": [
        {
            "id": "P90_ResponseTime_Frontend",
            "violations": [
                {
                    "value": 12773344.5,
                    "key": "SERVICE-CA9FE330E85EE73B",
                    "breach": "upper_critical",
                    "threshold": 4000000
                }]
            ],
            "score": 50
        },
        {
            "id": "AVG_ResponseTime_Frontend",
            "violations": [
                {
                    "value": 4308886.6,
                    "key": "SERVICE-CA9FE330E85EE73B",
                    "breach": "upper_critical",
                    "threshold": 4000000
                }
            ],
            "score": 50
        }
    ],
    "result": "pass"
}
```

</details>

## Example response of invalid arguments

A valid response will return an HTTP 400 with a JSON body containing these properties:
* result - string property with value of 'error'
* message - string property with error messsage

<details><summary>
Example response message
</summary>

```
{
  "status": "error",
  "message": "Missing timeStart. Please check your request body and try again."
}
```
</details>

## Example response of processing error

A valid response will return an HTTP 500 with a JSON body containing these properties:
* result - string property with value of 'error'
* message - string property with error messsage

<details><summary>
Example response message
</summary>

```
{
  "status": "error",
  "message": "The given timeseries id is not configured."
}
```
</details>

# Run the app from Azure Functions

You can run the app inside of Visual Studio Code using VSCODE tools for Azure Functions (option 1): https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions or build everything using Azure CLI, bash/cmd and your favorite node JS IDE tools to code and push to Azure (option 2).

### Option 1 - Running from VSCODE

1. Follow the instructions to create your project and set your VSCODE environment to work with Azure Functions following this tutorial: https://code.visualstudio.com/tutorials/functions-extension/getting-started, You don`t need to create a new Functions project and publish it to Azure, We will do it later, but make sure that your environment is working correctly and the best way is following the tutorial until the end.

2. Clone THIS repository and select (open the folder with VSCODE) (set the folder as the root of your project in VSCODE).

3. Run the following commands to make sure the Functions is working locally:

    * Install the dependencies
        ```
        npm install
        ```
    * Run the project using the Debugger option in VSCODE (Pressing F5) or type in terminal:
        ```
        npm start
        ```
4. The Project should start and you will see in the terminal window the URLs of the functions APIs, use the http://localhost:7071/api/pitometer to send requests, use the pitometer.rest located at the project sample folder to send to your requests (this perfSpec is designed to use with Dynatrace tools if you want to create your own perfSpec file to integrate Prometheus or other telemetry tools feel free to share with us!).

5. Create the environment variables in the Azure Functions App Settings, open the Azure Tab in VSCODE and click on the Function App and click again to download the Appsettings to your machine, this will create a local.settings.json in your project. Update the Appsettings with the following variables (Fill the values of DYNATRACE_BASEURL and DYNATRACE_APITOKEN):

```
DYNATRACE_BASEURL
DYNATRACE_APITOKEN
```

![CONFIGURING APPSETTINGS IN AZURE FUNCTIONS](https://github.com/dt-azure-demo/pitometer-azfunctions/blob/master/resources/localsettings.png)

If you don`t have created yet the Azure Function in Azure yet, you can modify in the local.settings.json locally and Upload the file after you updated it.

```json
{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "<YOUR AZURE STORAGE ACCOUNT>",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "FUNCTIONS_EXTENSION_VERSION": "~2",
    "WEBSITE_NODE_DEFAULT_VERSION": "8.11.1",
    "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "<YOUR AZURE FILE STORAGE ACCOUNT>",
    "WEBSITE_CONTENTSHARE": "pitfunc-content",
    "WEBSITE_RUN_FROM_PACKAGE": "1",
    "DYNATRACE_APITOKEN": "<YOUR DYNATRACE API TOKEN>",
    "DYNATRACE_BASEURL": "<YOUR DYNATRACE BASE URL>"
  }
}
```

6. make a post request using a tool like [Postman](https://www.getpostman.com/downloads/) or the [VS Code REST client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) and the [Complete Body example](samples/pitometer.rest)

7. Create the service Azure Functions App using the Azure Portal, VSCODE or Azure CLI, choose the best one for you and after creating the service in Azure, deploy it using the VSCODE button ()Deploy to Function App...).

Here are some ways to create the Azure Functions in Azure (this tutorial tested only with Windows Azure Functions v2.0):

Creating the Function using VSCODE: https://docs.microsoft.com/pt-br/azure/azure-functions/functions-create-first-function-vs-code

Create the Azure Functions using Azure Portal: https://docs.microsoft.com/pt-br/azure/azure-functions/functions-create-first-azure-function

Create the Azure Functions using Azure CLI: https://docs.microsoft.com/pt-br/azure/azure-functions/functions-create-first-azure-function-azure-cli

### Option 2 - Code and Deploy everything with scripts and code

1. You must have [node](https://nodejs.org/en/download/) installed locally.
2. Once you clone the repo, you need to run ```npm install``` to download the required modules
3. Confugure these environment variables
  * option 1: set environment variables in the shell
    ```
    export DYNATRACE_BASEURL=<dynatrace tenant url, example: https://abc.live.dynatrace.com>

    export DYNATRACE_APITOKEN=<dynatrace API token>
    ```
4. run ```npm start```
5. make post request using a tool like [Postman](https://www.getpostman.com/downloads/) or the [VS Code REST client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) and the [Complete Body example](samples/pitometer.rest)
6. Install the Azure Functions tools in your environment, follow the documentation to set up in Windows, Mac or Linux: https://code.visualstudio.com/tutorials/functions-extension/getting-started
7. Create the Azure Functions using the Azure CLI https://docs.microsoft.com/pt-br/azure/azure-functions/functions-create-first-azure-function-azure-cli follow the documentation to create all the resources needed to deploy Azure Functions and COPY the GIT Address and credentials to push changes to the Functions repository, We will do a new push to this respository using the code from this repository.
8. Clone this repository, set the new origin using the GIT Address you copied in the step before and push it.
9. The Azure Function should restart and you can access using the  address https://[yourfunctionsname.azurewebsites.net]/api/pitometer

repository: dt-demos/pitometer-azure-function

repo_name: dt-demos/pitometer-azure-function


text:
buffer-extension-shared
=======================

Shared code between Buffer extensions

# Contributing

While maintained by Buffer, we welcome any improvements you have! Feel free to
fork this repo and submit any pull requests that could benefit this project.

# Notes

Mozilla requires any major library to be unmodified from it's original release.
To get a list of these libraries visit Mozilla's [amo-validator](https://github.com/mozilla/amo-validator/blob/master/validator/testcases/hashes.txt) repo.
To compare your file on a mac run:

    $ shasum -a 256 path/to/your/file.js

repository: bufferapp/buffer-extension-shared

repo_name: bufferapp/buffer-extension-shared


text:
# pg-history-db

Append-only database driver for PostgreSQL

## Dependencies

- nvm (or the correct version of node according to .nvmrc)
- yarn
- docker
- docker-compose

## Tests

1. Run `nvm install`
2. Run `yarn`
3. Run `docker-compose up -d`
4. Run `yarn test`

repository: triptease/pg-history-db

repo_name: triptease/pg-history-db


text:
# Securing Hub/Signing_Server (The example below is for hub but could easily adjusted to signing_server as well)

## Connect to Hub via SSL
1. Create certificates, see example scripts in `docs/ssl` for further guidance. *The server CN needs to match the actual server's hostname!*
2. Start Hub in correct authMode: `--authMode ssl --sslKey docs/ssl/server.key --sslCert docs/ssl/server.crt --sslCA docs/ssl/ca.crt`

   **Please note that if you're running the hub via `bazel run`, these paths need to be absolute!**
3. Configure your Hub client to use SSL, see the provided Python example for further guidance. If you're using grpcc for testing, this might be helpful:
   `grpcc -a 'localhost:50051' -p proto/hub.proto --root_cert path-to/ca.crt --private_key path-to/client.key --cert_chain path-to/client.crt`

repository: iotaledger/hub

repo_name: iotaledger/hub


text:
![](https://img.shields.io/badge/Status:-RELEASED-green)

## Publish Data Endpoint Node Type

A node type that represents an endpoint that can receive data.

| Name | URI | Version | Derived From |
|:---- |:--- |:------- |:------------ |
| `PublishDataEndPoint` | `radon.nodes.datapipeline.destination.PublishDataEndPoint` | 1.0.0 | `radon.nodes.datapipeline.DestinationPB` |

gha_language: Python