text:
## Problem
Given a linked list, return the node where the cycle begins. If there is not cycle, return `null`.
Note: Do not modify the linked list.

## Solution
```java
public class Solution {
    public ListNode detectCycle(ListNode head) {
        if (head == null || head.next == null) return null; //Cannot return head cause head.next can be null but head is not null
        ListNode fast = head, slow = head, start = head;
        while (fast.next != null && fast.next.next != null) {
            fast = fast.next.next;
            slow = slow.next;
            if (fast == slow) {
                while (start != slow) {
                    start = start.next;
                    slow = slow.next;
                }
                return start;
            }
        }
        return null;
    }
}
```

## Analysis
The algorithm used in this solution is called **Floyd's Cycle Detection** algorithm
In my original solution, I tried to return as long as `fast == slow`
However, it failed because we cannot guarantee that `fast` and `slow` just meet at the start of cycle
Therefore, we have another variable `start`, which init to `head`
When we detect cycle, we use `start` and `slow` to try to find the beginning of the cycle
Cheers to **Floyd**!

repository: HeyDaniyar/Algorithms

repo_name: HeyDaniyar/Algorithms


text:
# Meraki VPN Client Setup

This short and sweet script will help with setting up the Windows VPN to use with Cisco Meraki firewall/routers. You can either run it raw or it can be included in your automation to deploy workstations at scale.

## Getting Started

You can either download the script or just copy and paste to run it in PowerShell.

### Prerequisites

What things you need to install the software and how to install them

```
You'll need to have a Cisco Meraki up and running that you can VPN into. You'll need access either to the Meraki dashboard or to the VPN server name/IP address and the public shared key.
```

## Built With

* [PowerShell]

## Contributing

Have at it!

## Authors

