text:
# micrograd

![awww](puppy.jpg)

A tiny Autograd engine (with a bite! :D). Implements backpropagation (reverse-mode autodiff) over a dynamically built DAG and a small neural networks library on top of it with a PyTorch-like API. Both are currently about 50 lines of code each.

The DAG only allows individual scalar values, so e.g. we chop up each neuron into all of its individual tiny adds and multiplies. In particular, the current library only supports scalars and three operations over them: (+,*,relu), but in fact these are enough to build up an entire deep neural net doing binary classification, as the demo notebook shows. Potentially useful for educational purposes. See the notebook `demo.ipynb` for a full demo of training an MLP binary classifier.

### Example usage

```python
from micrograd.engine import Value

x = Value(1.0)
z = 2 * x + 2 + x
q = z + z * x
h = z * z
y = z * z + q + q * x
print(y.data) # prints 45.0
y.backward()
print(x.grad) # prints 62.0 - i.e. the numerical value of dy / dx
```

### Tracing / visualization

Have a look at the jupyter notebook `trace_graph.ipynb` to also produce graphviz visualizations. E.g. this one is of a simple 2D neuron, arrived at by calling `draw_dot` on the code below, and it shows both the data (top number in each node) and the gradient (bottom number in each node).

```python
from micrograd import nn
n = nn.Neuron(2)
x = [Value(1.0), Value(-2.0)]
y = n(x)
dot = draw_dot(y)
```

![2d neuron](gout.png)

repository: newcodevelop/micrograd

repo_name: newcodevelop/micrograd


text:
# Sudoku

