text:
# add-newlines changelog

## v0.2.0
_2017-05-14_

 * **Bugfix**: New lines were not added to files without any new line characters at the end of the file

repository: perry-mitchell/add-newlines

repo_name: perry-mitchell/add-newlines


text:
# sepyrot
A little python script that encodes and decodes a text by replacing spaces with random numbers, applies rot13 to the letters and replace the second of doubled letters with a "+".

## Requirements

Python ≥ 3.0

## Usages :

### Works with simple text...

```
# Encode a short message
$ ./sepyrot.py --encode "Hello I am a message"
Ury+b2V4nz8n9zrf+ntr

# Decode a short message
$ ./sepyrot.py --decode "Ury+b2V4nz8n9zrf+ntr"
Hello I am a message
```

### ...And with files as well

```
# Encode a text file (which works with multiple lines indeed)
$ ./sepyrot.py --encode "$(cat textfile.txt)" > encoded_textfile.txt

# Decode an encoded text file
$ ./sepyrot.py --decode "$(cat encoded_textfile.txt)" > decoded_textfile.txt
```

### Tips

- You can also use `-e` and `-d` instead of `--encode` and `--decode`

## Issues :
- Special characters make the script crash with Python < 3. With Python 3 they are just not rot13 encoded and stay clear in the encoded message
- Cannot encode/decode messages that include numbers, it'll replace them with spaces in decoded message

license: MIT

repository: VonKavalier/sepyrot

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: VonKavalier/sepyrot