* **Ben Stitt** - *Initial work* - [GalacticDeep](https://github.com/GalacticDeep)

See also the list of [contributors](https://github.com/GalacticDeep/Meraki-VPN/graphs/contributors) who participated in this project.

## License

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

## Acknowledgments

* Special thanks to Billie Thompson, who has made a great readme.md template [PurpleBooth](https://github.com/PurpleBooth)

license: MIT

repository: kdm-acmisa/Meraki-VPN

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: kdm-acmisa/Meraki-VPN


text:
# Tic Tac Toe Web Service Noughts and Crosses Game II

[<<< DSLabs](https://github.com/FMCalisto/DSLabs)

<img src="assets/2000px-Tic_tac_toe.png" alt="Tic Tac Toe" align="center" width="50%"/>

## Preface

Based on the examples, was built a new Web Service Tic Tac Toe (noughts and crosses).

### Starting

- The starting point was the ```ttt-local```

- The point of arrival is the ```ttt-ws_juddi``` and ```ttt-ws-cli_juddi```, but there are still major changes
already done.

The class ```example.ws.uddi.UDDINaming``` uses the **API JAX-R** to make the interactions with the
**UDDI server**.

To use the **API JAX-R** the ```juddi-client``` *libraries* are required
(to be included in the ```pom.xml``` file)

Review the dependencies in the previous example and add what is missing inside the ```<dependencies>``` tag.

#### On the Server Side (```ttt-ws_juddi```):

- View the ```TTT``` interface and its implementation ```TTTImpl```

- Complete the ```javax.jws.WebService notes```, indicating the implemented interface:

```
ttt.TTT
```

#### On the Client Side (```ttt-ws-cli_juddi```):

Set in the ```pom.xml file``` (beyond (s) dependent (s) unknown):

- The location of the **UDDI** (```uddi.url```)

- The service name to search (```ws.name```)

===================================================

Distributed Systems
-------------------

#### Group 35

Daniel da Costa

69720

<EMAIL_ADDRESS>
-------------------

Filipe Fernandes

73253

<EMAIL_ADDRESS>
-------------------

Francisco Maria Calisto

70916

<EMAIL_ADDRESS>
-------------------

gha_language: HTML

gha_license_id: MIT


text:
# Test Literate Program

We just need a place to do some minor tests.

## Body

The body of the test  [testpro.js](# "save: |jshint")

    te = (function () {
        return  _"f1";
    })();

    three = _"| eval text = 1+1+1";

    function () {
        _"cl"

    }

## f1

A function

    function () {
        great = 3;
        return great;
    }

## cl

    console.log("I was here");

## Now for some bad stuff

What happens if to blocks refer to each other? It does not compile, that's
what. Adding a \ for the underscore to resolve.

    _":alice"

    _":bobby"

    _"what is up:out"

[just-talk](# "save:")

[Alice]()

    Alice needs _":Bob"

[Bob]()

    Bob needs \_":Alice"

## Now for some bad stuff

What happens if to blocks refer to each other?

[Alex]()

    Alex is good.

[Bobby](# ":|log" )

    Bobby needs _":Alex"

## What is up

Can we refer to the second block?

[out](# ":|log")

    George thinks _"Now for some bad stuff:Alex"

repository: quinn/literate-programming

repo_name: quinn/literate-programming


text:
---
title: Mount Various File Systems with Autofs on Mac OS X Mountain Lion
author: Karim Elatov
layout: post
permalink: /2013/07/mount-various-file-system-with-autofs-on-mac-os-x-mountain-lion/
dsq_thread_id:
  -<PHONE_NUMBER>
categories: ['storage', 'os']
tags: ['autofs', 'mac_ports', 'sshfs','mac_os_x']
---

I recently go a new Mac and I wanted to setup **autofs** on it, just like I did on my previous Linux Laptops. I am running Mac OS X Mountain Lion (10.8):

    kelatov@kmac:~$sw_vers
    ProductName:    Mac OS X
    ProductVersion: 10.8.4
    BuildVersion:   12E55

## AutoFS

There are pretty good definitions of AutoFS (and it's components) on Mac OS from the various **man** pages:

> Autofs in Leopard consists of the following programs and daemons.
>
> **autofsd**
>
> autofsd runs **automount**, and then waits for network configuration change events and, when such an event occurs, re-runs automount to update the mounts to reflect the current automounter maps. It can also be signalled by **automount_reread** to run **automount**.
>
> **automountd**
>
> automountd is a daemon that responds to requests from **autofs** to mount and unmount network filesystems, and to supply the contents of directories, based on the contents of automounter maps. The **automountd** is started on demand by **launchd**.
>
> **automount**
>
> automount is the actual mount manager. Manages the mounting and unmounting of remote resources using several map files and configuration files. The configuration files used are **/etc/autofs.conf** and **/etc/auto_master**.
>
> **automount_reread**
>
> The man pages for **autofsd** refer to a command called **automount_reread** that can trigger a network change event for **autofs**. However, there is no additional documentation in Leopard on that command and the command itself does not exist.

We can see that by default only **autofsd** is running:

    kelatov@kmac:~$ps -ef | grep auto | grep -v grep
        0    59     1   0  2:44PM ??         0:00.08 autofsd

We can also check out if the daemons are started via **launchd**:

    kelatov@kmac:~$sudo launchctl list | grep -E 'automo|autof'
    -   0   com.apple.automountd
    59  -   com.apple.autofsd

Lastly we can see what state the daemons are in:

    kelatov@kmac:~$sudo launchctl bslist | grep -E 'automo|autof'
    D  com.apple.automountd

The **D** stands for on-demand.

### Autofs Maps

With Mac OS there are a couple of options for **autofs**. From the Mac OS [man](https://opensource.apple.com/source/autofs/autofs-246.10.1/files/auto_master.5.auto.html) page:

> **Direct Map**
> A direct map associates filesystem locations directly with directories. The entry key is the full path name of a directory. For example:
>
>     /usr/local      eng4:/export/local
>     /src            eng4:/export/src
>
>
> Since the direct map as a whole isn't associated with a single directory, it is specified in the master map with a dummy directory name of **/-**.
>
> **Indirect Map**
> An indirect map is used where a large number of entries are to be associated with a single directory. Each map entry key is the simple name of a directory entry. A good example of this is the auto_home map which determines the entries under the /home directory. For example:
>
>     bill    argon:/export/home/bill
>     brent   depot:/export/home/brent
>     guy     depot:/export/home/guy
>

I prefer to have everything that is managed by **autofs** in one directory, so I will go with the **Indirect Map** approach.

### Creating an Indirect Map for AutoFS

I will use **/amnt** as the mount point which **autofs** will manage. To set this up, edit the **/etc/auto_master** file and add the following to it:

    /amnt           autofs_amnt

The above basically says that anything under the **/amnt** directory will be configured under the **/etc/autofs_amnt** file. Next let's add a **CIFS** share to be automatically mounted **/amnt/smb**.

### Auto Mount SMB with Autofs

Let's create the **/etc/autofs_amnt** file with appropriate permissions:

    kelatov@kmac:~$sudo touch /etc/autofs_amnt
    kelatov@kmac:~$sudo chmod 600 /etc/autofs_amnt

Now let's edit the file and add the following to it:

    smb -fstype=smbfs<EMAIL_ADDRESS>

Now to apply the settings run the following:

    kelatov@kmac:~$sudo automount -vc
    automount: /net updated
    automount: /home updated
    automount: /amnt updated
    automount: no unmounts

notice **/amnt** is now included. If everything worked you can **cd** into the directory and it will automatically mount:

    kelatov@kmac:~$cd /amnt/smb
    kelatov@kmac:/amnt/smb$df -Ph .
    Filesystem                           Size   Used  Avail Capacity  Mounted on
<EMAIL_ADDRESS>    3.0Ti  2.6Ti  341Gi    89%    /amnt/smb

You can use the **mount** command to find out the options of the mount point:

    kelatov@kmac:~$mount | grep elatov
<EMAIL_ADDRESS>on /amnt/smb (smbfs, nodev, nosuid, automounted, nobrowse, mounted by kelatov)

You will also notice **automountd** now running as well:

    kelatov@kmac:/amnt/smb$ps -ef | grep auto | grep -v grep
        0    59     1   0  2:44PM ??         0:00.09 autofsd
        0   930     1   0  2:15PM ??         0:00.01 automountd

If you ever want to manually un-mount the share, run the following:

    kelatov@kmac:~$umount /amnt/smb

### Auto Mount NFS with Autofs

Edit the **/etc/autofs_amnt** file and add the following:

    iso -fstype=nfs,rw,bg,hard,intr,tcp,resvport nfs.server.com:/data/isos

Apply the settings with:

    sudo automount -vc

and check to make sure it is auto mounted:

    kelatov@kmac:~$cd /amnt/iso
    kelatov@kmac:/amnt/iso$df -Ph .
    Filesystem                  Size   Used  Avail Capacity  Mounted on
    nfs.server.com:/data/isos  3.0Ti  2.5Ti  341Gi    89%    /amnt/iso

and of course **mount** can show you the options:

    kelatov@kmac:~$mount | grep iso
    nfs.server.com:/data/iso on /amnt/iso (nfs, nodev, nosuid, automounted, nobrowse)

### Mount SSHFS with Autofs

The first thing that we need to do is install Mac Ports.

#### Install Mac Ports

Go to [Installing MacPorts](http://www.macports.org/install.php) and download the *pkg* installer. Launch installer and you will see the following:

![mac ports install Mount Various File Systems with Autofs on Mac OS X Mountain Lion](https://github.com/elatov/uploads/raw/master/2013/07/mac_ports_install.png)

Follow the on-screen instructions install *Mac Ports*.

#### Install X-Code

*X-Code* is necessary for Mac Ports, so go ahead and install it from [XCode](https://developer.apple.com/xcode/). It will actually start up the *App Store* to do the download. After it's done your *App Store* will look like this:

![xcode install app store Mount Various File Systems with Autofs on Mac OS X Mountain Lion](https://github.com/elatov/uploads/raw/master/2013/07/xcode-install-app-store.png)

#### Install X-Code Command Line tools:

Go to your Applications (Command-Shift-a) and launch X-Code (accept the license agreement). Then go to the preferences:

![xcode preferences Mount Various File Systems with Autofs on Mac OS X Mountain Lion](https://github.com/elatov/uploads/raw/master/2013/07/xcode-preferences.png)

Then go to the "Downloads" tab and install command line tools. After they are installed you will see the following under preferences:

![xcode command line tools Mount Various File Systems with Autofs on Mac OS X Mountain Lion](https://github.com/elatov/uploads/raw/master/2013/07/xcode-command-line-tools.png)

#### Update Ports

Go to your "Utilities" (Command-Shift-u) and launch the terminal. From the terminal run the following:

    kelatov@kmac:~$sudo port -v selfupdate
    Password:
    --->  Updating MacPorts base sources using rsync
    receiving file list ... done

    sent 36 bytes  received 69 bytes  70.00 bytes/sec
    total size is 3594240  speedup is 34230.86
    receiving file list ... done

    sent 36 bytes  received 76 bytes  224.00 bytes/sec
    total size is 512  speedup is 4.57
    MacPorts base version 2.1.3 installed,
    MacPorts base version 2.1.3 downloaded.
    --->  Updating the ports tree
    Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar
    receiving file list ... done

    sent 36 bytes  received 70 bytes  70.67 bytes/sec
    total size is 53278720  speedup is 502629.43
    receiving file list ... done

    sent 36 bytes  received 77 bytes  226.00 bytes/sec
    total size is 512  speedup is 4.53
    receiving file list ... done

    sent 36 bytes  received 70 bytes  212.00 bytes/sec
    total size is 9759879  speedup is 92074.33
    receiving file list ... done

    sent 36 bytes  received 77 bytes  75.33 bytes/sec
    total size is 512  speedup is 4.53
    --->  MacPorts base is already the latest version

    The ports tree has been updated.  You will also notice that that the Mac Ports install added the following into your **.profile** file:

    elatov@kmac:~$cat ~/.profile
    # MacPorts Installer addition on 2013-07-02_at_10:53:46: adding an appropriate PATH variable for use with MacPorts.
    export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    # Finished adapting your PATH environment variable for use with MacPorts.

Since Mac Ports installs everything under **/opt/local** it needs to add **/opt/local/bin/** and **/opt/local/sbin/** to the path.

#### Install SSHFS

Mac Ports are like any package manager, it allows you to search for packages and install them. For example here is what I did to search for *sshfs*:

    kelatov@kmac:~$port search sshfs
    sshfs @2.4 (fuse)
        SSH filesystem for FUSE

    sshfs-gui @1.3 (fuse)
        OS X GUI for sshfs

    Found 2 ports.

I don't care about the GUI version. You can also check if the package has "variants":

    kelatov@kmac:~$port variants sshfs
    sshfs has the variants:
       universal: Build for multiple architectures

There aren't that many options. A good example is something like this:

    kelatov@kmac:~$port variants mysql56
    mysql56 has the variants:
       debug: Enable debug binaries
       openssl: Enable OpenSSL support
       universal: Build for multiple architectures

So if I wanted to enable *debug* binaries for the **mysql56** package I would run the following:

    sudo port install mysql56 +debug

Anyways, to install *sshfs*, run the following:

    sudo port install sshfs

#### Prepare SSHFS for Autofs

First make sure you can mount with the **sshfs** command:

    kelatov@kmac:~$which sshfs
    /opt/local/bin/sshfs
    kelatov@kmac:~$sudo mkdir /mnt/ssh
    kelatov@kmac:~$sudo chown kelatov /mnt/ssh

Now for the actual mount:

    kelatov@kmac:~$sshfs elatov@ssh.server.com:/mnt/data /mnt/ssh
    kelatov@kmac:~$df -Ph -T fuse4x
    Filesystem                        Size   Used  Avail Capacity  Mounted on
    elatov@ssh.server.com:/mnt/data  190Gi   80Gi  101Gi    45%    /mnt/ssh

You can un-mount the *sshfs* mount point like this:

    kelatov@kmac:~$umount /mnt/ssh

The way that *autofs* works is the type of the file system is always prepended with the *mount_* prefix and that is run to actually mount that file system. So if you specify **smbfs**, there must be a **mount_smbfs** command. Here are the available **mount** commands on the system:

    kelatov@kmac:~$compgen -c | grep ^mount
    mount
    mount_acfs
    mount_afp
    mount_cd9660
    mount_cddafs
    mount_devfs
    mount_exfat
    mount_fdesc
    mount_ftp
    mount_hfs
    mount_msdos
    mount_nfs
    mount_ntfs
    mount_smbfs
    mount_udf
    mount_webdav

So we need to create a *mount_sshfs* command. We can just create a *symlink* to the **sshfs** command like so:

    kelatov@kmac:~$sudo ln -s /opt/local/bin/sshfs /sbin/mount_sshfs

Now let's edit the **/etc/autofs_amnt** file and add the following:

    ssh -fstype=sshfs,defer_permissions,allow_other,auto_cache elatov@ssh.server.com:/mnt/data

As always, refresh **automount** by running the following:

    sudo automount -vc

Now check to make sure **autofs** works:

    kelatov@kmac:~$cd /amnt/ssh
    kelatov@kmac:/amnt/ssh$df -Ph .
    Filesystem                     Size   Used  Avail Capacity  Mounted on
    elatov@ssh.server.:/mnt/data  190Gi   80Gi  101Gi    45%    /amnt/ssh

That looks good, you can check the command that was executed by autofs to mount the sshfs mountpoint:

    kelatov@kmac:/amnt/ssh2$ps -ef | grep sshfs | grep -v grep
      502  1536     1   0  3:36PM ??         0:00.00 /sbin/mount_sshfs -o nobrowse -o nosuid,nodev -o defer_permissions,allow_other,auto_cache -o automounted elatov@ssh.server.com:/mnt/data /amnt/ssh

If it fails for some reason, grab that command and try to mount it manually to track down any issues. If you have any mount points that are stuck, try to restart both the **autofsd** and **automountd** daemons:

    kelatov@kmac:~$sudo launchctl stop com.apple.autofsd
    kelatov@kmac:~$sudo launchctl start com.apple.autofsd
    kelatov@kmac:~$sudo launchctl stop com.apple.automountd
    kelatov@kmac:~$sudo launchctl start com.apple.automountd

**autofsd** is automatically restart by **launchd**, so you can just stop it, and it will restart it. **Automountd** is started by **autofsd** so you can just stop that as well, and as soon as you try to auto mount something, it will automatically start up. If you want to get a feeling of all the file systems that are mounted you can run the following:

    kelatov@kmac:~$lsvfs
    Filesystem                        Refs Flags
    -------------------------------- ----- ---------------
    nfs                                  1
    hfs                                  1 local, dovolfs
    devfs                                0
    autofs                               3
    smbfs                                1
    fuse4x                               1

gha_language: CSS


text:
# BKubicki Magento 2 Polish nouns numeral declension adapter

## Overview
Magento 2 adapter for library [bkubicki/magento2-polish-noun-numeral-declination-adapter](https://github.com/bartoszkubicki/polish-noun-numeral-declension)

## Usage
`__p` returns phrase with count argument. If we have all strings in store in english and we translate them onto other languages (as we should),
for words that needs numeral declension, we should provide distinctive strings even in english, so translation will pick
proper declension in polish. For example for word comment:

For en_US.csv:
```
"comment","comment"
"comments","comments"
"comments-g","comments"
```

For pl_PL.csv it should look like:
```
"comment","komentarz"
"comments","komentarzy"
"comments-g","komentarze"
```

and in phtml usage will be like
```
<?= __p($count, 'comment', 'comments', 'comments-g') ?>
```

Drawback of this approach may be necessity of keeping en_US translation, but magento provides it out of the box.
Although, special, numeral noun declension doesn't seem to be common and will be used only from time to time.

## Prerequisites
* Magento 2.2/2.3+
* PHP 7.2/7.3

## Installation ###

To install the extension use the following commands:

```bash
 composer require bkubicki/magento2-polish-noun-numeral-declination-adapter
```

## Tests ##

### Unit ###
1. Run command
```
./vendor/bin/phpunit -c phpunit.xml --testsuite "Unit" --coverage-html coverage/coverage-html --colors=always
```

2. You can also use some alias:
  - `test-unit-coverage` - _`vendor/bin/phpunit -c phpunit.xml --testsuite "Unit" --coverage-html coverage/coverage-html --colors=always`_

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/bartoszkubicki/magento2-polish-noun-numeral-declension-adapter/tags).

## Authors

* [Bartosz Kubicki](https://github.com/bartoszkubicki)

## License

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


text:
# systematize

## Why does this even exist ?

So you can seperate the data and structure migrations in different folders, because you know organization and stuff.

## Installation

If you're using a `Gemfile`, just add it to your project
```gemfile
#Gemfile
gem 'systematize'
```

Or just add it via `bundler`
```gemfile
bundle install 'systematize'
```

## Structure
So as the structural migrations live in the `db/migrate` folder, the data migrations shall live in the `db/data` folder:

```gemfile
- app
  |
  |-db
    |-data
    |-migrate
```

## Usage
After installing you'll see the following tasks pop-up:

```bash
$> bundle exec rake -T
rake systematize:migrate       # Migrate the database
rake systematize:rollback      # Rollback the database (options: STEP=x, VERBOSE=false)
rake systematize:rollback_all  # Rollback all the database
rake systematize:create        # Create the database
rake systematize:drop          # Drop the database
```

Now if you need to migrate the database you just need to run:
```bash
bundle exec rake systematize:migrate
```

Needing to rollback the previous migration? No problem.
```bash
bundle exec rake systematize:rollback
```

Need to rollback 2/3/4 migrations? I got you.
```bash
bundle exec rake systematize:rollback STEP=2
```

Made a mess so big you need to start fresh? Do it. (the migrations need to be reversible 😅)
```bash
bundle exec rake systematize:rollback_all
```

## Why was this frankstein created ? 👹

One of the most important things that a ruby application can have are the migrations, but they can be one of 2 kinds:
- Structural migrations
- Data migrations

If you want to organize said migrations in their purpose you'll probably have a folder for the struture ones and another for the data ones. But with that separation comes a problem, when should you run one type and when to run the other?
Probably the sanner way of doing it is we firstly run the structure migrations and after that we run the data migrations, but with this approach one problem will rise:

What if I have a new field that is initially populated taking into account another field, and after that we can delete that other field?
Imagine the following scenario:
- You have a `Post` model that initially has a boolean field called `:deleted`.
- After some time, and some deleted `Posts`, you need to know when that post has been deleted. So you create a `:deleted_at` field that will contain the time of the deletion.
- You can now delete the old `:deleted` field because it turned obsolete, so you create the migration to do it.

On this scenario we will have 2 structure migrations (create the `:deleted_at` field and removing the `:deleted` field) and a data migration (go through all the Posts and add the time to `:deleted_at` if they are `:deleted`). With previous migration approach, running all the migrations would fail because when the data migration run we wouldn't have the `:deleted` field because it was deleted by the structure migration.

This is when `systematize` comes in for the rescue 🚀

## Caveats
- The migrations need to follow the Rails convention to them `YYYYMMDDHHMMSS_create_products.rb`
- The migrations are wrapped around a `ActiveRecord::Base.transaction`, so if any of the migration fails the batch of migrations will rollback, until the previous successful batch.

## TODO
- [ ] Customizable folder configuration
- [ ] Customizable transaction type configuration

## Contributing
I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:
  1. If its a feature, bugfix, or anything please only change code to what you specify.
  2. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
  3. Pull requests _must_ be made against `develop` branch. Any other branch (unless specified by the maintainers) will get rejected.
  4. Check for existing [issues](https://github.com/RicardoBrazao/systematize/issues) first, before filing an issue.
  5. Have fun!

### Created & Maintained By
[Ricardo Brazão](https://github.com/RicardoBrazao) ([@RicBrazao](https://www.twitter.com/RicBrazao))

repository: RicardoBrazao/systematize

gha_language: Ruby

repo_name: RicardoBrazao/systematize


text:
In the game of go (also known as baduk, igo, cờ vây and wéiqí) points
are gained by completely encircling empty intersections with your
stones. The encircled intersections of a player are known as its
territory.

Write a function that determines the territory of each player. You may
assume that any stones that have been stranded in enemy territory have
already been taken off the board.

Write a function that determines the territory which includes a specified coordinate.

Multiple empty intersections may be encircled at once and for encircling
only horizontal and vertical neighbours count. In the following diagram
the stones which matter are marked "O" and the stones that don't are
marked "I" (ignored).  Empty spaces represent empty intersections.

```text
+----+
|IOOI|
|O  O|
|O OI|
|IOI |
+----+
```

To be more precise an empty intersection is part of a player's territory
if all of its neighbours are either stones of that player or empty
intersections that are part of that player's territory.

For more information see
[wikipedia](https://en.wikipedia.org/wiki/Go_%28game%29) or [Sensei's
Library](http://senseis.xmp.net/).

## Hints

To complete this exercise, you need to implement the following functions:

- `territories` returns the coordinates (1 based, top left is (1,1))
of the points in each territory along with who "owns" the territory.

- `territoriesFor` returns the territory that contains the coordinate
along with the owner of the territory. If the coordinate does not point
to an empty location, returns *Nothing*.

A territory is owned by one of the players if that player's stones
are the only stones adjacent to the territory.

You will find the type signatures already in place, but it is up to you
to define the functions.

## Getting Started

Please refer to the [installation](https://exercism.io/tracks/haskell/installation)
and [learning](https://exercism.io/tracks/haskell/learning) help pages.

## Running the tests

To run the test suite, execute the following command:

```bash
stack test
```

#### If you get an error message like this...

```
No .cabal file found in directory
```

You are probably running an old stack version and need
to upgrade it.

#### Otherwise, if you get an error message like this...

```
No compiler found, expected minor version match with...
Try running "stack setup" to install the correct GHC...
```

Just do as it says and it will download and install
the correct compiler version:

```bash
stack setup
```

## Running *GHCi*

If you want to play with your solution in GHCi, just run the command:

```bash
stack ghci
```

## Feedback, Issues, Pull Requests

The [exercism/haskell](https://github.com/exercism/haskell) repository on
GitHub is the home for all of the Haskell exercises.

If you have feedback about an exercise, or want to help implementing a new
one, head over there and create an issue.  We'll do our best to help you!

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

repository: Leetlol/haskell

repo_name: Leetlol/haskell


text:
# Dogma REST Client

> A RESTful HTTP client for Dart

[![Join the chat at https://gitter.im/dogma-dart/dogma-dart.github.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dogma-dart/dogma-dart.github.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Usage

A simple usage example:

## Features and bugs

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]: https://github.com/dogma-dart/dogma-rest-client/issues

license: Zlib

repository: dogma-dart/dogma-rest-client

repo_name: dogma-dart/dogma-rest-client


text:
Simpalt
=====================

A ZSH theme based on [agnoster](https://github.com/agnoster/agnoster-zsh-theme) with focus on screen real estate.

###### Demo
[![Demo](img/simple.png)](https://asciinema.org/a/gYRKD3Hdv9dvcZ6JiCyWlvhkM)

How to use it
---------------------

### Software Requirement
* [ZSH](https://www.zsh.org/)

### Supported frameworks
* [Vanilla ZSH](https://www.zsh.org/)
* [Oh My ZSH](https://github.com/robbyrussell/oh-my-zsh)
* [Prezto](https://github.com/sorin-ionescu/prezto)
* [ZGen](https://github.com/sorin-ionescu/prezto)
* [ZPlug](https://github.com/sorin-ionescu/prezto)

### Initial setup
```bash
$ brew install zsh
$ chsh -s $(which zsh)
```

Installing the theme
---------------------

#### Using ZGen
Add the following to your `.zshrc`
```bash
if ! zgen saved; then
  ...
  zgen load m-lima/simpalt simpalt.zsh-theme
  ...
  zgen save
fi
```

#### Using ZGen with Prezto
Add the following to your `.zshrc`
```bash
if ! zgen saved; then
  zgen prezto
  zgen prezto prompt theme 'simpalt'
  ...
  zgen load m-lima/simpalt
  ...
  zgen save
fi
```

#### Using ZPlug
Add the following to your `.zshrc`
```bash
zplug "m-lima/simpalt", as:theme
```

#### Using Oh My ZSH
Download the theme
```bash
$ cd ~/.oh-my-zsh/custom
$ git clone https://github.com/m-lima/simpalt
```
Add the following to your `.zshrc`
```bash
ZSH_THEME="simpalt"
```

#### Using vanilla ZSH
Download the theme
```bash
$ cd <whereever_you want_to_install>
$ git clone https://github.com/m-lima/simpalt
```
Add the following to your `.zshrc`
```bash
source <whereever_you want_to_install>/simpalt.zsh-theme
```

Options
---------------------

##### SIMPALT_SMALL
###### Controls the presentation of the prompt
If set to anything, the prompt will be presented in compact mode; otherwise, the full prompt will be presented.

##### SIMPALT_PROMPT_SEGMENTS
###### Set the prompt segments to be presented
This array will set all segments that compose the prompt.

##### SIMPALT_MAIN_BRANCHES
###### Set the branches that do not require full name
When in a git repository, if the current branch is present in this list, it's name will be omitted.

Available segments:
* prompt_aws
* prompt_status
* prompt_context
* prompt_virtualenv
* prompt_dir prompt_git

### Suggested setup
You can enable quick switch between compact and full mode by registering something similar to the following in your `.zshrc`:
```bash
ts() { [ $SIMPALT_SMALL ] && unset SIMPALT_SMALL || SIMPALT_SMALL=1 }
```
Then, just use the `ts` command to swtich between prompt styles

repository: m-lima/simpalt

repo_name: m-lima/simpalt


text:
# Scrabble Scorer

### Created by Sarah Gilbert & Constantine Yakubovski

## Description

##### This is a console application that takes a word and returns the Scrabble score for that word. It was created to help us practice using C# and C# TDD.

## Specifications

| Test | Input | Output |

| :-------------------- | :------------------------------------- | :-------------------------- |

| ScoreCounterConstructor |||

|Should correctly create an instance of ScoreCounter | ("A") | A |

|Should correctly return value of a letter or letters and add them up to a final score | ("cat") | 6 |

## Setup Instruction

#### View Online

* Follow this link https://sarahgilbert064.github.io/Scrabble-Scorer.Solution/

#### Open Locally

1. Navigate to https://github.com/SarahGilbert064/Scrabble-Scorer.Solution

2. Click on the green "Code" button and copy the repository HTTPS URL

3. Open your machine terminal and use the command 'git clone https://github.com/SarahGilbert064/Scrabble-Scorer.Solution in the directory you would like to clone the repository

4. Another option is to click "Download Zip" and open the file on your machine.

5. Once opened in VS Code, go to your terminal and run 'npm install'.

6. Once the required webpack has been installed, run 'npm run build' to bundle all files.

## Known Bugs

#### No known bugs

## Support and Contact Details

* Contact me at<EMAIL_ADDRESS>

## Technologies Used

* HTML

* CSS

* JavaScript

* JQuery

* Visual Studio Code

* Jest

* esLint

* Babel

## Legal

#### Copyright (c) 2020 Sarah Gilbert & Constantine Yakubovski

#### This software is licensed under the MIT license


text:
---
title: Using External Service as Ingress Backend | Kubernetes Ingress
menu:
  docs_{{ .version }}:
    identifier: external-svc-backend-http
    name: External SVC
    parent: http-ingress
    weight: 40
product_name: voyager
menu_name: docs_{{ .version }}
section_menu_id: guides
---
> New to Voyager? Please start [here](/docs/concepts/overview.md).

# Using External Service as Ingress Backend

You can use an external service as a Backend for Kubernetes Ingress. There are 2 options depending on whether the external service has an external IP or DNS record.

## Using External IP

You can introduce any [external IP address as a Kubernetes service](https://github.com/kubernetes/kubernetes/issues/8631#issuecomment-104404768) by creating a matching Service and Endpoint object. Then you can use this service as a backend for your Ingress rules.

```yaml
apiVersion: v1
kind: Service
metadata:
  name: external-ip
  namespace: default
spec:
  ports:
  - name: app
    port: 80
    protocol: TCP
    targetPort: 9855
  clusterIP: None
  type: ClusterIP
---
apiVersion: v1
kind: Endpoints
metadata:
  name: external-ip
  namespace: default
subsets:
- addresses:
  # list all external ips for this service
  - ip: <IP_ADDRESS>
  ports:
  - name: app
    port: 9855
    protocol: TCP
```

Now, you can use this `external-ip` Service as a backend in your Ingress definition. For example:

```yaml
apiVersion: voyager.appscode.com/v1
kind: Ingress
metadata:
  name: test-ings-rhvulnlb
  namespace: default
spec:
  defaultBackend:
    service:
      name: external-ip
      port:
        number: 80
```

## Using External Domain

You can introduce an external service into a Kubernetes cluster by creating a [`ExternalName`](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types) type service. Voyager can forward traffic in both HTTP and TCP mode to the named domain in the `ExternalName` service by resolving dns. For static resolution of DNS record when HAProxy config is parsed, only use the `ingress.appscode.com/use-dns-resolver: "true"` annotation on the respective service. To periodically resolve dns, [DNS resolvers](https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#5.3) must be configured using annotations on the service name.

|  Keys  |   Value  |  Default |  Description |
|--------|-----------|----------|-------------|
| ingress.appscode.com/use-dns-resolver | bool | false for L7, always true for L4 | If set, DNS resolution will be used |
| ingress.appscode.com/dns-resolver-nameservers | array | | `Optional`. If set to an array of DNS nameservers, these will be used HAProxy to periodically resolve DNS. If not set, HAProxy parses the server line definition and matches a host name at start up. |
| ingress.appscode.com/dns-resolver-check-health | bool | | `Optional`. If nameservers are set, this defaults to `true`. Set to `false`, to disable periodic dns resolution. |
| ingress.appscode.com/dns-resolver-retries | integer | | `Optional`. If set, this defines the number of queries to send to resolve a server name before giving up. If not set, default value pre-configured by HAProxy is used. |
| ingress.appscode.com/dns-resolver-timeout | map | | `Optional`. If set, defines timeouts related to name resolution. Define value as '{ "event": "time" }'. For a list of valid events, please consult [HAProxy documentation](https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#5.3.2-timeout). |
| ingress.appscode.com/dns-resolver-hold | map | | `Optional`. If set, Defines period during which the last name resolution should be kept based on last resolution status. Define value as '{ "status": "period" }'. For a list of valid status, please consult [HAProxy documentation](https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#5.3.2-hold). |

Following example illustrates the scenario.

```
apiVersion: v1
kind: Service
metadata:
  name: external-ns
  namespace: default
  annotations:
    ingress.appscode.com/use-dns-resolver: "true"
    ingress.appscode.com/dns-resolver-nameservers: '["<IP_ADDRESS>:53", "<IP_ADDRESS>:53"]'
spec:
  externalName: google.com
  type: ExternalName
```

If this service is used in ingress, the traffic will forward to google.com's address.

```yaml
apiVersion: voyager.appscode.com/v1
kind: Ingress
metadata:
  name: test-ings-rhvulnlb
  namespace: default
spec:
  defaultBackend:
    service:
      name: external-ns
      port:
        number: 80
```

### HTTP Redirect
If `ingress.appscode.com/use-dns-resolver` annotation is set to false or missing on a `ExternalName` type service,
Voyager resolves L7 ingress in the following ways.

```
apiVersion: v1
kind: Service
metadata:
  name: external-ns
  namespace: default
spec:
  externalName: google.com
  type: ExternalName
```

#### Default redirect
If No BackendRules are configured for the endpoint, Voyager will configure HAProxy to redirect traffic to provided domain and port.
The redirect code will be 301 (permanent redirect). Scheme (http or https) used by endpoint is preserved on redirect.

```
backend:
  service:
    name: external-svc-non-dns
    port:
      number: 80
```

The generated redirect line in HAProxy config:

```
http-request redirect location http[s]://{{e.ExternalName}}:{{ e.Port }} code 301
```

#### Backend Rule

If Backendrules are configured, Voyager will not auto generate any redirect rule. This allows users to use full spectrum of HTTP redirection options available in HAProxy. To learn about these option, consult [HAProxy documentation](https://www.haproxy.com/doc/aloha/7.0/haproxy/http_redirection.html#redirection-examples).

```
backend:
  backendRules:
  - http-request redirect location https://google.com code 302
  service:
    name: external-svc-non-dns
    port:
      number: 80
```

repository: voyagermesh/voyager

gha_language: Shell

repo_name: voyagermesh/voyager


text:
# karma-nightmare-angular-demo
A working demonstration for visual regression testing of Angular application.

This demo uses the following:

* [angular-cli](https://github.com/angular/angular-cli)
* [angular/material2](https://github.com/angular/material2)
* [karma-nightmare](https://github.com/bokuweb/karma-nightmare): Nightmare launcher, which allows to capture Karma's state to .png file in my test code.
* [reg-cli](https://github.com/bokuweb/reg-cli): A simple images comparison tool.

## Install and run

This project was generated by [angular-cli](https://github.com/angular/angular-cli), so you can use the `ng` commanad.

```sh
npm install -g angular-cli
npm install
ng test
```

So .png files are generated into the `snapshot` directory. For example *snapshot/PictureCardComponent.png* :
![expected](expected/PictureCardComponent.png)

And execute the following, reg-cli compares between the `snapshot` dir and the `expected` dir. It outputs a HTML report to `dist/reg_report.html`.

```sh
npm run reg
```

## License
MIT License

Copyright (c) 2016 Quramy

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

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

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

repository: Quramy/karma-nightmare-angular-demo

repo_name: Quramy/karma-nightmare-angular-demo


text:
---
layout: post
title:  "The case of the infinite poop emoji crawler trap"
date:   2019-01-07 22:00:00 -0500
categories: mcc-workflow
tags: [ruby,http]
---

I noticed that my crawler was getting stuck in a site even though I set a timeout to `get`. Little did I know that the site was full of poop.

<!--more-->

## What happened
My worker on Heroku was getting stuck trying to get a response from a URL. Turns out the website was a trap and would infinitely print out poop emojis. Touche [RobePike](http://robpike.io), touche.

## How I fixed it
Using the built-in timeout argument in `Net::HTTP.read_timeout` wasn't doing the trick because the website *request* wasn't actually timing out. The page would simply take forever.

I ended up simply wrapping my `get_response` method in a Ruby `Timeout` block.

## How I found the solution

Was having trouble with getting the final redirect of a URL
- Found out that the `get_response` part never ended or timed out
  - Opened the URL in the browser to see what was happening. Turns out, the page constantly prints the poop emoji causing the crawler to never complete. Genius.
    - Found [this blog post](https://opensourceconnections.com/blog/2008/04/24/adding-timeout-to-nethttp-get_response/) showing how to set a get timeout
      - Only problem is, it doesn't actually time out. The page just deliberately renders indefinitely.
        - Used Timeout::(5) instead but it immediately throws an exception of "end of file reached"
          - Looks like redirects to HTTPS need to have `http.use_ssl = (uri.scheme == "https")` [Source](https://stackoverflow.com/questions/5244887/eoferror-end-of-file-reached-issue-with-nethttp)
            - Timeout worked!

extension: markdown


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

---

[//]: # (Image References)

[lane_detection]: ./gifs/lane_detection.gif
[broken_lanes]:  ./test_images_output/solidYellowCurve.jpg
[averaged_lanes]: ./test_images_output/solidYellowLeft_new.jpg
[shortcoming]: ./gifs/challenge.gif

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.

In this project we will detect lane lines in images using Python and OpenCV.  OpenCV means "Open-Source Computer Vision", which is a package that has many useful tools for analyzing images.

![Lane Detection][lane_detection]

Reflection
---

Pipeline consisted of **_7_** following steps:

1) Convert image to gray-scale
2) Apply Gaussian Blur to smoothen edges
3) Apply canny to obtain edges on smoothed gray image with the chosen high and low thresholds
4) Set vertices of the region of interest
5) Apply an image mask according to chosen set of region of interest coordinates
6) Obtain a list of hough lines within a region of interest according to given set of hyperparameters and plot them into a blank image (all black)
7) Superimpose the lanes found on to the original image

![alt text][broken_lanes]

There are multiple lines detected for a lane line. We should come up with an averaged line for that. In order to draw a single line on the left and right lanes, I created the draw_lane_lines() function the following way:

* All obtained hough lines being separated into two heaps denoting left and right lanes according to their slope ('m' in y = mx + b equation). The left lane should have a positive slope, and the right lane should have a negative slope. Therefore, we'll collect positive slope lines and negative slope lines separately.
* Average slopes and intercepts (m's and b's in y=mx+b) within each heap. It yields data for 2 linear functions at maximum (one for left and one right lane)
* Draw those averaged lines across the full extent of the region of interest

**_Note_**: In the image, y coordinate is reversed. The higher y value is actually lower in the image. Therefore, the slope is negative for the left lane, and the slope is positive for the right lane.

![alt text][averaged_lanes]

Potential shortcomings
---

Potential shortcomings are mostly related to detection of false positives and possible lack of true positives.

![alt text][shortcoming]

* Here we can see that canny function fails to detect the left lane while it is definitely present within the original image.

* Another possible shortcoming is that averaged slopes and intercepts implicitly contain values of all lines participating in averaging and it can possibly lead to not exactly following the lanes markings.

Possible improvements
---

An improvement for better performance with false positives / true positives would probably be to better tune the hyperparameters: kernel, thresholds, minimum line length, maximum line gap etc. But there is a danger to 'overfit' for some particular image class which would ultimately affect the overall performance.
In my opinion, there is always a tradeoff, and, after all, it is probably better not to detect the existing lane line at all rather then falsely detect the non-existing one.

To address the average lines not exactly following the actual lanes probably requires some more sophisticated averaging techniques, maybe involving operations across the neighbouring frames.

Optional Challenge
---

To improve detection I've implemented two techniques:

* filtering out of lines with too steep and too gradual slopes
* removing mostly vertical and horizontal lines, which are of no interest for the task

The repository contains the resulting video of an optional challenge as 'challenge.mp4'


text:
# Configuration

> The configuration is kept in the file `config.hjson` inside the configuration folder. You can specify your own folder using `--config /my/config/dir` otherwise default configuration folder is `~/.gphotos-uploader-cli`.

Example configuration file:

```hjson
{
  SecretsBackendType: auto,
  APIAppCredentials: {
    ClientID:     "20637643488-1hvg8ev08r4tc16ca7j9oj3686lcf0el.apps.googleusercontent.com",
    ClientSecret: "0JyfLYw0kyDcJO-pGg5-rW_P",
  }
  jobs: [
    {
      account<EMAIL_ADDRESS>      sourceFolder: ~/folder/to/upload
      makeAlbums: {
        enabled: true
        use: folderName
      }
      deleteAfterUpload: false
      includePatterns: [ "*.jpg", "*.png" ]
      excludePatterns: [ "*ScreenShot*" ]
    }
  ]
}
```
### SecretsBackendType
This option allows you to choose which backend will be used for secrets storage. You set `auto` to allow the application decide which one will be used given your environment.

Available options for secrets backend are:

```
"auto"              For auto backend selection
"secret-service"    For gnome-keyring support
"keychain"          For OS X keychain support
"kwallet"           For KDE Secrets Manager support
"wincred"           For Windows credentials support
"file"              For encrypted file support - needs interation to supply a symetric encryption key
"pass"              For Password Store support - needs user interation to supply a GPG pass key
```

Most of the times `auto` is the proper one. The application will try to use the existing backends in the order [defined by the library](https://github.com/99designs/keyring/blob/2c916c935b9f0286ed72c22a3ccddb491c01c620/keyring.go#L28):

```
// This order makes sure the OS-specific backends
// are picked over the more generic backends.
var backendOrder = []BackendType{
	// Windows
	WinCredBackend,
	// MacOS
	KeychainBackend,
	// Linux
	SecretServiceBackend,
	KWalletBackend,
	// General
	PassBackend,
	FileBackend,
}
```

## APIAppCredentials

Given that `gphotos-uploader-cli` uses OAuth 2 to access Google APIs, authentication is a bit tricky and involves a few manual steps. Please follow the guide below carefully, to give `gphotos-uploader-cli` the required access to your Google Photos account.

Before you can use `gphotos-uploader-cli`, you must enable the Photos Library API and request an OAuth 2.0 Client ID.

1. Make sure you're logged in into the Google Account where your photos should be uploaded to.
1. Start by [creating a new project](https://console.cloud.google.com/projectcreate) in Google Cloud Platform and give it a name (example: _Google Photos Uploader_).
1. Enable the [Google Photos Library API](https://console.cloud.google.com/apis/library/photoslibrary.googleapis.com) by clicking the ENABLE button.
1. Configure the [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent) by setting the application name (example: _gphotos-uploader-cli_) and then click the Save button on the bottom.
1. Create [credentials](https://console.cloud.google.com/apis/credentials) by clicking the **Create credentials → OAuth client ID** option, then pick **Other** as the application type and give it a name (example: _gphotos-uploader-cli_).
1. Copy the **Client ID** and the **Client Secret** and keep them ready to use in the next step.
1. Open the *config file* and set both the `ClientID` and `ClientSecret` options to the ones generated on the previous step.

## jobs
List of folders to upload and upload options for each folder.

### `account`
Needs to be unique. It's the Google Account identity (e-mail address) where the files of this job are going to be uploaded.

### `sourceFolder`
The folder to upload from.
 Can expand the home folder tilde shorthand.

### `makeAlbums`
If `makeAlbums.enabled` set to true, use the last folder path component as album name. You can customize the name of the created albums with `makeAlbums.use`.

Available options are:

* `folderName`: It will use the name of the item's containing folder as Album name.
* `folderPath`: It will use the full path of the  item's containing folder as Album name.

```
# for file: /foo/bar/xyz/file.jpg

use: folderName
# album name: xyz

use: folderPath
# album name: foo_bar_xyz
```

### `deleteAfterUpload`
(Only for versions >= v0.6.0)

If set to true, media will be deleted from local disk after upload.

### `uploadVideos`
(Only for versions < v1.0.0)
> **DEPRECATION NOTICE:** This option has been deprecated in v1.0.0 in favor of `_ALL_VIDEO_FILES_` tagged pattern used in `includePatterns` or `excludePatterns`.

If set to `true`, video media items will be included (uploaded). If `false`, video files will be excluded.

If you want to upload video files (`uploadVideos: true`), you can use:
```
includePatterns: [ "_ALL_VIDEO_FILES_" ]
excludePatterns: []
```

If you don't want to upload video files (`uploadVideos: false`), you can use:
```
includePatterns: [ "_ALL_FILES_" ]
excludePatterns: [ "_ALL_VIDEO_FILES_" ]
```

**NOTE:** It means that as far as `uploadVideos` options is present, video files are always included or excluded,

## Including and Excluding files
You can include and exclude files by specifying the `includePatterns` and `excludePatterns` options. You can add one or more patterns separated by commas `,`. These patterns are always applied to `sourceFolder`.

For example, to upload all _JPG and PNG files_ that are not named _*ScreenShots*_ you can configure it like this:
```
includePatterns: [ "*.jpg", "*.png" ]
excludePatterns: [ "*ScreenShot*" ]
```

### Patterns
Patterns use [filepath.Glob](https://golang.org/pkg/path/filepath/#Glob) internally, see [filepath.Match](https://golang.org/pkg/path/filepath/#Match) for syntax.

Regular wildcards cannot be used to match over the directory separator `/`. For example: `b*ash` matches `/dir/bash` but does not match `/dirb/ash`.

For this, the special wildcard `**` can be used to match arbitrary sub-directories: The pattern `foo/**/bar` matches:

* `/dir1/foo/dir2/bar/file`
* `/foo/bar/file`
* `/tmp/foo/bar`

#### Tagged patterns
There are some common patterns that has been tagged, you can use them to simplify your configuration.

* `_ALL_FILES_`: Matches all files, is the same as using `*`.
* `_ALL_VIDEO_FILES_`: Matches all video file extensions supported by Google Photos.
> Supported video extensions are sourced by [Google Photos support](https://support.google.com/googleone/answer/6193313) and it includes:
> .mpg, .mod, .mmv, .tod, .wmv, .asf, .avi, .divx, .mov, .m4v, .3gp, .3g2, .mp4, .m2t, .m2ts, .mts, and .mkv files.

repository: iamacarpet/gphotos-uploader-cli

repo_name: iamacarpet/gphotos-uploader-cli


text:
# FormAttribute

![Ruby](https://github.com/hex-event-solutions/form-attribute/workflows/Ruby/badge.svg)

A lightweight gem for adding typed attributes to plain objects

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'form_attribute'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install form_attribute

## Usage

Add the line `extend FormAttribute` to your class, then start defining
attributes as in the example below:

```ruby
class Person
  extend FormAttribute

  attribute :name, String
  attribute :role, String, default: 'user'
  attribute :employee, Boolean, default: true
  attribute :contact, [String, Integer]
  attribute :date_of_birth, Time
end
```

Attribute definitions follow the pattern `attribute <name>, <types>, <options>`.
`<types>` can be an array of allowed types or a single allowed type. When
setting the value, it will be validated against this list of types and will
raise a `TypeError` if the value being set is not one of these types.

Attributes on an object can be read with `Class.attributes`

```ruby
Person.attributes
=> [:name, :role, :employee, :contact, :date_of_birth]
```

The type of an attribute can be read with `Class.type_of(<attribute>)`

```ruby
Person.type_of :name
=> [String]

Person.type_of :contact
=> [String, Integer]
```

The default value of an attribute can be read with
`Class.default_for(<attribute>)`

```ruby
Person.default_for :role
=> "user"
```

Each attribute is available as a method on the object created.

```ruby
person = Person.new
=> #<Person name: nil, role: "user", employee: true, contact: nil, date_of_birth: nil>

person.name
=> nil

person.role
=> "user"
```

Setting attributes is also available as a method

```ruby
person.name = 'John Smith'
=> "John Smith"

person.name
=> "John Smith"
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run
`rake spec` to run the tests. You can also run `bin/console` for an interactive
prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To
release a new version, update the version number in `version.rb`, and then run
`bundle exec rake release`, which will create a git tag for the version, push
git commits and tags, and push the `.gem` file to
[rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at
https://github.com/hex-event-solutions/form_attribute. This project is intended
to be a safe, welcoming space for collaboration, and contributors are expected
to adhere to the
[code of conduct](https://github.com/hex-event-solutions/form_attribute/blob/master/CODE_OF_CONDUCT.md).

## License

The gem is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the FormAttribute project's codebases, issue trackers,
chat rooms and mailing lists is expected to follow the
[code of conduct](https://github.com/hex-event-solutions/form_attribute/blob/master/CODE_OF_CONDUCT.md).

```

```

repository: hex-event-solutions/form-attribute

branch_name: refs/heads/main

repo_name: hex-event-solutions/form-attribute


text:
---
hrs_structure:
  division: '1'
  volume: '6'
  title: '19'
  chapter: 339D
  section: 339D-1
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0339D-0001
    parent: HRS0339D
    name: 339D-1 Definitions
weight: 65005
title: Definitions
full_title: 339D-1 Definitions
---
**PART I. DEFINITIONS**

Note

Section 339D-1 designated as part I by L 2009, c 183, §3.

**§339D-1 Definitions.** As used in this chapter:

"Brand" means a symbol, word, or mark that identifies a covered electronic device or a covered television, rather than any of its components.

"Covered electronic device" _[See note below.]_:

(1) Means a computer, computer printer, computer monitor, or portable computer with a screen size greater than four inches measured diagonally; and

(2) Shall not include:

(A) A covered electronic device that is a part of a motor vehicle or any component part of a motor vehicle assembled by or for a motor vehicle manufacturer or franchised dealer, including replacement parts for use in a motor vehicle;

(B) A covered electronic device that is functionally or physically required as a part of a larger piece of equipment designed and intended for use in an industrial, commercial, or medical setting, including diagnostic, monitoring, or control equipment;

(C) A covered electronic device that is contained within a clothes washer, clothes dryer, refrigerator, refrigerator and freezer, microwave oven, conventional oven or range, dishwasher, room air conditioner, dehumidifier, or air purifier; or

(D) A telephone of any type.

"Covered entity" means any household, government entity, business, or nonprofit organization exempt from taxation under section 501(c)(3) of the United States Internal Revenue Code, regardless of size or place of operation within the State.

"Covered television":

(1) Means any device that is capable of receiving broadcast, cable, or satellite signals and displaying television or video programming, including without limitation any direct view or projection television with a viewable screen of nine inches or larger with display technology based on cathode ray tube, plasma, liquid crystal, digital light processing, liquid crystal on silicon, silicon crystal reflective display, light emitting diode, or similar technology marketed and intended for use by a household;

(2) Shall not include:

(A) A computer, computer printer, computer monitor, or portable computer;

(B) A television that is a part of a motor vehicle or any component part of a motor vehicle assembled by or for a vehicle manufacturer or franchised dealer, including replacement parts for use in a motor vehicle;

(C) A television that is functionally or physically required as a part of a larger piece of equipment designed and intended for use in an industrial, commercial, or medical setting, including diagnostic, monitoring, or control equipment;

(D) A telephone of any type, including a mobile telephone; or

(E) A global positioning system.

"Department" means the department of health.

"Electronic device manufacturer":

(1) Means any existing person:

(A) Who manufactures or manufactured covered electronic devices under a brand that it owns or owned or is or was licensed to use, other than a license to manufacture covered electronic devices for delivery exclusively to or at the order of the licensor;

(B) Who sells or sold covered electronic devices manufactured by others under a brand that the seller owns or owned or is or was licensed to use, other than a license to manufacture covered electronic devices for delivery exclusively to or at the order of the licensor;

(C) Who manufactures or manufactured covered electronic devices without affixing a brand;

(D) Who manufactures or manufactured covered electronic devices to which it affixes or affixed a brand that it neither owns or owned nor is or was licensed to use; or

(E) For whose account covered electronic devices manufactured outside the United States are or were imported into the United States; provided that if at the time those covered electronic devices are or were imported into the United States and another person has registered as the manufacturer of the brand of the covered electronic devices, this paragraph shall not apply;

(2) Shall not include persons who manufacture no more than one hundred computers per year.

"Household" means any occupant of a single detached dwelling unit or of a single unit of a multiple dwelling unit who has used a covered electronic device or covered television at a dwelling unit primarily for personal or home business use.

"Market share":

(1) Means the calculation of a television manufacturer's prior year's sales of televisions divided by all manufacturers' prior year's sales for all televisions, as determined by the department;

(2) May be expressed as a percentage, a fraction, or a decimal fraction.

"New covered electronic device" means a covered electronic device that is manufactured after the effective date of this chapter.

"Person" means any individual, business, partnership, limited liability company, corporation, not-for-profit organization, association, government entity, public benefit corporation, or public authority.

"Program year" means a full calendar year beginning on or after January 1, 2010, and each calendar year thereafter beginning on January 1.

"Recover" means to reuse or recycle.

"Recycling" means processing (including disassembling, dismantling, or shredding) covered electronic devices or covered televisions or their components to recover a useable product; provided that "recycling" does not include any process defined as incineration under applicable laws and rules.

"Retailer" means any person who offers covered electronic devices or covered televisions for sale, other than for resale by the purchaser, through any means, including sales outlets, catalogs, or the Internet.

"Sell" or "sale" means any transfer for consideration of title, including transactions conducted through sales outlets, catalogs, or the Internet, but excluding leases.

"Television manufacturer" means a person who:

(1) Manufactures for sale in the State a covered television under a brand that it licenses or owns;

(2) Manufactures for sale in the State covered televisions without affixing a brand;

(3) Resells into the State a covered television manufactured by others under a brand that the seller owns or is licensed to use;

(4) Imports into the United States or exports from the United States a covered television for sale in the State;

(5) Sells at retail a covered television acquired from an importer described in paragraph (4), and elects to register as the manufacturer for those products;

(6) Manufactures covered televisions and supplies them to any person or persons within a distribution network that includes wholesalers or retailers in this State; or

(7) Assumes the responsibilities and obligations of a television manufacturer under this chapter.

In the event the television manufacturer is one who manufactures, sells, or resells covered televisions under a brand for which it has obtained the license, then the licensor or brand owner of the brand shall not be included in the definition of television manufacturer under paragraph (1) or (3). [L Sp 2008, c 13, pt of §2; am L 2009, c 183, §8]

Note

The source note to this section is supplemented by "L Sp 2008, c 13, §3(e); am L 2009, c 183, §16".

Electric device recycling task force; report to 2013 legislature; dissolved June 30, 2013\. L 2012, c 78.

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# Installation by Debian packages

For a simple installation we provide `.deb` packages. They should work on all
recent Debian based distributions and are mostly tested with ubuntu 12.04 and
debian weezy. The debian packages can be found on the official
[releases page](https://github.com/osiam/osiam/releases). Install with:

    sudo dpkg -i osiam-*.deb
    sudo apt-get install -f

## Database configuration

While installation you can choose to get the database setup managed by the installation. In this case you just have to provide a database password. The installation then creates a postgresql database called `osiam`, on the same machine and imports the basic database schema.
If you prefer to do the database configuration by hand, simply choose this option and edit the `/etc/*.properties` files after installation.

## Import basic data

When starting the applications there is already [basic data](detailed-reference-installation.md#default-setup)
imported by Flyway.

## Basic Installation Architecture

### Packages

We have divided OSIAM in the following packages:

* **osiam-common:** OSIAM common package. This package contains the tomcat instance configuring for all osiam services.
* **osiam-auth-server:** OSIAM authorisation server. The server component for login  and ticket granting.
* **osiam-resource-server:** OSIAM resource server. The server component for management of the identity data over a SCIM2 API.
* **osiam-addon-self-administration:** OSIAM self administration web frontends. The OSIAM frontends for registration and password self service.
* **osiam:** Metapackage depending on all OSIAM sub-packages. Does nothing except installing all other osiam packages.

### Distribution over different machines

You can choose to install all package on the same machine, or distribute them over different machines, depending on your security architecture. In the most cases, the auth-server and the addon-self-administration will be on a public available server (behind an apache), while the resource-server is installed on a machine, not directly connected with the internet.

### The osiam service

OSIAM will be started in it's own process on `port 6001`. You can manage osiam with

    service osiam start|stop|restart

After startup, you can test the services e.g. with curl:

    curl http://localhost:6001/osiam-resource-server/ServiceProviderConfigs

You can find the logfiles at:

    /var/log/osiam/

### Tomcat configuration

OSIAM uses the distributions tomcat7 packages, but with an own configuration. You can modify the osiam tomcat configuration by editing the files in `/etc/osiam/tomcat-conf/`.


text:
# Aggregate keys

In DDD we have to find our own solution to the aggregate identification. This is important if we want to change the state of a specific aggregate - the command must include some kind of identifier of the aggregate.

In the source code of a DDD project, the aggregate is loaded from the repository by the identifier included in the command. But in PESS, the concept of command handler is hidden in the generated code.

From the view of the domain expert, the key of the aggregate must exist and must be unique. It's something the domain expert does not need to work with. That's why PESS separates commands to creational and updating. Updating command always requires a key but what that value concerns the developer, not the domain expert.

PESS requires that the value of the aggregate key:

- should be relatively easy to compare with another value visually
- should be possible to simply copy and paste the value of the key

repository: czmirek/Pess

repo_name: czmirek/Pess


text:
# awesome-openmp
A curated list of awesome open.mp gamemodes, filterscripts, libraries, plugins and open.mp-related software.

## Contents
* [Gamemodes](#gamemodes)
  * [Roleplay](#roleplay)
  * [Freeroam](#freeroam)
  * [Deathmatch / Team Deathmatch](#deathmatch--team-deathmatch)
  * [Capture the Flag](#capture-the-flag)
* [Filterscripts](#filterscripts)
* [Maps](#maps)
* [Libraries](#libraries)
* [Plugins](#plugins)
* [Software](#software)
  * [Package Managers](#package-managers)
  * [IDE's](#ides)
  * [Extensions for Code Editors](#extensions-for-code-editors)
* [Other](#other)

## Packages

### Gamemodes
#### Roleplay
- None so far...
#### Freeroam
- None so far...
#### Deathmatch / Team Deathmatch
- None so far...
#### Capture the Flag
- None so far...

### Filterscripts
- None so far...

### Maps
- None so far...

### Libraries
- [YSI](https://github.com/pawn-lang/YSI-Includes) - Just the YSI include files, none of the extra stuff.
- [fixes](https://github.com/pawn-lang/sa-mp-fixes) - Includes and plugins to fix various issues in the SA:MP server that can be fixed externally, leaving the devs time for other things.

### Plugins
- None so far...

### Software
#### Package Managers
- [sampctl](https://github.com/Southclaws/sampctl) - The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
#### IDE's
- None so far...
#### Extensions for Code Editors
- [Pawn Tools](https://github.com/Southclaws/vscode-pawn) - Pawn tools for vscode, powered by sampctl.
#### Compilers
- [pawn-lang/compiler](https://github.com/pawn-lang/compiler) - Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS.

### Other
- None so far...

repository: alextwothousand/awesome-openmp

repo_name: alextwothousand/awesome-openmp


text:
[[中文版]](README_cn.md)

![v2](asserts/v2.png)

![anim](asserts/anim.gif)

This project is developed using Tuya SDK,which enables you to quickly develop branded apps connecting and controlling smart scenarios of many devices.

For more information,please check [Tuya Developer Website](https://developer.tuya.com/).

## Introduce

- Mainly through sht30 to monitor the indoor temperature and humidity, and upload to the cloud platform, you can view it at any time through the app
- The two clouds represent the indoor and outdoor temperature and humidity respectively, and show the difference of indoor and outdoor environment by displaying different colors of RGB lamp beads
- The connection status of the network can also be displayed through different display effects
- Good fortune
- For home decoration

## Video

[BiliBIli](https://www.bilibili.com/video/BV18K4y1p78z)

## Hardware

WB3S WiFi&BLE Module ：1.1.71

[SHT30](https://item.szlcsc.com/78489.html)

[BluePill](https://github.com/WeActTC/BluePill-Plus)

[TC3838RGB](https://item.szlcsc.com/839901.html)

[PCB](https://oshwhub.com/kakaka/tu-ya-zhi-neng-yun-duo)

## Software

Tuya MCU SDK ：v2.5.6

VS Code + PlatformIO + Arduino

 Source code：[software](software)

## Screenshot

![3](asserts/3.png)

![2](asserts/2.png)

![4](asserts/4.jpg)

![5](asserts/5.jpg)

![6](asserts/6.jpg)

![7](asserts/7.jpg)

![8](asserts/8.jpg)

## License

[MIT](https://github.com/Modular-X-01/diy-tuya-cloud-sw/blob/main/LICENSE)

repository: LYFYNC/diy-tuya-cloud-sw

repo_name: LYFYNC/diy-tuya-cloud-sw


text:
# Code Optimization

## Prefer static over virtual

In any class, if you don't need to access an object's fields, make your method static. Invocations will be about `15-20%` faster. And you can tell other devs that calling the method can't alter the object's state.

## Use static final for constants

In any class, if use `static int val = 22` the compiler generates a class initializer method - called `<clinit>`, that is executed when the class is first used - to store `22` into `val` to access later with field lookup.

If we add the `final` keyword like `static final int val = 22` this class no longer requires a `<clinit>` method, because the constants go into static field initializers in the dex file and can be refered directly later without field lookup.

Note: This optimization applies ONLY to primitive types and String constants, not arbitrary reference types. Still, it's good practice to declare constants static final whenever possible.

## Use enhanced foreach syntax for loops

`foreach` loop can be used for collections that implement the Iterable interface and for arrays, should use it by default because it's faster (with JIT) or equal (without JIT) than normal counted for loop.

But with an `ArrayList`, a hand-written counted loop is about 3x faster than foreach loop.

## Use package instead of private access modifier with inner class

Consider define an inner class (inner class cannot be static) `Foo$Inner` that directly accesses private methods/fields in the outer class. This is legal in Java.

But the problem is that the VM considers direct access to `Foo`'s private members from `Foo$Inner` to be illegal because `Foo` and `Foo$Inner` are different classes. To bridge the gap, the compiler generates [synthetic methods](https://vanillajava.blogspot.com/2011/07/java-secret-generated-methods.html):

```
/*package*/ static int Foo.access$100(Foo foo) {
    return foo.mPrivateVal;
}
/*package*/ static void Foo.access$200(Foo foo, int val) {
    foo.privateMethod(val);
}
```

The inner class code calls these static methods whenever it needs to access the `mPrivateVal` or invoke the `privateMethod()` of the outer class. This is an "invisible" performance hit because accessors are **slower** than direct field accesses, and it will **hurt the 64K methods limit** of Android too.

## Avoid using floating point

As a rule of thumb, floating-point is about `2x` slower than integer on Android-powered devices.

In speed terms, there's no difference between float and double on the more modern hardware. Space-wise, double is `2x` larger. As with desktop machines, assuming space isn't an issue, you should prefer double to float.

## Know & use libraries

By prefering library code over your own code you can avoid "re-inventing the wheel" and bear in mind that the system is allowed to replace calls to library methods with hand-coded assembler, which may be better than the best code the JIT can produce for the equivalent Java. The typical example here is `String.indexOf()` and related methods, which Dalvik replaces with an inlined intrinsic. Similarly, the `System.arraycopy()` method is about `9x` faster than a hand-coded loop on a Nexus One with the JIT.

## Use native methods carefully

Developing your app with native code using the Android NDK is NOT necessarily more efficient than programming with the Java language.

For one thing, there's a cost associated with the Java-native transition, and the JIT can't optimize across these boundaries. If you're allocating native resources (native heap,..) it's more difficult to arrange timely collection of these resources. You also need to compile your code for each architecture you wish to run on so it will increase APK size.

Native code is primarily useful when you have an **existing native codebase that you want to port to Android, not for "speeding up" parts of your Android app written with the Java**.

## Avoid using enum

Enum cause bigger apk size, 4 byte reference + enum size.
-> Use constants or [IntDef](https://stackoverflow.com/questions/32032503/enums-and-android-annotation-intdef) instead.

repository: nhoxbypass/android-development-patterns

repo_name: nhoxbypass/android-development-patterns


text:
Many of the files in here, e.g. `*.yml`, are for automatic updates, powered by https://www.electron.build/auto-update/.

Note:
- `Outline-Manager.zip` is for auto-updates on macOS
- `*.blockmap` is for differential (smaller!) downloads
- the paths in `*.yml` are specified by the `package_*_action.sh` scripts in `src/server_manager/electron_app`

repository: ierghub/outline-releases

repo_name: ierghub/outline-releases


text:
# Web (SPA/PWA) client for [jury-server](https://github.com/asymptote-inc/jury-server)

## Features
Please see [NLU Checklist](https://github.com/asymptote-inc/jury-web/issues/11#issuecomment-341160487)

## Installation
Since the client is a Website, installation is not required. However, user may choose to install the app.
In mobile browsers (especially Google Chrome, Microsoft Edge, Samsung Browser etc. in **Android**)
user will be asked to install the app. If the user was not shown any notification to install,
user can click the corresponding button/menu item to install the app. Installing will add a shortcut to home screen.

## Removing
Installed app can be removed as it is just another shortcut.

repository: asymptote-inc/jury-web

gha_language: JavaScript

repo_name: asymptote-inc/jury-web


text:
# Scenario: Connection to DB server lost! No. 9 - DBサーバへの接続が切れた。その9

## Walkthrough

Deployed sources and access flow:
![access flow](./asset/13-guide01.drawio.svg)

1. First, let's check what is deployed.
![tag manager](./asset/13-guide02.jpg)
Seeing this, you can see what instances are deployed what resources are deployed for this scenario.
2. It depends on you where to start, but in this scenario we take a look at the security group attached to CSR1000v EC2 instance. Click the security group identifier for csr identifier in the tag editor, and it will open another tab to show you the resource.

![route table](./asset/13-guide03.jpg)
Having checked the security group detail, there is no rule allowing the communication from the web server to db server. As it is described in the image, the traffic needs to be allowed in security group.
![src dest explanation](./asset/13-sg.drawio.svg)
In order to allow this traffic, simply add another rule into the seccurity group. In this case, I added the rule allowing the communication for anny traffic goinng to DB subnet(<IP_ADDRESS>/24) and it has destination port tcp/3306.
![src dest check](./asset/13-guide04.jpg)

4. Now press the button on the web site, and you should get an image.


text:
# Makie

Makie is a high level plotting interface for [GLVisualize](https://github.com/JuliaGL/GLVisualize.jl/), with a focus on interactivity and speed.

It can also be seen as a prototype for a new design of [Plots.jl](https://github.com/JuliaPlots/Plots.jl),
since it will implement a very similar interface and incorporate a lot of the ideas.

A fresh start instead of the already available GLVisualize backend for Plots.jl was needed for the following reasons:

1) Plots.jl was written to create static plots without any interaction. This is deeply reflected in the internal design
   and makes it hard to integrate the high performance interaction possibilities from GLVisualize.

2) Plots.jl has many high level plotting packages as a backend which lead to a very inconsistent design for the backends.
   E.g. there is no straight interface a backend needs to implement. The backend abstraction happens at a very high level
   and the Plots.jl design relies on the high-level backends to fill in a lot of functionality - which lead to a lot of duplicated work
   for the lower level backends and a lot of inconsistent behavior since the code isn't shared between backends.
   It also means that it is a lot of work to maintain a backend.

3) The attributes a plot/series contains and where the default creation happens is opaque and not well documented.
   Sometimes it's the task of the backend to create defaults for missing attributes, sometimes Plots.jl creates the defaults.
   A missing attribute is signaled in too many different ways (e.g false, nothing, "") which then needs to be checked and filled in by the backend.
   This leads to making it very challenging to e.g. find the color of a line for different plot types and creates buggy, inconsistent and messy backend code.

4) As mentioned in point 2, there is not a single consistent low level drawing API.
   This also influences recipes, since there is not a straight mapping to a low level drawing API and therefore it's not that easy to compose.
   There should be a finite set of 'atomic' drawing operations (which can't be decomposed further) which a backend
   needs to implement and the rest should be implemented via recipes using those atomic operations.
   So once a backend implements those, it will support all of the plotting operations and only minor maintenance work needs to be done from that point on.

5) Backend loading is done in Plots.jl via evaling the backend code. This has at 4 negative consequences:
    a) Backend code can't be precompiled leading to longer load times
    b) Backend dependencies are not in the Plots.jl REQUIRE
    c) Backend dependencies get loaded via a function that gets evaled, so it's a bit awkward to use those dependencies in the function inside a backend
    d) World age issues because of the eval

Please read the chapters [Scene](@ref), [Functions](@ref), [Interaction](@ref), [Extending](@ref), [Backends](@ref) and [Devdocs](@ref) to see how Makie solves those issues!

The code that will be moved back to Plots.jl lives in [plotsbase](https://github.com/SimonDanisch/Makie.jl/tree/master/src/plotsbase).


text:
# GithubSearching
Angular app to search information in GitHub.

# Installation

GithubSearching requires [Node.js](https://nodejs.org/) and [Angular CLI](https://angular.io/cli) to run.

Install the dependencies and start the server.

```sh
$ cd gitHubSearching
$ npm install
$ ng serve --open
```

# Dependencies

GithubSearching uses the next dependecies:

- [Angular](https://angular.io/).
- [angular-fontawesome package](https://www.npmjs.com/package/@fortawesome/angular-fontawesome).
- [RxJS](https://rxjs-dev.firebaseapp.com/) for reactive programming.

# Tech

GithubSearching uses the [GitHub API v3](https://developer.github.com/v3/) to get the repositories information.
Some endpoints of the GitHub API have a [limit rate restriction](https://developer.github.com/v3/#rate-limiting) per hour. To increase the
rate limit you must [generate an OAuth token](https://help.github.com/en/github/extending-github/git-automation-with-oauth-tokens#step-1-get-an-oauth-token) and supply it in the **enviroment.ts** file in the **githubApiKey** property of the **environment** constant.

repository: jlzapata/GithubSearching

gha_language: TypeScript

repo_name: jlzapata/GithubSearching


text:
# Mozilla Firefox Config Guide

## Screenshot
![image](../screenshots/Firefox_and_Bar.png)

Hello! Because of I do not own the Firefox theme
and don't want to share the extension files, I wanted
to create guide instead of sharing my whole profile
folder. Disadvantage of this is you need to install
these single by single.

## Startpage/Homepage
I use Square Start Page extension for my homepage.

## Theme
[FlyingFox](https://github.com/akshat46/FlyingFox)

[FlyingFox's Installation Guide](https://github.com/akshat46/FlyingFox/wiki/%23-Installation)

## Extensions
- Adblocker for YouTube
- Cookie Popup Blocker
- Ctrl+Number to switch tabs
- DuckDuckGo Privacy Essentials
- Facebook Container
- Flagfox
- HTTPS Everywhere
- Night Eye - Dark Mode on any website (see the Notes section at the bottom)
- Notifier for GitHub
- Privacy Badger
- React Context DevTool
- Redux DevTools
- Simple Tab Groups
- Simple Translate
- Square Start Page
- Svelte Devtools
- Take Webpage Screenshots Entirely - FireShot
- Tree Style Tab (see the Notes section at the bottom)
- Trocker
- uBlock Origin
- Universal Bypass
- Vue.js devtools
- Wide GitHub
- Windowed - floating Youtube/every website
- You No Cards

# Notes
- Yeah, I care about privacy
- NightEye extension is different from others and analyzes site and if website is already dark, it disables itself. (Like magic right?)
- If you want the Tree Style Tab to have a theme like mine, you need to check the Theme section at the above. It's theme guide is on FlyingFox's Wiki page.
- Trocker extension is awesome and works similar to PixelBlock.


text:
# SQL Basics: Top 10 Customers by Total Payments Amount

## Instructions

### Overview

For this kata we will be using the DVD Rental database.

Your are working for a company that wants to reward its top 10 customers with a
free gift. You have been asked to generate a simple report that returns the top
10 customers by total amount spent. Total number of payments has also been
requested.

### Task

The query should output the following columns:
- customer_id [int4]
- email [varchar]
- payments_count [int]
- total_amount [float]

and has the following requirements:
- only returns the 10 top customers
- ordered by total amount spent

### Database Schema

```
customer
- customer_id
- store_id
- first_name
- last_name
- email
- address_id
- activebool
- create_date
- last_update
- active

payment
- payment_id
- customer_id
- staff_id
- rental_id
- amount
- payment_date
```

![](http://www.postgresqltutorial.com/wp-content/uploads/2018/03/dvd-rental-sample-database-diagram.png)

url: https://raw.githubusercontent.com/DomikIAm/codewars_challenges/62b20d4e729c8ba79eac7cae6a179af57abd45d4/SQL/6 kyu/SQL Basics - Top 10 Customers by Total Payments Amount/instructions.md


text:
# Massdrop x Sennheiser HD 58X
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.

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

| Type    | Fc      |    Q | Gain    |
|:--------|:--------|:-----|:--------|
| Peaking | 182 Hz  | 0.57 | -3.1 dB |
| Peaking | 2087 Hz | 4.5  | 1.9 dB  |
| Peaking | 2550 Hz | 3.21 | 2.8 dB  |
| Peaking | 6685 Hz | 9.94 | 4.8 dB  |
| Peaking | 14 Hz   | 0.55 | 7.6 dB  |
| Peaking | 70 Hz   | 4.16 | 1.5 dB  |
| Peaking | 1176 Hz | 3.87 | -1.7 dB |
| Peaking | 4464 Hz | 6.22 | 3.4 dB  |
| Peaking | 5395 Hz | 6.98 | -4.1 dB |

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

| Type    | Fc       |    Q | Gain    |
|:--------|:---------|:-----|:--------|
| Peaking | 31 Hz    | 1.41 | 4.3 dB  |
| Peaking | 62 Hz    | 1.41 | 0.8 dB  |
| Peaking | 125 Hz   | 1.41 | -2.5 dB |
| Peaking | 250 Hz   | 1.41 | -2.5 dB |
| Peaking | 500 Hz   | 1.41 | 0.1 dB  |
| Peaking | 1000 Hz  | 1.41 | -1.8 dB |
| Peaking | 2000 Hz  | 1.41 | 2.5 dB  |
| Peaking | 4000 Hz  | 1.41 | 0.7 dB  |
| Peaking | 8000 Hz  | 1.41 | 0.6 dB  |
| Peaking | 16000 Hz | 1.41 | -1.0 dB |

### Graphs
![](https://raw.githubusercontent.com/jaakkopasanen/AutoEq/master/results/oratory1990/harman_over-ear_2018/Massdrop%20x%20Sennheiser%20HD%2058X/Massdrop%20x%20Sennheiser%20HD%2058X.png)

path: /results/oratory1990/harman_over-ear_2018/Massdrop x Sennheiser HD 58X/README.md


text:
# UPGRADING GUIDE

## 3.3 to 4.0

Version 4.0 requires PHP 7.2-8.0 and any HTTP client and HTTP client factory implementation. We are now decoupled from any HTTP messaging client by using [PSR-7](https://www.php-fig.org/psr/psr-7/), [PSR-17](https://www.php-fig.org/psr/psr-17/), [PSR-18](https://www.php-fig.org/psr/psr-18/), and [HTTPlug](https://httplug.io/). You can visit [HTTPlug for library users](https://docs.php-http.org/en/latest/httplug/users.html) to get more information about installing HTTPlug related packages. There are many good choices for HTTP clients, such as Guzzle 7. Upgrading from version 3.0 should be easy, once you have picked an HTTP client, as all of our other changes are purely internal.

## 2.3 to 3.0

Version 3.0 requires PHP 7.1-7.4 and either Guzzle 6, Guzzle 7, or Buzz 0.16. We recommend using Guzzle 7 if you are running PHP 7.1, and Guzzle 7 if you are using PHP 7.2+. Version 3.0 provides some great internal changes since 2.3, which will allow us to fully move to PSR-7, PSR-17, and PSR-18 in version 4.0. We recommend everyone using version 2.3 upgrades to version 3.0 as soon as possible. New features and breaking changes are documented in the change log.

### New Client Class

The `DigitalOceanV2\DigitalOceanV2` class has been renamed to `DigitalOceanV2\Client`, and you no longer need to provide an HTTP client when you create an instance. We will automatically discover one based on what you have installed! Moreover, authentication is simplified. Just call the `authenticate` method on the client, and you're ready to go.

#### 2.3 Code:

```php
$adapter = new DigitalOceanV2\Adapter\BuzzAdapter('your_access_token');

$client = new DigitalOceanV2\DigitalOceanV2($adapter);
```

#### 3.0 Code:

```php
$client = new DigitalOceanV2\Client();

$client->authenticate('your_access_token');
```

### Result Pager

In version 2.3, we used to provide a way to set the page and per page parameters to the `getAll` API methods, defaulting the per page value to 200. In version 3.0, we no longer interfeer with this query parameter, and instead provide a proper way to page through results. Our new result pager class with temporarily set the per page value to 100 while it does its work, rather than the API classes doing this, however you can customise this number when you create the result pager.

#### 2.3 Code:

```php
// get the first 200 droplets as an array
$droplets = $client->droplet()->getAll();

// get stuck...
```

#### 3.0 Code:

```php
// get the first 20 droplets as an array
$droplets = $client->droplet()->getAll();

// create a new result pager
$pager = new DigitalOceanV2\ResultPager($client);

// get all your droplets as an array
$droplets = $pager->fetchAll($client->droplet(), 'getAll');

// get all droplets as a Generator which lazily yields
// new results as they become available
$droplets = $pager->fetchAllLazy($client->droplet(), 'getAll');
```

Note that `fetchAll` is implemented behind the scenes by simply calling `iterator_to_array` on `fetchAllLazy`. The
advantage to `fetchAllLazy` is you don't need to keep all the droplets in memory at the same time, however it is
possible for a request to fail after you have part processed some of the droplets, so choose whichever method is best
for your needs.

repository: DigitalOceanPHP/Client

gha_language: PHP

repo_name: DigitalOceanPHP/Client


text:
## Cottonwood revision history

### v9

#### Features
Image processing tools added to toolbox:
* Gamma compression / decompression
* Color (RGB) to grayscale conversion

### v8

#### Bugfixes
* `__str__()` methods added to `experiment` classes
* Installation instructions updated
* Installation dependencies on Numpy and Matplotlib added

### v7

Reporting added
as detailed in section 6 of
[Course 313](https://end-to-end-machine-learning.teachable.com/p/advanced-neural-network-methods/).

#### Features
* `__str__()` methods added to all core classes
* String representations of components combined together in a model report
* Widespread refactoring
* Added to PyPi

### v6

Initializers added
as detailed in section 5 of
[Course 313](https://end-to-end-machine-learning.teachable.com/p/advanced-neural-network-methods/).

#### Features
* Glorot initialization
* He initialization
* Uniform initialization

### v5

Optimizers added
as detailed in section 4 of
[Course 313](https://end-to-end-machine-learning.teachable.com/p/advanced-neural-network-methods/).

#### Features
* Stochastic Gradient Descent (SGD)
* SGD with momentum
* Adam
* Noisy momentum (experimental)

#### Refactoring
* Creation of `data`, `examples`, and `experimental` directories.
* Variable, class, and module name changes throughout to better reflect
their purpose.
* Regularizers' function broken out into pre- and post-optimizer.

### v4

Custom layers added
as detailed in section 3 of
[Course 313](https://end-to-end-machine-learning.teachable.com/p/advanced-neural-network-methods/).

#### Features
* Normalization layer
* Difference layer
* Directed acyclic graph architectures
* Input value range inferred automatically

#### Bugfixes
* Error functions take single array as input, return single value.
* Connections in autoencoder visualization reflect connection weights

### v3

Dropout added
as detailed in section 2 of
[Course 313](https://end-to-end-machine-learning.teachable.com/p/advanced-neural-network-methods/).

#### Features
* Dropout

### v2

Regularization added, as detailed in section 1 of
[Course 313](https://end-to-end-machine-learning.teachable.com/p/advanced-neural-network-methods/).

#### Features
* **Regularizers** L1, L2, and Limit (max-norm)

### v1

The initial state of the code, as built in
[Course 312](https://end-to-end-machine-learning.teachable.com/p/write-a-neural-network-framework/)

#### Features
* Fully-connected layers
* Sequential architecture
* Backpropagation
* **Activation functions** hyperbolic tangent, rectified linear unit, and logistic
* **Error functions** squared error and absolute error

#### Examples
* Autoencoder

#### Data sets
* 2x2 pixel test images
* 3x3 pixel test images
* 7x7 pixel Nordic rune images

repository: brohrer/cottonwood

gha_language: Python

repo_name: brohrer/cottonwood


text:
---
layout: post
title: Efficiency and fun from using ADB Shell, Part 2 - I/O
tags: [adb, AndroidShell, input, output, logcat, screenshot, screenrecord]
---

Continuing this series of articles I want to tell more about basic `input` and `output` provided by Android Debug Bridge.

## Input

Pretty often happening that we need enter specific data to `register/login/connect` into our application. Thankfully we can do it easily with adb. To input user/pass we use flag `text` and to go to second `EditText` [key event](https://developer.android.com/reference/android/view/KeyEvent.html)

adb shell input text username;
adb shell input keyevent 20;
adb shell input text username;

We can enter set of commands either sequentially either pass all commands for shell inside of quotes, depends on design of our layout we may need to go up/down between `EditTexts`

adb shell "input text 2; input keyevent 20; input text 1;
input keyevent 20; input keyevent 20; input text <IP_ADDRESS>;
input keyevent 19; input keyevent 19; input text 7050;"

Sometimes it may help to avoid hassle of entering data every time.

![Input text with adb](/images/2/input.gif "Input text with adb")

Thanks for Rene Barbosa we can see [full list of keyevents](http://stackoverflow.com/a/28969112/1823992) plus use of `swipe` and `tap` flags. We can mix commands as we wish for example to **unlock screen**:

//26 -->  "KEYCODE_POWER"
adb shell "input keyevent 26; input swipe 200 700 200 0;"

It might be come in handy to add in gradle build script like a last task for example:

def wakeUpViaAdb() {
  exec {
    //put your own shell
    executable "zsh"
    args "-c", 'if (($(adb devices | wc -l) < 4)); then adb \
shell "input keyevent 26; input swipe 200 700 200 0;"; fi'
  }
}

android.applicationVariants.all { variant ->
    variant.assemble.doLast {
      wakeUpViaAdb()
    }
  }

## Output
  We can use several information channels for output with adb `logs`, `screenshot`, `screen record`
### Logs
 To see logs we can use embedded adb command `log cat`. Mixing with `tag`, `priority` flags and tool `grep` we can get any information listed in logs.

//TAG:priority(V/D/I/W/E), we will see verbose priority logs with tag WifiStateMachine
adb logcat -s WifiStateMachine:V

 But I considering to be more convenient to use [PID Cat](https://github.com/JakeWharton/pidcat) by Jake Wharton because of highlighting priority with colours and look up by a package. It just python script and could be run easy everywhere.

  ![PID Cat](/images/2/pidcat.png)

### Screenshots

adb shell screencap -p /sdcard/screenshot.png && adb pull /sdcard/screenshot.png

We can also use nicer one-liner getting output [straight away](http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html)

adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screenshot.png

### Recording screen
Starting from version of Android 4.4 we can record screen. Keep in mind that it's not available on emulators.

//size for resolution, time-limit time of recording in seconds
adb shell screen record /sdcard/temp.mp4 --size 1280x720 --time-limit 5

There is also very useful gist to make [gif](https://gist.github.com/lorenzos/e8a97c1992cddf9c1142) out of a video.

These are the basic input/output commands for adb. In next Part, I’ll tell more useful tips and tricks about adb and Android. Stay tuned and keep investigating this wonderful Android World! ;)


text:
# Econometric with Python:

This repository introduces the popular, powerful, and free programming language and software pacakge *Python* with a focus on the implementation of standard tools and methods used in *economometric* models and methods. It builds on the excellent and popular econometric textbook **Introductory Econometrics A Modern Approach** by **Jeffrey M. Wooldridge**.

## Content:
1. Introduction to Python
2. Basic Statistic with NumPy and SciPy
3. Simple Linear Regression Analysis
4. Multiple Linear Regression Analysis
5. Regression Inference and OLS Asymptotics
6. Multiple Regression Analysis: Further Issues
7. Heteroscedasticity

Resources:
- [Using Python for Introductory Econometrics](https://www.amazon.com/dp/B08924H17Y)
- [Introductory Econometrics A Modern Approach](https://economics.ut.ac.ir/documents/3030266/14100645/Jeffrey_M._Wooldridge_Introductory_Econometrics_A_Modern_Approach__2012.pdf)

Copyright © 2021 Norman Lo