![License](https://img.shields.io/badge/license-MIT-blue.svg "License Badge")

This Sudoku App is my first project since graduating the Full Stack Bootcamp.

## 🍔 Getting started

####  🐑 Cloning

1. [Fork this repository](https://help.github.com/en/articles/fork-a-repo).
1. [Clone the forked repository](https://help.github.com/en/articles/cloning-a-repository) locally
1. Run `npm install` to install dependencies

## 💥 Issues

This app is still under development and includes many issues. Sending data around the code from component to component proves to be my biggest learning opportunity so far.

## ☕ License:

For more information about the license, click on the link below.

- [License](https://choosealicense.com/licenses/mit/)

## ❔ Questions:

For questions about this project you can go to my GitHub page at the following link:

- [GitHub Profile](https://github.com/Halvosaurus34)

For additional questions please reach out to me at<EMAIL_ADDRESS>
---

## 🎯 Links

[Sudoku GitHub Repository](https://github.com/Halvosaurus34/Sudoku)

---

I used [Sudoku](https://www.npmjs.com/package/sudoku) npm package and [react-compound-timer](https://www.npmjs.com/package/react-compound-timer) to build this web app.

---

## 👀 Screenshot

![Website Screenshot](./Screenshot.PNG)

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
## Want to contribute?

Found a bug or have an idea to improvement? First [open an issue](https://github.com/mvmjacobs/timetracking/issues) and we will discuss about it.

But if you want to resolve an issue, first make sure the issue is not tagged with `committed` neither `in progress`. After that, follow the instructions below to make a pull request.

### How to make a clean pull request

- Create a personal fork of the project on Github.
- Clone the fork on your local machine. Your remote repo on Github is called `origin`.
- Add the original repository as a remote called `upstream`.
```
$ git remote add upstream https://github.com/mvmjacobs/timetracking.git
```
- If you created your fork a while ago be sure to pull upstream changes into your local repository.
- Create a new branch to work on! Branch from `dev-z.x.y` (current version number) if it exists, else from `master`.
- Implement/fix your feature, comment your code.
- Add or change the documentation as needed.
- Use [keywords](https://help.github.com/articles/closing-issues-using-keywords/) in your commit message. To bug fixes use `(fixes #n)`, to improvements and new features use `(resolves #n)`. (When `n` is the issue number).
- Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary.
- Push your branch to your fork on Github, the remote `origin`.
- From your fork open a pull request in the correct branch. Target the project's `dev-z.x.y` (current version number) branch if there is one, else go for `master`
- Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete
your extra branch(es).

 Your commit message should describe what the commit, when applied, does to the code – not what you did to the code.

repository: mvmjacobs/timetracking

branch_name: refs/heads/master

gha_language: TypeScript

gha_license_id: MIT

repo_name: mvmjacobs/timetracking


text:
---
layout: post
title: "Introducing ACL"
---
Over the years, I’ve had my fare share of discussions about animation compression and two things became obvious over time:
we were all (re-)doing similar things and none of us had access to a state of art implementation to compare against.
This lead to rampant speculation about which algorithm was superior or inferior.
Having implemented a few algorithms in the past, I have finally decided to redo all that work once more and in the open this time.
Say ‘Hello’ to the [Animation Compression Library]( https://github.com/nfrechette/acl) (**ACL** for short).

To quote the readme:

>  This library has two primary goals:
>  * Implement state of the art and production ready animation compression algorithms
>  * Serve as a benchmark to compare various techniques against one another

Over the next few months, I hope to implement state of the art versions of common algorithms and to surpass what current game engines currently offer.
It is my hope that this library can serve as the foundation for an industry standard so that together we may be able to move forward and well past the foot sliding issues of yester-year!

gha_language: CSS

gha_license_id: NOASSERTION


text:
# 2.0.5
  - Specs fixes, see https://github.com/logstash-plugins/logstash-patterns-core/pull/137
# 2.0.4
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
# 2.0.3
  - New dependency requirements for logstash-core for the 5.0 release
## 2.0.0
 - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
   instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
 - Dependency on logstash-core update to 2.0

# 0.4.0
 - Added grok patterns for nagios notifications
 - Added commong exim patterns
 - Allow optional space between sysloghost and colon, fixes https://github.com/elastic/logstash/issues/2101 for Cisco ASA devises.
 - Make progname optional (not always provided) for the syslog base patern.
 - Improve pattern matching performance for IPV4 patterns.
 - Fixes: UNIXPATH pattern does not combine well with comma delimination, https://github.com/logstash-plugins/logstash-patterns-core/issues/13
 - Add new valid characters for URI's in HTML5 patterns.
 - Make IPORHOST pattern match first an IP and then a HOST as the name
   implies.
 - Added patterns for ASA-4-106100, ASA-4-106102, ASA-4-106103 CISCO
   firewalls.
 - Update CISCOFW106023 rule to match values from FWSM
 - Add basic apache httpd error log format
 - Support TIMESTAMP_ISO8601 in HAProxy patterns, useful for rsyslog and other systems that can be configured to use this format. Fixes https://github.com/logstash-plugins/logstash-patterns-core/pull/80

# 0.3.0
 - Updated the AWS S3 patterns
 - Added patterns for rails 3
 - Added patterns for haproxy
 - Added patterns for bro http.log
 - Added shorewall patterns
# 0.2.0
 - Added patterns for S3 and ELB access logs amazon services
# 0.1.12
 - add some missing Cisco ASA firewall system log patterns
 - fix cisco firewall policy_id regex for policies with '-' in the name
# 0.1.11
 - Added Catalina and Tomcat patterns
 - Added German month names

repository: CoderlikeTea/aiLog

gha_language: Roff

repo_name: CoderlikeTea/aiLog


text:
# An overview of Kubernetes

Notice: This hasn't been updated in some time, and while most of it still
remains relevant, there are certainly things in here I'd like to update to keep
on track with the Kubernetes project. This is due to a) me being a bit lazy, and
b) most importantly, the amazing contributors who hack away on Kubernetes. There
is so much love for that project and we're seeing new versions and features
being shipped frequently. I hope this keeps up. And I also hope to keep up with
it at some point in regards to this project. Contributions are still and always
welcome. If you're a Kubernetes contributor and you're reading this, thank you
for everything.

Recently I have been playing around with Kubernetes on Google Container Engine.
At first it seemed pretty daunting to me and from what I've heard from a few
other people it has been the same for them. But once you start getting used to
how Kubernetes works and how you're supposed to use it, you realise how powerful
it can be and how it can make your deployments seem almost effortless. The goal
of this document is to go through Kubernetes step by step in such a way whereby
the only prerequisite for you is that you understand what containers are and
ideally, how Docker works. This is just Kubernetes in my own words. I hope you
find it helpful. (WIP)

### So what is it?
In short, Kubernetes is a set of tools and programs that give you higher level
control of your cluster and everything running on it. Once Kubernetes is all set
up on your cluster you can start pods, services, and have your containers all
running in harmony. You can find out more about it, along with Google Container
Engine [here][1].

### Up and running quickly
A great way to get up and running quickly with Kubernetes is to get set up with
Google Container Engine, which allows you to start up a cluster with everything
working from the get go. You can manage aspects of this using the [gcloud][2]
cli tool, which I'll be using in this brief introduction. You can also get up
and running locally using Vagrant, or elsewhere as listed on the
[getting started page][3].

For this tutorial I will be using the following:

  - Go
  - Docker / Docker Hub
  - A Linux environment
  - gcloud cli application /w kubectl
  - Google Container Engine / Kubernetes

### The application

First, we need an application that we'd like to run on our cluster. We could
use one that already exists, but for this introduction I'm going to create one
using the [Go programming language][4].

[`hello.go`][8]
```go
package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {
	http.HandleFunc("/", handler)
	log.Fatal(http.ListenAndServe(":3000", nil))
}

func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprint(w, "Hello from Go!")
}
```

Next, we'll compile this program making sure it is statically linked:

Go 1.4:

```
$ CGO_ENABLED=0 GOOS=linux go build -o hello -a -installsuffix cgo .
```

Go 1.5:

```
$ CGO_ENABLED=0 GOOS=linux go build -o hello -a -tags netgo -ldflags '-w' .
```

We're now left with our `hello` binary. If you're already on Linux, you'll be
able to test this. If not, you can boot up a VM and try it out there. We'll be
using Docker next to create our container image.

As we already have our compiled application, our Dockerfile is going to be super
simple:

`Dockerfile`
```
FROM scratch
ADD hello /
CMD ["/hello"]
```

We can then build this and push it to the Docker registry:

```
$ docker build -t DOCKERHUB_USERNAME/hello:latest .
$ docker push DOCKERHUB_USERNAME/hello
```

So now we have our image built and pushed, we should be able to test running it:

```
$ docker run -p 3000:3000 DOCKERHUB_USERNAME/hello
```

And to check that our application is working correctly:

```
$ curl localhost:3000
Hello from Go!
```

### Starting the cluster

Now we have our container image pushed to the Docker hub, we can get a start on
creating the cluster.

Once you have gcloud installed, you'll be able to install kubectl:

```
$ gcloud components update kubectl
```

If you've set up Google Container Engine and have enabled billing etc... you
should have a default project listed. You can access that [here][5].

NOTE: If you've not done this yet and feel uneasy about paying for something you
might never use, Google (at least as of writing this) offer 60 days and $300
worth of resources to use with Google Cloud Platform when you initially sign up,
no strings attached. This is a total steal, just [go here][7] then click on
Free Trial.

Get the ID of the project and configure like so:

```
$ gcloud config set project PROJECT_ID
```

Next, set your default zone (you can learn about that [here][6]):

```
$ gcloud config set compute/zone ZONE
```

You can now start the cluster. I'll just be using the default settings here, but
you can use flags to customise various aspects of it.

```
$ gcloud container clusters create helloapp
```

After a few moments, your cluster will be created! You should see something like
this:

```
NAME      ZONE            MASTER_VERSION  MASTER_IP       MACHINE_TYPE   NODE_VERSION  NUM_NODES  STATUS
helloapp  europe-west1-b  1.1.7           <IP_ADDRESS>     n1-standard-1  1.1.7         3          RUNNING
```

Now we're ready to start deploying our application.

### Pods

This is where things might start to seem a little daunting if you're new to
Kubernetes. But once you get used to it, it's really not that bad. Kubernetes
has this concept of pods. Pods are basically a collection of 1 or more
containers, it's that simple. Within a pod you can allocate resources and limits
to what the containers have access to.

Kubernetes makes it easy for us to create multiple pods of the same application
and sit them behind a load balancer. We can also tell Kubernetes that at anytime
we'd like 3 instances of our app to be running. Or 4, or 5. It doesn't really
matter too much at this point. What does matter though, is that Kubernetes will
make sure that how ever many you specify to be running at one time, it will
stick to that, by means of creating new pods if one were to go down, or to bring
a pod down if at anytime there are too many running. I'll get onto that shortly.

First though, let's create a single pod. We'll do this by use of a JSON
document. You may also use YAML if you prefer that.

[`hello-pod.json`][9]
```json
{
  "apiVersion": "v1",
  "kind": "Pod",
  "metadata": {
    "name": "hello",
    "labels": {
      "name": "hello"
    }
  },
  "spec": {
    "containers": [
      {
        "name": "hello",
        "image": "DOCKERHUB_USERNAME/hello:latest",
        "ports": [
          {
            "name": "http",
            "containerPort": 3000,
            "protocol": "TCP"
          }
        ]
      }
    ]
  }
}
```

Let's go over this a little. So we're specifying the API version we'll be using
at the top here. In this example this is simply just `v1`. We need to tell
Kubernetes what it is we'd like to create, in this case it's a `Pod`, which is
the value to `kind`.

As you can see there is also a metadata section, where we can name this pod,
and provide it some key / value pairs under labels. Labels, as you'll come to
see are pretty important, as we can select resources to be ran by using them,
as opposed to just a name.

And finally the `spec`, which is where we list our containers to be ran in this
pod. We're only going to be using the one. This will be pulled from the Docker
registry that we pushed to earlier on.

We then specify the ports, and if you remember from earlier our Go application
runs on port 3000, so we'll use that here also.

Let's now create this pod:

```
$ kubectl create -f hello-pod.json
pod "hello" created
```

If we list our pods, the newly created one should be there:

```
$ kubectl get pods
NAME      READY     STATUS    RESTARTS   AGE
hello     1/1       Running   0          1m
```

So now that is up and running, we can move on to services.

### Services

So what is a service and why do we need them? As far as Kubernetes is concerned,
a service is basically a named load balancer. In essence this means that we
could have multiple pods running on our cluster, and have our service use the
metadata to select the pods that are relevant. You will then be able to hit the
application that is running inside one of your pods via the public IP of the
service.

So let's create the service:

[`hello-service.json`][10]
```json
{
  "apiVersion": "v1",
  "kind": "Service",
  "metadata": {
    "name": "hello-service",
    "labels": {
      "name": "hello-service"
    }
  },
  "spec": {
    "type": "LoadBalancer",
    "ports": [
      {
        "name": "http",
        "port": 80,
        "targetPort": 3000
      }
    ],
    "selector": {
      "name": "hello"
    }
  }
}
```

You can see here that we're using the `selector` key to find anything using the
specified metadata key / value pairs. In this case, something with the `name`,
`hello`. The target port of this pod is 3000, as specified in the pod file, but
we would like to run that on port 80, so it's more accessible. With this kind of
service, the `type` needs to be specified as `LoadBalancer`. This allows it to
be publically accessible to the outside world via IP address.

So with both our `hello-pod.json` and our `hello-service.json`, we're now able
to create them on the cluster:

```
$ kubectl create -f hello-service.json
service "hello-service" created
```

We can also list our services, and should see this new one appear:

```
$ kubectl get services
NAME            CLUSTER_IP       EXTERNAL_IP   PORT(S)   SELECTOR     AGE
hello-service   <IP_ADDRESS>                 80/TCP    name=hello   44s
kubernetes      <IP_ADDRESS>     <none>        443/TCP   <none>       8m
```

It may take a few moments, but once the service is up and running, you should be
able to visit the external IP address and see the application up and running.
You can find out what that is by running the following:

```
$ kubectl describe services hello-service
```

It should look a little like this:

```
Name:			hello-service
Namespace:		default
Labels:			name=hello-service
Selector:		name=hello
Type:			LoadBalancer
IP:			    <IP_ADDRESS>
LoadBalancer Ingress:	<IP_ADDRESS>
Port:			http	80/TCP
NodePort:		http	30962/TCP
Endpoints:		<IP_ADDRESS>:3000
Session Affinity:	None
```

If you try going to the IP address listed as `LoadBalancer Ingress:` in your
web browser, you should see the application running live.

```
$ curl <IP_ADDRESS>
Hello from Go!
```

### Replication Controllers

A replication controller is responsible for keeping a defined amount of pods
running at any given time. You may have your replication controller create 4
pods for example. If one goes down, the controller will be sure to start another
one. If for some reason a 5th one appears, it will kill one to bring it back
down to 4. It's a pretty straight-forward concept, and better yet we can make
use of our pod files we made earlier to create our first replication
controller.

[`hello-rc.json`][11]
```json
{
  "apiVersion": "v1",
  "kind": "ReplicationController",
  "metadata": {
    "name": "hello-rc",
    "labels": {
      "name": "hello-rc"
    }
  },
  "spec": {
    "replicas": 3,
    "selector": {
      "name": "hello"
    },
    "template": {
      "metadata": {
        "name": "hello",
        "labels": {
          "name": "hello"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "hello",
            "image": "DOCKERHUB_USERNAME/hello:latest",
            "ports": [
              {
                "name": "http",
                "containerPort": 3000,
                "protocol": "TCP"
              }
            ]
          }
        ]
      }
    }
  }
}
```

So if you look beyond `template`, you'll see the same pod that we created
earlier on. If the replication controller is going to start and maintain a
number of pods, it needs a template to know what our pods will look like.

Above `template`, you'll see things specific to the controller itself. Notably,
the `replicas` key which defines how many of the pods specified below should
be running. It also uses a selector, which is again linked with the metadata
provided inside the pod. So this replication controller is going to look for
anything with `name` as `hello`. Above that you'll also notice keys which so
fer we've specified in each of our other files too.

So at this point we can kill the pod we created earlier on:

```
$ kubectl delete pods hello
```

and then create our replication controller:

```
$ kubectl create -f hello-rc.json
```

After that has started, you should be able to see 3 of our `hello` pods running:

```
$ kubectl get pods
```

The `hello-service` should also still be running, serving incoming request to
each of your newly created pods. We can see the replication controller in action
if we manually try to delete a pod:

```
$ kubectl delete pods POD_ID
```

and then quickly run:

```
$ kubectl get pods
```

To see what is going on under the hood.

### Scaling

So with our replication controller handling our pods and our service balancing
the load, we can now think about scaling. As of now, we haven't specified any
limits for the pods, I will come to that shortly.  You write a blog post about it and send out a few
tweets. The traffic is on the rise. Your app is beginning to struggle with the
load. We need to create more pods to even the load out on the cluster. We're
going to do this with just one simple command and change from having 3 pods to
5 pods:

```
$ kubectl scale --replicas=5 -f hello-rc.json
```

You should now be able to run:

```
$ kubectl get pods
```

to see the two newly created ones:

```
$ kubectl get pods
NAME             READY     STATUS    RESTARTS   AGE
hello-zndh4s     1/1       Running   0          21m
hello-j8sdgd     1/1       Running   0          21m
hello-8sjn4h     1/1       Running   0          21m
hello-ka98ah     1/1       Running   0          1m
hello-qjwh37     1/1       Running   0          1m
```

This works both ways. Eventually the traffic might subside, and you can then
bring it back down to 3 pods.

```
$ kubectl scale --replicas=3 -f hello-rc.json
```

### Persistent Storage

NOTE: To go through this next part, you may want to delete all the pods and
services currently running, first:

```
$ kubectl delete services hello-service
$ kubectl delete rc hello-rc
```

Something your application may need is storage. You may be dealing with file
uploads, or a database. Although containers should be seen as being fairly
disposable, your storage / data should remain. GCE makes this really easy for us
as all we need to do is to create a disk, and then tell our containers where
that disk is.

So let's make a disk first of all:

```
$ gcloud compute disks create mysql-disk
```

By default, this will create a 500GB disk. You can change this among various
other settings by passing flags to that command.

Within the scope of `containers` in either your pod or ReplicationController
file, you can add another section called `volumeMounts`. Here, you are able to
specify where inside your container you'd like to mount.

I've created a new application called todo.go. It is based off our original
hello.go application, only it actually does something this time:

[`todo.go`][12]
```go
package main

import (
	"database/sql"
	"fmt"
	"html/template"
	"log"
	"net/http"

	_ "github.com/go-sql-driver/mysql"
)

const dbHost = "mysql-service:3306"
const dbUser = "root"
const dbPassword = "password"
const dbName = "todo"

func main() {
	http.HandleFunc("/", todoList)
	http.HandleFunc("/save", saveItem)
	log.Fatal(http.ListenAndServe(":3000", nil))
}

// Todo represents a single 'todo', or item.
type Todo struct {
	ID   int
	Item string
}

// todoList shows the todo list along with the form to add a new item to the
// list.
func todoList(w http.ResponseWriter, r *http.Request) {
	tmpl := `
<html>
	<head>
		<title>List of items</title>
	</head>
	<body>
		<h1>Todo list:</h1>
		<form action="/save" method="post">
			Add item: <input type="text" name="item" /><br />
			<input type="submit" value="Add" /><br /><hr />
		</form>
		<ul>
		{{range $key, $value := .TodoItems}}
			<li>{{ $value.Item }}</li>
		{{end}}
		</ul>
	</body>
</html>
`
	t, err := template.New("todolist").Parse(tmpl)
	if err != nil {
		log.Fatal(err)
	}

	dbc := db()
	rows, err := dbc.Query("SELECT * FROM items")
	if err != nil {
		log.Fatal(err)
	}

	todos := []Todo{}
	for rows.Next() {
		todo := Todo{}
		err = rows.Scan(&todo.ID, &todo.Item)
		todos = append(todos, todo)
	}

	data := struct {
		TodoItems []Todo
	}{
		TodoItems: todos,
	}

	t.Execute(w, data)
}

// saveItem saves a new todo item and then redirects the user back to the list
func saveItem(w http.ResponseWriter, r *http.Request) {
	dbc := db()
	stmt, err := dbc.Prepare("INSERT items SET item=?")
	if err != nil {
		log.Fatal(err)
	}
	_, err = stmt.Exec(r.FormValue("item"))
	if err != nil {
		log.Fatal(err)
	}
	http.Redirect(w, r, "/", 301)
}

// db creates a connection to the database and creates the items table if it
// does not already exist.
func db() *sql.DB {
	connStr := fmt.Sprintf(
		"%s:%s@tcp(%s)/%s?charset=utf8&parseTime=True&loc=Local",
		dbUser,
		dbPassword,
		dbHost,
		dbName,
	)
	db, err := sql.Open("mysql", connStr)
	if err != nil {
		log.Fatal(err)
	}
	_, err = db.Exec(`CREATE TABLE IF NOT EXISTS items(
		id integer NOT NULL AUTO_INCREMENT,
		item varchar(255),
		PRIMARY KEY (id)
	)`)
	return db
}

```

Now we can go through similar steps from earlier to create our binary and Docker
container image. This one will be called `todo`.

```
$ go get -u github.com/go-sql-driver/mysql
$ CGO_ENABLED=0 GOOS=linux go build -o todo -a -tags netgo -ldflags '-w' .
```

`Dockerfile`
```
FROM scratch
ADD todo /
CMD ["/todo"]
```

```
$ docker build -t DOCKERHUB_USERNAME/todo:latest .
$ docker push DOCKERHUB_USERNAME/todo
```

That is our container image pushed to the Docker Hub. Now onto defining our
replication controller and services. Seeing as we'll be using MySQL this time,
we'll be creating a seperate disk using the gcloud cli tool. This is what we'll
use when configuring the `volumes` for our containers.

```
$ gcloud compute disks create mysql-disk
```

`mysql-disk` is going to be the name of it. This is important as it is used
to reference the disk in our JSON files. Once that is done, we can go ahead and
create the MySQL pod.

[`mysql.json`][13]
```json
{
  "apiVersion": "v1",
  "kind": "Pod",
  "metadata": {
    "name": "mysql",
    "labels": {
      "name": "mysql"
    }
  },
  "spec": {
    "containers": [
      {
        "name": "mysql",
        "image": "mysql:5.6",
        "env": [
          {
            "name": "MYSQL_ROOT_PASSWORD",
            "value": "password"
          },
          {
            "name": "MYSQL_DATABASE",
            "value": "todo"
          }
        ],
        "ports": [
          {
            "name": "mysql",
            "protocol": "TCP",
            "containerPort": 3306
          }
        ],
        "volumeMounts": [
          {
            "name": "mysql-storage",
            "mountPath": "/var/lib/mysql"
          }
        ]
      }
    ],
    "volumes": [
      {
        "name": "mysql-storage",
        "gcePersistentDisk": {
          "pdName": "mysql-disk",
          "fsType": "ext4"
        }
      }
    ]
  }
}

```

As you can see in this file, we specify a few more things than in our original
hello pod. We'll be using the official `mysql:5.6` container image from Docker
Hub. Environment variables are set to configure various aspects of how this pod
will run. You can find documentation for these at the Docker Hub on the MySQL
page.

We'll just be setting the basics, `MYSQL_ROOT_PASSWORD` and `MYSQL_DATABASE`.
This will give us access to our `todo` database as the `root` user. The next new
thing here are the `volumeMounts` and `volumes` keys. We give each volume mount
a name and path. The name is what is then used by the `volumes` as a reference
to it. The mount path is just where on the container you'll mount to.

Outside of the scope of our containers, we can specify where our volume mounts
will be. In this case, we'll be using the newly created `mysql-disk` from
earlier, and defining the file system type to `ext4`. Now we can start the pod:

```
$ kubectl create -f mysql.json
```

Next, we'll create a service for this pod. Like earlier, our service is going to
be acting as a load balancer. We'll say what port we'd like to listen on, along
with the target port of the running container:

[`mysql-service.json`][14]
```json
{
  "apiVersion": "v1",
  "kind": "Service",
  "metadata": {
    "name": "mysql-service",
    "labels": {
      "name": "mysql"
    }
  },
  "spec": {
    "selector": {
      "name": "mysql"
    },
    "ports": [
      {
        "protocol": "TCP",
        "port": 3306,
        "targetPort": 3306
      }
    ]
  }
}
```

We can now start this:

```
$ kubectl create -f mysql-service.json
```

Take note of the `name` key in this file. Google Container Engine comes with
a DNS service already running, which means pods are able to access each other
using the value to `name` as the host. If you noticed in our Go program, we
specify the host as `mysql-service:3306`. This can also be done with environment
variables. I'll go into detail with that another time.

With MySQL running, we should be able to start our todo application now. For
this example I'll be using a replication controller rather than just a single
pod definition:

[`todo-rc.json`][15]
```json
{
  "apiVersion": "v1",
  "kind": "ReplicationController",
  "metadata": {
    "name": "todo-rc",
    "labels": {
      "name": "todo-rc"
    }
  },
  "spec": {
    "replicas": 3,
    "selector": {
      "name": "todo"
    },
    "template": {
      "metadata": {
        "name": "todo",
        "labels": {
          "name": "todo"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "todo",
            "image": "DOCKERHUB_USERNAME/todo:latest",
            "ports": [
              {
                "name": "http",
                "containerPort": 3000,
                "protocol": "TCP"
              }
            ]
          }
        ]
      }
    }
  }
}
```

You'll notice this file is very similar to our hello app replication controller.
We can start this now:

```
$ kubectl create -f todo-rc.json
```

And the service, with `"type": "LoadBalancer"` to expose a public IP:

[`todo-service.json`][16]
```json
{
  "apiVersion": "v1",
  "kind": "Service",
  "metadata": {
    "name": "todo-service",
    "labels": {
      "name": "todo-service"
    }
  },
  "spec": {
    "type": "LoadBalancer",
    "ports": [
      {
        "name": "http",
        "port": 80,
        "targetPort": 3000
      }
    ],
    "selector": {
      "name": "todo"
    }
  }
}
```

The same as always:

```
$ kubectl create -f todo-service.json
```

Once the service has finished creating the load balancer, you can head over to
the public IP to see your application running.

More coming soon...

### Questions and contributions

If you have any questions, feel free to open an issue. Contributions are more
than welcome, especially if you think there is something that can be explained
more clearly or see any mistakes.

### License

This project uses the MIT license.

[1]: https://cloud.google.com/container-engine/docs/
[2]: https://cloud.google.com/sdk/gcloud/
[3]: http://kubernetes.io/gettingstarted/
[4]: http://golang.org
[5]: https://console.cloud.google.com/project
[6]: https://cloud.google.com/compute/docs/zones#available
[7]: https://cloud.google.com/
[8]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/src/hello/hello.go
[9]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/resources/hello/hello-pod.json
[10]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/resources/hello/hello-service.json
[11]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/resources/hello/hello-rc.json
[12]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/src/todo/todo.go
[13]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/resources/todo/mysql.json
[14]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/resources/todo/mysql-service.json
[15]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/resources/todo/todo-rc.json
[16]: https://raw.githubusercontent.com/hazbo/kubernetes-overview/master/resources/todo/todo-service.json

repository: hazbo/kubernetes-overview

gha_language: Go

repo_name: hazbo/kubernetes-overview


text:
---
layout: docs
toc: api-toc.html
title: API Reference
---

### [Admin HTTP API](admin)

This HTTP-based API can be used to remotely administer the runtime. It is used
by the Node-RED Editor and command-line admin tool.

### [Runtime API](runtime)

This API can be used when embedding Node-RED into another application.

### [Storage API](storage)

This API provides a pluggable way to configure where the Node-RED runtime stores
data.

### [Editor UI Widgets](ui)

A set of jQuery widgets that can be used within a node's edit template. _Since 0.14_

gha_language: HTML


text:
---
title: Brew no. 7 - setup
date: 2020-04-14 18:00:00 0000
---

Start of batch no. 7.

##### Tea

1. Starter tea from [Lean Matcha Green](https://www.pukkaherbs.com/shop/organic-teas/lean-matcha-green/) batch
2. 3 liters of [Lean Matcha Green](https://www.pukkaherbs.com/shop/organic-teas/lean-matcha-green/) - tea bags
    * (three tea bags per jug, brewed for 15 minutes)

##### Sugar

100 grams (50 grams per jug)

##### Notes

The first batch to test how the reduction in sugar impacts the fizziness.
After removing the oldest scoby disc, all the current discs seem nice, thin
and healthy.


text:
# logReducer function for reducer

this is a simple function for reducer. it's a pure function, not a react component or react hook (which is good/not for react concurrent mode). works for `redux` and `useReducer`.

# Installation

yarn

```
yarn add @abdulghani/logreducer
```

npm

```
npm install @abdulghani/logreducer
```

# Usage

```javascript
import logReducer from "@abdulghani/logreducer";
import reducer from "somewhere";

// setup your reducer
const loggedReducer = logReducer(reducer);

const MyApp = () => {
  const [state, dispatch] = useReducer(loggedReducer);

  // render function
};
```

repository: abdulghani/logreducer

repo_name: abdulghani/logreducer


text:
# Low-Cost Autonomous Vehicle for Inventory Movement in Warehouses

* [__Project Objectives__](#project-objectives)
* [__Our Model__](#our-model)
* [__Evaluation Parameters__](#evaluation-parameters)
* [__Evaluating Model__](#evaluating-model)
* [__About this repository__](#about-this-repository)
* [__Conclusion and Further work__](#conclusion-and-further-work)
* [__More Information__](#more-information)

## Project Objectives

Automation can help Warehouses become more efficient, productive, robust, and cost-effective. A variety of Autonomous Robots are used in large warehouses which can be expensive. We intend to build cost-effective Autonomous Robots for small and medium scale Warehouses with reasonable accuracy.

## Our Model

The robot is monitored by the camera, which sends the stream to the workstation. Using the procedure described below, the workstation sends a command(UP, DOWN, LEFT, RIGHT) to the rpi via a TCP connection. The rpi then sends this command to the Arduino. The Arduino then sends a message to motor drivers accordingly. IMUs and Wheel Encoders are attached to the robot, which sends data to the rpi via an I2C connection. The Arduino is also connected to two servo motors mounted at the front and back. Two ultrasonic sensors are also connected to the servos. This arrangement can be used for backup and collision avoidance.

The Source and Destination are provided by the user in the environment visible to the camera. A path is made from source to destination using the A-star Algorithm.
A colored marker is placed on the robot which is used to estimate the robot’s location and the heading. A line is drawn from the yellow to the purple marker which gives the Heading. The decision to move the next step is taken using the heading of the robot, the robot’s current location, and the next coordinate in the path to follow.

## Evaluation Parameters

* **Cost and Accuracy:** There is a trade-off between the accuracy of the robot and the cost required to build it.
* **Scalability:** Using an overhead camera for tracking, robots can easily be scaled up, to track and guide multiple robots.
* **Backup system:** Redundancy should be available that could be used in case of any failure with the primary system.
* **Path Following and Reaching Destination:** To track the deviation while the robot is traversing the estimated path and check whether the robot can reach the destination or not.

## Evaluating Model

We Evaluate the results on the success rate of the robot in reaching the destination and the deviation in the path to reach the destination. We have considered that if the distance between the robot and destination is less than 20cm or 100px, then the robot is on the destination point. We draw the path that the robot should move on and the path that the robot moved on. We compare these paths to measure how close the robot was to the destination.
The computed path is shown in orange color and the actual path traversed by the robot is shown using the blue color.

Out of 10 times, The robot was able to reach the destination 6 times. Hence, the accuracy of our model should be close to 60%. The robot is built with cheap hardware which is easily available making our robot very affordable. The robot also uses an overhead camera which facilitates greater scalability

## About this repository

* **rsc** contains images and other files used for aid in building the model and documenting the work.
* **src** contains the source code of the project consisting of three folders:
	* **Arduino** contains the code to be uploaded to Arduino. Arduino further contains three folders:
		* **Misc Codes** contains code that was used to learn about libraries. Most of these are taken from tutorials easily found online. It also contains code that is no longer used in the robot but was used for testing at some point. It contains code to get data from ultrasonic sensors, move servos, move motors, etc.
		* **libs** contain the libraries that were used in the Arduino Project.
		* **Important** contains the code that was at some point used in the project and still holds importance. It can be used to test various parts of the robot. For example- to move the robot, rotate ultrasonic sensors, etc.

	* **Workstation** contains two folders:
		* **Important** contains the final code that was used in the workstation.
		* **Misc Codes** contains code that was used to learn about modules and to test the robot. Some of the code was previously used.

	* **rpi** contains two folders:
		* **Important** contains the final code that was used in the raspberry pi.
		* **Misc Codes** contains code that was used to learn about modules and to test the robot. Some of the code was previously used.

* Upload `Major-Project/src/Arduino/important/MotionWithRotatingHCSR04/MotionWithRotatingHCSR04.ino` to Arduino UNO.
* Upload `src/rpi/Important/master.py` to raspberry pi and run it. This would wait for a connection to the address specified in the code.
* Connect a camera to the workstation and place it so that the robot is clearly visible.
* Run `Major-Project/src/Workstation/Important/Obstacle Detection and Path Planning/main2.py`, you may want to configure the `IP address` and `port` in `parameters.py` as well.
* A window will appear showing the stream from the camera. Double-click on the window at the starting point of the robot and the destination. Press `Esc`. Now a path appears and the robot starts moving toward the destination. The robot should move as shown in [this video](https://www.youtube.com/watch?v=GJ0nYhXhNK4&list=PLMkePoybCpm4CkMRtGrQV7CXr9gtPblFH&index=5)

## Conclusion and Further work

We have built a cheap and fairly accurate robot. It is versatile and can work in varied environments. Given the backup system and an overhead camera, the robot is fairly secure and scalable. The scope of the work can be enhanced in the future by employing novel ways of increasing accuracy with little changes in cost.

## More Information

* Please see my [Project Report](https://docs.google.com/document/d/1Ga6hZdya4-FO2D3pxWp_QicPi5e_mkiPZHorXCSN8MU/edit?usp=sharing) for more detailed information about this project.
* A paper was also published in [PDGC 2020](https://www.juit.ac.in/pdgc-2020/index1.php) titled _**"Low-Cost Autonomous Vehicle for Inventory Movement in Warehouses"**_ You can Find it [here](https://ieeexplore.ieee.org/document/9315762). Please cite as `F. Alam, K. S. Bin Hasan and A. Varshney, "Low-Cost Autonomous Vehicle for Inventory Movement in Warehouses," 2020 Sixth International Conference on Parallel, Distributed and Grid Computing (PDGC), Waknaghat, India, 2020, pp. 400-405, doi: 10.1109/PDGC50313.2020.9315762.`
* Please refer to [this playlist](https://www.youtube.com/playlist?list=PLMkePoybCpm4CkMRtGrQV7CXr9gtPblFH) to learn more about the robot.
* You can also find the [presentation for the paper](https://www.slideshare.net/khansaadbinhasan/lowcost-autonomous-vehicle-for-inventory-movement-in-warehouses)


text:
# The API Platform Utilities Bundle

![Maintenance Status](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
[![Build Status](https://app.travis-ci.com/it-bens/api-platform-utilities-bundle.svg?branch=master)](https://app.travis-ci.com/it-bens/api-platform-utilities-bundle)
[![Coverage Status](https://coveralls.io/repos/github/it-bens/api-platform-utilities-bundle/badge.svg?branch=master)](https://coveralls.io/github/it-bens/api-platform-utilities-bundle?branch=master)

This bundle provides a set of useful abstract classes that encapsulate some logic for the usage of [API platform](https://api-platform.com).
Furthermore, it implements an easily configurable input- and output transformer system that can be used without further classes.

## How to install the bundle?
The bundle can be installed via Composer:
```bash
composer require it-bens/api-platform-utilites-bundle
```

If you're using Symfony Flex, the bundle will be automatically enabled. For older apps, enable it in your Kernel class.
> ⚠ The ITB\ObjectTransformerBundle should be enabled, too.

## What does this bundle provide and how to use it?
Let's start with the non-configurable stuff.

### DataProvider

### DataPersister

### DataTransformer
Now we'll take a look at the `DataTransformer` system, that this bundle provides (or extends).

The typical use-case for the API Platform data transformer system is to transform DTOs to Entities/Objects and vice versa.
This bundle uses the `TransformationMediator` from the [Object Transformer Bundle](https://github.com/it-bens/object-transformer-bundle).

Normally, you would probably write an implementation of the API Platform `DataTransformerInterface`
for every DTO transformation that should be performed during the ordinary data flow, described [here](https://api-platform.com/docs/core/dto).
That's quite a mess if there are a lot of resources, requests DTOs and response DTOs.
The `ApiInputTransformer` and `ApiOutputTransformer` classes handle that complete process with a tiny bit of configuration.

After the bundle is enabled, a `itb_api_platform_utilities.yaml` file should be created.
Every transformation the two transformers should handle, has to be registered here. Here's an example:
```yaml
itb_api_platform_utilities:
  input_transformations:
    - { request_class: 'ITB\ObjectTransformerTestUtilities\Object1', object_class: 'ITB\ObjectTransformerTestUtilities\Object2' }
  output_transformations:
    - { object_class: 'ITB\ObjectTransformerTestUtilities\Object2', response_class: 'ITB\ObjectTransformerTestUtilities\Object1' }
```
Every line represents a registered transformation. The configuration is allowed to be empty,
which means that the transformers of this bundle won't be used. Otherwise, all the keys you see are required
and the have to present fully qualified class names.

> ⚠ The transformers will use the `TransformationMediator` as described. That means there should be transformers,
> that can handle the registered transformations.

That's all you have to configure or implement.

## What else?
For the configuration and usage of Object Transformer bundle see:
* https://github.com/it-bens/object-transformer
* https://github.com/it-bens/object-transformer-bundle

## Contributing
I am really happy that the software developer community loves Open Source, like I do! ♥

That's why I appreciate every issue that is opened (preferably constructive)
and every pull request that provides other or even better code to this package.

You are all breathtaking!

repository: it-bens/api-platform-utilities-bundle

gha_language: PHP

repo_name: it-bens/api-platform-utilities-bundle


text:
# Mean Single Convolution

This is the project I built to try the PYNQ development flow before implementing CNN, which realizes hardware acceleration for a single convolution operation.

Run mean.tcl in Vivado to build the block design.

mean.cpp is the HLS IP design.

_64 means the image size is 64×64.
_512 means the image size is 512×512.

_f means the data type is float32, while the others are int8 or int16, which is defined in mean.cpp.

repository: weiyj-postgraduate/PYNQ-CNN-ATTEMPT

repo_name: weiyj-postgraduate/PYNQ-CNN-ATTEMPT


text:
# Timeline-View

Android Timeline View Library (Using RecyclerView) is simple implementation used to display view like Tracking of shipment/order, steppers etc.

### Specs
[![Download](https://api.bintray.com/packages/vipulasri/maven/TimelineView/images/download.svg)](https://bintray.com/vipulasri/maven/TimelineView/_latestVersion)
[![MethodsCount](https://img.shields.io/badge/Methods%20and%20size-56%20|%207%20KB-e91e63.svg)](http://www.methodscount.com/?lib=com.github.vipulasri%3Atimelineview%3A1.0.5)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/vipulasri/Timeline-View/blob/master/LICENSE)

### Badges/Featured In
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Timeline--View-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2923) [![Android Gems](http://www.android-gems.com/badge/vipulasri/Timeline-View.svg)](http://www.android-gems.com/lib/vipulasri/Timeline-View?lib_id=773) [![AndroidDev Digest](https://img.shields.io/badge/AndroidDev%20Digest-%23126-blue.svg)](https://www.androiddevdigest.com/digest-126/)

![showcase](https://github.com/vipulasri/Timeline-View/blob/master/art/showcase.png)

## Sample Project

You can download the latest sample APK from this repo here: [https://github.com/vipulasri/Timeline-View/tree/master/apk](https://github.com/vipulasri/Timeline-View/tree/master/apk)

For information : checkout [Sample App Code](https://github.com/vipulasri/Timeline-View/tree/master/app) in repository.

## Quick Setup

### 1. Include library

**Using Gradle**

``` gradle
dependencies {
    compile 'com.github.vipulasri:timelineview:1.0.5'
}
```

**Using Maven**

``` maven
<dependency>
    <groupId>com.github.vipulasri</groupId>
    <artifactId>timelineview</artifactId>
    <version>1.0.5</version>
    <type>pom</type>
</dependency>
```

#### Manual:
**Manual - Using [Android Studio](https://developer.android.com/sdk/installing/studio.html):**
 * Download the library folder and import to your root application folder.
You can manually achieve this step with 3 steps:
    1. Paste the folder library into your application at the same level of your app, build and gradle folder
    2. Add to your settings.gradle file the following code line:
    "include ':app', ':timelineview'"
    3. Rebuild the project
 * File → Project Structure → in Modules section click on "app" → Click on tab "Dependecies" → Click on the green plus → Module Dependecy → Select ":library"
 * Done

### What's New

See the project's Releases page for a list of versions with their changelogs.

### [View Releases](https://github.com/vipulasri/Timeline-View/releases)

If you Watch this repository, GitHub will send you an email every time I publish an update.

### 2. Usage
 * In XML Layout :

``` java
<com.github.vipulasri.timelineview.TimelineView
    android:id="@+id/time_marker"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    app:markerSize="20dp"
    app:lineSize="2dp"
    app:line="@color/colorPrimary"/>
```

##### Line Padding around marker

``` java
<com.github.vipulasri.timelineview.TimelineView
    android:id="@+id/time_marker"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    app:markerSize="20dp"
    app:lineSize="2dp"
    app:line="@color/colorPrimary"
    app:linePadding="5dp"/>
```

* Configure using xml attributes or setters in code:

    Attribute Name
    Default Value
    Description

        app:marker="@drawable/marker"
        Green Colored Oval Drawable
        sets marker drawable

        app:markerSize="25dp"
        25dp
        sets marker size

        app:markerInCenter="false"
        true
        sets the marker in center of line if `true`

        app:line="@color/primarColor"
        Dark Grey Line
        sets line color

        app:lineSize="2dp"
        2dp
        sets line width

        app:lineOrientation="horizontal"
        vertical
        sets orientation of line ie `horizontal` or `vertical`

        app:linePadding="5dp"
        0dp
        sets line padding around marker

* RecyclerView Holder :
   Your `RecyclerViewHolder` should have an extra paramenter in constructor i.e viewType from `onCreateViewHolder`. You would also have to call the method `initLine(viewType)` in constructor definition.

``` java

    public class TimeLineViewHolder extends RecyclerView.ViewHolder {
        public  TimelineView mTimelineView;

        public TimeLineViewHolder(View itemView, int viewType) {
            super(itemView);
            mTimelineView = (TimelineView) itemView.findViewById(R.id.time_marker);
            mTimelineView.initLine(viewType);
        }
    }

```

* RecyclerView Adapter :
   override `getItemViewType` method in Adapter

``` java

    @Override
    public int getItemViewType(int position) {
        return TimelineView.getTimeLineViewType(position,getItemCount());
    }

```
   And pass the `viewType` from `onCreateViewHolder` to its Holder.

``` java

    @Override
    public TimeLineViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = View.inflate(parent.getContext(), R.layout.item_timeline, null);
        return new TimeLineViewHolder(view, viewType);
    }

```

## Apps that use this library

If you're using this library in your app and you'd like to list it here,
Please let me know via [email](mailto:vipulasri.2007@gmail.com), [pull requests](https://github.com/vipulasri/Timeline-View/pulls) or [issues](https://github.com/vipulasri/Timeline-View/issues).

## License

    Copyright 2017 Vipul Asri

    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.


text:
# YOLOv5-LibTorch
Real time object detection with deployment of YOLOv5 through LibTorch C++ API

### Environment

- Ubuntu 18.04
- OpenCV 3.2.0
- LibTorch 1.6.0
- CMake 3.10.2

### Getting Started

1. Install OpenCV.

   ```shell
   sudo apt-get install libopencv-dev
   ```

2. Install LibTorch.

   ```shell
   wget https://download.pytorch.org/libtorch/nightly/cpu/libtorch-shared-with-deps-latest.zip
   unzip libtorch-shared-with-deps-latest.zip
   ```

3. Edit "CMakeLists.txt" to configure OpenCV and LibTorch correctly.

4. Compile and run.

   ```shell
   cd build
   cmake ..
   make
   ./../bin/YOLOv5LibTorch
   ```

Note: COCO-pretrained YOLOv5s model has been provided. For more pretrained models, see [yolov5](https://github.com/ultralytics/yolov5).


text:
![POLITICO](https://rawgithub.com/The-Politico/src/master/images/logo/badge.png)

# gspan

### What is this?

Gspan is a CLI that downloads an [anno-docs](https://github.com/nprapps/anno-docs)-formatted Google Doc and translates it into JSON.

### Quickstart

Gspan depends on [gdrive](https://github.com/prasmussen/gdrive) to handle downloading files from Google Drive. Install it with homebrew and authenticate your account:

```
$ brew install gdrive
$ gdrive list
```

Then, install gspan as a Python module.

```
$ pip install gspan
```

Then, you can use `gspan` as a command in your shell. To get JSON:

```
$ gspan parse <Google Doc ID> > output.json
```

As a principle, `gspan` pipes all of its output to stdout, much like [csvkit](http://csvkit.readthedocs.io/en/1.0.2/) and [elex](http://elex.readthedocs.io/en/stable/).

You can also download the raw Google Doc HTML and pipe that to a file:

```
$ gspan download <Google Doc ID> > download.html
```

### Testing

```
$ pytest
```

repository: The-Politico/gspan

repo_name: The-Politico/gspan


text:
---
layout: post
date: "2008-04-07"
title: Fix for slow-loading Google ads
comments: true
categories: howto, javascript, troubleshooting
---

Google's AdSense ads, and lots of others, are added to pages using Javascript, and if that Javascript appears early in the page's HTML, it can seriously slow down the rendering of the rest of the page. That's because browsers generally refuse to do any further rendering of the page until they have a requested Javascript file in hand.

We ran into this with the ad in the left column of some pages on DailyStrength.org, which appears above the page content in the HTML; when we switched to a new ad provider, which required fetching multiple Javascript files, the issue was even more pronounced.

Since these ads only work when Javascript is enabled anyway, I decided to use some DOM manipulation (via jQuery, which is already on the page) to load the ad script in a hidden div at the bottom of the HTML, and then relocate the Javascript-generated iframe containing the ad to an empty, visible div where the ad needed to be:

{% codeblock lang:javascript %}
$('#ad_hide').find('iframe').appendTo('#ad');

{% endcodeblock %}

Now, loading the Javascript doesn't slow down the rendering of the content, and the ad appears right after the page is loaded.

repository: rmurphey/blog-octopress

repo_name: rmurphey/blog-octopress


text:
---
date: '2019-09-01'
title: 'Master of Science - Electrical Engineering'
company: 'University of Twente'
location: 'Enschede, the Netherlands'
range: '2018 - 2020'
url: 'https://www.utwente.nl'
---

- Specialization: Robotics and Mechatronics
- Master Thesis:
  - Research Group: [Robotics and Mechatronics](https://www.ram.eemcs.utwente.nl/)
  - Project: [3DHAP-Quick and accurate reconstruction of skin surface for 3D visualization of the blood perfusion](https://www.ram.eemcs.utwente.nl/research/projects/3dhap)
  - Thesis: [3D Stereovision for Quantification of Skin Diseases](https://www.ram.eemcs.utwente.nl/education/assignments/3d-stereovision-quantification-skin-diseases)


text:
# SS Gravity
A space flight simulator/game with solar system gravity I'm developing and experimenting with.

## Executables
[Mac](https://github.com/tomskarning/ss-gravity/releases/download/0.1/Mac.zip), [Windows](https://github.com/tomskarning/ss-gravity/releases/download/0.1/Windows.zip).

## Attributions

### Music
[Earthbound](http://www.dreamstatelogic.com/downloads.html) by Dreamstate Logic &
[Sci Fi](https://www.bensound.com/royalty-free-music/track/sci-fi) by Bensound.

### SFX
[ALERT](https://freesound.org/people/qubodup/sounds/182724/) by qubodup,
[Space Ship Loop](https://freesound.org/people/kaumodaki/sounds/245773/) by kaumodaki,
[Spaceship Engine - just noise](https://freesound.org/people/Nexotron/sounds/371282/) by Nexotron &
[space ship atmos](https://freesound.org/people/CuddleNucks/sounds/424415/) by CuddleNucks.

### GFX
[planet-581239](https://pixabay.com/illustrations/planet-moon-orbit-solar-system-581239/) by LoganArt.

### Game Assets
[Low Poly Space Station](https://assetstore.unity.com/packages/3d/environments/sci-fi/low-poly-space-station-63555) by David Stenfors,
[Dynamic Space Background Lite](https://assetstore.unity.com/packages/2d/textures-materials/dynamic-space-background-lite-104606) by DinV Studio,
[Destructor Spaceship](https://assetstore.unity.com/packages/3d/vehicles/space/destructor-spaceship-3229) by Eldanu,
[Planet Earth Free](https://assetstore.unity.com/packages/3d/environments/sci-fi/planet-earth-free-23399) by headwards &
[Star Creation Tools](https://assetstore.unity.com/packages/2d/textures-materials/star-creation-tools-80595) by Jacob Lane.

## Programming Language & Engine
C# in Unity.

## Version
0.1

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

repository: tomskarning/ss-gravity

repo_name: tomskarning/ss-gravity


text:
# About

Karibu PUBReL 🎉 ... An Introductory  repo for maintainers, collaborators and the bioinformatics community at large. To Introduce yourself, fork the repo, edit the readme file, add your name and interests then submit a pull request.

😺 Happy Hacking !!

## Community

1. [Wilson Mudaki](https://github.com/totodingi)
    #### Interests
    ---
    - Machine Learning & AI
    - Software development

    #### Hobbies
    ---
    - Playing piano
    - Video games
    - Playing Chess

2. [George Kitundu](https://github.com/EorgeKit)

   #### Interests
   ---
   - Biotechnology enterprises
   - Virology (escape mutants development)
   - Youth developmnent and enterpreneurship

   #### Hobbies
   ---
   - Playing guitar
   - Video games
   - Reading books
   - Jogging
   - Swimming
   - Adventure

 2. [Brenda Kiage](https://github.com/Kiage24)
    #### Interests
     - Bioinformatics

     - Virology

    #### Hobbies
     - Music :trumpet:

     - Travelling :hiking_boot: :mountain:

     - Swimming :swimming_woman:

2. [Kauthar Omar](https://github.com/Kauthar-Omar)

    Hello :wave:.

      #### Interests
      ---
      - Genomics
      - Machine Learning

      #### Hobbies
      ---
      - Board games
      - Safaris
      - Learning new languages

    Feel free to interact with me on [twitter](https://twitter.com/K__Omar) and lets get to know each other :smile:.

  5. [Brenda Kamau](https://github.com/brendamuthonikamau)
      #### Interests
      - Bioinformatics
      - Genomics
      #### Hobbies
      - Adventuring :bus:
      - Music :musical_score:
      - Sleeping :sleeping_bed: :sleeping:

   6. [Stephen Kuria](https://github.com/sephoh)
      #### Interest

Machine learning

Bioinformatics

Programming

      #### Hobbies

Brainstorming

Debating

repository: sephoh/Introductions

repo_name: sephoh/Introductions


text:
# Pyro ![Foo](Library/flame-small.png)
[![Build status](https://ci.appveyor.com/api/projects/status/github/cschladetsch/flow?svg=true)](https://ci.appveyor.com/project/cschladetsch/flow)
[![CodeFactor](https://www.codefactor.io/repository/github/cschladetsch/pyro/badge)](https://www.codefactor.io/repository/github/cschladetsch/pyro)
[![License](https://img.shields.io/github/license/cschladetsch/pyro.svg?label=License&maxAge=86400)](/LICENSE)

## Overview

*Pyro* is a cross-platform collection of .Net libraries supporting object persistence, networking, and a coroutine micro-kernel. It is based on [Flow](https://github.com/cschladetsch/Flow), [Kai](https://github.com/cschladetsch/KAI) and [Om](https://github.com/cschladetsch/OM) before that, dating back decades.

Each major component has its own project, and its own `Readme.md` file.

*Pyro* is based on two language systems, an object registry, and a generalised virtual machine named *Executor*.

The two key languages are:

* **Pi**. A reverse-polish double stack-based language with fast lexing and parsing. See [pi](https://github.com/cschladetsch/Pyro/wiki/Pi).

* **Rho**. An infix language that looks a lot like Python. It translates to Pi code and shares the same *Executor*.

From either *Pi* or *Rho* it is trivial to access all .Net objects, and also simple to add new custom types that you can expose to the runtime.

## Installation

Installation of the software is straight-forward, with the addition of having some external submodules that must be updated before building the solution.

```bash
$ git clone git@github.com:cschladetsch/Pyro.git
$ git submodule init
$ git submodule update
$ git lfs install
$ git flow init
```
Can be installed as a Unity3d Package. See [package.json](package.json).

## Building

Binary assemblies are built to `Bin` folder.

Each project also copies its output assembly to the `Assemblies` folder within the sample Unity3d project.

## Applications
There are four main applications that come with the *Pyro* suite:
1. A command-line Repl interface.
1. A Gui interface.
1. A network generation tool for proxies and agents.
1. A Unity3d console with Pi, Rho, Stack and Output panels.

All components support colored output and on-the-fly colored syntax highlighting.

## Window

![Window](Resources/PyroWindow.PNG)

## Code Analysis

Define `CODE_ANALYSIS` for each project that uses `SuppressMessage` attribute.

```C#
    [SuppressMessage("NDepend", "ND1003:AvoidMethodsTooBigTooComplex", Justification="This is practically irreducible")]
```

repository: bubdm/Pyro

repo_name: bubdm/Pyro


text:
# Numbers-Game-reactive
Numbers game implemented with WebFlux, Reactive Mongo, Event Sourcing (commands) and CQRS.

This repository takes the [Numbers-Game](https://github.com/razorcd/numbers-game) implementation in vanilla Java and integrates it with Spring WebFlux, ReactiveMongodb following Event Sourcing as the commands and CQRS.

#### At the moment this app is still work in progress !

## Architecture

```
                 _________                _____________           ______________
                |         |              |             |         |              |
  (actions)     | Actions | (subscribe)  |             |         |              |
--------------->|  Event  |------------->|             |         |              |
                |  Source |              |             |         |              |
                |_________|              |   Command   |         | Numbers Game |
                                         | Interpreter |<------->|    Engine    |
                 _________               |             |         |              |
                |         |              |             |         |              |
<---------------| Actions |  (publish)   |             |         |              |
  (log events)  |  Logs   |<-------------|             |         |              |
                |_________|              |_____________|         |______________|
```

repository: razorcd/numbers-game-reactive

repo_name: razorcd/numbers-game-reactive


text:
# [Talk Hipster](http://alexa.amazon.com/#skills/amzn1.echo-sdk-ams.app.c5c80a10-b310-4430-8d53-396d6e5b5c66)
![2.9 stars](../../images/ic_star_black_18dp_1x.png)![2.9 stars](../../images/ic_star_black_18dp_1x.png)![2.9 stars](../../images/ic_star_half_black_18dp_1x.png)![2.9 stars](../../images/ic_star_border_black_18dp_1x.png)![2.9 stars](../../images/ic_star_border_black_18dp_1x.png) 6

To use the Talk Hipster skill, try saying...

* *Alexa, talk hipster.*

* *Mix in some Latin.*

* *Now go back to hipster.*

Push the bounds of hipster-speak past the limits. Not enough? Ask to add in some Latin. Turn Alexa into the most DIY organic food truck chia kale chip locavorista with a fresh cup of cold-pressed. #humblebrag

***

### Skill Details

* **Invocation Name:** talk hipster
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.c5c80a10-b310-4430-8d53-396d6e5b5c66
* **ASIN:** B01M69C491
* **Author:** Justin Revelstoke
* **Release Date:** November 17, 2016 @ 00:35:38
* **In-App Purchasing:** No


text:
[Home](./index.md) > [@josh-brown/vector](./vector.md) > [MatrixBuilder](./vector.matrixbuilder.md) > [fromIndexFunction](./vector.matrixbuilder.fromindexfunction.md)

## MatrixBuilder.fromIndexFunction() method

Builds a matrix with entries given by \_entry = f(i, j)\_ where \_f\_ is `indexFunction` and `i` and `j` are the indices of the element

Signature:

```typescript
fromIndexFunction(shape: MatrixShape, indexFunction: (i: number, j: number) => S): M;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  shape | [MatrixShape](./vector.matrixshape.md) | The shape of the matrix as a tuple [m, n] |
|  indexFunction | (i: number, j: number) => S | A function returning the entry for a given i, j |

Returns:

M

The new matrix

## Example

```
const matrix = matrixBuilder.fromIndexFunction(3, 4, (i, j) => i + j + 3);

// [ 3 4 5 6 ]
// [ 4 5 6 7 ]
// [ 5 6 7 8 ]

```


text:
# MVConnect Packages

MVConnect now offers packages which are separate code projects to do certain tasks.  Instead of everything being included in the original install you can use MVDBTOOLKIT.PACKAGE.INSTALLER to interactively install the packages you want.

## Package List

| Function                                   | Description                                          |
| -----------------------------------------  | ---------------------------------------------------  |
| [MVSENDGRID](./mvsendgrid/README.md)         | Tool to send email via SendGrid's Email Api        |
| [MVETL](./mvetl/README.md)                   | Tool to extract data                               |

<PageFooter />

repository: patpog/docs

repo_name: patpog/docs


text:
---
tags: [ technology, drm, bad experience, directsong ]
title: A Bad Experience with DRM
created:<PHONE_NUMBER>
redirect_from:
- /node/129
- /journal/2007/05/26/a_bad_experience_with_drm
- /journal/2007-05-26/a_bad_experience_with_drm
- /journal/2007-26-05/a_bad_experience_with_drm
---
A couple of days ago I made my first
[DRM](http://en.wikipedia.org/wiki/Digital_rights_management)-protected music
purchase: the Supreme Commander soundtrack from the
[DirectSong](http://www.directsong.com) online store. I've long been a fan of
Jeremy Soule's work, ever since I heard the wonderful Total Annihilation
soundtrack.<!--break-->

I'm idealogically opposed to most forms of DRM, as I believe that they are
capable of removing fundamental consumer rights, and can easily be abused by the
content providers. Indeed, the whole issue of buy/license/copy rights is
completely broken in this age of instant, flawless, free digital copies, but
no-one's though of a universally acceptable solution yet. I made an exception in
this case, as although DirectSong's albums are encoded in Windows Media Audio
with [Janus DRM](http://en.wikipedia.org/wiki/Janus_%28DRM%29) protection, they
are at 320kb/s, and have the right to burn to CD. Their FAQ says that to the
recommended way to use the music with  a non-Janus device, such as a Mac or an
iPod or Microsoft's own Zune, is simply to burn and re-rip a CD. They even
provide cover art; one wonders why they bother with DRM at all!

Big mistake. I was bitten by one of the biggest problems with DRM — the
content controllers can rescind users' rights at will, or inadvertently remove
them through sufficiently advanced incompetence. In this case I think the fault
lay with Windows Media Player 11 on Windows Vista. After I'd `gained' rights for
my machine to play the music, the media properties in WMP claimed that I had
absolutely no rights at all. No burning rights, no synching rights, not even
playing rights — but it played fine. If this isn't a bug, I don't know
what is. I've been prevented from doing something which I paid to be permitted
to do! Since I use Linux and a Janus-incompatible portable media player most of
the time, this effectively stopped me from using my music at all. And let's not
forget that [Microsoft removed the right to back up your
licenses](http://www.theinquirer.net/default.aspx?article=34523) with Media
Player 11, so that if you reinstall your OS, you lose one of your precious
hardware licenses.

Apart from my personal inconvenience while I pester DirectSong to sort this out,
and research DRM-stripping software such as FairUse4WM, this is probably a good
thing. Hopefully, broken implementations of DRM will badly burn people and turn
them against DRM before the content mafia legally gain absolute control over all
our PC hardware. I'll certainly think twice before buying DRM'd tracks again.

_Update (2007/05/30):_ DirectSong got back to me pretty quickly, and I'm
satisfied with the way they've handled it. It turns out they've haven't yet been
able to get their tracks to work properly on Media Player 11, as Microsoft have
broken backwards compatibility. It may be a while until I can buy anything else
from them...

branch_name: refs/heads/source


text:
# Wiki Translation Tool

This is a proposal of a text editor designed for wiki translators. Intended features are:

- Automatically get wikitext from wiki servers and upload translated text back to it.
- Highlight wiki syntaxes
- Auto completion or repalcement and quick access for templates and internal links and grammar
- Glossary
- Preview pages (might need internet)
- Link to habitica
- Progress overview
- Show wiki activities and track changes in source pages
- Recommend unfinished/stub/most wanted/important/outdated pages to work on.
- Help with mass editing (how?)
- And more...

As far as I know, there has not been any text editor that specifies in wiki translation. I hope it will simplify wiki translation by relieving translators from endless grammar details and CN/EN switching and so on.

Below is unfinished blueprint of the code (might be reallly bad):
- main.py: Just as the name suggests.
- servercommunication.py: communicate with the server; we are using pwb, but we may switch to other libs in the future for pwb (seems to) relies on command line. It also makes files that contain raw wiki text.
- textprocessing.py: parses wikitext in both .wiki files and text area of UI, stores some global results(e.g. outline of each page) and suggests completion.
- UI.py: I have no idea how UIs are made, only of desired appearance. It should consist of 2 windows, one for origin text and another for translation, with other small parts to show competion etc. Multiple themes should be provided, including classical, dark, and Habitica-styled, which will contain SFX from Habitica itself. (Yes I spend more time imagining UI hhh)
- data part: see trello card: https://trello.com/b/HJFWDtHy/wiki-translation-tool
  * For invitation please click [here](https://trello.com/invite/b/HJFWDtHy/a29767b55917ff16dcd4a02206adf82c/wiki-translation-tool)

repository: ceontouwong/wiki-translation-tool

repo_name: ceontouwong/wiki-translation-tool


text:
# angular-clipboard

[![Build Status](https://img.shields.io/travis/omichelsen/angular-clipboard/master.svg)](https://travis-ci.org/omichelsen/angular-clipboard)
[![Test Coverage](https://img.shields.io/coveralls/omichelsen/angular-clipboard/master.svg)](https://coveralls.io/r/omichelsen/angular-clipboard?branch=master)
[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/angular-clipboard.svg)](https://bundlephobia.com/result?p=angular-clipboard)

Copy text to clipboard by clicking a button without using Flash. This is using the [Selection API](https://developer.mozilla.org/en-US/docs/Web/API/Selection) and [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent) available in newer browsers.

Browser support: Chrome 43+, Firefox 41+, Opera 29+, IE10+, Safari 10+ and Mobile Safari 10+.

See the [demo](https://rawgit.com/omichelsen/angular-clipboard/master/demo/index.html).

## Install

```bash
$ npm install angular-clipboard --save
```

angular-clipboard has no other dependencies than [Angular](https://angularjs.org/)
itself.

## Usage

Require angular-clipboard as a dependency for your app:

```javascript
angular.module('MyApp', ['angular-clipboard'])
    .controller('MyController', ['$scope', function ($scope) {
        $scope.supported = false;

        $scope.textToCopy = 'I can copy by clicking!';

        $scope.success = function () {
            console.log('Copied!');
        };

        $scope.fail = function (err) {
            console.error('Error!', err);
        };
    }]);
```

Copy text from an input field by clicking a button:

```html
<input type="text" ng-model="textToCopy">
<button clipboard supported="supported" text="textToCopy" on-copied="success()" on-error="fail(err)">Copy</button>
```

You can supply a method to be called for the `on-copied` and `on-error` event. The `on-error` function will be called with the error object as argument `err`.

The optional `supported` property can be used to detect browser support for the clipboard feature.

### Use as service

You can also invoke the copy to clipboard action directly by injecting the `clipboard` service. Just remember it has to be in a click event, as clipboard access requires user action.

```javascript
angular.module('MyApp', ['angular-clipboard'])
    .controller('MyController', ['$scope', 'clipboard', function ($scope, clipboard) {
        if (!clipboard.supported) {
            console.log('Sorry, copy to clipboard is not supported');
        }

        $scope.clickHandler = function () {
            clipboard.copyText('Copy this text');
        };
    }]);
```

### Use with a module loader

If you are using a module loader, you can import the module name when requiring it in angular. Works with any AMD/UMD/CommonJS module loader.

```javascript
import clipboardModule from 'angular-clipboard';

angular.module('mymodule', [clipboardModule.name]);
```

license: Zlib,MIT

repository: eysp/portainer

detected_licenses: Zlib MIT

repo_name: eysp/portainer


text:
# flac-mass-transcode
It will find every flac file and transcode them to opus files, while keeping the directory structure, adding album covers where possible. If another type of music file is found, like mp3's, it will be copied over without transcoding.

# Usage
```bash
./flac-mass-transcode ~/music_input_dir ~/music_output_dir
```

## The --uplevel flag
Let's say you only want to copy over 1 album, while keeping the directory. -u 1 can be used for that. For example.
```bash
./flac-mass-transcode ~/music/album ~/output
```
This would put every file in album under output.

```bash
./flac-mass-transcode -u 1 ~/music/album ~/output
```
This will create an album directory under output, and put the files there.

license: Unlicense


text:
# CMake and Make

### Skill Level Goal
Advanced level is implemented, purpose on practicing!

## Table of Contents
- build
- Object files
- large project build
- cmake
- make

## Overview
In this workspace you will learn about

- Object files: what actually happens when you run g++.
- How to use object files to compile only a single file at a time. If you have many files in a project, this will allow you can compile only files that have changed and need to be re-compiled.
- How to use cmake (and make), a build system which is popular in large C++ projects.CMake will simplify the process of building project and re-compiling only the changed files.

## Instructions
- use cmake&make part in Lesson 4
- Also detailes instructions below...

**Object Files**
When you compile a project with `g++`, `g++` actually performs several distinct tasks:

The preprocessor runs and executes any statement beginning with a hash symbol: #, such as #include statements. This ensures all code is in the correct location and ready to compile.
Each file in the source code is compiled into an "object file" (`a.o file`). Object files are platform-specific machine code that will be used to create an executable.
The object files are "linked" together to make a single executable. In the examples you have seen so far, this executable is a.out, but you can specify whatever name you want.
It is possible to have g++ perform each of the steps separately by using the `-c` flag. For example,

```
g++ -c main.cpp
```

will produce a main.o file, and that file can be converted to an executable with

```
g++ main.o
```

Your Turn
Try to compile main.cpp to an object file using the commands from the previous page. In the terminal to the right:

Compile the main.cpp file to an object file using the -c flag. You can list the files in the directory with ls.

After compiling, you should see a main.o in the directory (along with other notebook files).

Convert the file to an executable with g++.

Run the executable with ./a.out.

**Compiling One File of Many, Step 1**
In the previous example, you compiled a single source code file to an object file, and that object file was then converted into an executable.

Now you are going to try the same process with multiple files. Navigate to the `multiple_files_example` directory in the terminal to the right. This directory should have the increment_and_sum and `vect_add_one` files from a previous Notebook. Try compiling with the commands below:

```
root@abc123defg:/home/workspace/multiple_files_example# g++ -c *.cpp
root@abc123defg:/home/workspace/multiple_files_example# g++ *.o
root@abc123defg:/home/workspace/multiple_files_example# ./a.out
```
Here, the * operator is a wildcard, so any matching file is selected. If you compile and run these files together, the executable should print:

> The total is: 14

**Compiling One File of Many, Step 2**
But what if you make changes to your code and you need to re-compile? In that case, you can compile only the file that you changed, and you can use the existing object files from the unchanged source files for linking.

Try changing the code in `/multiple_files_example/main.cpp` to have different numbers in the vector and save the file with CTRL-s.

When you have done that, re-compile just main.cpp by running:

```
root@abc123defg:/home/workspace/multiple_files_example# g++ -c main.cpp
root@abc123defg:/home/workspace/multiple_files_example# g++ *.o
root@abc123defg:/home/workspace/multiple_files_example# ./a.out
```

Compiling just the file you have changed saves time if there are many files and compilation takes a long time. However, the process above is tedious when using many files, especially if you don't remember which ones you have modified.

For larger projects, it is helpful to use a build system which can compile exactly the right files for you and take care of linking.

**CMake and Make**
CMake is an open-source, platform-independent build system. CMake uses text documents, denoted as `CMakeLists.txt` files, to manage build environments, like make. A comprehensive tutorial on CMake would require an entire course, but you can learn the basics of CMake here, so you'll be ready to use it in the upcoming projects.

**CMakeLists.txt**
`CMakeList.txt` files are simple text configuration files that tell CMake how to build your project. There can be multiple `CMakeLists.txt` files in a project. In fact, one `CMakeList.txt` file can be included in each directory of the project, indicating how the files in that directory should be built.

These files can be used to specify the locations of necessary packages, set build flags and environment variables, specify build target names and locations, and other actions.

In the next few docs of this workspace, you are going to create a basic `CMakeLists.txt` file to build a small project.

**CMake Step 1**
In the terminal to the right, navigate to the `cmake_example` folder. This folder should contain a simple CMake project, including:

An empty `CMakeLists.txt` file
A src directory with the `increment_and_sum` and `vect_add_one` files from a previous Notebook
The `CMakeLists.txt` file should be open in the tabs on the right, along with the files from the src directory. You will write a basic `CMakeLists.txt` file to build all of these project files into an executable.

The first lines that you'll want in your `CMakeLists.txt` are lines that specifies the minimum versions of cmake and C++ required to build the project. Add the following lines to your `CMakeLists.txt` and save the file:

```
cmake_minimum_required(VERSION 3.5.1)

set(CMAKE_CXX_STANDARD 14)
```
These lines set the minimum cmake version required to `3.5.1` and set the environment variable `CMAKE_CXX_STANDARD` so CMake uses `C++ 14`. On your own computer, if you have a recent g++ compiler, you could use `C++ 17` instead.

**CMake Step 2**
CMake requires that we name the project, so you should choose a name for the project and then add the following line to CMakeLists.txt:

```
project(<your_project_name>)
```
You can choose any name you want, but be sure to change `<your_project_name>` to the actual name of the project!

**CMake Step 3**
Next, we want to add an executable to this project. You can do that with the add_executable command by specifying the executable name, along with the locations of all the source files that you will need. CMake has the ability to automatically find source files in a directory, but for now, you can just specify each file needed:
```
add_executable(your_executable_name  path_to_file_1  path_to_file_2 ...)
```
Hint: The source files you need are the three `.cpp` files in the `src/ directory`. You can specify the path relative to the `CMakeLists.txt` file, so `src/main.cpp` would work, for example.

**CMake Step 4**
A typical CMake project will have a build directory in the same place as the top-level CMakeLists.txt. Make a build directory in the /home/workspace/cmake_example folder:

```
root@abc123defg:/home/workspace/cmake_example# mkdir build
root@abc123defg:/home/workspace/cmake_example# cd build
```
From within the build directory, you can now run CMake as follows:
```
root@abc123defg:/home/workspace/cmake_example/build# cmake ..
root@abc123defg:/home/workspace/cmake_example/build# make
```
The first line directs the cmake command at the top-level CMakeLists.txt file with `..`. This command uses the CMakeLists.txt to configure the project and create a `Makefile` in the build directory.

In the second line, `make` finds the `Makefile` and uses the instructions in the `Makefile` to build the project.

If CMake and Make are successful, you should see something like the following output in the terminal:
```
 --Configurating done
 --Generating done
 --Build files have been written to: /xx
```
```
 [ 25 %]Linking CXX executable example
 [100 %]Built target example
```

**CMake Step 5**
If everything has worked correctly, you should now be able to run your executable from the build folder:

```
root@abc123defg:/home/workspace/cmake_example/build# ./your_executable_name
```
This executable should print:

> The total is: 14

just as it did in the previous workspace.

If you don't remember the name of your executable, the last line of the make output should tell you:
```
 [100 %] Built target <your_executable_name>
```

**CMake Step 6**
Now that your project builds correctly, try modifying one of the files. When you are ready to run the project again, you'll only need to run the `make` command from the build folder, and only that file will be compiled again. Try it now!

In general, CMake only needs to be run once for a project, unless you are changing build options (e.g. using different build flags or changing where you store your files).

`Make` will be able to keep track of which files have changed and compile only those that need to be compiled before building.

Note: If you do re-run CMake, or if you are having problems with your build, it can be helpful to delete your build directory and start from scratch. Otherwise, some environment variables may not be reset correctly.

### Markdown HELPs

**Readme.md help**

As a suggestion, the `README.md` file for each repository can include the following information:

- a list of files contained in the repository with a brief description of each file
- any instructions someone might need for running your code
- an overview of the project

Readme.md and Markdown helper links:

[GitHub Readme.md/Markdowns](https://docs.github.com/en/free-pro-team@latest/github/writing-on-github).

[udacity lessons about Markdown](https://classroom.udacity.com/courses/ud777/lessons/5338568539/concepts/53931993710923)

[Basic writing and formatting syntax](https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/basic-writing-and-formatting-syntax).

**Lists**

You can make an unordered list by preceding one or more lines of text with - or *.

- George Washington
- John Adams
- Thomas Jefferson

**File full name or Directory path**
`bugra.txt`
`/multiple_files_example/main.cpp`

**Links**

You can create an inline link by wrapping link text in brackets [ ], and then wrapping the URL in parentheses ( ). You can also use the keyboard shortcut command + k to create a link.

This site was built using [GitHub Pages](https://pages.github.com/).

**URLs**

GitHub automatically creates links from standard URLs.

Visit https://github.com

**Quoting code**

```
function test() {
  console.log("notice the blank line before this function?");
}
```
```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```

**Quoting text**
In the words of Abraham Lincoln:

> Pardon my French

**Creating a table**
You can create tables with pipes | and hyphens -. Hyphens are used to create each column's header, while pipes separate each column. You must include a blank line before your table in order for it to correctly render.

| First Header  | Second Header |
| ------------- | ------------- |
| Content Cell  | Content Cell  |
| Content Cell  | Content Cell  |

url: https://raw.githubusercontent.com/bugraules/Cpp20-on-autonomous-vehicle/aa6a35aa9c81d6faeefa958ddfb897d985488104/Writing Multifile Programs in Linux/CMake & Make/README.md


text:
# PokeLoot

## Project Description
This project introduces a digitally collectable “PokeLoot” that can be randomly obtained by consuming a digital currency which can be earned by successfully completing a web-based minigame.  PokeLoot can be viewed and sorted as a collection by a user or even traded between users.  Users can make comments related to PokeLoot and view or respond to other users’ comments.  Each user also has a profile that can be viewed by other users.  Users can also see a menagerie of statistics related to PokeLoot collections that can be used to generally infer who has been the most successful completing their collection.
The features in this project are implemented by refactoring a previously created PokeLoot project from a Web API/Angular format into a microservices project, by adding various additional API’s, and enhancing the Angular front-end.  Microservices have been Dockerized and Azure web hosting is utilizing Kerbernetes to deploy each container.  Azure Devops is being used to manage CI/CD and everything is being driven by test driven development.
## Technologies Used

* Azure DevOps, ASP.NET Core Web API, Entity Framework, HTML, CSS, TypeScript, Jasmine, Karma, xUnit Testing, SQL Server, Sonarcloud, C#, REST, Angular 2+, SQL, Visual Studio, Swagger, Git, Requirements Gathering, Routing & Switching, User Stories, Agile-Scrum, XML, JavaScript, Azure SQL Databases, Asp.Net Core, Defect Logging, Docker, Kubernetes   - version 1.0

## Features

List of features ready and TODOs for future development
* Allow users to create new accounts and log in with previous credentials.
* Users can accumulate coins into a saved account balance through various tasks and activities.
* Users can use coins to open loot boxes that would randomly generate PokeLoot cards at varying rarities or buy cards from the message boards which reflect on their collection.
* Users can store their collected cards and sell them on the message boards.
* Users can view and insert various posts on the message board which dynamically updates.
* Users can see various stats on a leaderboard.
* Users can comment on each other’s posts.
* Users can can privately message other users.
* Users have a friends list where they can send and accept requests from other users.
* Users can view other users collections.
* Users can mark certain cards as 'favorite' within their collection which can be filtered for for easier searching.

To-do list:
* Increase options available to users to earn coins.
* Sort Message board by tags / descriptions.
* Improve card trading and selling features.
* Display discovered and undiscovered cards in a user’s collection view.
* Trade in their duplicates for a currency
* View an Auction Page and make bids
* Merge multiple versions of a card into itself to evolve the card or pokemon the card holds.
* See basic information about the pokemon without leaving the site or being redirected.
* See attacks each pokemon can do

## Getting Started

* [PokeLoot](https://pokelootapi.azurewebsites.net/).

## Usage

Simply signup for an account and start playing!

## Contributors

* Malia Labor (SCRUM Master)
* Tyler Mire (Team Lead)
* Greg Agnew (Team Lead)
* Mason Sanborn (Team Lead)
* Alain Duplan
* Adam Sepulveda
* Adrian Gonzalez
* Brian Corbett
* Christian Romero
* Ethan Baker
* Guillermo Delgado
* Qais Qaisi
* Sekou Dosso

## License

This project uses the following license: [MIT](https://opensource.org/licenses/MIT)

gha_language: C#


text:
# LyEditImageView

```
An view for zoom, pan, rotate and crop image built by swift in single file.
```
## Preview
Pan Crop View | Zoom, Rotate and Crop Image
---|---
![](https://github.com/Thanatos-L/LyEditImageView/blob/master/LyEditImageView/readme/1.gif) | ![](https://github.com/Thanatos-L/LyEditImageView/blob/master/LyEditImageView/readme/2.gif)

## Quick Start

To add a LyEditImageView in your viewController:
```
let editView = LyEditImageView(frame: frame)
let image = yourimage
editView.initWithImage(image: yourimage)
self.yourview.addSubview(editView)
```

Then get the cropped image:
```
let croppedImage = editView.getCroppedImage()

```
## For Who can speak Mandarin

[iOS - 图片的平移，缩放，旋转和裁剪](http://www.jianshu.com/p/790bffdd1891)

## License
LyEditImageView is released under the MIT License.


text:
# Ansible Role: Varnish

Forked role from Geerlingguy Ansible Role Varnish (https://github.com/geerlingguy/ansible-role-varnish).

This role installs Varnish 5.1, 5.0, 4.1 or 4.0 from packagecloud.io instead of the upstream version. It also deploys a VCL optimized for WordPress and daily cronjob warmer script written in Bash.

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

See [meta/main.yml](meta/main.yml)

Role Variables
--------------

See [defaults/main.yml](defaults/main.yml)

Dependencies
------------

See [meta/main.yml](meta/main.yml)

# Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

```yml
- hosts: servers
  roles:
    - ansible-varnish-wordpress
```

## License

MIT / BSD


text:
## BERT for Natural Questions

This project is using pre-trained BERT model (uncased_L-12_H-768_A-12) to tackle Google's Natural Questions answering challenge. We start our exploration and implementation based on a BERT baseline model on the Natural Questions ([repo](https://github.com/google-research/language/tree/master/language/question_answering/bert_joint)) by Google AI Language.

### Install & Prerequisites

You need to have a GPU enabled TensorFlow installed. If not, you can easily do that in NYU Prince culster with Anaconda2 and python2. Below command create a conda virtual env with tensorflow-gpu and all required packages.
```
conda create --name tf_gpu python=2.7 tensorflow-gpu
```

After activated the conda virtual env. Need to install **bert** and **natural questions** related libraries.

```
pip install bert-tensorflow natural-questions
or
conda install bert-tensorflow natural-questions
```

Then, you need to install **gsutil** and download the pre-processed natural questions training dataset from Google.
```
gsutil cp -R gs://bert-nq/bert-joint-baseline .
```

This should give you the preprocessed training set, which will be used in our training.

```
bert-joint-baseline/nq-train.tfrecords-00000-of-00001
```
You also need to download the "tiny" dev set to verify/estimate the trained model performance.
```
gsutil cp -R gs://bert-nq/tiny-dev .
```

### Training
You can train the natural question model using below command. We have tried different implementations. So, you might select different run_nq_xxx.py
1. Simple Linear Layer to adapt to QA problem/task domain: **run_nq_linear_layer**
2. Add Convolutional Abstraction Layers: **run_nq_conv**
3. Add BiLSTM(Bi-directional LSTM) and Attention Layers: **run_nq_BiLSTM**

--**train_precomputed_file**: where the pre-processed natural questions training dataset stores. You can use my download (/scratch/ywn202/ is public in NYU Prince)
--**init_checkpoint**: where the pre-trained bert model used is stored. You can use my download (/scratch/ywn202/ is public in NYU Prince)
--**output_dir**: where the model checkpoints will be stored

```
srun --mem=15GB --gres=gpu:1 python -m run_nq_BiLSTM \
  --logtostderr \
  --bert_config_file=bert_config.json \
  --vocab_file=vocab-nq.txt \
  --train_precomputed_file=/scratch/ywn202/bert-joint-baseline/nq-train.tfrecords-00000-of-00001 \
  --train_num_precomputed=494670 \
  --learning_rate=3e-5 \
  --num_train_epochs=1 \
  --max_seq_length=512 \
  --save_checkpoints_steps=5000 \
  --init_checkpoint=/scratch/ywn202/uncased_L-12_H-768_A-12/bert_model.ckpt \
  --do_train \
  --output_dir=/scratch/ywn202/bert_model_output8 \
  --train_batch_size 4 \
  --num_train_epochs 1
```

### Eval the Trained Model
With the "tiny" dev set you have previously downloaded. Run below command to get the predictions/answers.

--**predict_file**: where the file contains tiny-dev examples we want to do predictions by the trained model
--**init_checkpoint**: the trained model path. The file is too large to be included in the src/ for submission. If you don't want to try train our model, a trained BiLSTM-Attention model is stored in following location in NYU HPC: /scratch/ywn202/bert_model_output8/model.ckpt-123667 (the folder is public accessible)
--**output_dir**: where the predicted answer will be saved to

```
 srun --mem=15GB --gres=gpu:1 python -m run_nq_BiLSTM \
  --logtostderr \
  --bert_config_file=bert_config.json \
  --vocab_file=vocab-nq.txt \
  --predict_file=/scratch/ywn202/tiny-dev/nq-dev-sample.no-annot.jsonl.gz \
  --init_checkpoint=/scratch/ywn202/bert_model_output8/model.ckpt-123667 \
  --do_predict \
  --output_dir=/scratch/ywn202/bert_model_output8/ \
  --predict_batch_size 4
```

Calculate the accuracy and F1 numbers with below command.
natural_questions.nq_eval is the script included in natural_questions python lib we installed.

--**gold_path**: location of the ground truth of the tiny-dev set
--**predictions_path**: location of the predictions/answers produced by your model

```
srun --mem=15GB --gres=gpu:1 python -m natural_questions.nq_eval \
  --logtostderr \
  --gold_path=/scratch/ywn202/tiny-dev/nq-dev-sample.jsonl.gz \
  --predictions_path=/scratch/ywn202/bert_model_output8/predictions.json
```

You should see some numbers similar as below:
```
{"short-best-threshold-f1": 0.544, "long-best-threshold-recall": 0.5048543689320388, "short-recall-at-precision>=0.75": 0.2, "short-precision-at-precision>=0.5": 0.5, "long-best-threshold-precision": 0.65, "long-recall-at-precision>=0.75": 0.36893203883495146, "long-best-threshold": 6.858288586139679, "short-best-threshold-recall": 0.4533333333333333, "long-recall-at-precision>=0.9": 0.02912621359223301, "short-best-threshold": 8.764707803726196, "short-recall-at-precision>=0.5": 0.5333333333333333, "long-recall-at-precision>=0.5": 0.5728155339805825, "short-precision-at-precision>=0.75": 0.75, "short-precision-at-precision>=0.9": 1.0, "long-precision-at-precision>=0.5": 0.5175438596491229, "long-precision-at-precision>=0.9": 1.0, "long-precision-at-precision>=0.75": 0.76, "short-recall-at-precision>=0.9": 0.04, "short-best-threshold-precision": 0.68, "long-best-threshold-f1": 0.5683060109289617}
```

repository: EagleTongX/QA-on-Natural-Question

repo_name: EagleTongX/QA-on-Natural-Question


text:
# README

> When you run `docs` in the command line, Verb looks for files with the `.tmpl.md` extension in the `docs/` directory of your project

Generating a readme is as easy as running

repository: Melindrea/verb

repo_name: Melindrea/verb


text:
# Grado GS1000i
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.

### Parametric EQs
In case of using parametric equalizer, apply preamp of **-7.2dB** and build filters manually
with these parameters. The first 5 filters can be used independently.
When using independent subset of filters, apply preamp of **-7.2dB**.

| Type    | Fc       |    Q | Gain     |
|:--------|:---------|:-----|:---------|
| Peaking | 37 Hz    | 0.57 | 9.5 dB   |
| Peaking | 82 Hz    | 0.73 | -9.5 dB  |
| Peaking | 528 Hz   | 0.28 | 4.8 dB   |
| Peaking | 1119 Hz  | 2.04 | 1.0 dB   |
| Peaking | 8094 Hz  | 0.97 | -13.1 dB |
| Peaking | 1879 Hz  | 4.79 | -1.7 dB  |
| Peaking | 3122 Hz  | 1.38 | 1.6 dB   |
| Peaking | 3620 Hz  | 4.38 | -2.8 dB  |
| Peaking | 13586 Hz | 2.17 | -4.3 dB  |
| Peaking | 14986 Hz | 0.91 | 2.6 dB   |

### Fixed Band EQs
In case of using fixed band (also called graphic) equalizer, apply preamp of **-8.8dB**
(if available) and set gains manually with these parameters.

| Type    | Fc       |    Q | Gain     |
|:--------|:---------|:-----|:---------|
| Peaking | 31 Hz    | 1.41 | 8.8 dB   |
| Peaking | 62 Hz    | 1.41 | -2.6 dB  |
| Peaking | 125 Hz   | 1.41 | -3.2 dB  |
| Peaking | 250 Hz   | 1.41 | 3.0 dB   |
| Peaking | 500 Hz   | 1.41 | 3.6 dB   |
| Peaking | 1000 Hz  | 1.41 | 4.4 dB   |
| Peaking | 2000 Hz  | 1.41 | 1.5 dB   |
| Peaking | 4000 Hz  | 1.41 | -0.7 dB  |
| Peaking | 8000 Hz  | 1.41 | -14.6 dB |
| Peaking | 16000 Hz | 1.41 | -0.9 dB  |

### Graphs
![](https://raw.githubusercontent.com/jaakkopasanen/AutoEq/master/results/referenceaudioanalyzer/zero/Grado%20GS1000i/Grado%20GS1000i.png)