text:
---
layout: default
title: Browsertime 3.0
description: The next generation of performance testing in your browser is here.
authorimage: /img/aboutus/peter.jpg
intro: We have built 3.0 mainly for ourselves and read about how it also will help you!
keywords: sitespeed.io, sitespeed, 3.0, browsertime
nav: blog
---

# Browsertime 3.0

We have built 3.0 mainly for ourselves: The old version (2.x) was built with Promises. Promises were good compared to the old callback hell, but moving to _async/await_ was essential for us to be able to move fast: fix bugs and add more functionality. In the new version the main workflow is built with async/await it will help us a lot in the future.

But why should **you** upgrade? We also added a couple of fixes/new functionality:

* [Less memory usage/less CPU usage = more stable metrics](#less-memory-usageless-cpu-usage--more-stable-metrics)
* [New Firefox with new way of getting the HAR](#new-firefox-with-new-way-of-getting-the-har)
* [CPU time spent from Chrome](#cpu-time-spent-from-chrome)
* [New way of navigate (more stable metrics)](#new-way-of-navigate-more-stable-metrics)
* [WebPageReplay support using Docker](#webpagereplay-support-using-docker)
* [Screenshots as jpeg or png](#screenshots-as-jpeg-or-png)
* [1 based file names](#1-based-file-names)
* [Better error handling](#better-error-handling)
* [DOMContentLoaded in the video](#domcontentloaded-in-the-video)
* [Trace files/logs are now gzipped](#trace-fileslogs-are-now-gzipped)
* [Shorter(!) videos](#shorter-videos)
* [Emulating mobile in Chrome works better than ever](#emulating-mobile-in-chrome-works-better-than-ever)
* [Introducing a new metric: Visual Readiness](#introducing-a-new-metric-visual-readiness)
* [Do you need that extra MOZ HTTP log?](#do-you-need-that-extra-moz-http-log)
* [Better friends with Android](#better-friends-with-android)
* [And more ...](#and-more-)
* [Breaking Changes](#breaking-changes)

### Less memory usage/less CPU usage = more stable metrics

In the new version we store metrics and data to disk between runs. That means screenshots/ tracelogs and other metrics are stored to disk immediately. This makes Browsertime use less memory when you do many runs. See [#308](https://github.com/sitespeedio/browsertime/issues/308) for a use case where that helps.

The CPU usage is also decreased, mainly since we switched to the new version of Firefox. Here's an example of when we deployed an early version of 3.0 on AWS.

![CPU usage]({{site.baseurl}}/img/bt-3.0/cpu-usage.png)
{: .img-thumbnail-center}

 The red arrow shows when we installed the first alpha version of Browsertime

The decreased memory and CPU usage makes your metrics more stable.

### New Firefox with new way of getting the HAR

You know the HAR Export trigger was broken in Firefox 55. The only alternative is to use the HTTP MOZ log to recreate a HAR but that [will add overhead](https://bugzilla.mozilla.org/show_bug.cgi?id=1452535) that for some sites at least makes the timing metrics unrealistic.

We now use the new [HARExport Trigger](https://github.com/devtools-html/har-export-trigger) that will work in Firefox 60/61. If you use FF versions lower than 61 it will add some overhead. And at the moment the devtools bar needs to be open, but that will hopefully be fixed in later version of Firefox.

### CPU time spent from Chrome

We have a new project called [Chrome trace](https://github.com/sitespeedio/chrome-trace) built by [Tobias](https://github.com/tobli) that parses the Chrome trace log and check the time spent. Use it by add --chrome.timeline to your run. For a brief period we did use the [Trace parser](https://github.com/WPO-Foundation/trace-parser) project but moving to our own will open up for us to add more metrics and do bug fixes faster.

### New way of navigate (more stable metrics)

In the old version of Browsertime we used the Webdriver to navigate to the page. In some cases on under powered server that could make metrics unstable. We now navigate with JavaScript and that has made our metrics more stable.

We now use pageLoadStrategy _none_.

### WebPageReplay support using Docker

We had it in alpha/beta for a while and now it's there in our default container: [WebPageReplay](https://github.com/catapult-project/catapult/blob/main/web_page_replay_go/README.md).

WebPageReplay is proxy that first records your web site and then replay it locally. That can help you find performance regression in the front-end code easier: Latency/server timings are constant.

You can run like this:

docker run --cap-add=NET_ADMIN --shm-size=1g --rm -v "$(pwd)":/browsertime -e REPLAY=true -e LATENCY=100 sitespeedio/browsertime https://en.wikipedia.org/wiki/Barack_Obama

Here are a couple of examples from our real world tests. We test on Digital Ocean Optimized Droplets 4 gb memory with 2 vCPUs. We test both with connectivity set to cable (to try to minimize the impact of flaky internet) and one tests using WebPageReplay. We tests with the same amount of runs on the same machine.

Here's an example from one of the sites we test. Here we test with connectivity set to cable.
![Connectivity example 1]({{site.baseurl}}/img/bt-3.0/connectivity-example-1.png)
{: .img-thumbnail}

 The variation is normally whopping 500 ms and max is over 1400 ms.

The same site using WebPageReplay, the same amount of runs:

![Replay example 1]({{site.baseurl}}/img/bt-3.0/replay-example-1.png)
{: .img-thumbnail}

 The difference is now less than 100 ms.

Here's another site, setting connectivity:

![Connectivity example 2]({{site.baseurl}}/img/bt-3.0/connectivity-example-2.png)
{: .img-thumbnail}

 The First Visual Change variation is 150 ms

And then with WebPageReplay:

![Replay example 2]({{site.baseurl}}/img/bt-3.0/replay-example-2.png)
{: .img-thumbnail}

 Using WebPageReplay the variation is 67 ms.

Using WebPageReplay we get more stable metrics. This is super useful if you want to make sure you find front end performance regressions. However testing **without** a proxy is good since you will then get the same variations as your user will get.

### Screenshots as jpeg or png

We use [sharp](http://sharp.pixelplumbing.com/) to store/convert screenshots. Screenshots are now located in the screenshots folder, named after each run. Default is jpeg screenshots. [#468](https://github.com/sitespeedio/browsertime/pull/468).

### 1 based file names

One of the most annoying things in older Browsertime versions has been that the file names has been 0-based. File names are now based on 1 and not 0 so the first file from the first iteration is named something with -1. [#536](https://github.com/sitespeedio/browsertime/pull/536).

### Better error handling

Browsertime now catch most errors and there's an error array in the JSON output that holds errors that has happened within each run. The array is an array of arrays, potentially you could have multiple errors per run.

### DOMContentLoaded in the video

You can now see when DOMContentLoaded happens in the video.

![DOM Content Loaded]({{site.baseurl}}/img/bt-3.0/domContentLoaded.png)
{: .img-thumbnail}

### Trace files/logs are now gzipped

We try to stora all large files and gzipped from the new version. You can also gzip the HAR file by adding --gzipHar to your run.

### Shorter(!) videos

Move video out of pre/post scripts. When we first started with the video we used the pre/post structure. That was ok to move fast but one of the negatives is that stopping the video happen after we collected all metrics. We now stop the video exactly when the page is finished loading [#448](https://github.com/sitespeedio/browsertime/pull/448).

### Emulating mobile in Chrome works better than ever

Better handling of Chrome emulated mobile: We now set the correct window size for phones [#528](https://github.com/sitespeedio/browsertime/pull/528).

### Introducing a new metric: Visual Readiness

We got a new metric: **Visual Readiness** - the time between the first change on the screen until the last one. You will get it with the rest of the Visual Metrics by turning on --visualMetrics

![Visual Readiness]({{site.baseurl}}/img/bt-3.0/visual-readiness.png)
{: .img-thumbnail}

 Lower Visual Readiness is better.

### Do you need that extra MOZ HTTP log?

Sometimes when you want to report a bug to Firefox you need to supply the MOZ HTTP log to make it easier for Mozilla to debug the issue. You can now turn on the MOZ HTTP log for Firefox with --firefox.collectMozLog [#451](https://github.com/sitespeedio/browsertime/pull/451) see [https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging](https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging).

### Better friends with Android

We updated how Browsertime drives Chrome on Android and it works better than before. Try it out and let us know if there is something that needs to be fixed.

### And more ...

Checkout the full [Changelog](https://github.com/sitespeedio/browsertime/blob/main/CHANGELOG.md) for all changes.

## Breaking Changes

We got some breaking changes, please read about them before you upgrade.

* Since we updated to Firefox Quantum (and the new HAR Export trigger) timing metrics will change for you. Quantum is faster/slower for your site.
* Store extra JSON and screenshots per run (and collect stats between runs). We want to make Browsertime as mean and clean as possible: Store all extra JSONs (chrome trace categories, console log and more), and the screenshots between runs (before they where stored on exit). This is good because it will decrease the memory impact but it is non-backward compatible change! Sitespeed.io and other tools need to change how they handle extra JSONs and the screenshot. Browsertime users that use browsertime from the command line will not see any change. We also moved most stats to be collected between runs, that is needed for CPU stats since we store the data and throws it away between runs [#449](https://github.com/sitespeedio/browsertime/pull/449).
* We disabled the old HAR Export trigger (max Firefox 54). And we now uses the new [https://github.com/devtools-html/har-export-trigger/](https://github.com/devtools-html/har-export-trigger/) that needs Firefox 61 or later to work.
* We renamed the options to get Visual Metrics to be --visualMetrics instead of --speedIndex. When we first introduced Visual Metrics Speed Index was more known, but it has always been a thorn in the side to call the option that. In Docker we collect Visual Metrics by default.
* We use [sharp](http://sharp.pixelplumbing.com/) to store/convert screenshots. Screenshots are now located in the screenshots folder, named after each run. Default are now jpg screenshots. [#468](https://github.com/sitespeedio/browsertime/pull/468). Before it was png.
* Remove deprecated (renamed) options experimental.dumpChromePerflog (use chrome.collectPerfLog) and chrome.dumpTraceCategoriesLog (use --chrome.collectTracingEvents).
* Remove broken support for video recording on macOS (Docker on Mac still works).
* Removed deprecated (renamed) option videoRaw. Always use --videoParams.addTimer (boolean) if you want to toggle timer/metrics in the video
* We now use pageLoadStrategy **none**.
* We changed how we change between orange to white when we record a video. Depending on your machine, Selenium/WebDriver introduced latency the old way we did the switch [#503](https://github.com/sitespeedio/browsertime/pull/503).
* We removed collecting Resource Timing data as default [#505](https://github.com/sitespeedio/browsertime/pull/505). If you still need the metrics, you can still run the script: [https://github.com/sitespeedio/browsertime/blob/2.x/browserscripts/timings/resourceTimings.js](https://github.com/sitespeedio/browsertime/blob/2.x/browserscripts/timings/resourceTimings.js).
* You can now choose what kind of response bodies you want to store in your HAR file. Instead of using --firefox.includeResponseBodies to include all bodies you can now use --firefox.includeResponseBodies [none,all,html][#518](https://github.com/sitespeedio/browsertime/pull/518).
* We cleaned up how you collect trace logs from Chrome. If you want the devtools.timeline log (and CPU spent metrics), just use --chrome.timeline. If you want to configure trace categories yourself, use --chrome.traceCategories
* File names are now based on 1 and not 0 so the first file from the first iteration is named something with -1. [#536](https://github.com/sitespeedio/browsertime/pull/536).
* Store the ChromeDriver log in the result directory (before it was stored where you run Browsertime) [#452](https://github.com/sitespeedio/browsertime/pull/452).
* In some cases we leaked Bluebird promises, they are now native promises.
* Running the engine took a promise that eventually became the scripts. Now you need to run with the scripts directly (no promises) to simplify the flow.

And by the way: the main branch of sitespeed.io is using 3.0 and we plan to release the next major of in a month or so.


text:
---
id: deploy-rstudio
title: RStudio
---

## Start RStudio

Start a RStudio container based on [Rocker RStudio tidyverse images](https://github.com/rocker-org/rocker/wiki/Using-the-RStudio-image) (debian), with `sudo` privileges to install anything you need (e.g. pip or apt packages)

You can start a container using the **RStudio** template in the [Catalog web UI](https://console-openshift-console.apps.dsri2.unimaas.nl/catalog) (make sure the **Templates** checkbox is checked)

Provide a few parameters, and Instantiate the template. The **username** will be `rstudio` and the **password** will be what you configure yourself, the DSRI will automatically create a persistent volume to store data you will put in the `/home/rstudio` folder. You can find the persistent volumes in the DSRI web UI, go to the **Administrator** view > **Storage** > **Persistent Volume Claims**.

<img src="/img/screenshot-deploy-rstudio.png" alt="Deploy RStudio" style={{maxWidth: '100%', maxHeight: '100%'}} />

:::info Official image documentation

See the [official Docker image documentation](https://github.com/rocker-org/rocker/wiki/Using-the-RStudio-image) for more details about the container deployed.

:::

## Restricted RStudio with Shiny server

Start a RStudio application, with a complementary Shiny server, using a regular `rstudio` user, **without `sudo` privileges**.

Create the template in your project:

* In the DSRI web UI, go to **+ Add**, then click on **YAML**, add the content of the [template-rstudio-shiny-restricted.yml](https://raw.githubusercontent.com/MaastrichtU-IDS/dsri-documentation/master/applications/templates/restricted/template-rstudio-shiny-restricted.yml) file, and validate.

* You can also do it using the terminal:

  ```bash
  oc apply -f https://raw.githubusercontent.com/MaastrichtU-IDS/dsri-documentation/master/applications/templates/restricted/template-rstudio-shiny-restricted.yml
  ```

Once the template has been created in your project, use the **RStudio with Shiny server** template in the OpenShift web UI catalog. It will automatically create a persistent storage for the data.

:::caution No sudo privileges

You will not have `sudo` privileges in the application.

:::

## Use Git in RStudio

The fastest way to get started is to use `git` from the terminal, for example to clone a git repository use `git clone`

You can also check how to enable Git integration in RStudio at https://support.rstudio.com/hc/en-us/articles/200532077

You can run this command to ask git to save your password for 15min:

```bash
git config credential.helper cache
```

Or store the password/token in a plain text file:

```bash
git config --global credential.helper 'store --file ~/.git-credentials'
```

Before pushing back to GitHub or GitLab, you will need to **configure you username and email** in the terminal:

```bash
git config --global user.name "Jean Dupont"
git config --global user.email<EMAIL_ADDRESS>```

:::tip Git tip

We recommend to use SSH instead of HTTPS connection when possible, checkout [here](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) how to generate SSH keys and use them with your GitHub account.

:::

## Run R jobs

You can visit this folder that gives all resources and instructions to explain how to run a standalone R job on the DSRI: https://github.com/MaastrichtU-IDS/dsri-demo/tree/main/r-job

If you want to run jobs directly from RStudio, checkout this package to run chunks of R code as jobs directly through RStudio: https://github.com/lindeloev/job

license: MIT

repository: MaastrichtU-IDS/dsri-documentation

branch_name: refs/heads/master

extension: md

gha_language: TypeScript

gha_license_id: MIT

license_type: permissive

repo_name: MaastrichtU-IDS/dsri-documentation


text:
# spaceonfire/simple-php-apidoc API Documentation

- [\spaceonfire\SimplePhpApiDoc](./spaceonfire/SimplePhpApiDoc)
    - Classes
        - [Context](./spaceonfire/SimplePhpApiDoc/Context.md)
        - [GeneratorCommand](./spaceonfire/SimplePhpApiDoc/GeneratorCommand.md)
- [\spaceonfire\SimplePhpApiDoc\Elements](./spaceonfire/SimplePhpApiDoc/Elements)
    - Classes
        - [ArgumentElement](./spaceonfire/SimplePhpApiDoc/Elements/ArgumentElement.md)
        - [BaseElement](./spaceonfire/SimplePhpApiDoc/Elements/BaseElement.md)
        - [ClassElement](./spaceonfire/SimplePhpApiDoc/Elements/ClassElement.md)
        - [ConstantElement](./spaceonfire/SimplePhpApiDoc/Elements/ConstantElement.md)
        - [FunctionElement](./spaceonfire/SimplePhpApiDoc/Elements/FunctionElement.md)
        - [InterfaceElement](./spaceonfire/SimplePhpApiDoc/Elements/InterfaceElement.md)
        - [MethodElement](./spaceonfire/SimplePhpApiDoc/Elements/MethodElement.md)
        - [NamespaceElement](./spaceonfire/SimplePhpApiDoc/Elements/NamespaceElement.md)
        - [PropertyElement](./spaceonfire/SimplePhpApiDoc/Elements/PropertyElement.md)
        - [TraitElement](./spaceonfire/SimplePhpApiDoc/Elements/TraitElement.md)
    - Interfaces
        - [ElementDecoratorInterface](./spaceonfire/SimplePhpApiDoc/Elements/ElementDecoratorInterface.md)
        - [ElementInterface](./spaceonfire/SimplePhpApiDoc/Elements/ElementInterface.md)
        - [ElementVisibilityInterface](./spaceonfire/SimplePhpApiDoc/Elements/ElementVisibilityInterface.md)
        - [MethodOwnerInterface](./spaceonfire/SimplePhpApiDoc/Elements/MethodOwnerInterface.md)
        - [PropertyOwnerInterface](./spaceonfire/SimplePhpApiDoc/Elements/PropertyOwnerInterface.md)
- [\spaceonfire\SimplePhpApiDoc\Elements\Collections](./spaceonfire/SimplePhpApiDoc/Elements/Collections)
    - Classes
        - [MethodsCollection](./spaceonfire/SimplePhpApiDoc/Elements/Collections/MethodsCollection.md)
        - [NamespacesCollection](./spaceonfire/SimplePhpApiDoc/Elements/Collections/NamespacesCollection.md)
        - [PropertiesCollection](./spaceonfire/SimplePhpApiDoc/Elements/Collections/PropertiesCollection.md)
        - [TraitsCollection](./spaceonfire/SimplePhpApiDoc/Elements/Collections/TraitsCollection.md)
    - Interfaces
        - [FilterableByVisibilityCollectionInterface](./spaceonfire/SimplePhpApiDoc/Elements/Collections/FilterableByVisibilityCollectionInterface.md)
    - Traits
        - [FilterableByVisibilityCollectionTrait](./spaceonfire/SimplePhpApiDoc/Elements/Collections/FilterableByVisibilityCollectionTrait.md)
- [\spaceonfire\SimplePhpApiDoc\Elements\DocBlockResolver](./spaceonfire/SimplePhpApiDoc/Elements/DocBlockResolver)
    - Classes
        - [BaseDocBlockResolver](./spaceonfire/SimplePhpApiDoc/Elements/DocBlockResolver/BaseDocBlockResolver.md)
        - [ClassDocBlockResolver](./spaceonfire/SimplePhpApiDoc/Elements/DocBlockResolver/ClassDocBlockResolver.md)
        - [MethodDocBlockResolver](./spaceonfire/SimplePhpApiDoc/Elements/DocBlockResolver/MethodDocBlockResolver.md)
        - [PropertyDocBlockResolver](./spaceonfire/SimplePhpApiDoc/Elements/DocBlockResolver/PropertyDocBlockResolver.md)
- [\spaceonfire\SimplePhpApiDoc\Renderers](./spaceonfire/SimplePhpApiDoc/Renderers)
    - Classes
        - [BaseRenderer](./spaceonfire/SimplePhpApiDoc/Renderers/BaseRenderer.md)
    - Interfaces
        - [RendererInterface](./spaceonfire/SimplePhpApiDoc/Renderers/RendererInterface.md)
- [\spaceonfire\SimplePhpApiDoc\Renderers\Markdown](./spaceonfire/SimplePhpApiDoc/Renderers/Markdown)
    - Classes
        - [MarkdownHelper](./spaceonfire/SimplePhpApiDoc/Renderers/Markdown/MarkdownHelper.md)
        - [MarkdownRenderer](./spaceonfire/SimplePhpApiDoc/Renderers/Markdown/MarkdownRenderer.md)

---

This file automatically generated by [Simple PHP ApiDoc](https://github.com/spaceonfire/simple-php-apidoc)

repository: spaceonfire/simple-php-apidoc

gha_language: PHP

repo_name: spaceonfire/simple-php-apidoc


text:
# Ubuntu

> Ubuntu is a free and open-source Linux distribution based on Debian. Ubuntu is officially released in three editions: Desktop, Server, and Core for the internet of things devices and robots. All the editions can run on the computer alone, or in a virtual machine.

## Introduction

- 📖 [Initial Server Setup with Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04)

## Things to Know

- 📖 [How to use pbcopy on Ubuntu](https://garywoodfine.com/use-pbcopy-on-ubuntu/)

## Nginx

- 📖 [How To Install Nginx on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04)

- 📖 [How To Secure Nginx with Let's Encrypt on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04)

- 📖 [How To Set Up Password Authentication with Nginx on Ubuntu 14.04](https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-nginx-on-ubuntu-14-04)

repository: hirajanwin/awesome-bootstrappers

repo_name: hirajanwin/awesome-bootstrappers


text:
# Sinderella

[![Build Status](https://travis-ci.org/Integralist/Sinderella.png?branch=master)](https://travis-ci.org/Integralist/Sinderella) [![Gem Version](https://badge.fury.io/rb/sinderella.png)](http://badge.fury.io/rb/sinderella) [![Coverage Status](https://coveralls.io/repos/Integralist/Sinderella/badge.png)](https://coveralls.io/r/Integralist/Sinderella)

Ruby gem which will allow authors to pass a code block to transform a data object for a specific period of time.

Note I created this repo and all the code under the name "Cinderella" but it later transpired that the name was already taken and although the project owner has officially abandoned it I'm not able to take over the gem name...

> nope, pick a new name. If anyone cares about it in 3 years I'll hand it over.

So I decided to rename the project and publish the gem under the title of Sinderella instead.

## Installation

Add this line to your application's Gemfile:

    gem 'sinderella'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sinderella

## Usage

```ruby
require 'sinderella'

data = { :key => 'value' }
till_midnight = 60 # 1 minute

id = Sinderella.transforms(data, till_midnight) do |data|
  data.each do |key, value|
    data.tap { |d| d[key].upcase! }
  end
end

puts Sinderella.get(id) # => { :key => 'VALUE' }

# we'll randomly reset the data before the time expires...
if (rand() * 2).to_i == 1
  puts "Resetting data early"
  Sinderella.midnight(id)
end

sleep 10

# if reset early     == { :key => 'value' }
# if not reset early == { :key => 'VALUE' }
puts Sinderella.get(id)

sleep 60

# time has expired by this point so == { :key => 'value' }
puts Sinderella.get(id)
```

## Contributing

1. Fork it ( http://github.com/Integralist/Sinderella/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: pbrudny/Sinderella

repo_name: pbrudny/Sinderella


text:
---
layout: guide
title: Connecting to Kuri
category: getting-started
tags:
- SSH
---

## Goal
The goal of this guide is to allow you to connect to Kuri for the first time.

## Getting Kuri on WiFi
Connecting Kuri to WiFi happens during the onboarding process through the app.  During the process you are asked to enter your WiFi credentials so that the app can send the information to Kuri through BlueTooth.

The first step is to create an account through the OSRF hosted cloud or run Kuri on the local network only.
![](/assets/images/getting-started/Screenshot_Kuri_20181008-132348.png)

![](/assets/images/getting-started/Screenshot_Kuri_20181008-132402.png)

The next few steps guide you through turning Kuri on and setting up the dock properly.
![](/assets/images/getting-started/Screenshot_Kuri_20181008-132835.png)

![](/assets/images/getting-started/Screenshot_Kuri_20181008-132851.png)

![](/assets/images/getting-started/Screenshot_Kuri_20181008-132858.png)

![](/assets/images/getting-started/Screenshot_Kuri_20181008-132904.png)

Through bluetooth the phone looks for Kuri and, if more than one is found, will allow you to select the Kuri to connect to.
![](/assets/images/getting-started/Screenshot_Kuri_20181008-132937.png)

![](/assets/images/getting-started/Screenshot_Kuri_20181008-132946.png)

Once connected to your Kuri through bluetooth, the WiFi connection page lets you send the WiFi credentials to Kuri so that he too can be online.  If Kuri connects but complains that it can't talk to the internet, please just try connecting again.

![](/assets/images/getting-started/Screenshot_Kuri_20181008-133033.png)

After this is completed, the app connects to Kuri so that the rest of setup can be finished.  These steps include creating a map of the house, and learning to control him through the app.

![](/assets/images/getting-started/Screenshot_Kuri_20181008-133104.png)

## Finding Kuri's hostname
Kuri's hostname is based upon the serial number of the robot which is printed on the box as well as on the bottom of the robot.  The hostname is built with a base `kuri-0000` with the addition of the last numbers and letters from the serial number.

For example, if Kuri's serial number is `KR118160000abc`, the hostname is `kuri-0000abc`.

During the onboarding process, the searching for robots step only returns one result since only one Kuri is around.  This should be your Kuri and it will report the hostname of the robot.

## Finding Kuri's IP address
Once Kuri is online, it is possible to find his IP address.  This can be useful if it is not possible to use the hostname to connect to Kuri remotely due to the network setup.

#### Linux command line
Through the Linux command line it is possible to find the IP addresses of computers on the network.  The program `nmap` allows your computer to search through the network and find other computers which respond.  Run the program as follows using your own IP address as the starting point.

```bash
host:~$ sudo nmap -sn <IP_ADDRESS>/24
```

Results should come back as a long list with a Kuri showing up similar to this:
```bash
Nmap scan report for kuri-0000abc.dev.mayrobo.com (<IP_ADDRESS>)
Host is up (0.21s latency).
MAC Address: 03:02:92:4H:E3:B6 (Aaeon Technology)
```

#### Android/iOS
Fing is a free app for Android or iOS which allows users to scan the network for devices.  It is one of many apps which allow users to check on their network status.  The documentation on how to use the app and find devices can be found in the [Fing docs](https://help.fing.io/knowledge-base/how-use-fing-app/).

## Connecting to Kuri over SSH
Kuri is running an SSH server to allow users to connect remotely through a terminal.  Once Kuri is set up on WiFi and the hostname is determined, it is time to try and connect through a computer.

> The default username on Kuri is `mayfield` and the default password is `freekuri`.

```bash
host:~$ ssh mayfield@kuri-0000abc
```

When connecting for the first time to Kuri over SSH, the output should be similar to this:
```bash
host:~$ ssh mayfield@kuri-0000abc
The authenticity of host 'kuri-0000abc (<IP_ADDRESS>)' can't be established.
ECDSA key fingerprint is SHA256:0000000000000000000000000000000000000000000.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'kuri-0000abc' (ECDSA) to the list of known hosts.
DISCLAIMER: By logging in or accessing this system you agree to the terms of
            use and licensing restrictions supplied in the Robot Recipient
            Agreement. In addition, by accessing this system you acknowledge
            that any modifications to the software or configuration on this
            system incur risk that could render this system unstable or
            unusable which you are solely responsible for.

mayfield@kuri-0000abc's password:
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 4.4.13-mayfield x86_64)

 * Documentation:  https://help.ubuntu.com/
mayfield@kuri-0000abc:~$
```

At this point you are now within the home folder of the mayfield user on Kuri.

## Setting up passwordless SSH
Passwordless SSH is a method to allow users to connect to a remote machine without typing in the password each time.  This method of connecting to a remote host is more secure since the security keys are harder to break than a username/password combination.  The following steps generate an RSA key and set up Kuri to accept the key as authentication rather than using the password.  Users need the hostname and username/password pair for Kuri to properly set up the connection.

This is a common method for connecting to a remote host over a Linux terminal.  If something doesn't work with this guide, using Google can provide a wide array of information on the subject.

#### Step 1
Generate an RSA key pair on the local machine.  Accepting the default parameters when prompted is not a problem.
```bash
host:~$ ssh-keygen
```

#### Step 2
Copy the public SSH key onto Kuri.  This is a special SSH program that runs locally to securely copy the public portion of the key onto the Kuri.
```bash
host:~$ ssh-copy-id mayfield@kuri-0000abc
```

#### Step 3
SSH into Kuri to test the setup.  If everything is correct, the output should be similar to that shown in the [Connecting to Kuri over SSH](#connecting-to-kuri-over-ssh) section.
```bash
host:~$ ssh mayfield@kuri-0000abc
```

#### Step 4 (optional)
An SSH configuration file located on the local machine at `~/.ssh/config` defines connections which can be given aliases to hide the details of the connection.  Below is an example to connect to Kuri as configured above.

```
Host kuri
  HostName kuri-0000abc
  User mayfield
```

Setting up the ssh configuration file as so will allow users to connect to Kuri with the following line
```bash
host:~$ ssh kuri
```

## Troubleshooting

#### Could not resolve hostname
If trying to SSH into Kuri results in an error such as
```
ssh: Could not resolve hostname kuri-00000abc: Name or service not known
```
there could be two issues.  One is that the computer and Kuri are not on the same network and cannot see each other.  Two is that the network cannot resolve hostnames into IP addresses and the kuri hostnames given above need to be replaced with the specific IP address of Kuri.

#### Remote Host Identification has changed
If the network is mapping Kuri IP addresses into hostnames, sometimes it happens that the specific IP address of your Kuri changes between connections over SSH.  When this happens, an error like this occurs:
```bash
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:0000000000000000000000000000000000000000000.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/user/.ssh/known_hosts:37
  remove with:
  ssh-keygen -f "/home/user/.ssh/known_hosts" -R "kuri-0000abc"
ECDSA host key for kuri-0000abc has changed and you have requested strict checking.
Host key verification failed.
```
If you trust this network, this is probably benign and you can run the `ssh-keygen` line as suggested and try reconnecting to Kuri.  If you are unsure, please contact your system administrator and confirm the changes which have occurred.

repository: cjwilliams/Kuri-Documentation

repo_name: cjwilliams/Kuri-Documentation


text:
Homework evaluation rubric:

- [ ] Correctly implement get_data with an exception if the URL does not exist. (Hint: Try downloading the file using urllib3 (1 pt)
- [ ] Correctly implement remove_data (1 pt)
- [ ] Implement tests for get_data that consider the following cases: (a) file is present locally; (b) file is not present locally, and the URL points to a file that exists; and (c) URL does not point to a file that exists. Achieve 100% coverage with the tests. (1 pt)
- [ ] Correctly implement tests for remove_data.  Achieve 100% coverage with the tests. (1 pt)
- [ ] Use correct PEP8 coding style and generate a clean `pycodestyle` report (1 pt)

gha_language: Shell


text:
---
title: Flowers For Algernon
playwright: Daniel Keyes
adaptor: David Rogers
period: Spring
season: Fringe
season_sort: 260
date_start: 2016-03-07
date_end: 2016-03-08
venue: Sherwood Library

assets:
  - type: poster
    image: mc5KfV7

cast:
 - role: Charlie
   name: Miguel Barrulas
 - role: Alice Kinnian
   name: Alice Simmons
 - role: Professor Nemur
   name: Ben Dillon
 - role: Dr Strauss
   name: Robert Goodall
 - role: Alberta
   name: Darcey Graham

crew:
 - role: Director
   name: Emily Sterling
 - role: Producer
   name: Eden Phillips Harrington
 - role: Production Assistant
   name: Shannon Moffatt
 - role: Design Assistant
   name: Josh Mallalieu
 - role: Technical Director
   name: Andrew Calverley
 - role: Lighting Designer
   name: Joseph Heil
 - role: Sound Designer
   name: Nathan Penney
 - role: Poster Designer
   name: Beth Wilson

prod_shots: 6DNrjz
---

Told through a series of journal entries, Flowers for Algernon is the story of Charlie Gordon, an adult with learning difficulties, who takes part in an experimental medical trial to raise his IQ. Charlie’s story is paralleled with Algernon, the lab mouse who is the successful model of the treatment. As Charlie’s IQ begins to rise he grows both mentally and emotionally but his growth is unsustainable and before too long, he becomes more isolated than he ever was before. This play asks questions about innocence and disability, and whether it is right for scientists to play God.

repository: nt-user/history-project

repo_name: nt-user/history-project


text:
# Torrent Worker
This module was created for use in [**Powder Player**](https://github.com/jaruba/PowderPlayer), it is a wrapper of [peerflix](https://github.com/mafintosh/peerflix).

It's purpose is to launch `peerflix` in a node.js enabled web worker, clone the important parts of it's `engine` object back in the main thread, and keep this information updated.

This is an important task as `torrent-stream` can be heavy on the main thread.

**This module does not use the latest version of peerflix, it uses a personal fork of it and other forked dependencies.**

(although it should work with the latest version too, I haven't tried)

## Install

```
npm install workerjs
npm install torrent-worker
```

Yes, add these 2 separately, even in `package.json`, it's the only way to make sure the relative path to `worker.js` will be correct.

## Options

```
{
                          // All the torrent-stream options:
    connections: 100,     // Max amount of peers to be connected to.
    uploads: 10,          // Number of upload slots.
    tmp: '/tmp',          // Root folder for the files storage.
                          // Defaults to '/tmp' or temp folder specific to your OS.
                          // Each torrent will be placed into a separate folder under /tmp/torrent-stream/{infoHash}
    path: '/tmp/my-file', // Where to save the files. Overrides `tmp`.
    verify: true,         // Verify previously stored data before starting
                          // Defaults to true
    dht: true,            // Whether or not to use DHT to initialize the swarm.
                          // Defaults to true
    tracker: true,        // Whether or not to use trackers from torrent file or magnet link
                          // Defaults to true
    trackers: [
        'udp://tracker.openbittorrent.com:80',
        'udp://tracker.ccc.de:80'
    ],
                          // Allows to declare additional custom trackers to use
                          // Defaults to empty
    storage: myStorage(), // Use a custom storage backend rather than the default disk-backed one
    port: 4593,           // Default peer port

                          // Torrent Worker specific options:
    noSeeding: '1',       // defaults to null (always seed), '1' means stop seeding when download has completed
    withResume: true      // defaults to false, if set to true it will also the download event for verified pieces too
}
```

## Usage

```
var torrentWorker = require('torrent-worker');

// every time you use 'new torrentWorker' it will start a new web worker
// try to always kill unneeded workers and keep a low number
// of simultaneous workers at a time
var worker = new torrentWorker();

var engine = worker.process(torrent, options);

// do whatever you want with the engine

engine.on('listening', function() {
    console.log('the streaming link: http://localhost:' + engine.server.address().port);
});

engine.on('download', function(piece) {
    console.log('downloaded piece: ' + piece);
});

engine.on('ready', function () {
    console.log('torrent is ready');
    console.log('infoHash: ' + engine.infoHash);
    console.log('download path: ' + engine.path);
    console.log('torrent name: ' + engine.torrent.name);
    console.log('total length: ' + engine.torrent.length);
    console.log('files: ' + engine.files);
    console.log('nr of pieces: ' + engine.torrent.pieces.length);

    // select file with index 1 to be downloaded:
    // engine.selectFile(1);

    // don't download file at index 0:
    // engine.deselectFile(0);
});

var printInfo = setInterval(function() {
    console.log('connected to ' + engine.swarm.wires.length + ' peers');
    console.log('uploaded ' + engine.swarm.uploaded + ' bytes');
    console.log('upload speed is ' + engine.swarm.uploadSpeed + ' bytes/second');
    console.log('download speed is ' + engine.swarm.downloadSpeed + ' bytes/second');
}, 1000);
```

## Stopping Workers
At the end of a kill action the worker will be automatically terminated as well.

As simultaneous workers can be used, you do not need to wait for a worker to be killed in order to start a new one.

```
// terminates a worker and removes all downloaded files

engine.kill(function() {
   console.log('engine has been killed');
});

// terminates a worker and does not removes the downloaded files

engine.softKill(function() {
   console.log('engine has been killed');
});
```

repository: jaruba/torrent-worker

repo_name: jaruba/torrent-worker


text:
## Object oriented programming

In Java everything has to be contained in a class, no matter how simple the program.

### Object oriented concepts

An object has a state and a behaviour. They can be made up of other objects.
Fields (variables) store a state. Methods (functions) expose behaviour.
Data encapsulation is hiding an object's state by requiring users to use its methods.
A class is an object blueprint. Objects are instances of a class.
Inheritance is how classes inherit common fields and methods from a superclass (parent). Each class can have
only a single superclass.
Interface is a group of related unimplemented methods.
Package is a group of related classes and interfaces.

### Class

A class is a merger of a data structure and functions associated with that data. A class models an object
in the real world. Classes act like blueprint from which objects are instantiated (created).
Classes have fields (variables) and methods (functions).
When a class is created, a data type of the same name is also created.
A class inherits from another by using the "extends" keyword.

### Object

An object is instantiated (created) from a class. Objects can invoke methods and access fields.

### Fields

Classes have fields in which they store data. Fields can belong to an object (instance variables,
non-static fields) or to a class (class variables, static fields). Class variables are shared across
all objects of the same class.

### Visibility

Visibility keywords determine who can access a method or a field.

| Modifier | Class | Package | Subclass | World | Explanation |
| :--- | :---: | :---: | :---: | :---: | :--- |
| public | Y | Y | Y | Y | everyone |
| protected | Y | Y | Y | N | classes who inherit or are in the package |
| no modifier | Y | Y | N | N | same class or classes in the package |
| private | Y | N | N | N | only the same class can access it |

### Methods

Methods are function which perform operations on data.
It is common to set a field to private and to then make setter (mutators) and getter (accessors)
methods who will change the data in the private fields. Getters should always try to return either just
the data or a new object and should never return the reference to a private field (because then a
field can be changed by accessing its reference).

### Constructor method

Constructors are methods who share the same name as the class. They are invoked when an object is
instantiated from a class.

### Overriding methods

All classes inherit some other class. Classes who don't explicitly inherit any other class inherit a
generic Java class called Object. Inherited methods such as equals and toString often get overridden with a
more specific and more appropriate method. Inherited methods are overridden if the inheritor class has a
method of the same name. Overridden methods are manually marked with @Override.

### Hiding methods

Imagine that a child class inherits from a parent class and then a child object is created. Assume a child
has a static method of the same name as the parent class. If the child object is stored in a variable whose
reference is that of a parent class, invoking the child's static method will instead invoke the parent's
static method. This is called hiding.

### Overloading methods

When two methods share the same name within the same class, but have different method signatures, they are
said to be overloaded. When invoking these methods the more appropriate one will be called.

### Static and final

Fields marked with the keyword static belong to a class (class variables). If any object changes a
static field, it changes for all other objects belonging to the same class as well.
Fields without the keyword static are unique to an object (instance variables).
Methods marked with the keyword static can be invoked by a class as well as an object. Static methods can
be hidden by reference upon inheritance.
Methods without the keyword static can be overridden by an inheritor.
A static block is a block of statements executed after field declarations.

Fields marked with the keyword final cannot be changed.
Methods marked with the keyword final cannot be overridden or hidden.
Classes marked with the keyword final cannot be inherited.

Fields and methods can be marked with both final and static keywords. Final decides if they can be changed
while static says to whom they belong.

### Inheritance

Classes can inherit another class. You can only inherit from a single class. When a class inherits another,
it gains the other classes' fields and methods. The inheritor class (child class) can override methods
of the inherited class (parent class) if it not marked with static. If a method is marked with static, it
can be hid. Inheriting, overriding, hiding and object/reference difference is demonstrated in the .java file.

### Abstract

The purpose of abstract classes is to make the inheritor class implement an abstract method.
Classes can be marked with the keyword abstract. Objects cannot be created from abstract classes. A class
can be abstract even if it has implemented all of its methods.
Methods that are not implemented have to be marked with the keyword abstract. If a class has at least one
abstract method, it has to be marked with the keyword abstract.

### Interface

Interface is similar to an inherited class only interfaces are implemented. If a class implements an
interface it has to implement all of its methods. An interface can already have some methods implemented.
When a class implements an interface it makes a contract that it will have all the interface's methods.
To implement an interface use the "implements" keyword.

### Difference between an interface and an abstract class

When a class implements an interface it has to implement all of its methods, while a class that extends an
abstract class can be abstract itself and can keep the abstract methods unimplemented.

### Summary

Object, state, behaviour, field/variable, method, signature, data encapsulation, class, instance, inheritance, interface, package.
Visibility, belonging, static, final, public, private, protected, no modifier.
Constructor, destructor, overriding, overloading, hiding.
Abstract.

repository: MrOakenShield/Knowledge-Repository

repo_name: MrOakenShield/Knowledge-Repository


text:
# Multi-Robot Collaborative Dense Scene Reconstruction (SIGGRAPH 2019)
We provide the implementation of the optimal-mass-transport algorithm tailored for collaborative scanning along with virtual scan examples, on top of ROS.

# Requirements
This package depends on OpenCV, CGAL and OctoMap. Please install these libraries first.

# Download and Installation
```
catkin_ws/src$ git clone https://github.com/siyandong/CoScan.git
catkin_ws$ catkin_make_isolated
```

# Run
roslaunch virtual_scan simulator.launch

roslaunch virtual_scan data_sever.launch

rosrun co_scan co_scan

# Citation
If you use this code for your research, please cite our paper:
```
@article{dong2019multi,
  title={Multi-robot collaborative dense scene reconstruction},
  author={Dong, Siyan and Xu, Kai and Zhou, Qiang and Tagliasacchi, Andrea and Xin, Shiqing and Nie{\ss}ner, Matthias and Chen, Baoquan},
  journal={ACM Transactions on Graphics (TOG)},
  volume={38},
  number={4},
  pages={84},
  year={2019},
  publisher={ACM}
}
```

repository: siyandong/CoScan

repo_name: siyandong/CoScan


text:
# flowfield
An interactive flow field simulation made in Godot.

### Features

* Save resulting images in 4K.
* Microphone/OGG input, the simulation reacts to rhythms by changing the colors, speed, size and adherence to flow field.
* Full control over noise generation, can be combined/replaced with imported images.
* Unlimited amount of emitters and attractors.
* Permissive MIT license.

 [Short video of the application in action.](https://streamable.com/rdaroj) (Streamable.com)

### This is what the interface looks like:

![Screenshot 0](/screenshots/0.png)

### Examples:

![Screenshot 1](/screenshots/1.png)
![Screenshot 2](/screenshots/2.png)
![Screenshot 3](/screenshots/3.png)

repository: NiclasEriksen/flowfield

repo_name: NiclasEriksen/flowfield


text:
# Docker Build

To build the firmware using docker, follow the following steps:

```
git clone https://github.com/openmv/openmv.git --depth=50
cd openmv/docker
make TARGET=<TARGET NAME>
```

After building you should see the target build output under `docker/build/<TARGET_NAME>`.

## Testing HTTP POST/GET

In order to test HTTP POST and GET request, you can use the following docker image to setup a test web server that can accept POST and GET requests:

```
docker run -v $PWD/images:/tmp/nginx_upload/ -e HOST_UID=$UID -e HOST_GID=$GID --name nginx-requests -d -p 80:80 -p 443:443 openmvcam/nginx-requests:v0.1.0
```

This will run an nginx web server and any image POSTed to the server will be saved within the container in /tmp/nginx_upload and on your host at the <current_directory>/images

## POST Requests

The web server accepts requests to both http and https with following URI `/upload`, and uses the following basic authentication:

```
user: admin
password: testadmin
```

Examples for post requests can be found at `scripts/examples/OpenMV/14-WiFi-Shield/http_post.py`.

## GET Requests

The web server accepts requests to both http and https with following URI `/images`.

## Deleting The Server

After finishing testing, you can stop or delete the container simply by running:

```
docker stop nginx-requests
docker rm nginx-requests
```

Note that even after deleting the container you will still find $PWD/images directory on your system.

repository: openmv/openmv

gha_language: C

repo_name: openmv/openmv


text:
---
title:  Crumb CORS Token Disclosure
author:  Marcus Stong
module_name: crumb
publish_date: Mon Aug 1 2014 09:40:57 GMT-0700 (PST)
cves: "[]"
vulnerable_versions: "<3.0.0"
patched_versions: ">=3.0.0"
...

## Overview
When CORS is enabled on a hapi route handler, it is possible to set a crumb token for a different domain. An attacker would need to have an application consumer visit a site they control, request a route supporting CORS, and then retrieve the token. With this token, they could possibly make requests to non CORS routes as this user.

A configuration and scenario where this would occur is unlikely, as most configurations will set CORS globally (where crumb is not used), or not at all.

## Recommendations
Update to a version 3.0.0 or greater.

## References
- https://github.com/spumko/crumb/commit/5e6d4f5c81677fe9e362837ffd4a02394303db3c

repository: grnd/nodesecurity-www

gha_language: JavaScript

repo_name: grnd/nodesecurity-www


text:
[![PyPI version](https://badge.fury.io/py/opentargets-validator.svg)](https://badge.fury.io/py/opentargets-validator)

[![Build Status](https://travis-ci.org/opentargets/validator.svg?branch=master)](https://travis-ci.org/opentargets/validator)

[![codecov](https://codecov.io/gh/opentargets/validator/branch/master/graph/badge.svg)](https://codecov.io/gh/opentargets/validator)

[![Docker Repository on Quay.io](https://quay.io/repository/opentargets/validator/status "Docker Repository on Quay.io")](https://quay.io/repository/opentargets/validator)

# opentargets-validator

Evidence string validator.

## Purpose

This tool is intended to validate JSON files that have a single JSON object per line. This is the format that is required from the [data sources](https://docs.targetvalidation.org/data-sources/data-sources) that provide us with evidence for our target-disease associations.

The validator will check the expected structure, look for missing objects, flag disease IDs that do not start as EFO and Orphanet ID, among other assessments.

Be aware that this is *not* a general-purpose JSON validator, and use of "pretty-printed" JSON will cause errors.

## How to install it

```sh
pip install opentargets-validator
```

## How to use it

You have two options
- read from a stdin file (_piped_ one)
- pass as a positional argument and use a zipped or gzipped file (optional)

### Read from stdin

```sh
cat file.json | opentargets_validator --schema https://raw.githubusercontent.com/opentargets/json_schema/master/src/literature_curated.json
```
All log messages will be redirected to _stderr_.

### Read from positional argument

Filename extensions could be `.[json|json.zip|json.zip]`

Using this option you could use these uri formats
- http[s]://file/location/name.json
- file://relative/local/file.json
- file:///absolute/file.json
- location/file.json

```sh
opentargets_validator --schema https://raw.githubusercontent.com/opentargets/json_schema/master/src/literature_curated.json https://where/myfile/is/located.json
```

### How many lines do you want to get printed?

Using the parameter `--log-lines 100`, `opentargets_validator` will accumulate up to
100 lines and then it will exit.

## How to develop it

Within a [virtualenv](https://virtualenv.pypa.io/en/latest/) you can install with:

```sh
pip install -e .[dev]
```

and you can run the tests with:

```sh
pytest --cov=opentargets_validator --cov-report term tests/ --fulltrace
```

This repository has [Travis integration](https://travis-ci.com/opentargets/validator) and [CodeCov integration](https://codecov.io/gh/opentargets/validator) .

Releases are put on [PyPI](https://pypi.org/project/opentargets-validator).

repository: deniseOme/validator

repo_name: deniseOme/validator


text:
# Welcome to my Weather Map

First things first, check your current weather forecast from  [my map](https://jwparker1797.github.io/WeatherMap/map.html).

As you will find, there are a few layers that show interesting weather data including: radar, current temperatures, weather watches and warnings, and a current snow depth.  I have also added a forecast tool that can be used by putting your location in the search bar.

Below I will outline some of the code I used to accomplish this web map.

## Layers

Before making the app, I went to the NWS (National Weather Service) GIS service endpoints and found the layers (and URL's) I wanted to use.  An example of how I added one of the layers is shown below.

```javascript
var watchesWarnings = new MapImageLayer({
        refreshInterval: 15,
        url: "https://idpgis.ncep.noaa.gov/arcgis/rest/services/NWS_Forecasts_Guidance_Warnings/watch_warn_adv/MapServer",
        sublayers: [{
            id: 1,
            popupEnabled: true,
            popupTemplate: watchWarnPopupTemplate,
            title: "Watches/Warnings"
        }],
        title: "Watches/Warnings"
    });

map.add(watchesWarnings);
```

## Widgets

Widgets are a crucial element of web maps.  For this weather map, I included a bunch of great widgets.

The widgets placed on the map include a handful of default ArcGIS API widgets like zoom, a basemap toggle, a fullscreen button, and a search bar used to get a location that is then sent to the NWS API which pulls a forecast.

There are a few widgets placed in the accordian menu on the left side of the app that include a layer list (with visibility switches), a legend, and my custom forecast widget.

Below you will see the code for the search bar widget and how it interacts with my forecast widget.

```javascript
    var searchBar = new Search({
        view: view,
        resultGraphicEnabled: false,
        popupEnabled: false
    });
    view.ui.add(searchBar, "top-right");

    searchBar.on("search-complete", function(event) {
        var searchExtentCenter = event.results[0].results[0].extent.center;
        getForecast(searchExtentCenter.longitude, searchExtentCenter.latitude, event.results[0].results[0].name);
    });

    var getForecast = function(x, y, place) {
        var Http = new XMLHttpRequest();
        var url = "https://api.weather.gov/points/" + y + "," + x + "/forecast";
        Http.open("GET", url);
        Http.send();
        Http.onreadystatechange = function() {
            var forecastPane = document.getElementById("ForecastPane");

            if (this.readyState == 4 && this.status == 200) {
                var forecastData = JSON.parse(Http.responseText);
                var forecastProperties = forecastData.properties;
                accordionContainer.selectChild("ForecastPane", true);
                forecastPane.innerHTML = "<h3>" + place + "</h3><br>";
                forecastProperties.periods.forEach(function(fp) {
                    forecastPane.innerHTML += "<img src=" + fp.icon + "><br><b>" + fp.name + "</b>: <p style='font-size:12px'>" + fp.detailedForecast + "</p><br><br>";
                });
            } else if (this.readyState == 4 && this.status == 404) {
                forecastPane.innerHTML = "Location not found.  Forecasts are only available for locations in the United States.";
            }
        };
    };
```

If you have had a chance to try out the map, you may have noticed there are pop-ups.  Pop-ups are actually a widget, and can include custom information by using a pop-up template.  Below you will see how I create pop-ups for the watches/warnings layer.

```javascript
    var watchWarnPopupTemplate = new PopupTemplate({
        title: "{prod_type}",
        content: "Issued: {issuance}<br>Expires: {expiration}<br><a href={url}>More Info</a>"
    });

    var watchesWarnings = new MapImageLayer({
        refreshInterval: 15,
        url: "https://idpgis.ncep.noaa.gov/arcgis/rest/services/NWS_Forecasts_Guidance_Warnings/watch_warn_adv/MapServer",
        sublayers: [{
            id: 1,
            popupEnabled: true,
            popupTemplate: watchWarnPopupTemplate,
            title: "Watches/Warnings"
        }],
        title: "Watches/Warnings"
    });
```

## Side Menu

In the previous example, you may have noticed I was referencing an accordian container.  This is a menu that acts like a slinky and it comes directly from dojo (dijit to be exact).  Inside the accordian container, there are content panes which are just div's, so these can contain anything a normal div would, like widgets!  Below you can see how I created the container menu and content panes.

```javascript
    var accordionContainer = new AccordionContainer({
        style: "height: 100%",
    }, "sideBar");

    accordionContainer.addChild(new ContentPane({
        title: "Layers",
        content: layerList
    }));
```

### Check out more of my work

Hope you enjoyed this guide to my weather map.
Go to my [page](https://jwparker1797.github.io/) to check out more of my work.


text:
# MyLink

MyLink is a platform to store all of your links in one place.

## Installing dependencies

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install dependencies.

## Mac/Linux:

```bash
pip3 install -r requirements.txt
```

## Windows:

```bash
pip install -r requirements.txt
```

## Running the app

```bash
cd app
python3 app.py
```

## File Structure

#### env - Virtual Environment

#### app - Directory that contains main app files

#### app/templates/ & app/static/ - Frontend files

#### app/\*.py - Python files

## Contributing

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

## License

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

branch_name: refs/heads/main


text:
# Hippo

```text
fontawesome-6/Solid/Hippo
```

```text
include('fontawesome-6/Solid/Hippo')
```

| Illustration | Hippo |
| :---: | :---: |
| ![illustration for Illustration](../../fontawesome-6/Solid/Hippo.png) | ![illustration for Hippo](../../fontawesome-6/Solid/Hippo.Local.png) |

## Sprites
The item provides the following sriptes:

- `<$HippoXs>`
- `<$HippoSm>`
- `<$HippoMd>`
- `<$HippoLg>`

## Hippo

### Load remotely
```plantuml
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution"

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('fontawesome-6/bootstrap')

' loads the Item which embeds the element Hippo
include('fontawesome-6/Solid/Hippo')

' renders the element
Hippo('Hippo', 'Hippo', 'an optional tech label', 'an optional description')
@enduml
```

### Load locally
```plantuml
@startuml
' configures the library
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../.."

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('fontawesome-6/bootstrap')

' loads the Item which embeds the element Hippo
include('fontawesome-6/Solid/Hippo')

' renders the element
Hippo('Hippo', 'Hippo', 'an optional tech label', 'an optional description')
@enduml
```

repository: tmorin/plantuml-libs

repo_name: tmorin/plantuml-libs


text:
Bookmanager

The problem:

	We have a number of distributed documentation written by
	different groups and organizations and users. Although we can
	put an html link up with the collection Students, researchers,
	tutorial participants can benefit from a tool that integrates
	all of them into a single Document and not just a collection
	of links. This allows for a “book” like distribution of the
	content written by various people and hosted on various and
	GitHub repositories.

	In our case it also serves as a mechanism for generating class
	proceedings of reports developed by students so they can take
	them “home” after they did the class.

The solution

	We have a simple tool called bokmanager that creates an epub
	of documents specified in a yaml table of contents. The
	documents will be fetched from the url, the images downloaded
	and an epub generated. This epub (if not to big) can than be
	browes not only on your computer, but also on your iPads and
	cell phones, so you can add them to your book collection

Source

	https://pypi.org/project/cyberaide-bookmanager/
	https://github.com/cyberaide/bookmanager

Sample yaml file

    https://github.com/cyberaide/bookmanager/blob/master/tests/python.yml

Summary of Benefit

	* Simple to use
	* leverages pandoc, so more formats in future will be
	* supported
	* pulls together information from several sources
	* auto generated title page
	* epub

repository: cyberaide/bookmanager

gha_language: Python

gha_license_id: NOASSERTION

repo_name: cyberaide/bookmanager


text:
# Test::Redef ![Build Status](https://secure.travis-ci.org/nearbuy/test-redef.png?branch=master)

Replace methods with test code, get feedback on how they are called
and put it all back together when your test is done.

## Examples

``` ruby
require 'test/unit'
require 'test/redef'

class Example < Test::Unit::TestCase
  def test_redef
    now = Time.at(1375654620).utc
    Test::Redef.rd(
      'Time.now' => proc { now },  # replace with the given proc
      'Time#sunday?' => :wiretap,  # instrument existing implementation
      'Kernel#raise' => :empty,     # replace with empty proc
    ) do |rd|
      assert( Time.now.sunday? )
      assert_nothing_raised { raise ArgumentError }

      assert_equal( [[ArgumentError]], rd[:raise].args )
      assert_equal( 1, rd[:sunday?].called )
      assert( rd[:now].called? )
    end
  end
engsd
```

## Support

Please report issues at https://github.com/nearbuy/test-redef/issues

## See Also

* https://metacpan.org/module/Test::Resub
* https://metacpan.org/module/Test::Wiretap

## License

Copyright (c) 2013, Nearbuy Systems, Inc
All rights reserved.

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

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

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

repository: belden/test-redef

repo_name: belden/test-redef


text:
# JC Calendar

[![Netlify Status](https://api.netlify.com/api/v1/badges/690f0adc-a331-45e4-a71e-e5c07a12c4b3/deploy-status)](https://app.netlify.com/sites/adoring-gates-ebbba7/deploys)

For the live app [click here](https://adoring-gates-ebbba7.netlify.app/).

This is a simple calendar app where you can add reminders for a specific date/time and city.

## Development

### Installing Dependencies

You will need [Node.js](https://nodejs.org/en/) (v12+) to start and build this project.

Also will need to run the following command in order to install the project's dependencies before running other commands:

```bash
npm install
```

### Running in Development Mode

To start the project simply run:

```bash
npm start
```

This will start a [webpack](https://webpack.js.org/) development server that will serve the built web app. It also includes hot-reloading for live updates when you save a file.

If you want to use the forecast functionality you'll need to add the API key as follows:

```bash
REACT_APP_FORECAST_API_KEY=api_key_value npm start
```

If you are a _Windows_ user, open a [PowerShell](https://github.com/PowerShell/PowerShell) window and run:

```powershell
$env:REACT_APP_FORECAST_API_KEY="api_key_value"; npm start
```

You will need to replace `api_key_value` for the actual key.

> You can find more about the API and get a key at [https://www.weatherapi.com/](https://www.weatherapi.com/).

### Running Tests

```bash
npm test
```

This will start jest, which will run tests when tests changes or files that are being used for testing changes.

### Creating a Production Build

If you are on a _Unix_ based system, run:

```bash
NODE_ENV=production npm run build
```

If you are a _Windows_ user, open a [PowerShell](https://github.com/PowerShell/PowerShell) window and run:

```powershell
$env:NODE_ENV="production"; npm run build
```

> You can also set `NODE_ENV` as an environment variable in any way you would with any other variable, or you can also just omit it.
>
> Please note that if `NODE_ENV` is not set to `production`, some files will **not** be optimized.
>
> You will still need to set `REACT_APP_FORECAST_API_KEY` as mentioned in [Running in Development Mode](#running-in-development-mode), if you wish to use the forecast API functionality.

## Technologies

### React

Builds the view layer of the web app.

### Redux

Store's the app's data and acts as it's single source of truth. Is also responsible for predictable state changes through actions.

### Redux Saga

A Redux middleware that will handle async actions as well as complex actions, acting as a process manager.

> [https://redux-saga.js.org/](https://redux-saga.js.org/)

### Tailwind.css

The CSS framework of the web app. It is a utility-first CSS framework.

> [https://tailwindcss.com/](https://tailwindcss.com/)

## Licence

This project is provided under the [MIT License](./LICENSE.md).

repository: zipi-shtrasberg/exmple

repo_name: zipi-shtrasberg/exmple


text:
[comment]: <> (

Filename: YYYY-MM-DD-<any name>.md
    The name of the file does not appear anywhere

)

---
layout: post
title: McKinsey Analytics Online Hackathon
published: false
---

[comment]: <> (This is a comment, it will not be included)

[comment]: <> (Code block)
{% highlight r %}

{% endhighlight %}

[comment]: <> (example of link to pictures - save in separate folder for each post)
[comment]: <> (makes it easier to manage per post)
![_config.yml]({{ site.baseurl }}/images/2017-12-02/photo.png

{% include image.html file="/images/2017-12-02/wprts_mtry_5-13_analysis.png" description="This is an image." %}


text:
# Supported tags and respective `Dockerfile` links

-	[`latest`, `0.3.3` (*Dockerfile*)](https://github.com/ewindisch/docker-cirros/blob/5ef3f5024b0aa80553cc34be9eff6685cb31b458/Dockerfile)

For more information about this image and its history, please see the [relevant manifest file (`library/cirros`)](https://github.com/docker-library/official-images/blob/master/library/cirros) in the [`docker-library/official-images` GitHub repo](https://github.com/docker-library/official-images).

# What is CirrOS?

CirrOS is a Tiny OS that specializes in running on a cloud.

> [launchpad.net/cirros](https://launchpad.net/cirros)

![logo](https://raw.githubusercontent.com/docker-library/docs/master/cirros/logo.png)

# Supported Docker versions

This image is officially supported on Docker version 1.5.0.

Support for older versions (down to 1.0) is provided on a best-effort basis.

# User Feedback

## Issues

If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/ewindisch/docker-cirros/issues).

You can also reach many of the official image maintainers via the `#docker-library` IRC channel on [Freenode](https://freenode.net).

## Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/ewindisch/docker-cirros/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

repository: balena-io-library/docs

repo_name: balena-io-library/docs


text:
---
layout: post
title: Happy 2022! Love your limits
---

To all 10 of my blog readers, a very late (albeit still joyous) Happy New Year!
It has certainly been ages since my last blog post. 6 months, can you believe that?

Life has improved greatly since being employed with the State of Alaska - Department of Natural Resources as of August 2021. Sadly though my time and attention to this blog was lost.

In addition to adjusting to my new 40 hour work weeks, I am also finding how to use my limited free time. I've done some digital painting and rewarded myself with some video games. I do weightlifting or calisthenics every so often. But most of all I've just been enjoying the cold Winter of Alaska, surprisingly.

I turned 26 last November. I bought my family Christmas presents, and was happy to do so.

And then 2022 arrived.

But before getting into that, let's take a look at 2021 in recap.

January 2021 - Arrive in Washington, with plans to join the Army. I began applying to different jobs in the meantime. One of these was Per Scholas' Full-Stack Application Development Manager course, with a guaranteed Infosys interview at the end of 15 weeks.

February 2021 - May 2021 - Full Stack ADM course, full time. Experiment with Artificial Intelligence and Machine Learning. Began micro-investing in the stock market.

May 2021 - Move to Alaska, enrolled for a semester at UoPeople, and began job searching again. Get rejected from Infosys and Pendo.io. Applied to Apple and Google apprenticeships, but didn't even receive rejection letters. :(

July 2021 - Receive a job offer from State of Alaska

August 2021 - Began work with the Department of Natural Resources.

And everything since then has been a bit of a blur. In October, due to the Coronavirus Pandemic I switched to working from home full time. Now in January, we are back to the office.

# Programming / Art

At work I've been mostly focused on .NET Core MVC, Entity Framework, Microsoft SQL Server, and a small portion of Python.

I've been wanting to improve in Javascript but that is particularly slow. I have made a few simple things in Vue.js and began working on some MERN stack tutorials.

I haven't done much with Machine Learning or Artificial Intelligence for the last few months.

I've been reading a bit more. My booklist includes *Surely You're Joking, Mr. Feynman!*, *Einstein's Fridge*, and *4000 Weeks: Time Management for Mortals*. I only read when there's time and it feels appropriate.

The books I finished last year include *Atomic Habits* and *How to Live* by Derek Sivers.

And just today I got accepted into a Per Scholas Alumni course offering, Google's UX/UI Design course on Coursera. So that will be a 6 month undertaking on top of work.

Below, you can see a painting that took me months. I started it in about July, working on it every few weeks when I felt the urge.

It's only now, months later, that I feel it's 90% finished. I say that because I'm still testing out different ideas with this painting :)

![Humming-Maria](https://user-images.githubusercontent.com/10329673/149835179-50bacfc4-9b38-400f-9eaf-b3627ec60d51.png)

# Lessons learned from 2021

Family is important, as long as the relationships are healthy.

Otherwise, a little distance is beneficial.

Mental and Spiritual Health has a lot to do with feeling secure within yourself. Having a job and the financial means to support yourself is one of the most peace-of-mind things you can do, more beneficial than all the hours of reading, meditation and careful planning combined.

We are limited. In skill, in what we can accomplish, in stamina, in emotion, and in time. We are limited. Acknowledge that we are imperfect, human, beings and it's more than just ok to be who you are.

**Love your limits.**

Ambitions are not to be taken lightly. I have learned this year that we can become addicted to over-work and accomplishment, just like alcohol or gambling.

It is not accomplishing our goals that satisfies us. It's the pride of moving towards those goals. It's the emotional feedback after all our effort starts to show tidbits and pieces of the results we seek.

Chasing on-top-of-the-world emotions is a factor for all addictions, and I've learned including addiction to ambition is no different.

So choose balance instead. Clock out, and be proud of it. Take forever and a day for personal projects. Go out and enjoy a meal at a new restaurant, watch a movie, and play some video games.

Don't dedicate solely to work and ambitions. The present moment is all we have.

Use it freely.

Thank you for your patience.

Love from the Pacific North West

Chris


text:
# R on github

This project uses githubs code and repository api to collect information about
all github repositories that use R.

## Getting the data

Getting all repo data is a two step process:

* `1a-search.r` runs searches to find all R language repos. Searches are done by
  month to overcome the current search API limits, and are cached in the
  `cache/` directory

* `1b-repos.r` takes each repo found by the search and creates a list with 5
   components:

  * `info`: general information about the repository.
    http://developer.github.com/v3/repos/#get

  * `lng`: languages used in the repo.
    http://developer.github.com/v3/repos/#list-languages

  * `dir`: a directory listing of all files and directories in the repo root.
    http://developer.github.com/v3/repos/contents/#get-contents

  * `desc`: if a `DESCRIPTION` file is found, the result of parsing that
    file with `read.dcf` and converting into a list

  * `tags`: any tags used by the repo.
     http://developer.github.com/v3/repos/#list-tags

  The data on each repo is cached in `cache-repo/`.

To update repos for the current month, `source("1a-search.r")`, then
`source("1b-repos.r")`. You'll need to set your github user name and password
into environment variables `GITHUB_USER` and `GITHUB_PASS`. All requests are
appropriately throttled to stay within github's rate limits - this means that
downloading all repo info from scratch will take a number of hours.

## Exploring the data

If you just want to use the already cached data, see `2-languages.r` and
`2-packages.r` for example exploratory analyses.

repository: albertotb/r-on-github

repo_name: albertotb/r-on-github


text:
# cerke_noter
![language:Kotlin](https://img.shields.io/badge/language-Kotlin-orange.svg) ![license:MIT](https://img.shields.io/badge/license-MIT-blue.svg)
Android app which takes score of the cerke game.

## Requirement
Android 4.4+ (Kitkat+)

## Feature
- Can transcribe score by tapping the grids, pieces, buttons, and spinner.
- Can go back by tapping upper textView.
- By tapping `Enter` button when lower textView shows no chars, app generates `.txt`file after some questions.
- `.txt`file is saved on `storage/emurated/0/Android/data/com.example.cerkenoter/files/Documents`.
- This `.txt`file can be treated as if this is a `.json`file.


text:
# Python Flask App to present finn.no data.

This app uses the data stored by #finnazureflaskapp. On load, it queries the Azure Storage Blob for data and presents a
graphical representation. It also shows the overall data collected from finn in the tables below.

The app has two views: List view and map view. User can select between these views. Uses google maps api to fetch the geocode location of the address and then marks and displays the google maps.

It displays the following:

Graph
1. Statistics of realestates added.
2. Statistics of realestates sold.

Reports
1. Realestates added that day.
2. Price Changes for the same house.
3. Houses sold on that day.
4. Visnings added.

DEPLOYMENT

The app is now deployed on google cloud.
Browse link: http://<IP_ADDRESS>:9871/

Sample Graph

![alt text](https://github.com/Soumya117/finnDisplay/blob/master/Selection_140.png)

![alt text](https://github.com/Soumya117/finnDisplay/blob/master/Selection_141.png)

![alt text](https://github.com/Soumya117/finnDisplay/blob/master/Selection_142.png)

![alt text](https://github.com/Soumya117/finnDisplay/blob/master/Selection_143.png)


text:
---
title: osgi.enroute.rest.api
layout: service
version: 1.0
summary: Provides REST end-points that are based on method naming pattern with type safe use of the pay-load, parameters, and result body.
---

![REST Service](/img/services/osgi.enroute.rest.overview.png)

## Introduction

The OSGi enRoute REST API specifies a service contract for components to provide REST _end-points_. Representational State Transfer (REST) is an architectural style that allows the interchange of information between elements of a distributed system. A REST end-point has an HTTP(S) URL and can thus be accessed from all modern computing environments. An end-point defines the meaning of the segments of this URL, any specified parameters in the URL, as well as the used HTTP verb (GET, PUT, POST, etc). For example:

	GET /rest/upper/<word>?alphaonly=true

This end-point is mapped to the URI `/rest/upper` and the next segment specifies the word to translate to upper case. The `alphaonly` is a _parameter_ on the URL, in this case a boolean.

A HTTP request can specify a _payload_, a payload can be associated with the `POST` and the `PUT` verb. As response, the HTTP request will return a _body_.

Since the REST API is of such major importance for many modern systems, it is crucial that the overhead for the programmer to support this interface is absolutely minimized. This specifications leverages the Java type system to provide REST end points. It provides a deterministic mapping from a URI request to a REST method name of a restricted set of methods. Adding a method named according to a defined pattern is all that is required to add a new REST end-point.

## REST Methods

A REST class will make every public method that starts with `get`, `post`, `put`, `option`, `delete` available as a REST endpoint. The remainder of the method name and the parameters define the remainder of the URI. These methods can be POJO or take a special object providing the context. For example:

	public String getUpper() {
		return "UPPER";
	}

The first parameter of a REST method can be be an interface that is or extends the `RESTRequest` interface. This interface provides access to the underlying servlet objects as well as the host name. However, these objects are rarely needed; the primary purpose of this interface is to be extended with methods that have the name of the URL arguments. The interface does not have to be public, it can be a private interface of a class. That is, the previous example would need an interface defined as:

	interface UpperRequest extends RESTRequest {
		String upper();
	}

	public String getUpper( UpperRequest rq ) {
		return rq.upper().toUpperCase();
	}

Any return type can be used for the REST methods that is supported by the DTOs service conversion techniques.

Any remaining segments in the URI are mapped to the parameters of the method. These method parameters are not required to be strings. Any parameter type that can be converted from a string according to the DTO conversion techniques can be used. The REST method can either have a fixed number of parameters or it can use varargs for a variable number.

	public String getUpper(String lower) {
		return lower.toUpperCase();
	}

The returned body is defined by the method's return type. In general, this type is converted to a JSON file according to the DTO JSON conversion rules. All Java's basic types and all DTO's can be used as return types.

Since REST requests are always copied (they have to move to another process) it is allowed to return original copies; the REST implementation must not modify the returned objects in any way.

Therefore, the previous example can be defined as:

	@Component
	public class UpperApplication implements REST {

		interface UpperRequest extends RESTRequest {
			boolean alphaonly();
		}

		public String getUpper( UpperRequest request, String string ) {
			return string.toUpperCase();
		}
	}

Assuming a default root of `/rest`, this will provide a REST end-point of the earlier example URL `GET /rest/upper/<word>?alphaonly=true`.

## Extra Conversions for the Body

Certain return types of the REST method are not mapped to JSON but are treated differently. These are the special conversions:

* `InputStream` – Will be copied directly to the output.
* `File` – The File contents will be copied to the output.
* `byte[]` – The content of the byte array will be copied to the output
* `null` – Nothing will be copied to the output. The method could have used the servlet objects to send output for rare cases.

If the content type has not been set by the method then the default MIME type will be `application/octet-stream` for these conversions.

## Pay-loads

`POST` and `PUT` URLs carry a pay-load from the client to the server. For this specification this pay-load must be expressed as a JSON body (`application/json;charset=UTF-8`). No other type of bodies are allowed.

The Java type of the pay-load is defined by the return type of the `_body()` method on the request parameter of the REST method. The incoming JSON pay-load is mapped to this return type following the JSON DTO conversion rules.

For example, a system has to handle people, so there is a (we know, simplistic) Person record.

	public class Person extends DTO {
		publci String id;
		public String name;
		public String middle;
		public String surname;
		public int birthYear;
	}

In REST protocols, the `PUT` verb would be used to store a new person. To create the proper end-point, we can define the following REST method.

	interface PersonRequest extends RESTRequest {
		Person _body();
	}

	Person putPerson( PersonRequest request ) {

		// authorization

		Person p = request._body();

		// augment
		// validate
		// persist, set id

		return p;
	}

## Exceptions

Since the REST methods provide full type safe access to the parameters and remaining URL segments a significant amount of validation is executed by the implementation of this service. These validations will result in the appropriate HTTP error and status code. Implementation should also add explanatory texts to the response.

Additionally, the REST methods may throw any exception, if an exception is thrown it is also translated to an HTTP error code. The conversions from exception to status code is as follows:

* File Not Found Exception – 404 NOT FOUND
* Security Exception – 403 FORBIDDEN

All other exceptions are translated to a 500 SERVER ERROR error code.

Clients can always set the response of the request through the servlet objects that are available on the RESTRequest arguments. However, this should in general be a last resort since most incompatibilities are caused by the sometimes really subtle interpretations of these error codes. In general it is best to try to make requests binary: succeed when all goes OK and fail in all other cases.

## Example

There is an example project in [the OSGi enRoute examples repository][1]. This project implements the different GET, POST, PUT, and DELETE methods and shows how to get the arguments from the path and the query parameters.

<footer>This example was donated by Chuck Boecking</footer>

## Discussion

*   **Couldn't we just annotate a service with a service property and then have it automatically extended regardless the service interface?**

The issue is that you cannot just convert a service since a service in general has NO defenses against attacks. I think it is quite crucial to realize that any method in that class is open for external calls from anywhere in the world. The work you need to do to make this work secure dwarfs the fact that you must implement an interface … Not just on the security, I find that the way you create this facade is often without any real functionality, it is often just an orchestrator. It checks the authority and then calls other services, potentially with the current user as parameters. In this model the JSONRPC and REST services are just securing and orchestrating. This allows the other services to be very cohesive since they know they do not have to worry about security and get the user as parameter instead of having to link in the current user model.

## Configuration

Implementations must follow the PID `osgi.enroute.rest` which must support at least the following fields:

* `org.osgi.service.http.servlet.pattern` – The primary end-point

[1]: https://github.com/osgi/osgi.enroute.examples/tree/master/osgi.enroute.examples.rest.application

branch_name: refs/heads/gh-pages

gha_language: CSS


text:
# struct literal

A struct literal denotes a newly allocated struct value by listing the values of its fields.
You can list just a subset of fields by using the Name: syntax. (And the order of named fields is irrelevant.)
The special prefix & returns a pointer to the struct value.

```
var (
	z1 = xy{1, 2}  // has type xy. z1={1,2}
	z2 = xy{X: 1}  // Y:0 is implicit z2={1,0}
	z3 = xy{}      // X:0 and Y:0 z3={0,0}
	p  = &xy{1, 2} // has type *xy  p={1,2}
)
```

[Go Playground](https://play.golang.org/p/P5whnHh57Zn)
```
package main

import "fmt"

type xy struct {
	X, Y int
}

var (
	z1 = xy{1, 2}  // has type xy
	z2 = xy{X: 1}  // Y:0 is implicit
	z3 = xy{}      // X:0 and Y:0
	p  = &xy{1, 2} // has type *xy
)

func main() {
	fmt.Println(z1, p, z2, z3)
}
```

repository: dhiemaz/gopherlabs

repo_name: dhiemaz/gopherlabs


text:
Installation:

* Build the service.
* Copy the binaries to location on monitoring machine (example would be c:\ntp).
* Create the service:
	* sc create NtpMonitor binpath= c:\ntp\MonitoringService.exe start= auto
* Create the registry keys or alternatively, use the Example.reg as a template.
	* HKLM\System\CurrentControlSet\Services\NtpMonitor\Config
	 	* BasePath REG_SZ "C:\ntp\logs"
	 	* BasePath REG_SZ "C:\ntp\resolverlogs"
* Create directories for logs
* Create directories for resolverlogs

Generating Data from logs:

Setup each machine you want to monitor.  Restart of service is not required.

* HKLM\System\CurrentControlSet\Services\NtpMonitor\Servers
	* NtpServer1 REG_SZ ""

To run a report:
* Create a directory for you work
* Change to that directory
* Create a text file, serverlist.txt, which contains a list of servers you want to monitor.
* GenerateGraphs.ps1 .\serverlist.txt c:\ntp\logs 7
	Generates graph for the last 7 days, default is 1 day.
* Review data in Graph subdirectory


text:
# Zerolingo

### Scripts for farming xp on Duolingo spanish by spamming stories.
> *What do you mean "This isn't doing your homework"?*

#### This is a mini-project with a cringetastic name that I'm doing to help me practice my C# skills, learn more about web protocol, and learn how to use puppeteer *and definitely not to do my homwework for me or anything.*

Essentially, this app is suuper simple.  It logs into to Duolingo with your provided login, collects a list of all of the available story lessons, then just loops through the list and autocompletes them.  Although the efficiency varies, it can farm about **1200 XP per hour**, depending on how long it takes to complete each lesson.

This app uses [.NET 5.0](https://dotnet.microsoft.com/download/dotnet/5.0) and is written in C#.  The provided [releases](https://vividuwu/zerolingo/releases) are built to be *self contained* meaning that they bundle the .NET runtime and libraries needed to run the app, in the event that the user doesn't have .NET installed.  This does cause a slightly larger download, but the overall size is only ~30Mb, which is pretty manageable.
> This app uses the [Puppeteersharp](https://github.com/hardkoded/puppeteer-sharp) API to communicate with the Chromium instance via [Chrome Dev Tools](https://developer.chrome.com/docs/devtools/).

## Usage

In the [realeases](https://github.com/vividuwu/releases) on the Github repo, you can download the most recent release, depending on whether or not you are running Windows 10 or some form of Linux OS.
> The releases only have prebuilt versions for AMD64 systems, so if running on a x32 or ARM system, you can use Dotnet's CLI or Visual Studio to compile an executable for your architecture.

#### Disclaimer
Even though it may be tempting, having a lot of interactions with other windows on the desktop while the bot is running can sometimes cause unexpected crashes, so preferably, just leave it to run and don't touch your pc while it's running.

### Windows
Download the latest [release](https://github.com/vividuwu/zerolingo/releases) for Windows (10) and unzip the file.  Within the zip are all of the libraries required for the app to run (.dll files) and the executable itself (Zerolingo.exe).  Because the file name starts with a *Z*, it is at the bottom of the folder in the file explorer view.  Just run the file, and if a Windows Smart Screen popup appears, click "More Info" then "Run Anyway" to run the app. (This happens because I am not a verified publisher, so Windows automatically flags the software as potentially unsafe.)  After that, the program should run and begin downloading Chromium, just follow the on screen instructions in the console and spend your newly acquired freetime elsewhere!
#### DISCLAIMER FOR WINDOWS USERS!!!
If on Windows, when the program runs, [occasionally it may pause execution due to the Windows Console's Quick Mode feature.](https://dev.to/mhmd_azeez/why-my-console-app-freezes-randomly-and-i-need-to-press-a-key-for-it-to-continue-44h9)  If this happens (The program feels like it should be doing something, and it's not), then just select (focus) the command prompt window, and click any key.

### Linux
Download the latest [release](https://github.com/vividuwu/zerolingo/releases) for Linux and unzip the file.  This can be done with the "unzip" utility with the following command:
```bash
$ unzip Zerolingo-X.X.X-LinX64.zip
```
Once this is done, open up the directory and find the 'Zerolingo' executable.  Make sure that it is flagged as executable with the following command:
```
$ chmod +x ./Zerolingo
```
After this, just run it, either by double clicking in a UI (Ie. Dolphin) or running
```
$ ./Zerolingo
```
It should either start in the terminal you opened it or create a new window and begin downloading Chromium, just follow the on screen instructions in the console and spend your newly acquired freetime elsewhere!

## Exiting the Program
There is no built-in way to exit the program while it is running, so to do so, you will need to first issue an interupt signal to the terminal/command line where it is running by entering CTRL+C (Maybe a few times) this should terminate the process.  If the Chromium window is still open after this, just manually close it like you would any other window.

## Features

- Logs into Duolingo from terminal.
- Handles login both for accounts that were authenticated with Google and those that weren't.
- Collects a list of the user's available story lessons.
- Loops through the list of lessons.
- Spams through the lesson.
- Brute forces the matching tokens by clicking them in a random order extremely quickly. (Stupid but it works lol)

### Planned

- ~~Loop throught a list of stories, as provided in a JSON file.~~
- ~~Toggleable debug view (Runs Chromium with UI)~~
- Handle incorrect logins


text:
# Azure Web Apps Deno Deploy action

This action deploys a Deno app to Azure Web Apps (Linux).

## Inputs

### `app-name`

**Required** Name of the Azure Web App.

### `resource-group`

**Required** Name of the resource group.

### `package`

**Required** Path to zip package to deploy.

### `script-file`

**Required** Path to the script file to pass to `deno run`.

### `deno-version`

**Optional** Deno version to use (default: `latest`).

## Outputs

None

## Example usage

```yaml
on: [push]

name: Deploy to Azure

jobs:

  build-and-deploy:
    runs-on: ubuntu-latest
    steps:

    - uses: actions/checkout@v2

    - uses<EMAIL_ADDRESS>      with:
        creds: ${{ secrets.AZURE_CREDENTIALS }}

    - name: Set up Deno
      uses: denolib/setup-deno@master
      with:
        deno-version: 1.x

    - name: Bundle and zip Deno app
      run: |
        deno bundle server.ts server.bundle.js
        zip app.zip server.bundle.js

    - name: Deploy to Azure Web Apps
      uses: anthonychu/azure-webapps-deno-deploy@master
      with:
        app-name: my-app
        resource-group: my-resource-group
        package: app.zip
        script-file: server.bundle.js
        deno-version: "1.0.2"
```

## How it works

This action configures an Azure Web App for Linux to use a [custom runtime image](https://hub.docker.com/r/anthonychu/azure-webapps-deno) and deploys your code using [Run From Package](https://docs.microsoft.com/azure/azure-functions/run-functions-from-deployment-package).

It calls the Azure CLI. Ensure your workflow first calls `azure/login`.

---

*This is a community open source project. No official support is provided by Microsoft.*

repository: SalehAlbuga/azure-webapps-deno-deploy

repo_name: SalehAlbuga/azure-webapps-deno-deploy


text:
# Class Queue

This class implements the functionality of a queue it will allow to retain all requests into an in memory queue so:

- it is possible to change the message flow status between open / pause / close
- it allows to prevent loss of messages and registrations when the flow is paused
- it allows the requesting party to be released as soon the message arrives
- it allows to prevent loos of messages if the throughput is to high

## Functionality
This class is responsible for holding the arriving message and queue it so we can keep the order of delivery while we
can pause the system for any reason. Every queued message will be associated with an id that will live with the
message until it dies.

### Adding a message
This class allows the addition (queue) of a message by using the method `add`.

``` js
let q = new Queue()
let messageId = q.add({...})
```

### Getting a message
In order to get the message and its information we must request by the queued message id.

``` js
let messageFromQueue = q.get(messageId)
```

### Cancelling
This class also allows the cancellation of a message by providing the message Id.

``` js
let q.cancel(messageId)
```

### Next message
One of the main purpose of this class it to provide a mechanism to get the next message in the queue while removing it.

``` js
q.next()
```

repository: impulsesjs/impulses

branch_name: refs/heads/dev

repo_name: impulsesjs/impulses


text:
### [CVE-2003-0693](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0693)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

A "buffer management error" in buffer_append_space of buffer.c for OpenSSH before 3.7 may allow remote attackers to execute arbitrary code by causing an incorrect amount of memory to be freed and corrupting the heap, a different vulnerability than CVE-2003-0695.

### POC

#### Reference
- http://lists.grok.org.uk/pipermail/full-disclosure/2003-September/010135.html

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# Coder Configure

## Description

This directory contains an example [image](./Dockerfile.ubuntu) and
[configure](./configure) script. The configure script is used to add
[`nvm`](https://github.com/nvm-sh/nvm) to a Coder environment.

## How To Use It

If an image contains an executable script located at `/coder/configure`, it is
automatically detected and executed by Coder environments during the build
process.

## Further Reading

Our support site contains
[a tutorial](https://help.coder.com/hc/en-us/articles/360055782794-Configuring-Your-Environment-on-Startup)
on Coder Configure.

repository: ntimo/enterprise-images

repo_name: ntimo/enterprise-images


text:
# MyBlog

## Description

This is a simple CRUD blogging website created using PHP.

## Table of Contents

* [Installation](#installation)
* [Usage](#usage)
* [Finished Project](#finished-project)
* [Credits](#credits)
* [License](#license)

## Installation

There is no installation required to use this application. However, you do need to create a MySQL database called `myblog`, copy the content inside of `seeds.sql`, and run the copied content in your client of choice (I used phpMyAdmin).

## Usage

The user must first create an account to publish the first post. After this, they can view all posts on the home page, manage posts in the my posts page, and make more accounts if they please.

Instead of running locally, the application can also be ran here:
 * [MyBlog](https://kai-myblog.herokuapp.com/)

## Finished Project

![MyBlog](https://user-images.githubusercontent.com/67942678/125381751-712ce580-e362-11eb-93f7-0ab75a297509.png)

## Credits

* [PHP](https://www.php.net/)

## License

MIT License

© 2021, Kai Reid

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

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

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