text:
---
title: Ottawa 2
date: 2015-09-09
images: []
props: []
---
Just like [last night's concert]({{ site.baseurl }}{% post_url 2015-09-08-ottawa-1 %}), RBB and SB were missing. Given the concert was in the same venue, and fandom speculation is that the usual stage area for the bears has had to be cut to adapt the smaller stage, this makes sense!

Hopefully we'll see the bears for the Boston concert!

repository: beccasafan/rbb

extension: markdown

repo_name: beccasafan/rbb


text:
# Tweetilyse

## Website
I've deployed this app on Heroku and the link is given below:

### Link: [https://tweetilyse.herokuapp.com/](https://tweetilyse.herokuapp.com/) or [https://bit.ly/Tweetilyse](https://bit.ly/Tweetilyse)

Tweetilyse is a simple web app to analyse tweets from a given user

## Installation

1. Use the package manager [pip](https://pip.pypa.io/en/stable/) to install the required Libraries.
2. Enter your Developer Keys in the required fields

```bash
pip install /PackageName/
```

## Usage

```python
python3 app.py
#Go to the main directory and run the above app
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

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


text:
[![Build Status](https://travis-ci.org/wookieJ/podwiez-pl.svg?branch=master)](https://travis-ci.org/wookieJ/podwiez-pl)

RESTful application written in JAVA with Spring framework.

Application available at:

[https://podwiez-pl.herokuapp.com/](https://podwiez-pl.herokuapp.com/)

## Getting Started

You need maven in version at least 3.3.9 and JDK 8.

To clone repository use following command:

```
git clone https://github.com/wookieJ/podwiez-pl.git
```

## Built With
* [Maven](https://maven.apache.org/) - Dependency Management
* [Travis](https://travis-ci.org/) - Test and Deploy tool

## Deployment
* [Heroku](https://www.heroku.com/) - Cloud Application Platform
* [mLab](https://mlab.com/home) - Database-as-a-Service for MongoDB

## Tech Stack
* Spring Boot 2.0
  * Spring Data MongoDB
  * Spring Web (REST)
  * Spring Security
* MongoDB
* Heroku
* mLab

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

repository: wookieJ/podwiez-pl

repo_name: wookieJ/podwiez-pl


text:
# Setup the development environment on Linux

I'm not experienced enough to write guides on Linux. Here are some useful links to get started.

## Installing .NET

+ [Microsoft docs](https://docs.microsoft.com/en-us/dotnet/core/install/linux)
+ [Installing on Ubuntu ](https://www.techrepublic.com/article/how-to-install-dotnet-core-on-ubuntu-18-04/)

## Install Git

+ [Github](https://github.com/git-guides/install-git#install-git-on-linux)
+ [Altassian](https://www.atlassian.com/git/tutorials/install-git#linux)

## Install Visual Studio Code

+ [VS Code Docs](https://code.visualstudio.com/docs/setup/linux)
+ [Linuxize](https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-18-04/)

repository: just-the-benno/BlazQ

branch_name: refs/heads/main

repo_name: just-the-benno/BlazQ


text:
# PHP-boilerplate2019
A PHP MVC framework - intended for use in my personal projects.

Includes, beside the framework logic itself,
* a complete login system, and
* a Gulp setup for SASS compilation, as well as concatenation and minification of JS files.

## How to Use

### MVC framework

The `/public` directory contains the assets used for the project, such as CSS and JS files, and images. The CSS and JS in this directory can be generated by the Gulp workflow, if you wish to use that.

The `/app` directory is where all the MVC logic goes.

### Data setup
You edit the `/app/config/config.php` file, to use your own database authentication, site name and URL root.

### Controllers and Views
Controller files are created in the `/app/controllers`directory - remember that they are supposed to `extend` the base `Controller`class, like so:

```
class Pages extends Controller { }
```

Each controller class must contain a public function named `index`. The content of this method is the index view for the URL matching your `domain/controller` pattern.

If you need to match more URL's, like f.i. `domain/controller/id`, simply create another method, with the name of the URL param to match.

Views for each controller method can be created in the `/app/views` folder - preferrably by creating a folder with the same name as the controller, and then creating a file for each url param that needs a separate view.

When you have created the view templates, you can use them in the controller methods by calling `$this->view('controller-name/method-name');`

### Models

In order to use data from the database, you need to create a model, which you can do under `/app/models`.

A model file is a class that must contain a constructor instantiating the Database class, like so:

```
class User {
    private $db;

    public function __construct(){
      $this->db = new Database;
    }
}
```

After this, you create as many functions as you need, to create, read, update or delete data. An example could be:

```
public function findUserByEmail($email){
  $this->db->query("SELECT * FROM users WHERE email = :email");
  $this->db->bind(':email', $email);

  $row = $this->db->single();

  if($this->db->rowCount() > 0){
    return true;
  } else {
    return false;
  }
}
```

To create a link between a model and a controller, add the model to the controller's constructor, like f.i.:

```
public function __construct(){
  $this->postModel = $this->model('Post');
}
```

After that, if you wish to use the data in a certain view, you can do it within the public function creating the view, as such:

```
$data = $this->postModel->getPosts();
```

And when you call the view function, you can pass the data along as `$this->view('pages/index', $data);`

## Login system

In order to use the login system as it is included by default, you will need a db table with the name `users`, and the fields `name`, `password` and `email`. If you wish to alter this and use different names and/or more fields, edit the `User` model in `/app/models/User.php`.

## Gulp setup

The `/source` directory is where you will find some base styling in `.scss` files, to get started with. It is also where you can place your JS files, if you wish to have ES6+ code compiled by Babel, and/or minified and bundled.

You use the `gulp watch` command, in order to automatically run the above mentioned tasks upon file changes in `*.scss` or `*.js` files the `/source` directory.

You use the `gulp imagemin` command in order to minify image files placed in the `/public/images` directory.

NOTE: This setup still uses Gulp 3.9.1 - update to version 4 pending.

## Miscellaneous

Remember to edit the `<head>` section in the file `/app/views/inc/header.php`. Here, you'll want to set icons, SEO meta tags and social media meta tags to their proper values.

You may want to edit the manifest-file found in `/public/manifest.json` if you want your site to be a PWA.

From the outset, this file contains default colors, names and icon sources that should be changed to reflect your own. Icons should/could be located in `/public/images/icons`, which currently contains placeholder icons in the sizes specified by the manifest file.

gha_language: PHP

gha_license_id: MIT


text:
KMP Algorithm

The approach I follow is I start with the basics then keep building on it till we reach the most optimized solution. I will use Python for code snippets as it’s very much concise and readable.
> Problem statement:
To Find the occurrences of a word W within a main text T.

One naive way to solve this problem would be to compare each character of W with T. Every time there is a mismatch, we shift W to the right by 1, then we start comparing again. Let’s do it with an example:

T: DoYouSeeADogHere (it will be a case insensitive search for all examples)

W: dog

``` python
# Here is the working code of the naive approach.
def bruteSearch(W, T):
    # edge case check
    if W == "":
            return -1

    # getting the length of the strings
    wordLen = len(W)
    textLen = len(T)

    # i is the index of text T from where we will start comparing the
    # the word W
    i = 0

    # length of the subtext has to be equal to the length of the word,
    # so no need to check beyond (textLen - wordLen + 1)
    while i < (textLen - wordLen + 1):
        # we set match to false if we find a mismatch
        match = True

        for j in range(wordLen):
            if W[j] != T[i + j]:
                # A mismatch
                match = False
                break

        if match:
            # We found a match at index i
            print "There is a match at " + str(i)

        # incrementing i is like shifting the word by 1
        i += 1

    return -1
```

Time complexity of this naive approach is O(mn), where m and n are length of the word W and the text T respectively. Let’s see how can we make it better. Take another wacky example with all unique characters in W.

T: duceDuck

W: duck

As you can see in the above image, there is a mismatch at index 3. According to naive approach next step would be to shift W by 1. Since all letters in W are different, we can actually shift W by the index where mismatch occurred (3 in this case). We can say for sure there won’t be any match in between. I would recommend to try with some other similar example and check for yourself.
The idea is to find out how much to shift the word W when there is a mismatch. So far we have optimised the approach only for a special case where all characters in W are unique. Let’s take another bizarre example. This one is gonna be little tricky so brace yourself.

T: deadElephant

W: deadEye

Make sure you understand what green cells convey. I will be using a lot of them. In the above image the green cells in the left substring is equal to the green cells in the right substring. It is actually the largest prefix which is also equal to the suffix of the substring till index 4 of the word “deadeye”. Assume for now we have found it somehow, we will work on finding out largest prefix(green cells) later. Now let’s see how it works by taking an abstract example.

str1 = str2 (green cells) and str2 = str3. When there is a mismatch after str2, we can directly shift the word till after str1 as you can see in the image. Green cells actually tell us the index from where it should start comparing next, if there is a mismatch.

I suppose you now understand if we find out green cells for every prefix of the word W, we can skip few unnecessary matches and increase the efficiency of our algorithm. This is actually the idea behind knuth-Morris-Pratt(kmp) algorithm.

In search of green cells
We will be using aux[] array to store the index. Unlike Naive algorithm, where we shift the word W by one and compare all characters at each shift, we use a value from aux[] to decide the next characters to be matched. No need to match characters that we know will match anyway. Let’s take yet another weird example.

W: acabacacd

m and `i` define the state of our algorithm and signify that prefix of the word W before m is equal to the suffix for the substring till i-1 i.e `W[0…m-1] = W[i-m…i-1]`. For the above image state, 2(value of `m`) is stored in the aux[] array for the substring till index 4(`i-1`).

``` python
def createAux(W):
    # initializing the array aux with 0's
    aux = [0] * len(W)

    # for index 0, it will always be 0
    # so starting from index 1
    i = 1
    # m can also be viewed as index of first mismatch
    m = 0
    while i < len(W):
        # prefix = suffix till m-1
        if W[i] == W[m]:
            m += 1
            aux[i] = m
            i += 1
        # this one is a little tricky,
        # when there is a mismatch,
        # we will check the index of previous
        # possible prefix.
        elif W[i] != W[m] and m != 0:
            # Note that we do not increment i here.
            m = aux[m-1]
        else:
            # m = 0, we move to the next letter,
            # there was no any prefix found which
            # is equal to the suffix for index i
            aux[i] = 0
            i += 1

    return aux
```

Following will be the aux array for the word acabacacd

Now let’s use the above aux array to search the word acabacacd in the following text.

T: acfacabacabacacdk

``` python
W = "acabacacd"
T = "acfacabacabacacdk"

# this method is from above code snippet.
aux = creatAux(W)

# counter for word W
i = 0
# counter for text T
j = 0
while j < len(T):
    # We need to handle 2 conditions when there is a mismatch
    if W[i] != T[j]:
        # 1st condition
        if i == 0:
            # starting again from the next character in the text T
            j += 1
        else:
            # aux[i-1] will tell from where to compare next
            # and no need to match for W[0..aux[i-1] - 1],
            # they will match anyway, that’s what kmp is about.
            i = aux[i-1]
    else:
        i += 1
        j += 1
        # we found the pattern
        if i == len(W):
            # printing the index
            print "found pattern at " + str(j - i)
            # if we want to find more patterns, we can
            # continue as if no match was found at this point.
            i = aux[i-1]
```

Below is the snapshot of above code at some intermediate running state.

### Contributed by Shyam Kumar With 💜.

### Reach me on

path: /dsa-cp-1/KMP Algorithm/How.md

gha_language: Java


text:
---
layout: work_extra
type: work_extra
published: true
image: images/extra/tomo.png
title: Quantitative Tomography Analysis, GE
permalink: work_extra/uhcc-ge_tomo
date: 2019
labels:
  - GE
  - Mammography
  - Tomosynthesis
  - Breast Cancer
  - Matlab
  - Python

summary: For this project, we collaborate with General Electric, GE, Health to develop algorithms to improve tomosynthesis imaging for breast cancer screening.
---

## Quantitative Tomography Analysis ##

__Summary__

Tomosynthesis, tomo, is an medical imaging technique which involves taking multiple
images of an object at different angles.  Imaging at multiple angles provides
enough information such that a 3D rendering of the imaged object can be
reconstructed.  The concept is similar to that of a full CT but with less
images, imaging time, and radiation.  Breast tomosynthesis has proven to be a
useful diagnostic tool for identifying lesions within a patients breast.

We have developed an algorithm known as the 3 composition breast, 3CB, which is
able to separate a full field digital mammogram, FFDM, image into the three
major breast components.  The three major breast components include, lipid,
water, and protein.  Invasive breast cancers have a unique lipid, water, and
protein or 3CB signature and our algorithm helps to identify theses invasive
cancers.  This project is focused at adapting the 3CB algorithm to tomo and an
important piece of information is local breast thicknesses.  3CB for FFDM
utilized a calibration object or phantom that was placed in the x-ray field to
help estimate the local breast thickness.  With tomo, we attempt to gain the
local thickness estimations from the multiple images taken at different angles
without a calibration phantom.

An iterative approach was first implemented to try and estimate the local breast
thickness.  We assumed that a breast under compression maintained a simple
geometrical shape that can be defined by a width, thickness, density, and warp.
Using simulation, we generated virtual breast object, VBO, with different
parameters and then obtained the VBO's resulting sinogram.  Using a root mean
squared error, RMSE, loss function we compared the VBO simulated sinogram to the
real sinogram.  When the RMSE was at the minimum we would assume that the
parameters used to create the VBO are similar to the real imaged breast.
Matching real and simulated sinograms in order to determine the original breast
parameters is an inverse problem.  It turns out that this problem is non-convex
and our iterative algorithm would get stuck in local minima.

The iterative approach was also computationally expensive and wasteful because a
new VBO would be generated on each iteration.  Dynamic programing technique
such as memoization were not utilized which made the algorithm inefficient.  We
turned to using principal components analysis, PCA, to build a model that can
explain the variance between the geometrical breast parameters and the resulting
sinograms.  Our breast model was able to accurately predict the local breast
thickness down to sub-millimeter resolution.

__Resulting Presentation of Project Work__

- Poster at International Breast Density Workshop (IBDW) 05/2019

- Oral Presentation Radiology Society of North America (RSNA) 12/2019


text:
---
subcategory: "AAA"
---

# Resource: aaacertparams

The aaacertparams resource is used to create aaacertparams.

## Example usage

```hcl
resource "citrixadc_aaacertparams" "tf_aaacertparams" {
  usernamefield              = "Subject:CN"
  groupnamefield             = "Subject:OU"
  defaultauthenticationgroup = 50
}
```

## Argument Reference

* `usernamefield` - (Optional) Client certificate field that contains the username, in the format <field>:<subfield>. .
* `groupnamefield` - (Optional) Client certificate field that specifies the group, in the format <field>:<subfield>.
* `defaultauthenticationgroup` - (Optional) This is the default group that is chosen when the authentication succeeds in addition to extracted groups. Maximum length =  64

## Attribute Reference

In addition to the arguments, the following attributes are available:

* `id` - The id of the aaacertparams. It is a unique string prefixed with `tf-aaacertparams-`.

repository: citrix/terraform-provider-citrixadc

gha_language: Go

repo_name: citrix/terraform-provider-citrixadc


text:
---
layout: post
title: "Compare Java Boolean"
tags: ["java", "boolean", "compare", "NullPointerException"]
---

<div class="message">
Once in a blue moon, some funky problem will happen in Java world.
</div>

Take a look at the following code.

{% highlight java %}
private Boolean hasBanana(final Thing thing) {
    if (thing.hasBanana() == true) {
        return true;
    } else {
        return false;
    }
}
{% endhighlight %}

It all seemed good at a glance, but what actually happened was: it throws a `NullPointerException` on invocation. But how?

# boolean vs Boolean

In Java, there is a primitive type `boolean`, which always has a value of `true` or `false`.

And there is the object type `Boolean`, it's basically a wrapper for the primitive type. The default value for object `Boolean` is either `TRUE` or `FALSE`, which is just value `true` or `false` wrapped inside `Boolean` type. As an object, it offers more than just a wrapper, such as a bunch of default methods, serialisation and etc. But that is exactly where everything all went pear shaped: the object `Boolean` can also be `null` in Java world, when the program gets `null` instead of an expected boolean value and the scenario isn't handled, `NullPointerException` was thrown.

What can be done to deal with this complication?

# Boolean Comparison

This solution should be no stranger to any Java dev, which is to perform a null check while using the Boolean value.

{% highlight java %}
private Boolean hasBanana(final Thing thing) {
    Boolean hasBanana = thing.hasBanana();
    if (hasBanana != null) {
        if (hasBanana) {
            return true;
        }
        else {
            return false;
        }
    } else {
        return null;
    }
}
{% endhighlight %}

Using the native Boolean object would look better.

{% highlight java %}
private Boolean hasBanana(final Thing thing) {
    Boolean hasBanana = thing.hasBanana();

    if (Boolean.TRUE.equals(hasBanana)) {
        return true;
    } else if (Boolean.FALSE.equals(hasBanana)) {
        return false;
    } else {
        return null;
    }
}
{% endhighlight %}

Of course, just like everything in Java, there's a corperate version.

{% highlight java %}
import org.apache.commons.lang3.BooleanUtils;

private Boolean hasBanana(final Thing thing) {
    Boolean hasBanana = thing.hasBanana();

    if (BooleanUtils.isTrue(hasBanana)) {
        return true;
    } else if (BooleanUtils.isFalse(hasBanana)) {
        return false;
    } else {
        return null;
    }
}
{% endhighlight %}

As a stretch, there's a ternary operator version of this solution if you really don't care about `null` being a legitimate value (or maybe it isn't, or at least it really shouldn't be). Then take a look at the following.

{% highlight java %}
private Boolean hasBanana(final Thing thing) {
    Boolean hasBanana = thing.hasBanana();
    return hasBanana != null ? hasBanana : false;
}
{% endhighlight %}

But that still looks terrible, don't you think?

# Optional

You may see where I am alluding to: rather than allowing program to pass `null` around and smear all over the codebase, consider `Optional` to capture the `null` value, make it visible and deal with this hidden pitfall at an appropriate stage of your business logic.

{% highlight java %}
private Optional<Boolean> hasBanana(final Thing thing) {
    Boolean hasBanana = thing.hasBanana();

    return Optional.ofNullable(hasBanana);
}
{% endhighlight %}

Smells nice!


text:
# κατασφάζω.

<!-- Status: S2=Needs2ndReview -->
<!-- Lexica used for edits: BDAG, FFM, LN, BN, A-S -->

## Word data

* Strongs: G26950.

* Alternate spellings:

* Principle Parts:

* Part of speech:

[Verb](http://ugg.readthedocs.io/en/latest/verb.html).

* Instances in the New Testament: 1.

* All Scriptures cited: Yes.

## Etymology:

* LXX/Hebrew glosses:

;in LXX  [Zech 11:5](zec 11:5) [הרג](//en-uhal/H2026), [Ezek 16:40](ezk 16:40) [בּתק](//en-uhal/H1333) piel.

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses:

* Synonyms for all senses:

## Senses:

### Sense 1.0:

#### Definition:

To slaughter

#### Glosses:

strike down, slay, kill, slaughter

#### Explanation:

#### Citations:

;[πλὴν](../G41330/01.md) [τοὺς](../G35880/01.md) [ἐχθρούς](../G21900/01.md) [μου](../G14730/01.md) [τούτους](../G37780/01.md) [τοὺς](../G35880/01.md) [μὴ](../G33610/01.md) [θελήσαντάς](../G23090/01.md) [με](../G14730/01.md) [βασιλεῦσαι](../G09360/01.md) [ἐπ’](../G19090/01.md) [αὐτοὺς](../G08460/01.md) [ἀγάγετε](../G00710/01.md) [ὧδε](../G56020/01.md) [καὶ](../G25320/01.md) κατασφάξατε [αὐτοὺς](../G08460/01.md) [ἔμπροσθέν](../G17150/01.md) [μου](../G14730/01.md),
;"But these enemies of mine, those who did not want me to reign over them, bring them here and kill them before me.'"",  (ULT)
:[Luke 19:27](luk 19:27).

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
[Kaggle] Squeeze and Excitation Networks
=====

The source code for Digit Recognizer, Getting Started Prediction Competition in Kaggle, based on Squeeze and Excitation (SE) Network. The performance between basic CNN and SENet is provided in SENet-Simple.

## Squeeze and Excitation (SE) Module

The Squeeze and Excitation (SE) Module [1].

## Performance
The performance of this deep neural network is 0.99871. This is the 122th of 2270 teams (top 6%) as of November 29, 2019.

The performance measured by Kaggle.

## Reference
[1] Hu, Jie, et al. (2018). Squeeze-and-excitation networks. Proceedings of the IEEE conference on computer vision and pattern recognition. 2018.

repository: YeongHyeon/Kaggle-MNIST

repo_name: YeongHyeon/Kaggle-MNIST


text:
---
title: apache
pageTitle: "2-apache"
description: "Learn how to build a GraphQL server with Scala & Sangria and the best practices for filters, authentication and pagination."
question: "What is a Snap?"
answers: ["Protocol", "Library", "Language", "Specification" ]
correctAnswer: 3
---
## 1) Enable Mod_Proxy

```
sudo a2enmod proxy proxy_http proxy_wstunnel
```

[Apache Mod_Proxy documentation](http://httpd.apache.org/docs/current/mod/mod_proxy.html)

## 2) Restart Apache

Systemd:
```
sudo systemctl restart apache2
```
Init.d:
```
sudo service apache2 restart
```

## 3) Enable SSL in Apache config
```
Listen 443

NameVirtualHost *:443
```
## 4) Set Apache proxy

### a) Main URL

SSL with [Certbot](https://certbot.eff.org).

Config at `/etc/apache2/sites-available/example.com.conf`:

```ApacheConf
<VirtualHost *:443>

    ServerName example.com

    SSLEngine On
    SSLCertificateFile      /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile   /etc/letsencrypt/live/example.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
    ServerSignature Off

    <Location />
     require all granted
    </Location>

    ProxyPassMatch   "^/(sockjs\/.*\/websocket)$" "ws://<IP_ADDRESS>:3001/$1"
    ProxyPass        "/" "http://<IP_ADDRESS>:3001/"
    ProxyPassReverse "/" "http://<IP_ADDRESS>:3001/"

</VirtualHost>
```

### b) Sub URL

Config at `/etc/apache2/sites-available/example.com.conf`:

```ApacheConf
<VirtualHost *:443>

    ServerName example.com/wekan

    SSLEngine On
    SSLCertificateFile      /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile   /etc/letsencrypt/live/example.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
    ServerSignature Off

    ProxyPassMatch   "^/(sockjs\/.*\/websocket)$" "ws://<IP_ADDRESS>:3001/wekan/$1""
    ProxyPass        "/wekan" "http://<IP_ADDRESS>:3001/wekan"
    ProxyPassReverse "/wekan" "http://<IP_ADDRESS>:3001/wekan"

</VirtualHost>
```
To run as default site:
```ApacheConf
<VirtualHost _default_:443>
```

## 5) Enable your site

```
sudo a2ensite example.com
```
Or, add symlink manually:
```
sudo su

cd /etc/apache2/sites-enabled

ln -s ../sites-available/example.com.conf example.com.conf
```
On some distros Apache config is at different path:
```
cd /etc/httpd/conf.d
```

## 6) Reload Apache

Systemd:
```
sudo systemctl restart apache2
```
Init.d:
```
sudo service apache2 restart
```

## 7) Snap settings

### a) Main URL
```
sudo snap set wekan port='3001'

sudo snap set wekan root-url='https://example.com'
```
### b) Sub URL
```
snap set wekan port='3001'

snap set wekan root-url='https://example.com/wekan'
```

[All snap settings](https://github.com/wekan/wekan-snap/wiki/Supported-settings-keys)

repository: wekan/wekanhow

gha_language: TypeScript

repo_name: wekan/wekanhow


text:
# Chinese python code to English

It translates docstrings, comments and strings. In current version it uses
[free implementation of Google Translate](https://pypi.org/project/googletrans/). So sometimes it can be not very stable.
I added Google urls rotation and timeouts to avoid ip ban in case you want to translate big package

**Requires python 3.6+**

# installation
I highly recommend to use virualenv
```
git clone https://github.com/day0market/pychinesecodetoenglish.git
cd  CodeTranslator
pip install -r requirements.txt
```

# Run
```
python run.py [-h] [--level LEVEL] [--force] source_path destination_path

positional arguments:
  source_path       path to package you want to translate
  destination_path  path where you want to put translated file

optional arguments:
  -h, --help        show this help message and exit
  --level LEVEL     logging level
  --force           force re translate if file already exists

```

It will translate only *.py and *.md files from package. All other files will be just copied to
destination folder. Please note: .git and __pychache__ folders will be skiped.

repository: afcarl/pychinesecodetoenglish

repo_name: afcarl/pychinesecodetoenglish


text:
---
authors:
- martin-fleck
bio: null
email<EMAIL_ADDRESS>name: Martin Fleck
pairs:
- key: Mail
  link<EMAIL_ADDRESS>  value<EMAIL_ADDRESS>role: Dr.techn.
superuser: false
user_groups:
- Visitors and Friends
---

From 2007 Martin Fleck studied Software Engineering at the University of Applied Sciences Upper Austria, where he received his master’s degree in October 2012. His master’s thesis was concerned with the application of Machine Learning techniques in the profiling of social network users. During his studies he worked as a tutor for the subject _Relational Databases, SQL and XML_. From November 2012 to April 2016 he has been involved in the Business Informatics Group of the Technical University Vienna as a project assistant in the [FP7 project ARTIST](http://artist-project.eu/). During this time he also supported the courses _Model Engineering_, _Advanced Model Engineering_, and _Web Engineering_.

In May 2016, he received his PhD degree in computer science from the TU Wien for [his thesis](http://www.big.tuwien.ac.at/teaching/theses/174) on combining search-based optimization methods and model transformations. Since then he has been working at [EclipseSource Vienna](http://eclipsesource.com/vienna).

### Interests

*   model engineering
*   model transformations
*   search-based software engineering
*   search-based optimization
*   language engineering
*   programming languages

### Open Source Projects

*   __[ARTIST: Advanced software-based seRvice provisioning and migraTion of legacy SofTware](http://martin-fleck.github.io/momot/)__
     ARTIST eases the migration of non-cloud software applications to new computing paradigms like service-oriented architectures and cloud solutions.
*   __[MOMoT: Marrying Optimization and Model Transformations](http://martin-fleck.github.io/momot/)__
     A framework that combines model-driven engineering techniques with search-based optimization (population-based search and local search) to solve highly complex problems on model level.

branch_name: refs/heads/content

gha_language: HTML


text:
# About This Project

## General

This is a texted-RPG game developed by python.

This project is intended to practise OOP in python during my learning.

The idea and method of this project is mostly based on [this Udemy course](https://www.udemy.com/python-complete/learn/v4/overview)

It is welcomed to commit for better understanding by other python learners.

It is also welcomed to point out my mistakes or any optimization.

## Environment

Python --version : 3.7
MacOS (command line tool in windows may not support colored text)


text:
---
name: Checkbox
category: Form Controls
---
**When to use**
- When a user can select any number of choices from a set list.
- When a user needs to choose “yes” or “no” on only one option (use a stand-alone checkbox). For example, to toggle a setting on or off.
- When users need to see all the available options at a glance.

**When to consider something else**
- If there are too many options to display on a mobile screen.
- If a user can only select one option from a list (use radio buttons instead).

**Guidance**
- Users should be able to tap on or click on either the text label or the checkbox to select or deselect an option.
- List options vertically if possible; horizontal listings can make it difficult to tell which label pertains to which checkbox.
- Avoid using negative language in labels as they can be counterintuitive. For example, “I want to receive a promotional email” instead of “I don’t want to receive promotional email.”
- If you customize, make sure selections are adequately spaced for touch screens.

**Accessibility**
- Surround a related set of checkboxes with a `<fieldset>`. The `<legend>` provides context for the grouping. Do not use fieldset and legend for a single check.
-Each input should have a semantic id attribute, and its corresponding label should have the same value in it’s for attribute.
- The title attribute can replace `<label>`.

```example.html
 <fieldset>
    <legend class="sr-only">Checkbox example</legend>
    <div class="checkbox">
      <label for="option1">
        <input id="option1" type="checkbox" value="option1" checked>
        Option 1
      </label>
    </div>
    <div class="checkbox">
      <label for="option2">
        <input id="option2" type="checkbox" value="option2">
        Option 2
      </label>
    </div>
    <div class="checkbox">
      <label for="option3">
        <input id="option3" type="checkbox" value="option3">
        Option 3
      </label>
    </div>
    <div class="checkbox disabled">
      <label for="option4">
        <input id="option4" type="checkbox" value="" disabled>
        Option two is disabled
      </label>
    </div>
</fieldset>
```

repository: aragonwa/kc-form-standards

repo_name: aragonwa/kc-form-standards


text:
#md_data

An easy notation for describing multidimensional data.

For example:

```
1994
  BuenosAires
    Coal
      19t
    Potassium
      5t
1995
  BuenosAires
    Coal
      8t
    Potassium
      6t
```

Can be written down as:

```
class MaterialConsumption
  include MdData

  dimension :year, [:year_1994, :year_1995]
  dimension :city, [:buenos_aires, :zagreb]
  dimension :material, [:coal, :potassium]

  table_data do
    context 'year_1994 && buenos_aires' do
      add '8t', 'coal'
      add '5t', 'potassium'
    end
    context 'year_1995 && buenos_aires' do
      add '8t', 'coal'
      add '5t', 'potassium'
    end
  end
end

MaterialConsumption.select(:year => :year_1994, :city => :buenos_aires, :material => :coal) #=> '8t'
```
##Usage
By defining dimensions you get helper methods that can be used in 'context' and 'add' conditionals.

```
context 'year_1994 && buenos_aires'  do
  add '8t', 'coal'
end
```

Equals

```
context 'year == :year_1994 && city == :buenos_aires' do
  add '8t', 'material == :coal'
end
```

Important thing here is that this is still just Ruby in quotes. You can add any conditionals that you need
while you still have basic scenario covered and simplified.

##Usage
For any type of ruled based querying, when you want to pull out specific data based on attributes and rules.

## Installation

Add this line to your application's Gemfile:

    gem 'md_data'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install md_data

## Limitations

* No nested context allowed(yet)
* Tests for mis formed data definition
* Support for same dimension instance value and resolving of ambiguity

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
"default_action": ""
=========
Only "" default action supported at this point.

"collectors":
=========
Only four collectors supported at this point. They are dmi, file, storage and cpuid.
## dmi collector:

measures output of dmidecode based on input
type. input type (like BIOS, processor, system etc)
can be provided in policy file as shown.
```
"type": "dmi",
"events": [
   {
     "label": "BIOS",
     "fields": []
   },
   {
     "label": "System",
     "fields": []
   },
   {
     "label": "Processor",
     "fields": []
   }
```

## file collector:

measures any file that platform owner
wants to measure. target file to measure is input in the
paths field in policy file as shown
```
{
    "type": "files",
    "paths": [ "sda1:/Paul/foo" ]
},
```

## storage collector:

measures an entire disk. target disk to measure
can be provided in the policy file as shown
```
{
    "type": "storage",
    "paths": [ "/dev/sdb1" ]
},
```

## cpuid collector:

measures (hashes) cpuid data of the platform
and stores the result on a file. target file is input as
location field in policy file.
e.g
```
{
    "type": "cpuid",
    "location": "sda1:/Paul/foo"
}
```

"attestor": {}
=========
a nil slice is only supported at this point.

"launcher":
=========
launcher provides ability to kexec into a target kernel.
platform owners can choose which target kernel to kexec into
by setting launcher module in the platform policy file
as shown.
```
"launcher": {
    "type": "kexec",
    "params": {
    "initrd":"sdc1:/boot/initramfs-4.14.35-1941.el7uek.x86_64.img",
    "cmdline":"BOOT_IMAGE=/boot/vmlinuz-4.14.35-1941.el7uek.x86_64
root=/dev/mapper/ol-root ro rd.lvm.lv=ol/root LANG=en_US.UTF-8",
    "kernel":"sdc1:/boot/vmlinuz-4.14.35-1941.el7uek.x86_64"
    }
```
"eventlog":
=========
eventlog provides ability to parse event logs generated by
securelaunch kernel and write them to a file.The target file
can be specified in the policy file as shown.
```
"eventlog": {
    "type": "file",
    "location": "sda1:/evtlog"
}
```

***

Path format in policy file
=========
All of our file paths have the format device_identifier:/path/to/file.
device identifier is of the format
1. sda:/path/to/file OR
2. UUID:/path/to/file.

The following examples are acceptable formats for file path.
```
sda1:/foo/securelaunch.policy
sda2:/bar/evtlog
MWAAB8-Sunz-tRrp-E67t-sbal-xfYk-x9f6PZ:/zyd/cpuid.txt
```

SPECIAL NOTE: There is no need to prefix devices with /dev, so sda is sufficient.
Infact, if you enter a path as "/dev/sda", it will not be parsed by sluinit.

repository: u-root/u-root

repo_name: u-root/u-root


text:
# CapFrontDjango2

Requisite

django==2.1

djangorestframework==3.9.0

Project contains two APIs as,

#### <IP_ADDRESS>:8000/employee/employee_hire

It is POST API and used to insert a new Employee Data. Requested data must be in the format as,

data:{"birth_date":"YYYY-MM-DD","employee_id":2,"first_name":"FIRST","last_name":"LAST","gender":"M","hire_date":"2015-06-07","salary_from_date":"2015-06-07","salary_to_date":"2015-12-07","department":"Development","title":"Assistant Engineer"}

as sent from Postman.

Second api is,

#### <IP_ADDRESS>:8000/employee/eligible_for_hike/<employee_id>

It is GET API and used to check and update hike for eligible employee.

Example, <IP_ADDRESS>:8000/employee/eligible_for_hike/2

Project is based on WSGI. To run the server please run command,

python manage.py runserver


text:
# CI Examples

This examples directory is full of configuration files demonstrating the following:

1. How to set up a CI to deploy the import-map-deployer itself. [Examples](ci-for-import-map-deployer)
2. How to set up a CI to deploy an individual javascript module that calls the import map deployer. [Examples](ci-for-javascript-repo)

repository: fdagosti/import-map-deployer

repo_name: fdagosti/import-map-deployer


text:
# SoniColor

A JUCE powered app to provide quick educational demos on room acoustics. Students can form a matrix with their phones throughout the room while the color of the displays change based on the amplitude of the sound propagated throughout the room.

repository: drscotthawley/SoniColor

repo_name: drscotthawley/SoniColor


text:
# The Nuxed Period Component

> The Period component is Hack's missing time range API. it is based on [`league/period`](https://github.com/thephpleague/period) php packages, which is based on [Resolving Feature Envy in the Domain](https://verraes.net/2014/08/resolving-feature-envy-in-the-domain/) By Mathias Verraes and extends the concept to cover all basic operations regarding interval.

In your code, you will always have to typehint against the `Nuxed\Period\Period` class directly because it is a immutable value object class marked as final and the library does not provide an interface.

---

## Getting Started

---

### Overview

#### Accessing the interval properties

```hack
use type Nuxed\Period\Period;
use type DateTimeImmutable;
use type DateTime;

$interval = new Period(
    new DateTime('2014-10-03 08:12:37'),
    new DateTimeImmutable('2014-10-03 08:12:37')
);

$start = $interval->getStartDate(); // returns a `Nuxed\Period\DatePoint` object
$end = $interval->getEndDate(); // returns a `Nuxed\Period\DatePoint` object
$duration = $interval->getDateInterval(); // returns a `Nuxed\Period\Duration` object
$durationInSeconds = $interval->getTimestampInterval(); // returns the duration in seconds

print $interval->toString();
// result: 2014-10-03T08:12:37Z/2014-10-03T09:12:37Z
```

#### Iterate over the interval

A simple example on how to get all the days from a selected month.

```hack
foreach (Period::fromMonth(2014, 10)->getDatePeriod('1 DAY') as $day) {
    $day->format('Y-m-d');
}
```

#### Comparing intervals

```hack
$interval = Period::after('2014-01-01', '1 WEEK');
$alt_interval = Period::fromIsoWeek(2014, 1);
$interval->durationEquals($alt_interval); // returns true
$interval->equals($alt_interval);         // returns false
```

#### Modifying Interval

```hack
$period = Period::after('2014-01-01', '1 WEEK');
$altPeriod = $period->endingOn('2014-02-03');
$period->contains($altPeriod); //return false;
$altPeriod->durationGreaterThan($period); //return true;
```

#### Accessing all gaps between intervals

```hack
$sequence = new Sequence(
    new Period('2018-01-01', '2018-01-31'),
    new Period('2017-01-01', '2017-01-31'),
    new Period('2020-01-01', '2020-01-31')
);
$gaps = $sequence->gaps(); // a new Sequence object
print $gaps->count();
// result: 2
```

---

### Installation

```console
➜ composer require nuxed/period
```

---

## Building Blocks

---

### Definitions

#### Concepts

- *interval* - `Period` is a Hack implementation of a datetime interval which consists of :
  - two datepoints;
  - the duration between them;
  - a boundary type.
- *datepoint* - A position in time expressed as a `DateTimeImmutable` object. The starting datepoint is always less than or equal to the ending datepoint.
- *duration* - The continuous portion of time between two datepoints expressed as a `DateInterval` object. The duration cannot be negative.
- *boundary type* - An included datepoint means that the boundary datepoint itself is included in the interval as well, while an excluded datepoint means that the boundary datepoint is not included in the interval. The package supports included and excluded datepoint, thus, the following boundary types are supported:
  - included starting datepoint and excluded ending datepoint : `[start, end);`
  - included starting datepoint and included ending datepoint : `[start, end];`
  - excluded starting datepoint and included ending datepoint : `(start, end];`
  - excluded starting datepoint and excluded ending datepoint : `(start, end);`

> infinite or unbounded intervals are not supported.

#### Arguments

Since this package relies heavily on `DateTimeImmutable` and `DateInterval` objects and because it is sometimes complicated to get your hands on such objects the package comes bundled with:

- Two classes:
  - `Nuxed\Period\DatePoint`
  - `Nuxed\Period\Duration`

---

### The DatePoint Object

A datepoint is a position in time expressed as a `DateTimeImmutable` object.

The `DatePoint` class is introduced to ease `DatePoint` manipulation. This class extends Hack's DateTimeImmutable class by adding a new named constructor and several getter methods.

#### Named constructor

> public static function create(mixed $datepoint): this

Returns a `DatePoint` object or throws:

- a TypeError if the submitted parameter have the wrong type.

> *Parameters*

- `$datepoint` can be:
  - a `DateTimeInterface` implementing object.
  - a `string` parsable by the `DateTime` constructor.
  - an `integer` interpreted as a timestamp.

>Because we are using Hack's parser, values exceeding ranges will be added to their parent values.
>If no timezone information is given, the returned `DatePoint` object will use the current timezone.

##### Examples

Using the `$datepoint` argument

```hack
use type Nuxed\Period\Datepoint;

Datepoint::create('yesterday');
// returns new Datepoint('yesterday')
Datepoint::create(2018);
// returns new Datepoint('@2018')
Datepoint::create(new DateTime('2018-10-15'));
// returns new Datepoint('2018-10-15')
Datepoint::create(new DateTimeImmutable('2018-10-15'));
// returns new Datepoint('2018-10-15')
```

#### Accessubg calendar interval

Once you’ve got a `DatePoint` instantiated object, you can access a set of calendar type interval using the following methods.

```hack
public DatePoint::getSecond(): Period;
public DatePoint::getMinute(): Period;
public DatePoint::getHour(): Period;
public DatePoint::getDay(): Period;
public DatePoint::getIsoWeek(): Period;
public DatePoint::getMonth(): Period;
public DatePoint::getQuarter(): Period;
public DatePoint::getSemester(): Period;
public DatePoint::getYear(): Period;
public DatePoint::getIsoYear(): Period;
```

For each these methods a `Period` object is returned with:

- the `Period::INCLUDE_START_EXCLUDE_END` boundary type;
- the starting datepoint represents the beginning of the current datepoint calendar interval;
- the duration associated with the given calendar interval;

> *Examples*

```hack
use type Nuxed\Period\DatePoint;

$datepoint = new DatePoint('2018-06-18 08:35:25');
$hour = $datepoint->getHour();
// new Period('2018-06-18 08:00:00', '2018-06-18 09:00:00');
$month = $datepoint->getMonth();
// new Period('2018-06-01 00:00:00', '2018-07-01 00:00:00');
$month->contains($datepoint); // true
$hour->contains($datepoint); // true
$month->contains($hour); // true
```

---

### The Duration object

A duration is the continuous portion of time between two datepoints expressed as a `DateInterval` object. The duration cannot be negative.

The `Duration` class is introduced to ease duration manipulation. This class extends Hack’s `DateInterval` class by adding a new named constructor.

#### Named constructor

> public static function create(mixed $duration): this

Converts its single input into a `Duration` object or throws a `TypeError` otherwise.

> *Parameter*

`$duration` can be :

- a `Nuxed\Period\Period` object;
- a `DateInterval` object;
- a `string` parsable by `DateInterval::createFromDateString` method.
- an `integer` interpreted as the interval expressed in seconds.

> *Examples*

```hack
use type Nuxed\Period\Duration;
use type Nuxed\Period\Period;

Duration::create('1 DAY');
// returns new DateInterval('P1D')
Duration::create(2018);
// returns new DateInterval('PT2018S')
Duration::create(new DateInterval('PT1H'));
// returns new DateInterval('PT1H')
Duration::create(new Period('now', 'tomorrow'));
// returns (new DateTime('yesterday'))->diff(new DateTime('tomorrow'))
```

#### Duration::__construct

The constructor supports fraction on the smallest value.

For instance, the following is works while throwing an Exception on `DateInterval`.

```hack
use type Nuxed\Period\Duration;
use type DateInterval;

$duration = new Duration('PT5M0.5S');
$duration->f; // 0.5;

new DateInterval('PT5M0.5S'); // will throw an Exception
```

#### Duration representations

> *String representation*

```hack
public Duration::toString(void): string
```

Returns the string representation of a `Duration` object using [ISO8601 time interval representation](http://en.wikipedia.org/wiki/ISO_8601#Durations)

```hack
$duration = new Duration('PT5M0.5S');
print $duration->toString();
// result: PT5M0.5S
```

As per the specification the smallest value (ie the second) can accept a decimal fraction.

---

## Period

---

### Instatiation

>datepoint and duration conversions are done internally using the `Nuxed\Period\DatePoint` and the `Nuxed\Period\Duration` classes.

#### The constructor

```hack
  public Period::__construct(
    mixed $startDate,
    mixed $endDate,
    private PeriodBoundaryType $boundaryType =
      PeriodBoundaryType::INCLUDE_START_EXCLUDE_END,
  )
```

> *Parameters*

- The `$startDate` represents the starting datepoint.
- The `$endDate` represents the ending datepoint.
- The `$boundaryType` represents the interval boundary type.

Both `$startDate` and `$endDate` parameters are datepoints. `$endDate` must be greater or equal to `$startDate` or the instantiation will throw a `Nuxed\Period\Exception\LogicException`.

> *Example*

```hack
use type Nuxed\Period\Period;
use type Nuxed\Period\PeriodBoundaryType;

$period1 = new Period(
    '2012-04-01 08:30:25',
    '2013-09-04 12:35:21',
    PeriodBoundaryType::EXCLUDE_ALL
);
```


text:
# FHIR Primitive Wrappers

Primitive wrappers act as stateful encoding/decoding functions to translate from
some HL7 FHIR primitive JSON to a structured protobuf representation (parsing)
and vice-versa (printing). The wrappers subpackage implements a suite of wrapper
abstract classes and concrete subclasses for parsing/printing any HL7 FHIR
primitive datatypes found in versions [STU3](https://www.hl7.org/fhir/STU3/datatypes.html#primitive)
or [R4](https://www.hl7.org/fhir/datatypes.html).

## Primitive Wrapper Mapping

Each concrete wrapper implementation adheres to the
`primitive_wrappers.PrimitiveWrapper` abstract base class. Each FHIR version-
specific target (e.g. `//py/google/fhir/jsonformat/stu3`,
`//py/google/fhir/jsonformat/r4`) provides a wrapper implementation for an
encountered FHIR primitive at runtime via the
`primitive_handler.PrimitiveHandler` class. The vast majority of FHIR primitives
are "wrapped" using a `StringWrapper` implementation. Those primitives requiring
extra logic for parsing/printing (e.g. custom functions/additional state
information) are separated into their own modules within `wrappers/` for
readability.

## Primitive Wrapper Context

Certain FHIR wrappers require additional stateful information at the time of
wrapping. This information is typically used to alter the appearance of a
printed primitive (e.g. the type of "separator" used in a base64 binary string),
to infer intent in the face of ambiguity (e.g. the "default timezone" when a
date/time primitive has no associated timezone information), or is simply
information specific to the version of FHIR being parsed/printed (e.g. the
"generic" `Code` protobuf to use). This extra information is passed to the
wrapper via an instance of `primitive_wrappers.Context` class, which is provided
by the FHIR version-specific target `primitive_handler.PrimitiveHandler`
implementation.

## Testing

Testing necessitates parsing/printing specific FHIR versions of primitive
protobufs. As such, each FHIR version-specific target (e.g.
`//py/google/fhir/jsonformat/stu3`, `//py/google/fhir/jsonformat/r4`) tests the
primitive wrapper implementations via the `primitive_handler_test.py` module by
providing a specific implementation of the `primitive_handler.PrimitiveHandler`
class.

## Example Usage

### Parsing

```
datetime_str = '1970-01-01'
expected = datatypes_pb2.DateTime(
  value_us=0,
  precision=datatypes_pb2.DateTime.Precision.DAY,
  timezone='Z')
wrapper = _date_time.DateTimeWrapper.from_json_value(datetime_str)
assert(expected == wrapper.wrapped) # True
```

### Printing

```
primitive = datatypes_pb2.DateTime(
  value_us=-36000000000,
  precision=datatypes_pb2.DateTime.Precision.MONTH,
  timezone='Australia/Sydney')
wrapper = _date_time.DateTimeWrapper.from_primitive(primitive)
assert(wrapper.string_value() == '1970-01') # True
```

## References

See the official [hl7.org FHIR specification](https://www.hl7.org/fhir/) for
more information.  Information surrounding version-specific primitive datatypes
can be found at the following links:

* [STU3](https://www.hl7.org/fhir/STU3/datatypes.html)
* [R4](https://www.hl7.org/fhir/datatypes.html)

repository: google/fhir

repo_name: google/fhir


text:
# Hacktoberfest2018 ~ Week 3 Challenge

For previous challenges, please look at [readmes](https://github.com/RaidAndFade/Hacktoberfest2018/tree/master/READMES).

*This is part of a series of weekly projects that will be in this repository over the span of hacktoberfest.*
*this is satire, it's meant to be cute and to see what potential PRs have (both during hacktoberfest and otherwise)*

## Glitchtoberfest

Raid keeps breaking his stuff! His parents are sick of it!

## How can I help?!

All Raid wanted to do was to use his PS3 controller on his computer... Little did he realise it would cause the worst kind of error.... The BLUE SCREEN OF DEATH! But that made him realise; wouldn't it be fun to make my own BSoD? Make sure to put it in the `BSoD` folder.

## What on earth is a blue screen of death? (BSoD)

So basically, when your computer has some giant fatal error and can't bother anymore, it throws a blue screen of death! (or a kernel panic on linux/ some weird popup on macos). What i'm asking is that you try your best to replicate that screen in HTML!

## RULES

1. Your submission must be in the HTML file "BSoD/{YourUsername}.html"
2. Don't just use an IMG tag of some BSoD screenshot. Try and template it.
3. No Malicious Code (cookie sniffing, iframe hacking, css local file stealing, ios rootkits, while loops that never end, CPU Monero Miners)
4. No NSFW (porn, nudes, pictures of your cat's testicles, severed heads)
5. No ADS (No advertising your product, No third party ads)
6. DO NOT MODIFY OTHER PEOPLE'S SUBMISSIONS. THESE PRS WILL BE INSTANTLY DENIED AND MARKED SPAM.

## But why is this a challenge?

The point of this challenge is to replicate an image template into HTML, You might not think it's that important or that difficult, but in the workplace most (if not all) instances of web development require you to work based on a design.
 Try to make it so that if someone went fullscreen on your page, it would trick an average user!

repository: LeoMSSilva/HacktoberChallenges

repo_name: LeoMSSilva/HacktoberChallenges


text:
---
layout: post
author: Georgios Gousios
title: How to run a large scale survey
categories: survey qualitative
---

If you know me well, this blog post might seem strange. I have always been a  proponent of quantitative methods and big data.
Despite this, in April 2014, I run a survey that got filled in by 1,500 people.
One part of the survey analysis will be presented at [ICSE 2015](http://www.gousios.gr/bibliography/GZSD15.html) this year,
while we submitted the second part to [FSE 2015](http://gousios.gr/bibliography/GB15.html) (still twiddling our thumbs about the results). In wake of the ICSE 2015 publication, many colleagues asked me how I managed to get so many responses.

Here is how I did it.

* **Target an audience:** The broader the audience, the more general the survey
will be and therefore the less deep insights you will get. With qualitative research, it usually pays off to go deep rather than broad. So, it is preferable
to target an audience. What worked for me was that I preselected my audience.
Using the [GHTorrent](htp://ghtorrent.org) database, I queried it for the types of projects that I wanted to examine. For many problems in software engineering
at least, Github is a very good source of massive amounts of potential respondents provided one targets the appropriate ones.

* **Make it lean:** No one has time to spend on someone else's problem. So when
asking for help (this is what a survey is about), make sure that the helping
party's time is time well spent. Limit the number of questions to the absolute
minimum. Put all questions in one page. Make non essential questions optional.
Limit free-text questions. Configure the size of free-text question boxes to
guide the expected input size (2-3 lines should be enough). Give a realistic
estimate on how much time you expect the survey taker to spend in the invitation
email.

* **Personalize the invitation:** No matter how honest the sender's intentions
are, it is usually not nice to receive generic email. What I did was to include
details such as the project's name, the correspondent's name and links
to my past work, just to assure people that I am not a robot.

* **Give something back:** Even if you only ask 10 mins of someone's time, it is
nice to offer something in return. Since my survey was about pull requests, I
created a [customized report](http://ghtorrent.org/pullreq-perf/) of how pull
requests work for the Github repository. I believe this made a huge difference
in the completion rate of my survey: while the pilot was filled in by 8% of the
people I sent emails to, the actual survey completion rate was > 20%!

* **Be responsive:** After I 've sent the initial invitations (all 3,500 of them :-)) my mailbox got flooded by emails. This is something I did not expect,
but many people asked for clarifications, while others congratulated or
complained about the spamming. In any case, you need to act accordingly as fast as possible, otherwise you will loose your "clients". In my case, I answered 160 emails the first day; I estimate that around 100 responses lead to answers.

* **Automate processing of results** Getting lots of responses is one thing;
processing them is another. In surveys, we typically have three types of questions: i) Multiple (or single) choice, ii) Likert scale and iii) Open ended.
Multiple choice and Likert scale questions are easier to process en masse.
Open ended questions need to be [coded](http://en.wikipedia.org/wiki/Coding_(social_sciences)) first; then they can also be processed statistically.
Processing usually involves filtering, correlating and plotting. For all
those purposes a scripting language, such as R or Python, with support for datasets and plotting can be very handy; Excel or other GUI packages
are definitely not handy. Imagine that the last day before a deadline you
find a small error that affects all your plots and parts of the statistics.
With a scripting language, you just rerun the scripts. With a GUI tool, you
need to go through lots of painful point and clicking. You can find R code to process a CSV file with survey responses in the
GitHub repository: [gousiosg/pullreqs-integrators](https://github.com/gousiosg/pullreqs-integrators)

* **Offer an option to be notified about the results:** Finally, you should notify your respondents (the ones that want to be notified) about your results, when
they are available. While it is nice to send the paper itself, it is nicer for
busy people to read a blog post with the major findings. The benefit is mutual: developers learn about exiting results while our research is getting spread. My [blog post about the results](http://www.gousios.gr/blog/How-do-project-owners-use-pull-requests-on-Github/) of the ICSE 2015 paper is by far the most read one in my blog (around 8k views now). I really doubt that that many people read my paper.

Designing and running the survey was a great learning experience for me. First,
I understood the power of qualitative research: using the appropriate questions,
one can get tons of insight in very little time. Second, big data has its
limitations: while is relatively straightforward to quantitively analyze
mechanised processes (which have finite states), it is much more difficult to
get deep insights when people are involved, as people can act unpredictably and
have initiative. Third, I realised that despite my fears which were certainly
founded in my ignorance, it is actually possible (and sometimes preferable) to
turn qualitative research into quantitative research.

Given the opportunity, I would like to thank the 1,500 developers that replied to
my survey. The combined effort, assuming that it took 10 minutes to fill the
survey in, amounts to 30 working days worth of time given out for free. If I
were to do the survey the traditional way, i.e. sending actual copies to
companies, going door to door to ask people to fill it in etc, it would have
taken me more than a year.

repository: gousiosg/homepage

repo_name: gousiosg/homepage


text:
---
layout: page
title: Contact
permalink: /contact/

---
Thanks for visiting my portfolio. Feel free to use the form below to contact me or use any of the additional options in the header above.

<form action="https://getsimpleform.com/messages?form_api_token=b888a86dba0cc62dae347e47a3b587f0" method="post">

  <input type='hidden' name='redirect_to' value='http://www.gtgraves.net/thank-you/' />

  <input type='text' name='name' placeholder='Your Name' />

  <input type='email' name='email' placeholder='Your E-mail' />

  <textarea name='message' rows="4" cols="50" placeholder='Your message'></textarea>

  <input type='submit' value='Send Message' />
</form>


text:
# Reliable Queue [![Build Status](https://travis-ci.org/altmetric/reliable-queue.svg?branch=master)](https://travis-ci.org/altmetric/reliable-queue)

A PHP library for reliable queueing backed by [Redis](http://redis.io/).

**Current version:** 0.4.0
**Supported PHP versions:** 5.3, 5.4, 5.5, 5.6, 7

## Installation

```shell
$ composer require altmetric/reliable-queue
```

## Usage

```php
<?php
use Altmetric\ReliableQueue;
use Altmetric\ChunkedReliableQueue;
use Altmetric\PriorityReliableQueue;

$queue = new ReliableQueue('unique-worker-name', 'to-do-queue', $redis, $logger);
$queue[] = 'some-work';
$queue[] = 'some-more-work';

foreach ($queue as $work) {
    // Perform some action on each piece of work in the to-do-queue
}

$queue = new ChunkedReliableQueue('unique-worker-name', 100, 'to-do-queue', $redis, $logger);

foreach ($queue as $chunk) {
    // $chunk will be an array of up to 100 pieces of work
}

$queue = new PriorityReliableQueue('unique-worker-name', array('critical-queue', 'default-queue', 'low-priority-queue'), $redis, $logger);

foreach ($queue as $name => $work) {
    // $work will be popped from the queue $name in the priority order given
}
```

## API Documentation

### `public ReliableQueue::__construct(string $name, string $queue, Redis $redis, LoggerInterface $logger)`

```php
$queue = new \Altmetric\ReliableQueue('unique-worker-name', 'to-do-queue', $redis, $logger);
```

Instantiate a new reliable queue object with the following arguments:

* `$name`: a unique `string` name for this worker so that we can pick up any
  unfinished work in the event of a crash;
* `$queue`: the `string` key of the list in Redis to use as the queue;
* `$redis`: a [`Redis`](https://github.com/phpredis/phpredis) client object for
  communication with Redis;
* `$logger`: a
  [`Psr\Log\LoggerInterface`](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)-compliant
  logger.

The returned object implements both the
[`Iterator`](http://php.net/manual/en/class.iterator.php) (and therefore
[`Traversable`](http://php.net/manual/en/class.traversable.php)) and
[`ArrayAccess`](http://php.net/manual/en/class.arrayaccess.php) interface in
PHP.

This means that it can be iterated over with `foreach`, yielding the queue name
and a value on every iteration. Internally, the library will block for new work
but this is invisible from a client's perspective.

```php
foreach ($queue as $key => $work) {
    // $key will be the queue key name in Redis
    // $work will be the value popped from the queue
}
```

You can also modify the queue as if it were an array by using the typical array
operations:

```php
$queue[] = 'work';  // enqueues work
$queue[1];          // returns work at index 1 if it exists
$queue[1] = 'work'; // sets work to index 1 in the queue
unset($queue[1]);   // remove work at index 1 from the queue
```

### `public ChunkedReliableQueue::__construct(string $name, int $size, string $queue, Redis $redis, LoggerInterface $logger)`

```php
$queue = new \Altmetric\ChunkedReliableQueue('unique-worker-name', 100, 'to-do-queue', $redis, $logger);
```

Instantiate a new chunked, reliable queue object with the following arguments:

* `$name`: a unique `string` name for this worker so that we can pick up any
  unfinished work in the event of a crash;
* `$size`: an integer maximum size of chunk to return on each iteration;
* `$queue`: the `string` key of the list in Redis to use as the queue;
* `$redis`: a [`Redis`](https://github.com/phpredis/phpredis) client object for
  communication with Redis;
* `$logger`: a
  [`Psr\Log\LoggerInterface`](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)-compliant
  logger.

The returned object implements the
[`Iterator`](http://php.net/manual/en/class.iterator.php) (and therefore
[`Traversable`](http://php.net/manual/en/class.traversable.php)) interface in
PHP.

This means that it can be iterated over with `foreach`, yielding the queue name
and an array of up to `$size` elements on every iteration. Internally, the
library will block for new work but this is invisible from a client's
perspective.

If the queue contains sufficient items, the chunk of work will contain at most
`$size` elements but if there is not enough work, it may return less (but
always at least 1 value).

### `public PriorityReliableQueue:__construct(string $name, array $queues, Redis $redis, LoggerInterface $logger)`

```php
$queue = new \Altmetric\PriorityReliableQueue('unique-worker-name', array('critical-queue', 'default-queue', 'low-priority-queue'), $redis, $logger);
```

Instantiate a new priority-ordered, reliable queue object with the following arguments:

* `$name`: a unique `string` name for this worker so that we can pick up any unfinished work in the event of a crash;
* `$queues`: an `array` of `string` keys of lists in Redis to use as queues given in priority order;
* `$redis`: a [`Redis`](https://github.com/phpredis/phpredis) client object for communication with Redis;
* `$logger`: a
  [`Psr\Log\LoggerInterface`](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)-compliant
  logger.

The returned object implements the
[`Iterator`](http://php.net/manual/en/class.iterator.php) (and therefore
[`Traversable`](http://php.net/manual/en/class.traversable.php)) interface in
PHP.

This means that it can be iterated over with `foreach`, yielding the queue name
and a value on every iteration. Queues will be checked randomly for work based
on their priority order given in `$queues` meaning that the first queue will be
checked more often than the second, the second more than the third and so on.
Internally, the library will repeatedly poll for new work but this is invisible
from a client's perspective.

```php
foreach ($queue as $key => $work) {
    // $key will be the queue key name in Redis
    // $work will be the value popped from the queue
}
```

## References

* [Pattern: Reliable queue](http://redis.io/commands/rpoplpush#pattern-reliable-queue)

## Acknowledgements

* Thanks to [James Adam](https://github.com/lazyatom) for suggesting a way to
  test the randomness of the priority queue.

## License

Copyright © 2016-2017 Altmetric LLP

Distributed under the MIT License.

repository: overtonpolicy/reliable-queue

repo_name: overtonpolicy/reliable-queue


text:
# Overview

This image collects Kubernetes manifests, [Grafana](http://grafana.com/) dashboards,
and [Prometheus rules](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/) combined with
documentation and scripts to provide easy to operate end-to-end Kubernetes cluster monitoring
with [Prometheus](https://prometheus.io/) using the Prometheus Operator.

Components included in this image:

* The [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator)
* Highly available [Prometheus](https://prometheus.io/)
* Highly available [Alertmanager](https://github.com/prometheus/alertmanager)
* [Prometheus node-exporter](https://github.com/prometheus/node_exporter)
* [Prometheus Adapter for Kubernetes Metrics APIs](https://github.com/DirectXMan12/k8s-prometheus-adapter)
* [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics)
* [Grafana](https://grafana.com/)

This stack is meant for cluster monitoring, so it is pre-configured to collect metrics from all Kubernetes components.
In addition to that it delivers a default set of dashboards and alerting rules. Many of the useful dashboards and alerts
come from the [kubernetes-mixin project](https://github.com/kubernetes-monitoring/kubernetes-mixin), similar to this
project it provides composable jsonnet as a library for users to customize to their needs.

## About prometheus

We choose OpenEBS LocalPV as its default persistence storage and deploy it with two replicas resource. many prometheus rules in
this image will be loaded when prometheus start. you can check the`Prometheus` and `PrometheusRule` in the cluster for
more details.

```shell
kubectl get Prometheus -n kube-prometheus-stack-system
kubectl get PrometheusRule -n kube-prometheus-stack-system
```

## About grafana

We provide grafana as deployment resource in the cluster and which service type is `ClusterIP`. what's more, we hold
many useful grafana dashboard inside which will be applied with the grafana dashboard by default. you can check the
`ConfigMap`for more details in the `kube-prometheus-stack-system` namespace.

## Access the dashboard

Prometheus, Grafana, and Alertmanager dashboards can be accessed quickly using kubectl port-forward after running the
image via the commands below.

Examples:

```shell
kubectl --namespace kube-prometheus-stack-system port-forward service/kube-prometheus-stack-grafana 3000
```

Then access via [http://localhost:3000](http://localhost:3000) and use default dashboard access credential :

```shell
username : admin
password : sealer-admin
```


text:
## TA_Trend_IMSVA_Addon_for_Splunk
This app provides field extractions and normalisation to the Common Information Model for Trend InterScan Messaging Security (TIMSVA).

## Unpack
tar cvfz TA_trend_imsva_xxx.tgz TA_trend_imsva

## Support
For any feedback or questions, please reach out to<EMAIL_ADDRESS>


text:
# React Router Outlet

React Router Outlet provides a very simple, declarative way to define your React Router routes, inspired by Angular's approach.

## Prerequisite

This library requires React Router v5 as peer dependency.

To enable routing, the app would have a `<Router>` instance at a top-level component, ideally the `<App>`. You will only need to have **one** such instance for the entire app. This is provided by the standard **React Router**, not this library. You can check the React Router [official documentation](https://reacttraining.com/react-router/core/api/Router) for details.

## The Router Outlet

This library provides a _router outlet_ component that dynamically changes content depending on the current route. This is a convenient drop-in replacement for React Router's combination of `<Switch>`, `<Route>` and `<Redirect>` components, and then adds a couple of neat features as well.

### `<RouterOutlet>`

Place this component wherever you need routed views.

```html
<RouterOutlet routes={routes} />
```
where `routes` defines the routes declaratively (see below).

Routing can apply to any level component, so you can place a `<RouterOutlet>` virtually anywhere in the component tree. Similarly, you can have as many nested router outlets as required in the application, particularly when your route paths go from wildcard to specific.

**IMPORTANT:** If your `<RouterOutlet>` and the `<Router>` are not in the same parent component, you would normally need to apply React Router's `withRouter` HOC to the component that renders the `<RouterOutlet>`. This is a requirement of React Router, not of Outlet, so please check their documentation for details.

## Defining Routes Declaratively

We use this format when declaring routes:
```javascript
const routes = [
  {
    path: '/login',
    component: LoginPage
  },
  {
    path: '/default',
    component: DefaultPage
  },
  {
    path: '/',
    exact: true,
    redirectTo: '/default'
  },
  {
    component: NotFound
  }
];
```

These are the common cases for routes:

- Both `path` and `component` are defined in the route spec. This is straightforward routing.
- No `path` is specified, which means this is the default route if none of the preceding routes matched.
- If `exact` is set to `true`, the `path` has to match exactly.
- If `redirectTo` path is specified instead of `component`, this is a straightforward redirection.

## Protected Routes

Sometimes you need to restrict access to certain routes depending on some conditions. In such cases, you can do something like this:

```javascript
  {
    path: '/default',
    component: DefaultPage,
    canEnter: isAuthenticated,
    fallback: '/login',
  },
```
```javascript
const isAuthenticated = ({ auth }) => auth !== null;
```

If a `canEnter` _guard function_ is defined, the router will only activate the matched route if this function evaluates to `true`. Otherwise, it will route to the `fallback` path. This is useful for apps that require user login to access specific features. Just make sure to define `fallback` whenever you have a `canEnter`.

The signature of such guard function is:
```typescript
(outletProps: Object, route: Object) => condition: boolean
```
where `outletProps` contains all props that were passed to `<RouterOutlet>`, while `route` is a reference to the matched route.

In the example above, the outlet would look like this:
```html
<RouterOutlet routes={routes} auth={token} />
```
so that the `auth` prop is passed to the `isAuthenticated` guard.

If you pass some _state_ value (or an injected _state prop_, either internal or from store), the `<RouterOutlet>` will re-render, hence routing will happen, whenever this state value changes.

## Lazy Evaluated Redirection/Fallback

Both `redirectTo` and `fallback` in your routes can alternatively be expressed as functions with the following signature:

```typescript
(outletProps: Object, route: Object) => path: string
```

In this case, these path values are only evaluated when the `<RouterOutlet>` renders, and therefore you can dynamically determine the target paths based on props that were passed to the outlet, similar to how `canEnter` works with such props.

For example:
```javascript
{
  path: '/login',
  redirectTo: ({ referrer }) => referrer
}
```
where `referrer` is a prop of the outlet:
```html
  <RouterOutlet routes={routes} referrer={currentPath} />
```

## Routing to Lazy Loaded Components

For optimization, feature components can be _lazy loaded_, i.e. they are only fetched by the browser if and when they are required by the app. This technique is also called _code splitting_.

Instead of the normal `import`, use **React Lazy** to import lazy-loaded components.

```javascript
import React, { lazy } from 'react';

const WelcomePage = lazy(() => import('../welcome/WelcomePage'));
```

Then you can optionally tell `<RouterOutlet>` to display a placeholder (e.g. a spinner component) while the component is being loaded. For example:
```html
<RouterOutlet routes={routes} placeholder={<div>...</div>} />
```
where `placeholder` can be any component.

The `<RouterOutlet>` supports routing to such lazy-loaded components by using **React Suspense** internally.

For more information on React Lazy and Suspense, check out the [official documentation](https://reactjs.org/docs/code-splitting.html).

repository: arnelenero/react-router-outlet

repo_name: arnelenero/react-router-outlet


text:
# snowpack-plugin-raw

Resolves file import to raw string.

```sh
npm install --save-dev snowpack-plugin-raw
```

```javascript
// snowpack.config.json
{
  "plugins": [
    ["snowpack-plugin-raw", { extensions: [".txt", ".md"] }]
  ]
}
```

## Plugin Options

- extensions: File extensions.
- encoding: File encoding, default `utf-8`.

repository: cbdyzj/snowpack-plugin-raw

repo_name: cbdyzj/snowpack-plugin-raw


text:
---
name: How to use xxx in cvpods
about: Usage of cvpods
title: "[Usage]"
labels: ''
assignees: poodarchu

---

**Please use this template to submit your problem or your question will _NOT_ be properly tackled.**

---

Describe what you want to do, including:
1. what inputs you will provide, if any:
2. what outputs you are expecting:

## ❓ What does an API do and how to use it?

_Pur your question here._

repository: Megvii-BaseDetection/cvpods

gha_language: Python

repo_name: Megvii-BaseDetection/cvpods


text:
# GraphJin Instant GraphQL API

[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=for-the-badge&logo=appveyor&logo=appveyor)](https://pkg.go.dev/github.com/dosco/graphjin)
[![GoReport](https://goreportcard.com/badge/github.com/gojp/goreportcard?style=for-the-badge)](https://goreportcard.com/report/github.com/dosco/graphjin)
[![Apache 2.0](https://img.shields.io/github/license/dosco/graphjin.svg?style=for-the-badge)](https://github.com/dosco/graphjin/blob/master/LICENSE)
[![Docker build](https://img.shields.io/docker/cloud/build/dosco/graphjin.svg?style=for-the-badge)](https://hub.docker.com/r/dosco/graphjin/builds)
[![Discord Chat](https://img.shields.io/discord/628796009539043348.svg?style=for-the-badge&logo=appveyor)](https://discord.gg/6pSWCTZ)

GraphJin gives you an instant secure and fast GraphQL API without code. GraphQL is automagically compiled into an efficient SQL query. Use either as a library or a standalone service. Build your backend APIs 100X faster.

## 1. Quick install

Mac (Homebrew)

```
brew install dosco/graphjin/graphjin
```

Ubuntu (Snap)

```
sudo snap install --classic graphjin
```

Debian and Redhat ([releases](https://github.com/dosco/graphjin/releases))

```
Download the .deb or .rpm from the releases page and install with dpkg -i and rpm -i respectively.
```

Go Install

```
go install github.com/dosco/graphjin@latest
```

## 2. Create a new app

```bash
graphjin new <app_name>

cd <app_name>
docker-compose run api db setup
docker-compose up
```

## Secure out of the box

When you use a query in development it's auto-saved in an allow list and only queries from this allow list can be run in production. In production these allowed queries are converted into prepared statments in the database to protect against sql injection, etc. This makes GraphJin very secure and also very fast since no compiling happens in production all queries go directly to the database. GraphJin is built in Go a language designed by Google to be secure and memory safe.

## Built for production

#### Instantly deploy new versions

```bash
# Deploy a new config
graphjin deploy --host=https://your-server.com --secret="your-secret-key"

# Rollback the last deployment
graphjin deploy rollback --host=https://your-server.com --secret="your-secret-key"
```

#### Secrets Management

```bash
# Secure save secrets like database passwords and JWT secret keys
graphjin secrets
```

#### Database Management

```bash
# Create, Migrate and Seed your database
graphjin db
```

## Use in your own code

You can use GraphJin as a library within your own code. The [serv](https://pkg.go.dev/github.com/dosco/graphjin/serv) package exposes the entirely GraphJin standlone service as a library while the [core](https://pkg.go.dev/github.com/dosco/graphjin/core) package exposes just the GraphJin compiler. The [Go docs](https://pkg.go.dev/github.com/dosco/graphjin/core#pkg-examples) are filled with examples on how to use GraphJin within your own apps as a sort of alternative to using ORM packages. GraphJin allows you to use GraphQL and the full power of GraphJin to access your data instead of a limiting ORM.

```console
go get github.com/dosco/graphjin/core
```

```golang
package main

import (
  "context"
  "database/sql"
  "fmt"
  "log"

  "github.com/dosco/graphjin/core"
  _ "github.com/jackc/pgx/v4/stdlib"
)

func main() {
  db, err := sql.Open("pgx", "postgres://postgres:@localhost:5432/example_db")
  if err != nil {
    log.Fatal(err)
  }

  sg, err := core.NewGraphJin(nil, db)
  if err != nil {
    log.Fatal(err)
  }

  query := `
    query {
      posts {
      id
      title
    }
  }`

  ctx := context.Background()
  ctx = context.WithValue(ctx, core.UserIDKey, 1)

  res, err := sg.GraphQL(ctx, query, nil, nil)
  if err != nil {
    log.Fatal(err)
  }

  fmt.Println(string(res.Data))
}
```

### Use the standalone service as a library

```golang
import (
  "github.com/dosco/graphjin/serv"
)

gj, err := serv.NewGraphJinService(conf, opt...)
if err != nil {
 return err
}

if err := gj.Start(); err != nil {
 return err
}
```

![graphjin-screenshot-final](https://user-images.githubusercontent.com/832235/108806955-1c363180-7571-11eb-8bfa-488ece2e51ae.png)

## Support the Project

GraphJin is an open source project made possible by the support of awesome backers. It has collectively saved teams 1000's of hours dev. time and allowing them to focus on their product and be 100x more productive. If your team uses it please consider becoming a sponsor.

## About GraphJin

After working on several products through my career I found that we spend way too much time on building API backends. Most APIs also need constant updating, and this costs time and money.

It's always the same thing, figure out what the UI needs then build an endpoint for it. Most API code involves struggling with an ORM to query a database and mangle the data into a shape that the UI expects to see.

I didn't want to write this code anymore, I wanted the computer to do it. Enter GraphQL, to me it sounded great, but it still required me to write all the same database query code.

Having worked with compilers before I saw this as a compiler problem. Why not build a compiler that converts GraphQL to highly efficient SQL.

This compiler is what sits at the heart of GraphJin, with layers of useful functionality around it like authentication, remote joins, rails integration, database migrations, and everything else needed for you to build production-ready apps with it.

## Better APIs Faster!

Lets take for example a simple blog app. You'll probably need the following APIs user management, posts, comments, votes. Each of these areas need apis for listing, creating, updating, deleting. Off the top of my head thats like 12 APIs if not more. This is just for managing things for rendering the blog posts, home page, profile page you probably need many more view apis that fetch a whole bunch of things at the same time. This is a lot and we're still talking something simple like a basic blogging app. All these APIs have to be coded up by someone and then the code maintained, updated, made secure, fast, etc. We are talking weeks to months of work if not more. Also remember your mobile and web developers have to wait around till this is all done.

With GraphJin your web and mobile developers can start building instantly. All they have to do is just build the GraphQL queries they need and GraphJin fetches the data. Nothing to maintain no backend API code, its secure, lighting fast and has tons of useful features like subscriptions, rate limiting, etc built-in. With GraphJin your building APIs in minutes not days.

## Highlevel

- Works with Postgres, MySQL8, YugabyteDB, CockroachDB,
- Also works with Amazon Aurora/RDS and Google Cloud SQL
- Supports REST, GraphQL and Websocket APIs

## More Features

- Complex nested queries and mutations
- Realtime updates with subscriptions
- Add custom business logic in Javascript
- Build infinite scroll, feeds, nested comments, etc
- Add data validations on insert or update
- Auto learns database tables and relationships
- Role and Attribute-based access control
- Cursor-based efficient pagination
- Full-text search and aggregations
- Automatic persisted queries
- JWT tokens supported (Auth0, JWKS, Firebase, etc)
- Join database queries with remote REST APIs
- Also works with existing Ruby-On-Rails apps
- Rails authentication supported (Redis, Memcache, Cookie)
- A simple config file
- High performance Go codebase
- Tiny docker image and low memory requirements
- Fuzz tested for security
- Database migrations tool
- Database seeding tool
- OpenCensus Support: Zipkin, Prometheus, X-Ray, Stackdriver
- API Rate Limiting
- Highly scalable and fast
- Instant Hot-deploy and rollbacks
- Add Custom resolvers

## Documentation

[Quick Start](https://github.com/dosco/graphjin/wiki/Quick-Start)

[Documentation](https://github.com/dosco/graphjin/wiki)

[Build APIs in 5 minutes with GraphJin](https://dev.to/dosco/build-high-performance-graphql-apis-in-5-minutes-with-graphjin-261o)

[GraphQL vs REST](https://dev.to/dosco/rest-vs-graphql-building-startups-in-2021-3k73)

[GraphQL Examples](https://pkg.go.dev/github.com/dosco/graphjin/core#pkg-examples)

## Reach out

We're happy to help you leverage GraphJin reach out if you have questions

[twitter/dosco](https://twitter.com/dosco)

[discord/graphjin](https://discord.gg/6pSWCTZ) (Chat)

## Production use

The popular [42papers.com](https://42papers.com) site for discovering trending papers in AI and Computer Science uses GraphJin for it's entire backend.

## License

[Apache Public License 2.0](https://opensource.org/licenses/Apache-2.0)

Copyright (c) 2019-present Vikram Rangnekar

repository: GQAdonis/super-graph

repo_name: GQAdonis/super-graph


text:
# phattime_api
API for PhatTime services

## Development

### Get dependencies
    npm install

If you do nothing else, the api will work and you can post to it locally.  It will not write to the data store because it will detect you did not configure the data store environment.

### Set up environment variables

If you have an Azure Storage Account and Key plus the Table name you want to save at, put these env variables in a .env file in the root folder:

    AZURE_STORAGE_ACCOUNT=<storage account name>
    AZURE_STORAGE_ACCESS_KEY=<key here>
    AZURE_EMAIL_TABLE=<table to store email information in>

.env is in .gitignore.

gha_language: JavaScript


text:
# Alternating-Least-Square-With-QR

# The problem

The problem consists of finding a low-rank approximation of a matrix A of size m x n
defined by the following equation:
```
||A - UV||_F
```
Where U is a matrix of size m x k and V is a matrix of size k x n.
The  approximation  is  computed  using  an  alternating  minimization  procedure: choose V = V0, compute U1 = argmin‖A−UV0‖_F, then use it to compute V1 = argmin‖A−U1V‖_F,  and  so  on  until  we  find  a  sufficiently  good  approximation.

# How to execute

You need Julia installed in your PC. Then:
  1. Open the Julia console.
  2. Exec ```include("resetqr.jl")``` for RESETQR and ```include("cresetqr.jl")``` for CRESETQR.
  3. Create  a  matrix A for  which  you  want  to  find  the  UV  decomposition.   For instance, ```A = rand(10,20);```
  4.  Call theresetqr/cresetqrfunction with the following parameters:
      - A: matrix of size m x n
      - k: the rank of the UV decomposition. Note that k <= rank(A).
      - init_V: initial V_0 from which the algorithm starts. V_0 must be full rank. ([optional] default value is rand(k, n)).
      - min_error: the algorithm will stop if ‖fold−f‖F ≤ min_error ([optional] default value is 1e−8).
      - max_iterations: the algorithm will perform at most maxiteration steps ([optional] default value is 100).
      - print_error:   if  it  is  true,  the  algorithm  will  print  the  error  at  every iteration ([optional] default value is true).


text:
---
layout: default
---

# 1994-08-07 - Re: e$: Cypherpunks Sell Concepts

## Header Data

From<EMAIL_ADDRESS>(Robert Hettinga)

To<EMAIL_ADDRESS>(Eric Hughes)

Message Hash: 4667c422d79ddf1ca5f88098d7745e792a6305984f41bc7286affa46c6f2dd63

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-08-07 21:59:50 UTC

Raw Date: Sun, 7 Aug 94 14:59:50 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Robert Hettinga)
Date: Sun, 7 Aug 94 14:59:50 PDT
To<EMAIL_ADDRESS>(Eric Hughes)
Subject: Re: e$: Cypherpunks Sell Concepts
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At  2:19 PM 8/7/94 -0400, Perry E. Metzger wrote:

>The regulators
>have taken ten years just to eliminate the restrictions on interstate
>banking, and they still haven't quite done the job yet (although
>hopefully the restrictions will go away by '96 or so.)

It really isn't to most of the individual banking entities' advantage for
interstate banking to exist because almost all of them would merged out of
existence. It isn't the regulators' fault; it's a wonder they got this far
as fast as they did, and that's primarily because the foriegn markets are
driving the regulators to it. Regulatory arbitrage. If there was a clearcut
financial advantage to interstate banking to First Podunk Bank and Trust,
it would have happened already.

>They understood
>that stuff fairly well. They probably won't understand digital cash as
>well, although it will probably be even worse for us if they do.

Which, I believe, is the point of this thread.  It's time to shuck and jive
a bit.  If it can be demonstrably proved that a market exists, that there's
some boards of directors for those hoary old regulators to sit on in their
golden years, then there's a chance to make retail trade settlement a
reality.  You can't do that without a legimate test, and you can't get that
without mau-mauing the regulators some, eh?

Bob Hettinga

-----------------
Robert Hettinga<EMAIL_ADDRESS>"There is no difference between someone
Shipwright Development Corporation     who eats too little and sees Heaven and
44 Farquhar Street                       someone who drinks too much and sees
Boston, MA 02331 USA                       snakes." -- Bertrand Russell
(617) 323-7923

{% endraw %}
```

## Thread

+ Return to [August 1994](/archive/1994/08)

+ Return to<EMAIL_ADDRESS>(Robert Hettinga)](/authors/rah_at_shipwright_com_robert_hettinga_)"

+ 1994-08-07 (Sun, 7 Aug 94 14:59:50 PDT) - Re: e$: Cypherpunks Sell Concepts -<EMAIL_ADDRESS>(Robert Hettinga)_


text:
# <img src='https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/bed.svg' card_color='#22a7f0' width='50' height='50' style='vertical-align:bottom'/> Naptime
Put Mycroft to sleep when you don't want to be disturbed

## About
Tell Mycroft to sleep when you don't want to be disturbed in any way.
This stops all calls to Speech to Text system, guaranteeing your voice won't
be sent anywhere on an accidental activation.

When sleeping, Mycroft will only listen locally for the phrase "Hey Mycroft,
wake up". Otherwise the system will be totally silent and won't bother you.

On a Mark 1 this also dims the eyes.

## Examples
* "Go to sleep"
* "Nap time"
* "Wake up"

## Credits
Mycroft AI (@MycroftAI)

## Category
**Daily**
Configuration

## Tags
#nap
#naptime
#sleep
#donotdisturb
#do-not-disturb

repository: MycroftAI/skill-naptime

repo_name: MycroftAI/skill-naptime


text:
# **Finding Lane Lines on the Road**

[![Udacity - Self-Driving Car NanoDegree](https://s3.amazonaws.com/udacity-sdc/github/shield-carnd.svg)](http://www.udacity.com/drive)

### Overview

---

When we drive, we use our eyes to decide where to go. The lines on the road that show us where the lanes are act as our constant reference for where to steer the vehicle. Naturally, one of the first things we would like to do in developing a self-driving car is to automatically detect lane lines using an algorithm.

The goals / steps of this project are the following:

- Make a pipeline that finds lane lines on the road
- Reflect on your work in a written report

---

### Reflection

### 1. Pipeline

My pipeline consist of 7 steps.

```
def myPipeline(img):

    # Create a gray copy of an image
    img_copy = np.copy(img)
    gray = grayscale(img_copy)

    # Blur the gray image for noise reduction
    blur_gray = gaussian_blur(gray, 5)

    # Detect edges using Canny function
    edges = canny(blur_gray, 50, 150)

    # Define region of interest
    imshape = img.shape
    vertices = np.array([[(75, imshape[0]), (420, 325), (510, 325),
                      (915, imshape[0])]], dtype=np.int32)
    masked_image = region_of_interest(edges, vertices=vertices)

    # HoughLineP function parameters
    rho = 1  # distance resolution in pixels of the Hough grid
    theta = 1*np.pi/180  # angular resolution in radians of the Hough grid
    threshold = 35     # minimum number of votes (intersections in Hough grid cell)
    min_line_length = 5  # minimum number of pixels making up a line
    max_line_gap = 10    # maximum gap in pixels between connectable line segments

    # Connect detected lines using hough_lines function
    lines = hough_lines(masked_image, rho, theta, threshold, min_line_length, max_line_gap)

    # Create final image using weighted_img() function on img_copy and
    # lines (result of hough_lines function)
    w_img = weighted_img(lines, img_copy)
    plt.imshow(w_img)
    return w_img

```

Grayscale:

Firstly, image is converted to grayscale...

Blurred image:

then using gaussian_blur function for gaussian smoothing, and noise reduction.

Canny:

To edge detection it is used opencv canny function.

Region of Interest:

Returned edges from previous function are fed into region_of_interest function to filter the region of interest - ROI for futher processing.

Hough lines:

To connect lines hough_lines() function is used which uses modified draw_lines() function.
Basically, it is needed to collect slopes and interceptions of each lane line for each frame (if speaking of video), and calculate average of them. To determine which lane line is left or right it is checked if line slope is positive or negative. Using  formula y = mx + b new averaged x-coordinates are found and at the end drawn on starting image

```
def draw_lines(img, lines, color=[255, 0, 0], thickness=2):
    """
    NOTE: this is the function you might want to use as a starting point once you want to
    average/extrapolate the line segments you detect to map out the full
    extent of the lane (going from the result shown in raw-lines-example.mp4
    to that shown in P1_example.mp4).

    Think about things like separating line segments by their
    slope ((y2-y1)/(x2-x1)) to decide which segments are part of the left
    line vs. the right line.  Then, you can average the position of each of
    the lines and extrapolate to the top and bottom of the lane.

    This function draws `lines` with `color` and `thickness`.
    Lines are drawn on the image inplace (mutates the image).
    If you want to make the lines semi-transparent, think about combining
    this function with the weighted_img() function below
    """
    rlm = [] # right line m (slope)
    rlb = [] # right line b (intercept)
    llm = [] # left line m (slope)
    llb = [] # left line m (intercept)
    for line in lines:
        for x1,y1,x2,y2 in line:
            #cv2.line(img, (x1,y1),(x2,y2), color, thickness)
            m = (y2-y1)/(x2-x1)
            b = y1 - m * x1
            # if slope is positive we are considering  right lane line
            if m >= 0.5 and m < 0.8:
                rlm.append(m)
                rlb.append(b)
            # if slope is negative we are considering  left lane line
            elif m<=-0.5 and m > -0.8:
                llm.append(m)
                llb.append(b)

    # Defining fixed y-coordinates
    y_max = img.shape[0]
    y_min = 325

    # if there is slope and intercept, find average
    if rlm  and rlb:
        avg_rlm = float(sum(rlm)/len(rlm))
        avg_rlb = float(sum(rlb)/len(rlb))
        rlx_min = int((y_min-avg_rlb)/(avg_rlm))
        rlx_max = int((y_max-avg_rlb)/(avg_rlm))
        # draw line
        cv2.line(img, (rlx_min,y_min),(rlx_max,y_max), color, thickness=10)

    # if there is slope and intercept, find average
    if llm and llb:
        avg_llm = float(sum(llm)/len(llm))
        avg_llb = float(sum(llb)/len(llb))
        llx_min = int((y_min-avg_llb)/(avg_llm))
        llx_max = int((y_max-avg_llb)/(avg_llm))
        cv2.line(img, (llx_min,y_min),(llx_max,y_max), color, thickness=10)

```

Final - weighted image:

Finally, that region is added on original (copied) image.

<image src="examples\myWimg.png" width="480" alt="final image" />

### 2. Identify potential shortcomings with your current pipeline

1. One potential shortcoming is it only detects the straight lane lines. Challenge task with curved lane lines is not performed well.

2. Potential issue is if vehicle is positioned left or right of the central line. This will probably impact the slope calculation.

### 3. Suggest possible improvements to your pipeline

1. Current algorithm only detects straight lines, so further improvements will be in that direction. Possible solution to that issue, maybe, to segment lines into several parts checking and comparing slopes of previous and next  with the current one.