text:
# Terraform::AWS::Route53HealthCheck

Provides a Route53 health check.

## Properties

`ReferenceName` - (Optional) This is a reference name used in Caller Reference
(helpful for identifying single health_check set amongst others).

`Fqdn` - (Optional) The fully qualified domain name of the endpoint to be checked.

`IpAddress` - (Optional) The IP address of the endpoint to be checked.

`Port` - (Optional) The port of the endpoint to be checked.

`Type` - (Required) The protocol to use when performing health checks. Valid values are `HTTP`, `HTTPS`, `HTTP_STR_MATCH`, `HTTPS_STR_MATCH`, `TCP`, `CALCULATED` and `CLOUDWATCH_METRIC`.

`FailureThreshold` - (Required) The number of consecutive health checks that an endpoint must pass or fail.

`RequestInterval` - (Required) The number of seconds between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health-check request.

`ResourcePath` - (Optional) The path that you want Amazon Route 53 to request when performing health checks.

`SearchString` - (Optional) String searched in the first 5120 bytes of the response body for check to be considered healthy. Only valid with `HTTP_STR_MATCH` and `HTTPS_STR_MATCH`.

`MeasureLatency` - (Optional) A Boolean value that indicates whether you want Route 53 to measure the latency between health checkers in multiple AWS regions and your endpoint and to display CloudWatch latency graphs in the Route 53 console.

`InvertHealthcheck` - (Optional) A boolean value that indicates whether the status of health check should be inverted. For example, if a health check is healthy but Inverted is True , then Route 53 considers the health check to be unhealthy.

`EnableSni` - (Optional) A boolean value that indicates whether Route53 should send the `Fqdn` to the endpoint when performing the health check. This defaults to AWS' defaults: when the `Type` is "HTTPS" `EnableSni` defaults to `true`, when `Type` is anything else `EnableSni` defaults to `false`.

`ChildHealthchecks` - (Optional) For a specified parent health check, a list of HealthCheckId values for the associated child health checks.

`ChildHealthThreshold` - (Optional) The minimum number of child health checks that must be healthy for Route 53 to consider the parent health check to be healthy. Valid values are integers between 0 and 256, inclusive.

`CloudwatchAlarmName` - (Optional) The name of the CloudWatch alarm.

`CloudwatchAlarmRegion` - (Optional) The CloudWatchRegion that the CloudWatch alarm was created in.

`InsufficientDataHealthStatus` - (Optional) The status of the health check when CloudWatch has insufficient data about the state of associated alarm. Valid values are `Healthy` , `Unhealthy` and `LastKnownStatus`.

`Regions` - (Optional) A list of AWS regions that you want Amazon Route 53 health checkers to check the specified endpoint from.

`Tags` - (Optional) A mapping of tags to assign to the health check.

## See Also

* [aws_route53_health_check](https://www.terraform.io/docs/providers/aws/r/route53_health_check.html) in the _Terraform Provider Documentation_


text:
Y

Deleting cluster istio-workshop...done.
Deleted [https://container.googleapis.com/v1/projects/srecon19-workshop-250603/zones/europe-west1-b/clusters/istio-workshop].
```

## Delete Redis instance

```
gcloud redis instances delete redis-cart --region=$REGION_ID
```

branch_name: refs/heads/master

extension: md

gha_language: CSS

license_type: permissive


text:
---
id: 530
title: I Spot Transfort MAX Buses
date: 2016-03-08T20:04:32+00:00
author: Tyler Green
layout: post
guid: http://www.tyleragreen.com/blog/?p=530
permalink: /blog/2016/03/i-spot-transfort-max-buses/
categories:
  - Adventures
tags:
  - bus spotting
  - fort collins
  - transfort
---
If you wanted to see pictures of all six eight nine Transfort MAX buses, you are in luck! Please join me as we tour the fleet of North American Bus Industries vehicles. And no, I'm not the first person to practice bus spotting.

Aside: please raise your hand if you were also worried upon discovering the first verb in the first sentence on NABI's Wikipedia page is in past tense. "NABI Bus, LLC (NABI) **was** a designer and producer of heavy-duty transit buses…" The NABI brand was discontinued in 2014 (the year the MAX opened) and its plants will now produce buses for its parent brand, New Flyer. I hope NABI spare parts were not also discontinued.

## MAX 79

    MAX 79 departing the South Transit Center. Bus 79 was my last bus to spot and I was getting anxious. Calmer pictures to follow!

## MAX 80

    MAX 80 at the South Transit Center. This AM-sunlit platform would be clutch during my season of bus spotting.

## MAX 81

    A northbound MAX 81 crossing Olive on Mason. Again, not a bus portrait studio, but necessary for completion. This intersection would serve me well in the future…

## MAX 82

    MAX 82, also northbound at Olive and Mason. I couldn't have produced this motion panning effect even if I tried! And I definitely didn't. (See MAX 81.) Let's say I was hoping to produce a neat "we're going places" effect for a Transfort promotional.

## MAX 83

    MAX 83 back at the sun-soaked South Transit Center. This is the only known photo of my shadow with a MAX bus. Except for the other three in this set I cropped it out of.

## MAX 84

    MAX 84 at the…you guessed it…South Transit Center with a…you guessed it…tumbleweed. #colorado

## MAX 102

    MAX 102 at the South Transit Center on a day where the snow tainted its usually-pristine livery. MAX 103 peeps in from the rear. Buses 102 and 103 were ordered after the other six, which explains the gap in the fleet numbers.

## MAX 103

    MAX 103 at the South Transit Center on the same sloppy morning. Doesn't that sky just look cold? Bus 103 is currently the highest-numbered in the Transfort fleet.

And, a bonus…

## MAX 89: "MiniMAX"

    MAX 89 at the South Transit Center. Notice the lack of articulation? Because this is MiniMAX! The articulated buses are not run in the snow and this 40′ replacement is the only (that I know of) non-articulated bus with the MAX livery. It was an unexpected treat to watch the snow fall through a backwards "max" during this ride!

If you're wondering what kind of idyllic bus world the image below is from, the answer is Adobe Lightroom. Doesn't this better-than-real image make you want to go ride a bus?

I'll see you there.

**Ride on!**

license: MIT

gha_license_id: MIT


text:
---
layout: post
title:  "Working with multiple Git identities"
date:   2017-02-26 00:00:00 +0000
categories: "ALM"
tags:
    - git
    - ssh
    - vsts
---

I recently rebuilt my Mac Book Pro - appears OSX also benefits from a spring
clean every now and then. When attempting to clone a Git repo hosted on Visual Studio
Team Services (VSTS) I was hitting an authentication error.

```bash
$ git clone ssh://account@account.visualstudio.com:22/DefaultCollection/TeamProject/_git/repo
Cloning into 'repo'...

Your Git command did not succeed.
Details:
	Public key authentication failed..

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```

> NOTE: All references to `account` should be replaced with your VSTS account name.

## Git Authentication

Let's backtrack slightly. On my Windows machine I use the [Git Credential
Manager for
Windows](https://github.com/Microsoft/Git-Credential-Manager-for-Windows) which
can be installed as part of the [Git for Windows
installer](https://git-scm.com/download/win). This authenticates with VSTS and
creates a PAT (Personal Access Token) for accessing. There is an equivalent
[credential manager for Mac and
Linux](https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux)
but this requires installing an additional package so I decided to use SSH.

## SSH Keys

VSTS has some good [step by step
instructions](https://www.visualstudio.com/en-us/docs/git/use-ssh-keys-to-authenticate)
on using SSH to authenticate.

I already had an SSH key for GitHub (`~/.ssh/github_rsa`) - I think this was
created by the [GitHub Desktop app](https://desktop.github.com). Rather than
create a new SSH key in the default location `~/.ssh/id_rsa` I opted to create
one mirroring the naming of the GitHub one, `~/.ssh/vsts_rsa`. As this is not
the default identity we need to make [SSH aware of
it](https://www.visualstudio.com/en-us/docs/git/use-ssh-keys-to-authenticate#how-can-i-use-a-non-default-key-location-ie-not-sshidrsa-and-sshidrsapub-)
using `ssh-add`. You can verify that the key is registered using `ssh-add -l`.

At this point I expected to clone the repo and begin work, but not so fast. This
was the point I received the error at the start of this post.

Following the information in the VSTS docs, I tested the [SSH connection without
a Git
command](https://www.visualstudio.com/en-us/docs/git/use-ssh-keys-to-authenticate#how-can-i-test-my-ssh-connection-without-running-a-git-command).

```bash
ssh -T<EMAIL_ADDRESS>```

That test worked successfully, so Git was not using the SSH key.

The answer, to create an ssh config. After reading [this
post](http://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/)
I ended up with a config like below:

```
Host github.com
    User git
    HostName github.com
    IdentityFile ~/.ssh/github_rsa
Host account.visualstudio.com
    User account
    HostName account.visualstudio.com
    IdentityFile ~/.ssh/vsts_rsa
```

I use multiple VSTS accounts and this set-up allows for each account to be easily added.

## Different user name and email

With authentication handled there was one small item left to deal with, the name
and email associated with a commit. While not a big problem between my personal
VSTS account and GitHub I did want different values for work accounts. After
quite a bit of reading (this
[post](https://orrsella.com/2013/08/10/git-using-different-user-emails-for-different-repositories/)
dives into a lot of detail on options), I opted to use the `useConfigOnly` option
and force name and email to be specified per repository.

```bash
git config --global user.useConfigOnly true
```

gha_language: SCSS


text:
Bullring
========

Bullring is a ruby gem for safely running untrusted Javascript code.  Javascript
is the bull you want to watch but would like to protect yourself from.

Features
--------

* Runs the Javascript code in a separate process (`:rhino` runtime only)
* Lets you limit how long the untrusted code can run (`:rhino` runtime only)
* Uses therubyrhino to provide safe execution (though does not require your app to run on jruby)
* Pre-verifies the code by running it through JSLint
* Minifies the code for increased performance

Note that the `:racer` runtime option still runs JS safely but doesn't have the separate process and timeout features.  This runtime was added because in some production environments, the `:rhino` runtime option leads to instability that has not yet been debugged.  If you want to chat about this, drop me a line.

Requirements
------------

* When using the `:rhino` runtime, requires that rvm is available and that jruby has been installed through rvm (note that the rest of your code does NOT need to run on jruby).  Options for an rvm-less use are definitely conceivable, so if you have this need let's talk.

Usage
-----

(Coming soon)

Contributing
------------

(Coming soon)

Caveats
-------

Bullrings have been around a long time to keep bulls contained, but all users
should note that bulls [have gotten out before](http://tgr.ph/9tXxbc).  It is our
sincere hope that Bullring can protect you from bad side effects when running
untrusted code.  However, Javascript is a full-blown language and Bullring is and
contains open source software; both can have security holes, so you are urged
to be prudent when using Bullring in your application (see MIT-LICENSE for more details).
If you find a security hole, please let us know or contribute a patch.

Copyright
---------

Bullring is Copyright 2012 Kindling Labs, LLC.  See MIT-LICENSE for more details.

repository: kindlinglabs/bullring

repo_name: kindlinglabs/bullring


text:
# lilToon
Version 1.0

# Overview
This shader is developed for services using avatars (VRChat, etc.) and has the following features.
- Easy to use (One-click settings from presets, Saving your own presets, Color correction and exporting textures)
- Beautiful (Prevent overexposure, Anti-aliased shading)
- Lightweight (Automatically rewrites shaders and turns features on / off)
- Available in various versions (Unity 2017-2021, BRP/LWRP/URP)
- Compatible with all lighting and similar in brightness to StandardShader

# Support
Supported Unity versions
- Unity 2017 - Unity 2021.2

Supported Shader Models
- Normal: SM4.0 / ES3.0 or later
- Lite: SM3.0 / ES2.0 or later
- Fur: SM4.0 / ES3.1+AEP / ES3.2 or later
- Tessellation: SM5.0 / ES3.1+AEP / ES3.2 or later

Supported Rendering Pipelines
- Built-in Render Pipeline (BRP)
- Lightweight Render Pipeline (LWRP)
- Universal Render Pipeline (URP)
- Refraction shaders are supported only for BRP

# Features
- Main color x3 layers (Decal, Layer mask, Gif animation, Normal / Additive / Multiplicative / Screen blending)
- Color correction, UV Scrolling & Rotation
- Flexible shadows (2 shadows, SSS, Environment light compositing, AO mask to adjust the ease of shadowing)
- Emission x2 layers (Animation, Mask, Blinking, Color change over time, Parallax)
- Normal map x2 layers
- Specular reflection
- MatCap (Z-axis rotation cancellation, Normal / Additive / Multiplicative / Screen blending)
- Rim light
- Outline (Color specification by texture, Mask, Thickness based on vertex color and distance)
- Fur, Refraction
- Distance Clipping Canceler
- Distance Fade (Changes color according to distance)
- AudioLink (Animate materials in sync with sound in supported VRChat worlds)
- Tessellation (For video production due to high load)
- Mesh Encryption ([AvatarEncryption](https://github.com/lilxyzw/AvaterEncryption) is required)

# License
lilToon is available under the MIT License. Please refer to the `LICENSE` included in the package.

# Usage - Material Setup
1. Import lilToon into Unity using one of the following methods.
    i. Drag and drop unitypackage to the Unity window to import it.
    ii. Import ```https://github.com/lilxyzw/lilToon.git?path=Assets/lilToon#master``` from UPM.
2. Select a material from Project.
3. Select `lilToon` from `Shader` at the top of Inspector.
4. If no texture has been applied, set the texture to `Main Color`.
5. To make the material transparent, change `Rendering Mode` to `Cutout` or `Transparent`.
6. If you want to add more features, change the "[Shader Setting](https://github.com/lilxyzw/lilToon/blob/master/Assets/lilToon/MANUAL.md#shader-setting)" in the Advanced settings.

Please refer to the [manual](https://github.com/lilxyzw/lilToon/blob/master/Assets/lilToon/MANUAL.md) for more detailed settings.

# Usage - Update
1. Import lilToon into Unity using one of the following methods.
    i. Drag and drop unitypackage to the Unity window to import it.
    ii. Import ```https://github.com/lilxyzw/lilToon.git?path=Assets/lilToon#master``` from UPM.
2. Click `Assets/lilToon/Refresh Shaders` in the top menu bar.

# How to distribute your works that use lilToon
Shader settings are stored in the `lilToonSetting` folder, so it is recommended to include this folder in the unitypackage.
If you have not changed shader settings, you do not need to include them.
The following is the detailed procedure.
1. Select the folder of your works.
2. hold down ctrl and select `lilToonSetting` folder.
3. (only if you want to include shaders) hold down ctrl and select the `lilToon` folder.
4. Right click and select `Export package...`.
5. uncheck `Include Dependencies`.
6. Press `Export...` to save the unitypackage.

# Common Problems
- Material error has occurred.
  → Clicking `Assets/lilToon/Refresh Shaders` in the top menu bar may help.
- The shadows on face are dirty.
  → You can specify a mask texture in `Mask & Strength` to partially remove shadows.
- Outline becomes dirty.
  → You can specify a mask texture in `Mask & Width` to partially remove outline or adjust the thickness.
- Shadows are weak in bright places.
  → `Environment Strength` value affects the strength of shadows in bright places.

# Recommended settings outside the shader
The following settings improve the problem of different brightness in one part of the model. Also, texture transparency artifacts are removed.
- Select the mesh from the Hierarchy, unify the `Root Bone`, `Bounds`, and `Anchor Override` settings, and turn off `Recieve Shadows`.
- Select a transparent texture from Project and check `Alpha Is Transparency` in Inspector.
- Check the `Mip Maps Preserve Coverage` checkbox for textures used in Cutout materials.

# About Lite version
Lite version is a greatly optimized version that maintains the appearance of the normal version to some extent. This version is recommended for avatar displays because it has no shader settings and its features are unified. It is recommended to convert materials created with Normal version to the Lite version instead of setting materials directly from Lite version for more intuitive material setting.

# References
- [UnlitWF (whiteflare)](https://github.com/whiteflare/Unlit_WF_ShaderSuite) / [MIT LICENCE](https://github.com/whiteflare/Unlit_WF_ShaderSuite/blob/master/LICENSE)
I referred to many parts of both scripts and shaders, such as far shaders and property deletion.
- [Arktoon-Shaders (synqark)](https://github.com/synqark/Arktoon-Shaders) / [MIT LICENCE](https://github.com/synqark/Arktoon-Shaders/blob/master/LICENSE)
I'm referred to the shadow setting part.
- [MToon (Santarh)](https://github.com/Santarh/MToon) / [MIT LICENCE](https://github.com/Santarh/MToon/blob/master/LICENSE)
Comparing parameters when implementing `Convert to MToon (VRM)`
- [GTAvaCrypt (rygo6)](https://github.com/rygo6/GTAvaCrypt) / [MIT LICENCE](https://github.com/rygo6/GTAvaCrypt/blob/master/LICENSE)
- [Optimized inverse trigonometric function (seblagarde)](https://seblagarde.wordpress.com/2014/12/01/inverse-trigonometric-functions-gpu-optimization-for-amd-gcn-architecture/)
- [視差オクルージョンマッピング(parallax occlution mapping) (コポコポ)](https://coposuke.hateblo.jp/entry/2019/01/20/043042)

# Change log
## v1.1.1
- Show warning when property alpha is 0
- Support for changing editor theme
- Added shader refresh
## v1.1
- Added Alpha Mask
- Added MatCap 2nd
- Added properties to adjust Lower brightness limit and vertex light strength
- Fixed a bug where CascadeShadow was not working properly in URP
- Fixed a bug in MatCap where "Apply Lighting" was not working properly
- Added warnings for high-load functions (refraction / POM)
- Added references
## v1.0
- Opening to the public

repository: miccall/lilToon

repo_name: miccall/lilToon


text:
# SchedulingStatusResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | The ID generated for the scheduling job.  Use to GET result when job is completed. | [optional]
**status** | **string** | The status of the scheduling job. | [optional]
**errorDetails** | [**\PureCloudPlatform\Client\V2\Model\SchedulingProcessingError[]**](SchedulingProcessingError.md) | If the request could not be properly processed, error details will be given here. | [optional]
**schedulingResultUri** | **string** | The uri of the scheduling result. It has a value if the status is 'Success'. | [optional]
**percentComplete** | **int** | The percentage of the job that is complete. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: jameBruno/platform-client-sdk-php

repo_name: jameBruno/platform-client-sdk-php


text:
# query-stream

create autosuggest widgets with a async function.

create a query stream:

``` js
var query = require('query-stream')
var qs = query(function (query, cb) {
  //make request to
  make_query_to_wherever(query, cb)
})

```

then, write queries to it:

``` js
qs.write('samestuth')

//if you change your query it retries the search

qs.write('some stuff')
```

output chunks will look like this:

``` js
//assuming get(q, cb) calls back a string
"samestuff not found",
"CLEAR", //this means new results
"stuff1",
"stuff2",
etc..
```
`"CLEAR"` is a special message.
it means that the following is a new response,
and the display should clear previous elements.

# UI

Pipe a input field into this, and out to a list.
NOTE, this stuff isn't implemented yet!
But it will look something like this:
``` js
//input-stream creates a stream of DOM events.
inputStream('#query', 'onchange', function (e) {
  return e.value
}).pipe(qs)
//element stream adds elements to a given root Element.
.pipe(elementStream('#results', function (e) {
  if(e === 'CLEAR')
    return this.root.removeAllChildren()
  return '
'+e+'
'
})

## License

MIT

repository: dominictarr/query-stream

repo_name: dominictarr/query-stream


text:
# Mobile_like_dislike_classification
This is classification problem for Mobile based on the Rating given by the people.
It is solved by using MP Neuron and Perceptron.

Using MP Neuron the model achieved nearly 70% and 73% accuracy on train and test dataset respectively.
Using Perceptron learning algorithm the model achieved approximately 85% and 79% accuracy on train and test dataset respectively.
The Perceptron learning algorithm can achieve more accuracy by tuning the Hyperparameters - Epochs and Learning Rate.


text:
# Read-Only Models

Are you in the midst of a big refactoring that is phasing out an
`ActiveRecord` model? You may not be ready to wipe it from the project, but
you don't want it accidentally used to create any database records. You
essentially want your model to be read-only until it is time to actually
delete it.

This can be achieved by adding a `readonly?` method to that model that
always returns `true`.

```ruby
def readonly?
  true
end
```

`ActiveRecord`'s underlying persistence methods always check `readonly?`
before creating or updating any records.

[source](http://stackoverflow.com/questions/5641410/is-there-an-easy-way-to-make-a-rails-activerecord-model-read-only)

h/t Josh Davey

repository: jbranchaud/til

gha_language: Vim Script

repo_name: jbranchaud/til


text:
BuildBlast
==========

![BuildBlast Screenshot](screenshot.png)

Try it at **[BuildBlast.com](https://www.buildblast.com)**

Dev servers: [crazy2be](http://bb.jmcgirr.com), [yeerkkiller1](http://quentinbrooks.com)

Installation
------------

[Install go](http://golang.org/doc/install), set up your [GOPATH](http://golang.org/doc/code.html#GOPATH), then

	cd $GOPATH/src
	git clone git@github.com:crazy2be/buildblast.git buildblast

To play, copy the `server_config.template.json` to `server_config.json` and enter the following:
```
{
    "host": "localhost",
    "port": 8080,
    "client_assets": ".",
    "persist_enabled": true,
    "world_base_dir": "../world/",

    "db_pass": "",
    "mail_pass": "",
    "cookie_key_pairs": [
        "",
        ""
    ]
}
```

	./runserver --config="../server_config.json"
	google-chrome http://localhost:8081

To run the www server and enable authentication:

Linux:

- Follow instructions to add apt-get repository and install postgresql-9.4 at [postgresql.org](http://www.postgresql.org/download/linux/ubuntu/)
- `sudo apt-get install nodejs`
- `sudo apt-get install ruby-full`
- `sudo apt-get install libgemplugin-ruby`
- `sudo gem install compass`
- Change the db port to 5566:
  - `sudo vim /etc/postgresql/9.4/main/postgresql.conf`
- `sudo service postgresql start`
- `sudo -u postgres psql -p 5566`
- `ALTER USER postgres WITH ENCRYPTED PASSWORD '<generate a password>';`
- `\q`
- Create a user with no password
  - `sudo adduser buildblast`
- `sudo -u postgres createuser -S -D -R -l -P -E -e -h localhost -p 5566 buildblast`
  - (It will ask to create a password, generate one. The password it asks for afterwards is for the postgres user created above)
- `sudo -u postgres createdb -p 5566 --encoding=unicode --owner buildblast buildblast`
- Go to `/src/buildblast/db/`
  - `./execsql schema-000.sql (etc… for each schema in order)`

Copy the `server_config.template.json` to `server_config.json` and enter the following:
```
{
    "host": "localhost",
    "port": 8080,
    "client_assets": "./client",
    "persist_enabled": true,
    "world_base_dir": "~/buildblast-world/",

    "db_pass": "<ENTER PASSWORD>",
    "mail_pass": "",
    "cookie_key_pairs": [
        "<ENTER A GENERATED AUTH KEY, 64 CHAR HEX STRING>",
        "<ENTER A GENERATED ENCR KEY, 64 CHAR HEX STRING>"
    ]
}
```

- `./prod-build`
- `cd ~/buildblast-production/`
- Start both servers (different terminal sessions)
  - `./server`
  - `cd www-content && ../www --config="../server_config.json"`

Note: Confirmation emails will not work, since it's set to use the buildblast.com domain accounts.

<!-- TODO: This section is a bit... agressive. Might want to make it kinder sounding.  A couple tips:
- **Read your diffs**. We all change things casually when learning a system, and poke at various things, but you should revert these changes before committing (or stash them somewhere), to ensure your pull request is focused on one particular thing that needs changing, and to reduce the time it takes to review.
- **Keep pull requests small and incremental**. If you want a really big, awesome feature, develop it one piece at a time, so that each of them can be evaluated individually, and so that we can all discuss how we want the feature to look *before* you've built the whole thing. This also allows other to build other awesome things you haven't though of yet from your pieces, and reduces the pain of merging to master (which is very quickly changing at this point).
- **Format your code**.
	- Things are a little looser on the JS side, but try to match the existing code. Always use tabs. Use semicolons. Braces on the same line. I'm sure you can figure it out :).
	- On the go side, always run `go fmt buildblast/...` before submitting a pull request.

Architecture (client side)
---------------
The architecture is based on a few fairly simple structures, which communicate through a few objects (similar to http://yuml.me/d5f4fb7b). Specifically:
- **container**: Just a div in the html, we use this to hook up the actual rendering. There are some hardcoded elements in this, which we hook up to to give THREE.js a place to render (amoung other things).
- **Conn**: A wrapper for a WebSocket, used to communicate to the server.
- **Scene**: A THREE.Scene, this holds all the meshes and models which THREE.js will render.
- **ChunkManager**: Manages the chunks (of blocks), and handles adding and removing them from the THREE.Scene.
- **EntityManager**: Manages the entities (players for now, in the future hopefully more) and add/removes them from the THREE.Scene.
- **World**: Holds both the ChunkManager and EntityManager and provides useful logic to interface with them. Can directly expose blocks but also provides most of the helper functions you should need.
- **PlayerUI**: Handles displaying the interface elements and rendering the scene. Shouldn't hold any game data, or be required for the game to run.

Coordinate Systems
----------------------------
We use two main coordinates systems in the code:
- **wc**: World coordinates. Used for positions of entities, physics calculations, and everything that isn't blocks.
- **bc**: Block coordinates. Same as world coordinates, but always integers. Useful for dealing with blocks. On the JavaScript side, this distinction isn't as pronounced, most things just floor the world coordinates they are given.

In map generation and geometry code, which is particularly concerned with the existence of chunks, you may also see the following coordinate systems used:
- **cc**: Chunk coordinates. Essentially `floor(bc / 32)`. Gives the coordinate of a chunk, relative to other chunks. Multiply by 32 to get the position of the chunk in 3d space.
- **oc**: Offset coordinates. Like block coordinates, but refer to a block at a specified offset *within* a chunk, rather than just within the world. Used mostly just in map generation and geometry code. All components should be in the range [0...31].
- **pc**: Plane coordinates. Like offset coordinates, but have a rotated frame of reference. This allows the code which creates different faces to be the same. In this model z is perpendicular to the face. compX, compY, etc refer to the mapping from pc to bc (compX = 1, means pcX represents bc

Lag hiding
----------
In order to make the game playable with hundreds of milliseconds of lag we apply multiple algorithms to reduce the appearance of lag. You might find [this article by Valve](https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking) to be helpful if you are interested in this.

### Lag Compensation (Shooting is accurate regardless of lag)
If the client shoots at time 0 ms, and the server receives it at time 100 ms, it is likely the person they were shooting at has moved since the time they shot. So, we "lag compensate" players (entities). This means the server stores the history of positions for every player, and the player timestamps its shoot events, so when the server receives the shoot it can simulate it with the player positions that existed when the shot was fired.

 - https://developer.valvesoftware.com/wiki/Lag_compensation
 - http://en.wikipedia.org/wiki/Lag_(online_gaming)#Rewind_time

### Input Prediction (No player movement lag)
When the player presses a movement key technically we need to wait until the server confirms the message to know if we can move, since the server is the "master". However, it's much nicer from a user's perspecitve if the controls respond immediately. Thus, we use the client's game state to make predictions about what will happen, and show that state to the player. If the server thinks something different happened, we'll throw away our predictions, and follow it's command.

 - https://developer.valvesoftware.com/wiki/Prediction

### Lag Induction (Smooth other player movement and easier gameplay)
The server may send messages at a varying speed, and we may receive them at a varying speed.  To get around this we store don't immediately show player positions as we receive them, instead we show players where they were `lagInduction` time in the past. This gives us a buffer to hide the impact of lag (and smooth out movement). `clock.entityTime()` is the current time that entities are being displayed at.

 - https://developer.valvesoftware.com/wiki/Interpolation

Bugs
-------
If you find any bugs, please report them in the issue tracker with your hardware specs, screenshot, and steps taken to trigger the issue.

Firefox is not supported pending [#504553](https://bugzilla.mozilla.org/show_bug.cgi?id=504553).

Experiments
-----------------
If you want to try out something hard, and possibly impossible, attempt one of these:
- Change the network protocol to have unreliable delivery semantics for certain types of packets, namely player-position and entity-position packets (which are sent a LOT). WebRTC might help here.

Or checkout the bug list (for bugs or features, whichever suits your fancy).


text:
This is a guide through the ami build system. It is based on Webpack v3 in combination with Babel.

# How it works

The build system is based on Webpack v3 and Webpack-dev-server. Basicly pipeline runs as follows:
* `ami.js`, `example` or `lesson` source and all if its dependencies it references gets read in by webpack to an one big file.

* at same time it gets read in it runs through the configured loaders:
  * Javascript: runs through Babel.js where all "modern" Javascript will get transpiled "down" to the Javascript abilities of the set target browsers (IE11, Safari 10, Firefox ESR, Edge 12, Google Chrome 54). Example: IE 11 does not support Arrow Functions `sum = (a, b) => { return a + b; }` so it gets transpiled to ES5 style functions `function sum(a, b) { return a + b; }`. Another word you might already heard of for such a replacement is `polyfill`. If all that browsers support a feature then the native implementation of the browser is used.
  * css/sass/less Webpack in capable not only bundling javascript but also other kinds of files. In fact, everthing there is a loader available. When css/sass/less files are referenced in the source javascript, then they will get extracted out of the javascript bundle, sass/less gets "compiled" to css and then also bundled to a seperate css file bundle. If you want to dive in to that topic I highly recommend the [Webpack docs](https://webpack.js.org/concepts/)

* in `development` mode then all things get written to files in the output directory and thats it. In `production` mode there are a couple of things that happen additionally:
  * the javascript code gets `uglyfied`. That means that it will modified to minimal file size. Every not needed character (including linefeed) gets stripped out, variable and function names gets replaced by single or very short generic names like `a` or `f1`. That minified version of the library is getting saved as `min.js` like `ami.min.js`
  * In case of `ami.js` the minified bundle gets additinally zipped with gunzip to shrink down the file size even more. Most modern browsers and servers support zipped files.

* When the webpack-dev-server is running everthing gets run through like with webpack except one detail. An express.js mini-http server is launched to serve the contents of a directory or bunch of files, normally including the created bundle. It also runs in `hot` or `HMR` mode, means it watches the source of the bundle and refeshes the bundle and the browser when something changes.
  * Side note: the bundle, created by webpack-dev-server are `not` written to the filesystem. It "lives" only in Memory (RAM) as long the webpack-dev-server is running.

* on `examples` and `lessons` it works the same. Just not the AMI Library gets build but the javascript files of the `examples/lessons`. Depending on if a deployment is running it happens "in place" or in the deployment folder `dist`.

# package.json scripts
Every `package.json` script will be explaned here.

## AMI
### Build

To build AMI.js run the following command:
```bash
yarn build:ami
```
It creates the files `ami.js` and `ami.js.map` in the `lib` folder.

---

For a production build run
```bash
yarn build:ami:prod
````
This creates a minified version of AMI `ami.min.js` as well as a gunzipped version `ami.min.js.gz`.

---

### Clean

 The following commands are deleting the target directory `lib`.

 ```bash
yarn build:clean
 ```
 or
 ```bash
yarn build:clean:hot
 ````
 This script will only delete hot.update.js files which webpack creates in lesson mode. This runs automaticly and you have not to bother this script.

---

The following script deletes the `dist` directory, in preparation for an AMI deployment.

```bash
yarn dist:clean
```

and finally this combines both the `lib` and the `dist` clean.

```bash
yarn clean
```

---

This script starts a running webpack instance that watches continuously the AMI sources and creates a new bundle when the sources have been changed. The script is used by other scripts in order to develop the library (more on development below).

```bash
yarn dev:ami
```

---

### deploy

To deploy the AMI library run the following script

```bash
yarn dist:ami
```

It runs a combination of `clean` and `build` including a "production" version of AMI. In addition the that some automated documentation is generated (see below)

to create a full deployment run
```bash
yarn deploy
```

full means that
* the directories (`lib` & `dist`) gets cleaned
* build AMI (including docs)
* build & deploy `examples` into the `dist` folder

---

### Docs
```bash
yarn doc
```

With this script some automated documentation are generated based on the source. Target directory is `dist`.

---

### Linter & Tests
Tests are implemented with `Karma`. It imports some of the source code and run tests on it to ensure functionality when the source changes and don't break things.

```bash
yarn test
```

A Linter is used to ensure that the source code matches a set of rules. These rules expand from source code formatting up to forbidding or enforcing use of specific language features/commands.

```bash
yarn lint
```

### Analze `ami.js` bundle

It is possible to analize the content of the `ami.js` bundle both "normal" built as well as "production" built. After creation of the bundle the browser gets opened and shows the content of it including other additional information like the size.

```bash
yarn analize:ami
```

and for production

```bash
yarn analize:ami:prod
```

## Examples & Lessons
The AMI library comes with a set of examples and lessons to teach, demonstrate and develop the AMI library.

### Examples

The `examples` directory consists of examples of different aspects of the library. An example folder contains a entry html, javascript and css file.

to run an example execute

```bash
yarn example [name of example folder]

yarn example geometries_slice
```

It starts a webpack-dev-server on the example folder and opens a Browser to load the example. Now the example can be edited and webpack-dev-server will automaticly reload the page.

However webpack-dev-server is only "watching" the created bundle (living only in memory). Files that are part of the app/example but not of the bundle, like html and css files, will served through webpack-dev-server but not "hot-reloaded". For that matter there is a free plugin/addon called "LiveReload". It fills the gap and "hot-reloads" all other files except the bundle.

---

The html files are based on sample html files. They're placed directly in the `examples` parent directory. With the following script the `index.html` files are generated in the example sub folders. This is only necessary when the html files are missing or the sample has changed. There should already be an existing set of `index.html` files. These are mandatory in order to run the examples.

```bash
yarn gen:index:examples

yarn gen:index:examples:ga
```

The second script adds optional google analytics to the html files.

On AMI deployment these examples are copied to the `dist` folder and are processed with webpack.

Side note: the examples are using AMI by import of sources. This is the recommended way of using AMI but the use of a bundler like Webpack or Browserify is mandatory. That way only the used part of AMI gets bundled and that lowers the final file size.

### Lessons

Same like with examples these are server with webpack-dev-server. Unlike examples the lessons are not copied to `dist` folder on AMI deployment.

Side note: Unlike the examples are using the lessons the full AMI bundle as UMD Module directly from the `lib` folder. That why a second webpack instance is running on lessons which observes the AMI sources.

To run a lesson

```bash
yarn lesson [name of lesson]

yarn lesson 01
```

Like Examples the `index.html` files are generated by samples. the following scripts are generating these files.

```bash
yarn gen:index:lessons

yarn gen:index:lessons:cdn
```

Second script generates `index.html` files with CDN Links to the public AMI library instead of the local bundle.

repository: gtajesgenga/ami

gha_language: JavaScript

repo_name: gtajesgenga/ami


text:
# nippy-to-edn

A mini cli tool to convert nippy received via STDIN into edn on STDOUT.

Usage

```bash
cat frozen.nippy | nippy-to-edn
```

## install

1. Checkout: `git clone https://github.com/Velrok/nippy-to-edn-cli.git`
1. Compile: `lein uberjar` ; Assumes you have leiningen installed
1. Install: `./install.sh` ; This assumes you have a `$HOME/bin` folder which is on your `PATH`

repository: Velrok/nippy-to-edn-cli

repo_name: Velrok/nippy-to-edn-cli


text:
---
title: "bromocriptine - Parkinson's disease"
sidebar: mydoc_sidebar
permalink: bromocriptineparkinsonsdisease.html
toc: false
---

{% include image.html file="bromocriptineparkinsonsdisease.png" alt="bromocriptineparkinsonsdisease" %}

## Concepts

|------------|------|---------|
| Identifier | Name | Type    |
|------------|------|---------|
| MESH:D001971 | bromocriptine | Drug |
| UniProt:P14416 | Dopamine D2 receptor | Protein |
| UniProt:P35462 | Dopamine D3 receptor | Protein |
| MESH:D004298 | dopamine | ChemicalSubstance |
| UBERON:0035999 | dopaminergic cell groups | GrossAnatomicalStructure |
| UBERON:0002038 | substantia nigra | GrossAnatomicalStructure |
| UBERON:0014169 | nigrostriatal tract | GrossAnatomicalStructure |
| MESH:D010300 | Parkinson's disease | Disease |
|------------|------|---------|

## Relationships

|---------|-----------|---------|
| Subject | Predicate | Object  |
|---------|-----------|---------|
| Bromocriptine | POSITIVELY REGULATES | Dopamine D2 Receptor |
| Bromocriptine | POSITIVELY REGULATES | Dopamine D3 Receptor |
| Dopamine D2 Receptor | POSITIVELY CORRELATED WITH | Dopamine |
| Dopamine D3 Receptor | POSITIVELY CORRELATED WITH | Dopamine |
| Dopamine | LOCATED IN | Dopaminergic Cell Groups |
| Dopaminergic Cell Groups | LOCATED IN | Substantia Nigra |
| Substantia Nigra | PARTICIPATES IN | Nigrostriatal Tract |
| Nigrostriatal Tract | AFFECTED BY | Parkinson'S Disease |
|---------|-----------|---------|

Reference: [https://go.drugbank.com/drugs/DB01200#mechanism-of-action](https://go.drugbank.com/drugs/DB01200#mechanism-of-action){:target="_blank"}

repository: patrickrewers/DrugMechDB

branch_name: refs/heads/main

repo_name: patrickrewers/DrugMechDB


text:
---
layout: post
title:  "Open Discussion on Jekyll!"
date:   2015-06-08 12:00:00
tags: test comments, discussion, disqus
categories: testing
comments: true
---
We can now have a great conversation on a static site using Disqus!
This is pretty interesting knowing how easy and little code it takes to allow conversation on a site using Jekyll or just plain html.
Simply register for an account on Disqus, select the option to get the Universal Embed Code.
Copy and paste the code on any page or put it in one of the layout pages.

The code is very minimal:

``` html
{% if page.comments %}
<div id="disqus_thread"></div>
<script type="text/javascript">
    var disqus_shortname = 'myForumnName'; // required: replace example with your forum shortname
    var disqus_identifier = "{{ page.url }}";

    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
{% endif %}
```

extension: markdown


text:
<!--docs:
title: "Getting Started"
layout: landing
section: docs
path: /docs/getting-started/
-->

### 1. Depend on our library

Parcelled for Android is available through Google's Maven Repository.
To use it:

1.  Open the `build.gradle` file for your application.
2.  Make sure that the `repositories` section includes Google's Maven Repository
    `google()`. For example:
```groovy
  allprojects {
    repositories {
      google()
      jcenter()
    }
  }
```

3.  Add the library to the `dependencies` section:
```groovy
dependencies {
    // ...

    // parcelled version
    def parcelled_version = "1.0.0"

    // Java Project
    implementation("com.zeoflow:parcelled-runtime:$parcelled_version")
    annotationProcessor("com.zeoflow:parcelled-compiler:$parcelled_version")

    // Kotlin Project
    implementation("com.zeoflow:parcelled-runtime:$parcelled_version")
    kapt("com.zeoflow:parcelled-compiler:$parcelled_version")

    // ...
}
```

Visit [MVN Repository](https://mvnrepository.com/artifact/com.zeoflow/parcelled)
to find the latest version of the library.

## Contributors

Parcelled for Android welcomes contributions from the community. Check
out our [contributing guidelines](contributing.md) before getting started.

repository: zeoflow/parcelled

gha_language: Java

repo_name: zeoflow/parcelled


text:
![](docs/Logo.png)

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) [![npm](https://img.shields.io/npm/dm/localeval.svg)](https://www.npmjs.com/package/scrollto-with-animation)

- Only **one dependency** *(for the [polyfill](https://www.npmjs.com/package/animation-frame))*
- **Cross-browser**
- **60 FPS** Animation
- If user scrolls while animation is running, scroll animation would be immediately canceled
- Available adding **script or browserify**

#### [Live demo](https://davesnx.github.io/scrollto-with-animation/docs/demo/index.html)

## Install

```bash
npm install scrollto-with-animation --save
```

## Usage

### Available with browserify

```javascript
var scrollToWithAnimation = require('scrollto-with-animation')
// or ES2015
import scrollToWithAnimation from 'scrollto-with-animation'
```

### or available as a script

```html
<script src="scrollToWithAnimation.min.js"></script>
```

### Example

```javascript
scrollToWithAnimation(
    document.body, // element to scroll
    'scrollTop' // direction to scroll
    0, // target scrollY (0 means top of the page)
    10000, // duration in ms
    'easeInOutCirc', /*
        Can be a name of the list of 'Possible easing equations' or a callback
        that defines the ease. # http://gizma.com/easing/
    */
    function () { // callback function that runs after the animation (optional)
      console.log('done!')
    }
);
```

This will scroll to top of the page and the animation will run for 10 seconds (10000ms).

## Options

## Posible easings equations

- `linearTween`
- `easeInQuad`
- `easeOutQuad`
- `easeInOutQuad`
- `easeInCubic`
- `easeOutCubic`
- `easeInOutCubic`
- `easeInQuart`
- `easeOutQuart`
- `easeInOutQuart`
- `easeInQuint`
- `easeOutQuint`
- `easeInOutQuint`
- `easeInSine`
- `easeOutSine`
- `easeInOutSine`
- `easeInExpo`
- `easeOutExpo`
- `easeInOutExpo`
- `easeInCirc`
- `easeOutCirc`
- `easeInOutCirc`

> Feel free to add more ease functions to [easings.js](https://github.com/davesnx/scrollToWithAnimation/blob/master/src/easings.js) open a Pull request!

## License

MIT

repository: haraldox/scrollto-with-animation

repo_name: haraldox/scrollto-with-animation


text:
---
layout: post
title:  "Project: Eden "
date:   2007-02-01
thumbnail: "/assets/images/artwork/thumbnail/Project-Eden-2007.jpg"
---

![My image Name](/assets/images/artwork/Project-Eden_01.jpg)
![My image Name](/assets/images/artwork/Project-Eden_02.jpg)
![My image Name](/assets/images/artwork/Project-Eden_03.jpg)
![My image Name](/assets/images/artwork/Project-Eden_04.jpg)
![My image Name](/assets/images/artwork/Project-Eden_05.jpg)
![My image Name](/assets/images/artwork/Project-Eden_06.jpg)
![My image Name](/assets/images/artwork/Project-Eden_07.jpg)
![My image Name](/assets/images/artwork/Project-Eden_08.jpg)

# Project: Eden | 2007

Size
: 23 x 4 x 4.3 m

Medium
: Cleaning equipment, metal shipping containers, wooden staircase, railings, dustbins, plastic grass, mirror, etc.

Exhibition
: Raffles City, Singapore Arts Festival (2007), Singapore | Singapore Season China (12 Oct - 10 Nov 2007), “Hybricity: Singapore”, Beijing, China | City Link, Tickle Art, Singapore

<!--excerpt_separator-->

Ironically, though Singapore is known as the garden city – rows of beautiful trees and shrubs line every street In Singapore - 70% of the population live in HDB flats where the space constraints of sky-rise living do not allow for private gardens.   However, the desire for a garden does not abate despite the difficulty of realisation.  The Bonsai gardens, corridor/balcony gardens, and even the bottle gardens that many flat-dwellers own, may with a pinch of salt, be read as expression of this longing.

Personally, my desire for an individual garden was further fanned by Singapore’s emphasis on the English language. Through the act of reading foreign storybooks, I became familiar with the culture, climate and landscape of a land not my own.  I longed to see and play within the storybook gardens of snowdrops, buttercups and apple trees

In this particular work, an English wild garden, remembered from childhood storybooks is remade from the mundane miscellaneous flotsam found around the Singaporean house.  Toilet brushes, balloon sticks and cups, sponges and lily brushes metamorphose into weird hybrid flowers and grasses through creative arranging and a little imagination.


text:
# ActionSendGridview for Android

Standalone widget for retrieving and displaying the action_SEND intents on the user's device.

Use to share information with other apps
- Pulls the user's sharing options
- Allows you to set the message / subject / url that will be sent.
- Allows you to set a precedence list so that you can determine the precedence in which intents will be shown.
- Initially shows 6 intents with a 'More' button that when clicked slides down in an animation to reveal the rest of the intents on the device.

#### Example in app
![cups_share_griview](https://cloud.githubusercontent.com/assets/717076/4250573/f88f3b88-3a84-11e4-9cc0-296158bbb240.gif)

#### Initial 6 sharing options
![Before clicking the more button - initial list of 6 intents](https://cloud.githubusercontent.com/assets/8603749/4184607/252dcd1c-374c-11e4-9bb5-d51b135f0756.jpg)

#### After clicking the more button
![After clicking the more button](https://cloud.githubusercontent.com/assets/8603749/4184608/25485df8-374c-11e4-8dcf-200ee113deb7.jpg)

## Usage

Include GridviewFragment in your layout xml as a new fragment

``` xml
<fragment
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:id="@+id/coupon_sharing_fragment"
	android:name="com.citylifeapps.cups.actionsendgridview.GridviewFragment"/>
```

In order to properly display this widget, you should allocate about half the area of a standard phone screen.

In the onCreate method of your activity, before you call setcontentview, you should initialize some values for the widget using the static methods provided:

``` java
// Change the message text that you want to send
GridviewFragment.setMsgPayload("This is the message text");

// Change the message subject that you want to send
GridviewFragment.setMsgSubject("This is the subject");

// Change the url that you want to send
GridviewFragment.setUrlPayload("www.tester.com");
```

## Precedents Of Intents

If you want to change the predefined order of the intents shown on the screen, you can define precedence for each intent, in case it's found.

Changing the precedence:

```
setPrecedence(intent_name, value);
```

- intent_name (String) - The intent_name should be the label name of the intent, for example Twitter.

- value (Integer) - The value should be the precedence of the intent whereby lower numbers are higher precedence and would appear sooner in the list.

Once you are finished presetting the widget, you can display it onscreen by using
``` java
setcontentview(R.layout.your_layout)
```
The default precedence list (if none is specified and passed to the widget) is "Twitter, Facebook Messenger, Copy to Clipboard, Facebook, Gmail, WhatsApp, Email".

## Download

Clone the project from Github and reference it as a library project within your application
(`file --> import module...` in android studio).

## License

```
Copyright 2014 Urbancups, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

repository: urbancups/action-send-gridview

repo_name: urbancups/action-send-gridview


text:
# Benchmarking with JMeter

## Installation

It assumes that you have followed quick start/installation section and have required pre-requisites i.e. python3, java and docker [if needed]. If not then please refer [quick start](../README.md) for setup.

### Ubuntu

We have provided an `install_dependencies.sh` script to install everything needed to execute the benchmark on user's Ubuntu environment. First clone the TorchServe repository:

```bash
git clone https://github.com/pytorch/serve.git
```
Now execute this script as below.
On CPU based instance, use `./install_dependencies.sh`.
On GPU based instance, use `./install_dependencies.sh True`.

### MacOS

For mac, you should have python3 and java installed. If you wish to run the default benchmarks featuring a docker-based instance of TorchServe, you will need to install docker as well. Finally, you will need to install jmeter with plugins which can be accomplished by running `mac_install_dependencies.sh`.

The benchmarking script requires the following to run:
- python3
- JDK or OpenJDK
- jmeter installed through homebrew or linuxbrew with the plugin manager and the following plugins: jpgc-synthesis=2.1,jpgc-filterresults=2.1,jpgc-mergeresults=2.1,jpgc-cmd=2.1,jpgc-perfmon=2.1
- nvidia-docker

### Windows

For Windows, you should have python3 and java(OpenJDK-17) installed. You will need to install jmeter with plugins which can be accomplished by running `python windows_install_dependencies.py <Path to install jmeter>`. For example:
```bash
python3 windows_install_dependencies.py "C:\\Program Files"
```

## Models

The pre-trained models for the benchmark can be mostly found in the [TorchServe model zoo](../docs/model_zoo.md). We currently support the following:
- [resnet: ResNet-18 (Default)](https://torchserve.pytorch.org/mar_files/resnet-18.mar)
- [squeezenet: SqueezeNet V1.1](https://torchserve.pytorch.org/mar_files/squeezenet1_1.mar)

## Benchmarks

We support several basic benchmarks:
- throughput: Run inference with enough threads to occupy all workers and ensure full saturation of resources to find the throughput. The number of threads defaults to 100.
- latency: Run inference with a single thread to determine the latency
- ping: Test the throughput of pinging against the frontend
- load: Loads the same model many times in parallel. The number of loads is given by the "count" option and defaults to 16.
- repeated_scale_calls: Will scale the model up to "scale_up_workers"=16 then down to "scale_down_workers"=1 then up and down repeatedly.
- multiple_models: Loads and scales up three models (1. squeeze-net and 2. resnet), at the same time, runs inferences on them, and then scales them down. Use the options "urlN", "modelN_name", "dataN" to specify the model url, model name, and the data to pass to the model respectively. data1 and data2 are of the format "'Some garbage data being passed here'" and data3 is the filesystem path to a file to upload.

We also support compound benchmarks:
- concurrent_inference: Runs the basic benchmark with different numbers of threads

#### Using pre-build docker image

* You can specify, docker image using --docker option. You must create docker by following steps given [here](../docker/README.md).

```bash
cd serve/benchmarks
./benchmark.py latency -l 1 --docker pytorch/torchserve:0.1.1-cpu
```

* If you don't specify --ts or --docker then it will use latest image for torchserve on dockerhub and start container by the name of 'ts_benchmark_gpu' or 'ts_benchmark_cpu' depending on whether you have selected --gpus or not

```bash
cd serve/benchmarks
./benchmark.py latency -l 1
```

NOTE - '--docker' and '--ts' are mutually exclusive options

#### Using local TorchServe instance:

* Install TorchServe using the [install guide](../README.md#install-torchserve-and-torch-model-archiver)
* Start TorchServe using following command :

```bash
torchserve --start --model-store <path_to_your_model_store>
```
* To start benchmarking execute following commands

```bash
cd serve/benchmarks
python benchmark.py throughput --ts http://<IP_ADDRESS>:8080
```

#### By using external docker container for TorchServe:

* Create and start a [docker container for TorchServe](../docker/README.md).
* To start benchmarking execute following commands

```bash
cd serve/benchmarks
python benchmark.py throughput --ts http://<IP_ADDRESS>:8080
```

Note:
1) Refer the examples below to run different benchmarking suites on TorchServe.

## Accessing benchmark reports :

The benchmark reports are available at /tmp/TSBenchmark/

## Examples

Run basic latency test on default resnet-18 model\
```./benchmark.py latency```

Run basic throughput test on default resnet-18 model.\
```./benchmark.py throughput```

Run all benchmarks\
```./benchmark.py --all```

Run using the squeeze-net model\
```./benchmark.py latency -m squeezenet1_1```

Run on GPU (4 gpus)\
```./benchmark.py latency -g 4```

Run with a custom image\
```./benchmark.py latency -i {imageFilePath}```

Run with a custom model (works only for CNN based models, which accept image as an input for now. We will add support for more input types in future to this command. )\
```./benchmark.py latency -c {modelUrl} -i {imageFilePath}```

Run with custom options\
```./benchmark.py repeated_scale_calls --options scale_up_workers 100 scale_down_workers 10```

Run against an already running instance of TorchServe\
```./benchmark.py latency --ts <IP_ADDRESS>``` (defaults to http, port 80, management port = port + 1)\
```./benchmark.py latency --ts <IP_ADDRESS>:8080 --management-port 8081```

Run with multiple models \
```./benchmark.py multiple_models```

Run verbose with only a single loop\
```./benchmark.py latency -v -l 1```

## Known Issues(Running with SSL):
Using ```https``` instead of ```http``` as the choice of protocol might not work properly currently. This is not a tested option.
```./benchmark.py latency --ts https://<IP_ADDRESS>:8443```

## Benchmark options

The full list of options can be found by running with the -h or --help flags.

## Adding test plans
Refer [adding a new jmeter](add_jmeter_test.md) test plan for torchserve.

# Profiling

## Frontend

The benchmarks can be used in conjunction with standard profiling tools such as JProfiler to analyze the system performance. JProfiler can be downloaded from their [website](https://www.ej-technologies.com/products/jprofiler/overview.html).  Once downloaded, open up JProfiler and follow these steps:

1. Run TorchServe directly through gradle (do not use docker). This can be done either on your machine or on a remote machine accessible through SSH.
2. In JProfiler, select "Attach" from the ribbon and attach to the ModelServer. The process name in the attach window should be "com.amazonaws.ml.ts.ModelServer". If it is on a remote machine, select "On another computer" in the attach window and enter the SSH details.  For the session startup settings, you can leave it with the defaults.  At this point, you should see live CPU and Memory Usage data on JProfiler's Telemetries section.
3. Select Start Recordings in JProfiler's ribbon
4. Run the Benchmark script targeting your running TorchServe instance. It might run something like `./benchmark.py throughput --ts https://<IP_ADDRESS>:8443`. It can be run on either your local machine or a remote machine (if you are running remote), but we recommend running the benchmark on the same machine as the model server to avoid confounding network latencies.
5. Once the benchmark script has finished running, select Stop Recordings in JProfiler's ribbon

Once you have stopped recording, you should be able to analyze the data. One useful section to examine is CPU views > Call Tree and CPU views > Hot Spots to see where the processor time is going.

## Backend
The benchmarks can also be used to analyze the backend performance using cProfile. To benchmark a backend code,

1. Install Torchserve

    Using local TorchServe instance:

    * Install TorchServe using the [install guide](../README.md#install-torchserve-and-torch-model-archiver)

    By using external docker container for TorchServe:

    * Create a [docker container for TorchServe](../docker/README.md).

2. Set environment variable and start Torchserve

    If using local TorchServe instance:
    ```bash
    export TS_BENCHMARK=TRUE
    torchserve --start --model-store <path_to_your_model_store>
    ```
    If using external docker container for TorchServe:
    * start docker with /tmp directory mapped to local /tmp and set `TS_BENCHMARK` to True.
    ```
        docker run --rm -it -e TS_BENCHMARK=True -v /tmp:/tmp -p 8080:8080 -p 8081:8081 pytorch/torchserve:latest
    ```

3. Register a model & perform inference to collect profiling data. This can be done with the benchmark script described in the previous section.
    ```
    python benchmark.py throughput --ts http://<IP_ADDRESS>:8080
    ```

4. Visualize SnakeViz results.

    To visualize the profiling data using `snakeviz` use following commands:

    ```bash
    pip install snakeviz
    snakeviz /tmp/tsPythonProfile.prof
    ```
    ![](snake_viz.png)

    It should start up a web server on your machine and automatically open the page. Note that tha above command will fail if executed on a server where no browser is installed. The backend profiling should generate a visualization similar to the pic shown above.

repository: pytorch/serve

repo_name: pytorch/serve


text:
---
title: "getAccount"
description: ""
layout: "method"
tags:
    - "method"
    - "sldn"
    - "Account"
classes:
    - "SoftLayer_Account_Password"
aliases:
    - "/reference/services/softlayer_account_password/getAccount"
---
# [SoftLayer_Account_Password](/reference/services/SoftLayer_Account_Password)::getAccount

## Overview

-----

### Parameters
|Name | Type | Description |
| --- | --- | --- |

### Required Headers
* SoftLayer_Account_PasswordInitParameters
* authenticate

### Optional Headers
* SoftLayer_Account_PasswordObjectMask
* SoftLayer_Account_PasswordObjectFilter
* SoftLayer_ObjectMask

### Return Values
* <a href='/reference/datatypes/SoftLayer_Account'>SoftLayer_Account </a>

gha_language: HTML

gha_license_id: NOASSERTION


text:
# Message Templates

This library contains some classes to help with rendering messages and other templates to the user.

## Usage

This package has many uses and is very versatile. Let's take a look.

### Template Sources

Template sources are used to provide the rendering object information about the template.

Let's look at an example

##### Set up array to source from

In this example, we will use a global constant to source the templates from

```php
const TEMPLATES = [
   'key1' => 'template string, %s',
   'key2' => 'template string two, %s',
];
```

##### Implement the message source interfaces

We will create a new class for each potential key that will inherit the getTemplate method
from an abstract base class. This is to ensure that each template will be represented
by a discreet class which will return the correct template from the same source.

```php
abstract class ConstTemplateSource implements TemplateSourceInterface
{
    public function getTemplate(): string
    {
        return TEMPLATES[$this->key];
    }
}
```

```php
class Key1 extends ConstTemplateSource {
    protected $key = 'key1';
}
```

```php
class Key2 extends ConstTemplateSource {
    protected $key = 'key2';
}
```

### Template Rendering

Templates are rendered using classes that implement the RenderTemplateInterface.

Adding on to the previous example, we will use the included RenderVsprintfTemplate class

```php
// Create the render object
$template = new RenderVsprintfTemplate();

// Set the template source for the render object
$template->setSource(new Key1);

//Output the template with data
echo $template->render(['purple']);

//Outputs: template string, purple

// Set another template source for the render object
$template->setSource(new Key2);

//Output the template with data
echo $template->render(['red']);

//Outputs: template string two, red
```

#### Other rendering implementations

Many other rendering implementations can be created using the RenderTemplateInterface.
This can allow for using engines like Twig to render templates using the same sources or
even setting variables in other classes to a rendered template.

repository: Aesonus/message-templates

repo_name: Aesonus/message-templates


text:
# ⚠ DEPRECATED

This repository is no longer active, all the sources have been moved to a [new monorepo](https://github.com/gravitee-io/gravitee-api-management/tree/master/gravitee-apim-repository/gravitee-apim-repository-gateway-bridge-http).

The new repository will be become the single GitHub repository for everything related to Gravitee.io API Management.

## gravitee-repository-gateway-bridge-http
Gravitee.io - Repository - Gateway - Bridge HTTP


text:
# Launching a Parachain

We'll begin by deploying the test parachain with parachain id 100. These instructions are written specifically for parachain ID 100, however you can re-use these instructions with any parachain ID adjusting occurrences of the number 100 accordingly.

## Generate Genesis State

To register a parachain, the relay chain needs to know the parachain's genesis state. The collator node can export that state to a file for us. The following command will create a file containing the parachain's entire genesis state, hex-encoded.

```bash
test-collator export-genesis-state --parachain-id 100 para-100-genesis
```

> Creating this file is fast and easy, so this file is not included in the repository

## Obtaining the Wasm Validation Function

The relay chain also needs the parachain-specific validation logic to validate parachain blocks. This validation logic was created and included with the Wasm runtime when you compiled the collator. You can find it at `target/release/wbuild/cumulus-test-parachain-collator/cumulus-test-parachain-collator.compact.wasm`.

In case you chose to use a pre-built collator (eg a docker container) this validation blob is also included with this repository at `assets/cumulus-test-parachain-collator.compact.wasm`.

## Start the Collator Node
We can now start the collator node with the following command. Notice that we're supplying the same relay chain spec we used when launching relay chain nodes.

```bash
test-collator \
  --base-path collator-100 \
  --ws-port 9977 \
  --port 30336 \
  --parachain-id 100 \
  -- \
  --chain spec.json \
  --bootnodes /ip4/<Alice IP>/tcp/30333/p2p/<Alice Peer ID> \
  --bootnodes <Other Relay Chain Node(s)
```

The first thing to notice about this command is that several arguments are passed before the lone `--`, and several more agruments are passed after it. A cumulus collator contains the actually collator node, and also an embedded relay chain node. The arguments before the `--` are for the collator, and the arguments after the `--` are for the embedded relay chain node.

We give the collator a base path and ports as we did for the relay chain node previously. We also specify the parachain ID. Remember to change these collator-specific values if you are executing these instructions a second time for a second parachain. Then we give the embedded relay chain node the relay chain spec we are using. Finally, we give the embedded relay chain node some peer addresses.

## Is It Working?

At this point you should see your collator node running and peering with the relay-chain nodes. You should _not_ see it authoring parachain blocks yet. Authoring will begin when the collator is actually registered on the relay chain (the next step).

At this point your collator's logs should look something like this:
```
2020-06-23 07:21:48 Cumulus Test Parachain Collator
2020-06-23 07:21:48 ✌  version 0.1.0-05a83e8-x86_64-linux-gnu
2020-06-23 07:21:48 ❤  by Parity Technologies<EMAIL_ADDRESS>2017-2020
2020-06-23 07:21:48 📋 Chain specification: Local Testnet
2020-06-23 07:21:48 🏷  Node name: sad-sheet-9926
2020-06-23 07:21:48 👤 Role: FULL
2020-06-23 07:21:48 💾 Database: RocksDb at /tmp/collator-100/chains/local_testnet/db
2020-06-23 07:21:48 ⛓  Native runtime: wasm-test-parachain-4 (wasm-test-parachain-4.tx1.au3)
2020-06-23 07:21:50 Parachain id: Id(100)
2020-06-23 07:21:50 Parachain Account: 5Ec4AhP7HwJNrY2CxEcFSy1BuqAY3qxvCQCfoois983TTxDA
2020-06-23 07:21:50 Parachain genesis state: 0x0000000000000000000000000000000000000000000000000000000000000000008959d19fd6f3c67c6e83c0db48a52f0a08bcd9e1cc216a171b75e75a045444bd03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
2020-06-23 07:21:50 🔨 Initializing Genesis block/state (state: 0x8959…44bd, header-hash: 0x74be…fddf)
2020-06-23 07:21:50 📦 Highest known block at #0
2020-06-23 07:21:50 Using default protocol ID "sup" because none is configured in the chain specs
2020-06-23 07:21:50 🏷  Local node identity is: 12D3KooWBJBdWL7JesD7F1ytwuyi4csbuG4NvRDBD83f32W3vsid (legacy representation: QmbmsEtwLJenQgQ3detY4ThTy9f5tY4U8KERdkRDYrbgpc)
2020-06-23 07:21:51 🔍 Discovered new external address for our node: /ip4/<IP_ADDRESS>/tcp/30336/p2p/12D3KooWBJBdWL7JesD7F1ytwuyi4csbuG4NvRDBD83f32W3vsid
2020-06-23 07:21:51 🔨 Initializing Genesis block/state (state: 0xcd74…9bd3, header-hash: 0x4ed0…5c89)
2020-06-23 07:21:51 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-23 07:21:52 ⏱  Loaded block-time = BabeGenesisConfiguration { slot_duration: 6000, epoch_length: 600, c: (1, 4), genesis_authorities: [(Public(8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 (5FHneW46...)), 1), (Public(90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22 (5FLSigC9...)), 1), (Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-23 07:21:52 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-23 07:21:52 📦 Highest known block at #0
2020-06-23 07:21:52 🏷  Local node identity is: 12D3KooWLEFP2ZWAs9hZZtkyKox88LdRxFuoZmkLxNhLAMVWQt6i (legacy representation: QmbtLknBn5ejU47RoQfCkaTzQUusWLVgpnbMvfUyRBULSh)
2020-06-23 07:21:52 〽 Prometheus server started at <IP_ADDRESS>:9616
2020-06-23 07:21:52 📪 Libp2p listener () closed: Address already in use (os error 98)
2020-06-23 07:21:52 📪 Libp2p listener () closed: Address already in use (os error 98)
2020-06-23 07:21:52 Received message on non-registered protocol: [70, 82, 78, 75]
2020-06-23 07:21:55 💤 [Parachain] Idle (0 peers), best: #0 (0x74be…fddf), finalized #0 (0x74be…fddf), ⬇ 2.2kiB/s ⬆ 2.1kiB/s
2020-06-23 07:21:57 💤 [Relaychain] Idle (2 peers), best: #2 (0x5273…d217), finalized #0 (0x4ed0…5c89), ⬇ 2.8kiB/s ⬆ 2.3kiB/s
2020-06-23 07:22:00 ✨ [Relaychain] Imported #3 (0xcc7f…d2a5)
2020-06-23 07:22:00 Starting parachain attestation session on top of parent 0xcc7fe1df367b434bd0258bda7effb6622848e08b31e0c4ae5bf714f7334bd2a5. Local parachain duty is None
2020-06-23 07:22:00 💤 [Parachain] Idle (0 peers), best: #0 (0x74be…fddf), finalized #0 (0x74be…fddf), ⬇ 48 B/s ⬆ 45 B/s
2020-06-23 07:22:02 💤 [Relaychain] Idle (2 peers), best: #3 (0xcc7f…d2a5), finalized #0 (0x4ed0…5c89), ⬇ 0.3kiB/s ⬆ 0.3kiB/s
2020-06-23 07:22:05 💤 [Parachain] Idle (0 peers), best: #0 (0x74be…fddf), finalized #0 (0x74be…fddf), ⬇ 0 ⬆ 0
2020-06-23 07:22:06 ✨ [Relaychain] Imported #4 (0xe04d…eb43)
2020-06-23 07:22:06 Starting parachain attestation session on top of parent 0xe04d5b5b0ad077bfe6a56731ba4154262241d0ee488fc4e4390019aac809eb43. Local parachain duty is None
2020-06-23 07:22:07 💤 [Relaychain] Idle (2 peers), best: #4 (0xe04d…eb43), finalized #0 (0x4ed0…5c89), ⬇ 0.3kiB/s ⬆ 0.2kiB/s
2020-06-23 07:22:10 💤 [Parachain] Idle (0 peers), best: #0 (0x74be…fddf), finalized #0 (0x74be…fddf), ⬇ 0.3kiB/s ⬆ 0.3kiB/s
2020-06-23 07:22:12 ✨ [Relaychain] Imported #5 (0xa697…fbc4)
2020-06-23 07:22:12 Starting parachain attestation session on top of parent 0xa697b82fae4fd75c65845af6191a39f211f2cc7512d7b8b3419a557f8f9efbc4. Local parachain duty is None
2020-06-23 07:22:12 💤 [Relaychain] Idle (2 peers), best: #5 (0xa697…fbc4), finalized #0 (0x4ed0…5c89), ⬇ 0.3kiB/s ⬆ 0.3kiB/s
2020-06-23 07:22:15 💤 [Parachain] Idle (0 peers), best: #0 (0x74be…fddf), finalized #0 (0x74be…fddf), ⬇ 0 ⬆ 0
2020-06-23 07:22:17 💤 [Relaychain] Idle (2 peers), best: #5 (0xa697…fbc4), finalized #0 (0x4ed0…5c89), ⬇ 0.2kiB/s ⬆ 0.2kiB/s
2020-06-23 07:22:18 ✨ [Relaychain] Imported #6 (0xe175…92c8)
2020-06-23 07:22:18 Starting parachain attestation session on top of parent 0xe17562fff84d32fde412a227a2b0465ebed4c094ba5eebd87b7dd79df67892c8. Local parachain duty is None
2020-06-23 07:22:20 💤 [Parachain] Idle (0 peers), best: #0 (0x74be…fddf), finalized #0 (0x74be…fddf), ⬇ 0 ⬆ 0
2020-06-23 07:22:22 💤 [Relaychain] Idle (2 peers), best: #6 (0xe175…92c8), finalized #0 (0x4ed0…5c89), ⬇ 0.3kiB/s ⬆ 0.3kiB/s
2020-06-23 07:22:24 ✨ [Relaychain] Imported #7 (0xbd7a…03cd)
```

repository: wischli/cumulus-workshop

repo_name: wischli/cumulus-workshop


text:
# Manila CSI driver operator

An operator to deploy the [Manila CSI driver](https://github.com/openshift/cloud-provider-openstack/tree/master/pkg/csi/manila) in OpenShift.

## Design

The operator is based on [openshift/library-go](https://github.com/openshift/library-go). It manages `ClusterCSIDriver` instance named `manila.csi.openstack.org` and runs several controllers in parallel:

* `manilaController`: Talks to OpenStack API and checks if Manila service is provided.
  * If Manila service is found:
    * It starts `manilaControllerSet`: Runs `csidriverset.Controller` that installs the Manila CSI driver itself.
    * It starts `nfsController`: Runs `csidriverset.Controller` that installs NFS CSI driver itself.
    * It creates `StorageClass` for each share type reported by Manila and periodically syncs them at least once per minute, in case a new share type appears in Manila.
    * It never removes StorageClass if Manila service or share type disappears. It may be temporary OpenStack ir Manila re-configuration hiccup.
  * If there is no Manila service, it marks the `ClusterCSIDriver` instance with `ManilaControllerDisabled: True` condition. It does not stop any CSI drivers started when Manila service was present! This allows pod to at least unmount their volumes.
* `secretSyncController`: Syncs Secret provided by cloud-credentials-operator into a new Secret that is used by the CSI drivers. The drivers need OpenStack credentials in different format than provided by cloud-credentials-operator.

## Usage

Check deployment YAML files in `manifests/` directory.

The operator makes few assumptions about the namespace where it runs:

* OpenStack cloud credentials are in Secret named "cloud-credentials" in the same namespace where the operator runs. The operator uses the credentials to check if Manila is present in the cluster and, since OpenStack does not allow any fine-grained access control, it lets the CSI driver to use the same credentials.
* If underlying OpenStack uses self-signed certificate, the operator expects the certificate is present in a ConfigMap named "cloud-provider-config" with key "ca-bundle.pem" in the namespace where it runs. Generally, it should be a copy of "openshift-config/cloud-provider-config" ConfigMap. It then uses the certificate to talk to OpenStack API.
* The operand (= the CSI driver) must run in the same namespace as the operator, for the same reason as above - it uses the same self-signed OpenStack certificate, if provided.

repository: openshift/csi-driver-manila-operator

gha_language: Go

repo_name: openshift/csi-driver-manila-operator


text:
17.	Print Part of the ASCII Table

Find online more information about ASCII (American Standard Code for Information Interchange) and write a program that prints part of the ASCII table of characters at the console.  On the first line of input you will receive the char index you should start with and on the second line - the index of the last character you should print.

Examples

		Input
		Output

			60
65

			< = > ? @ A

			69
79

			E F G H I J K L M N O

			97
104

			a b c d e f g h

			40
55

			( ) * + , - . / 0 1 2 3 4 5 6 7

Hints

url: https://raw.githubusercontent.com/AleksandrinaGeorgieva/SoftUni/5f9c31a933f2b945cab3a0953eeeafdb1a2c627a/01 - Programming Fundamentals Course/01 - Data Types and Variables/Exercise/PrintPartOfTheASCIITable/Readme.md

repository: AleksandrinaGeorgieva/SoftUni

repo_name: AleksandrinaGeorgieva/SoftUni


text:
# DevOps your Skill: Submit

This is the last step of our pipeline. Previously we have run a lot of different tests and if everything is ok, it is time to submit our Alexa Skill to certification. It means, we have concluded the Continuous integration part, it is time to Continuous Deployment.

These step are automated in the continuous integration system (CircleCI) and are executed in each new version of the software.

## Prerequisites

Here you have the technologies used in this project
1. ASK CLI - [Install and configure ASK CLI](https://developer.amazon.com/es-ES/docs/alexa/smapi/quick-start-alexa-skills-kit-command-line-interface.html)
2. CircleCI Account - [Sign up here](https://circleci.com/)
3. Node.js v10.x
4. Visual Studio Code

## ASK CLI (Alexa Skill Kit CLI)

The Alexa Skills Kit Command Line Interface (ASK CLI) is a tool for you to manage your Alexa skills and related resources, such as AWS Lambda functions.
With ASK CLI, you have access to the Skill Management API, which allows you to manage Alexa skills programmatically from the command line.
We will use this powerful tool to validate our Alexa Skill. Let's start!

### Installation

The ASK CLI is included in the [Docker image](https://hub.docker.com/repository/docker/xavidop/alexa-ask-aws-cli) we are using so it is not necessary to install anything else.

### Submit

In this step of the pipeline we are going to submit our Alexa Skill using the ASK CLI.
When you submit your skill to the Alexa Store, it must pass a certification process from Amazon staff before it can be published live to Amazon customers.
We can use the following commands in the Skill Management API (SMAPI) to manage the certification and publication of an Alexa skill.
In our case, we will only submit to certificate and not publishing it automatically, just certify.

1. For ask cli v1:
```bash
    ask api submit -s ${skill_id} --publication-method MANUAL_PUBLISHING
```

2. For ask cli v2:
```bash
    ask smapi submit-skill-for-certification -s ${skill_id} --publication-method MANUAL_PUBLISHING
```

Those commands are integrated in the bash script file `test/submit/submit.sh`.

Here you can find the full bash script:

```bash
    #!/bin/bash
    skill_id=$1

    cli_version=$2

    echo "######### Submiting Skill for certification without publishing #########"

    if [[ ${cli_version} == *"v1"* ]]
    then
        submit=$(ask api submit -s ${skill_id} --publication-method MANUAL_PUBLISHING)
        exit 0
    else
        submit=$(ask smapi submit-skill-for-certification -s ${skill_id} --publication-method MANUAL_PUBLISHING)
        exit 0
    fi
```

This script has two parameters:
1. The id of the skill
2. The version of the ASK CLI you are running (v1 or v2).

### Reports

There are not reports defined in this job.

But we can see in the [Alexa Developer Console](https://developer.amazon.com/alexa/console/ask) the new status of our Alexa Skill in the Certification tab:

![image](../img/submit.jpg)

### Integration

It is not necessary to integrate it in `package.json` file.

## Pipeline Job

Everything is ready to submit our Alexa Skill, let's add it to our pipeline!

This job will execute the following tasks:
1. Restore the code that we have downloaded in the previous step in `/home/node/project` folder
2. Run the `submit` script.

```yaml
  submit:
    executor: ask-executor
    steps:
      - attach_workspace:
          at: /home/node/
      - run: cd test/submit/ && ./submit.sh $SKILL_ID v1
```

**NOTE:** To perform these tests in CircleCI you have to set the environment variable `SKILL_ID` with the id of your Alexa Skill.

## Resources
* [DevOps Wikipedia](https://en.wikipedia.org/wiki/DevOps) - Wikipedia reference
* [Official Alexa Skill Management API Documentation](https://developer.amazon.com/es-ES/docs/alexa/smapi/skill-testing-operations.html) - Alexa Skill Management API Documentation
* [Official CircleCI Documentation](https://circleci.com/docs/) - Official CircleCI Documentation

## Conclusion

Thanks to the ASK CLI we can perform this complex task.
This is the end, thank you for reading it until here!

I hope this example project is useful to you.

That's all folks!

Happy coding!

repository: xavidop/alexa-nodejs-lambda-helloworld

repo_name: xavidop/alexa-nodejs-lambda-helloworld


text:
---
layout: post
title: [Samsung SW - Mafia]
date: 2020-5-29
description: txt to markdown
thumbnail: city2.jpg
categories: Algorithm

# Information for the author block
author : Loui
---

```cpp

{% raw %}

	[189. [SAMSUNG SW – Mafia]
	- I felt that I have to read Question more deeply. since I’ve missed a restriction that if rest number of people is even, mafia turn. Otherwise, citizen’s turn.
	- because of that, I spent so much time.
	- I felt one more thing that it’s more effience that just implement max score rather than using sort algorithm in the algorithm header.
	- see the code.
	#include<iostream>
	#include<vector>
	#define max(a,b) a>b?a:b
	#define min(a,b) a>b?b:a
	using namespace std;

	//bool end_game = false;
	int N;
	int mafia_pos;
	vector<pair<int, bool>> people; //score and is_dead?
	vector<vector<int>> R;
	int answer = 0;

	void DFS(int rest, int night) {
		//if (end_game) return;
		if (people[mafia_pos].second == true || rest <= 1) {
			answer = max(answer, night);
			//if (rest == 1 && people[mafia_pos].second == false) end_game = true;
			return;
		}
		if (rest % 2 == 0) { //mafia time
			for (int i = 0; i < N; i++) {
				if (people[i].second == true || i == mafia_pos) continue;
				people[i].second = true;
				for (int j = 0; j < N; j++) {
					if (people[j].second==true) continue;
					people[j].first += R[i][j];
				}
				DFS(rest - 1, night + 1);
				//if (end_game) return;
				for (int j = 0; j < N; j++) {
					if (people[j].second == true) continue;
					people[j].first -= R[i][j];
				}
				people[i].second = false;
			}
		}
		else { //citizen time
			int max_score = 0;
			int min_index = 987654321;
			for (int i = 0; i < N; i++) {
				if (people[i].second == true) continue;
				if (people[i].first > max_score) {
					max_score = people[i].first;
					min_index = i;
				}
				else if (people[i].first == max_score) {
					min_index = min(min_index, i);
				}
			}
			people[min_index].second = true;
			DFS(rest - 1, night);
			//if (end_game) return;
			people[min_index].second = false;
		}
	}

	int main() {
		ios_base::sync_with_stdio(false);
		cin.tie(NULL); cout.tie(NULL);
		//get input
		cin >> N;
		people.assign(N,pair<int,int>());
		R.assign(N, vector<int>(N, 0));
		int temp_input;
		for (int i = 0; i < N; i++) {
			cin >> temp_input;
			people[i] = make_pair(temp_input, false);
		}
		for (int i = 0; i < N; i++)
			for (int j = 0; j < N; j++) cin >> R[i][j];
		cin >> mafia_pos;

		//algoirithm part
		DFS(N,0);
		cout << answer;
		return 0;
	}

{% endraw %}
```

path: /_posts/2020-5-29-[Samsung SW - Mafia].markdown

filename: 2020-5-29-[Samsung SW - Mafia].markdown


text:
# postman-doc-gen
Generate HTML API documentation from a postman collection. You can use this tool to auto-generate the documentation and host it alongside your API's as detailed <a<EMAIL_ADDRESS>
## Usage

- Download the latest release of the executable from  here.
- Open a new terminal and call the executable with the parameter -h to see the help info
    ![Screenshot](./img/iTerm_1.png?raw=true "Title")

- To generate documentation using a postman collection, use the following command -
    ```
    ./postman_doc_gen [path/to/collection] -o [path/to/output/folder]
    ```
    ![Screenshot](./img/iTerm_2.png?raw=true "Title")

- To apply environment values to the examples, use the following command -
    ```
    ./postman_doc_gen [path/to/collection] -o [path/to/output/folder] -e [path/to/environment/json]
    ```
    ![Screenshot](./img/iTerm_3.png?raw=true "Title")

- To enable download links to the collection and environment files, use the following command -
    ```
    ./postman_doc_gen [path/to/collection] -o [path/to/output/folder] -e [path/to/environment/json] -d true
    ```
    ![Screenshot](./img/iTerm_4.png?raw=true "Title")

- The output folder should now show the following -
    1. index.html - this is the html documentation generated from the collection
    2. css - this is the css folder consisting of the necessary css files
    3. js - this is the javascript folder consisting of the required js files
    4. collection json - if the download option was enabled, the collection json is also copied
    5. environment json - if the download option was enabled and an env file provided, the env json is also copied

## To build locally

- Clone the repository
- Download Python 3.7
- Create a virtual env (recommended but optional)
    ```
    python -m venv venv
    source ./venv/bin/activate
    ```
- pip install the dependencies from the requirements file
    ```
    pip install -r requirements.txt
    ```
- run the code
    ```
    python postman_doc_gen.py [path/to/collection] -o [path/to/output/folder]
    ```
- to create a new executable
    ```
    pyinstaller -F postman_doc_gen.spec postman_doc_gen.py
    ```

## Sample HTML Documentation

A video of the sample html document generated using the collection and environment json files
present in the example folder

![Sample HTML](sample_documentation.gif)

## Shout outs

The following tools/repos have been instrumental in building this tool

- Jinja
- PyInstaller
- Giphy Capture
- Bleach


text:
## Pi-Hypriot OS installation instructions

> ***NOTE: AFTER INITIAL POWER-UP OF THE NODES, AN INSTALLATION SCRIPT IS RUN WHICH WILL INSTALL THE OPENJDK AND A NUMBER OF PACKAGES. IT IS RECOMMENDED TO PLUG AN LED STRIP ON THE GPIO CONNECTOR AS IT WILL DISPLAY THE PROGRESS OF THE INSTALLATION (ALL LEDS TURN GREEN WHEN THE INSTALLATION IS COMPLETED)***

On your Mac, add the following entries to your _/etc/hosts_ file:

```
# Cluster #0
<IP_ADDRESS> node-0
<IP_ADDRESS> node-1
<IP_ADDRESS> node-2
<IP_ADDRESS> node-3
<IP_ADDRESS> node-4
```

> With support for `cloud-init` being present in the [Hypriot OS](http://blog.hypriot.com) distribution, we switch to using this tool instead starting from a standard installation and then going through a lengthy manual install.

The installation is now relatively simple:

Download and install the Hypriot _**flash**_ tool by following the instructions in the **Installation** section [here](https://github.com/hypriot/flash#installation).

Using the `akka-pi-os.yml` file in this repo, a 16GB micro SD card and a flash card reader/writer, you are now set to flash an SD card. You will probably customise at least one parameter in the `.yml`: the IP-address of the node (current value is _<IP_ADDRESS>_).

> NOTE: Edit `akka-pi-os.yml` to change line: `static ip_address=<IP_ADDRESS>/24` for each node.

The command to flash the card is (**always check the [Hypriot downloads page](https://blog.hypriot.com/downloads/) to find out what the most recent version is!**):

```
Pi-Akka-Cluster git:(master) ✗ flash -n node-1 -u akka-pi-os.yml \
   https://github.com/hypriot/image-builder-rpi/releases/download/v1.12.0/hypriotos-rpi-v1.12.0.img.zip
```

`-n node-0` specifies the host name for the node. For other nodes, set it to a name of the host this card is destined for (`node-0` through `node-4`)

We're also using the latest version of Hypriot (1.12.0 at the time of writing). For a complete list of available versions, see the [downloads page](https://blog.hypriot.com/downloads/).

Next:

- Insert the card into the micro SD slot on your Raspberry Pi (should work on Raspberry Pi 2 and 3 - Model B and B+).
- Power-up the Pi.
- Be patient... Installation progress is indicated on the LED strip (provided one is plugged into the GPIO connector).
- After about 1.5 minute, you can log-in on the Raspberry Pi. Log-in as user _akkapi_ using ssh (password is also _akkapi_).
- It takes between 4 and 6 minutes to complete the initial installation (depending on the Raspberry Pi model and the speed of the micro SD card).

> Note: During the first boot, a number of things happen:
>
> - Resizing of file system to utilise the full capacity of the flashed micro SD card.
> - Install a number of packages (see `.yaml` file for details.
> - Install Java 8 (OpenJDK).
>
> Check `/var/log/cloud-init-output.log` for progress.
>
> The process is finished when the following line is logged:

```
Cloud-init v. 0.7.9 finished at Sun, 12 May 2019 14:06:46 +0000. Datasource
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net].
Up 277.31 seconds
```

#### Repeat process for nodes 1 through 4

The installation of the OS as described in the previous section should be repeated for the remaining nodes. Make sure to pass the correct hostname (`node-1` ... `node-4`) to the `flash` script and to set the corresponding IP address in the `akka-pi-os.yml` file.

### Configure password-less login & finish the configuration

Follow the instructions in paragraphs `"Configure password-less login"` and `"Finishing the configuration"` in the [Hypriot OS Course Preparation Instructions](Hypriot-OS-Course-Preparation-Instructions.md) document.

### Running base cluster with status LED indicators

Start an `sbt` session and have a look at the available exercises by running the `projects` command:

```
$ sbt
man [e] > Pi-Akka-Cluster > initial state > projects
[info] 	   common
[info] 	 * exercise_000_initial_state
[info] 	   exercise_002_cluster_base
[info] 	   exercise_003_cluster_weakly_up
[info] 	   exercise_004_cluster_singleton
[info] 	   exercise_005_cluster_the_perils_of_auto_downing
[info] 	   exercise_006_cluster_weakly_up_disabled
[info] 	   exercise_007_split_brain_resolver_keep_majority
[info] 	   exercise_008_split_brain_resolver_static_quorum
[info] 	   exercise_009_split_brain_resolver_keep_referee
[info] 	   exercise_010_split_brain_resolver_keep_oldest
[info] 	   exercise_011_split_brain_resolver_down_all
[info] 	   exercise_012_split_brain_resolver_static_quorum_http_mamagement
[info] 	   exercise_013_clustered_sudoku_solver
[info] 	   exercise_014_add_cluster_client
[info] 	   exercise_015_clustered_sudoku_solver_cluster_client_enabled
[info] 	   exercise_017_es_opentracing
[info] 	   exercise_018_es_classic_console
[info] 	   exercise_050_cluster_cluster_singleton_akka_bootstrap_discovery_via_config
[info] 	   exercise_051_cluster_singleton_akka_bootstrap_discovery_via_akka_dns
[info] 	   pi_cluster_master
```

Next, we build the first exercise (`exercise_000_initial_state`):

```
man [e] > Pi-Akka-Cluster > initial state > clean;universal:packageBin
[success] Total time: 0 s, completed Nov 14, 2019 8:21:39 PM
[success] All package validations passed
<... elided>

[success] Total time: 6 s, completed Nov 14, 2019 8:21:46 PM
```

Quit `sbt` and copy the packaged binaries to the boards by running `copy` script. Pass the number of the exercise you want to copy, exercise 0 in this case, as a single argument:

```
$ ./copy 0
Copy exercise_000_initial_state-1.3.0.zip to node-0
exercise_000_initial_state-1.3.0.zip                                     100%   31MB  11.3MB/s   00:02
Unzipping archive
Copy exercise_000_initial_state-1.3.0.zip to node-1
exercise_000_initial_state-1.3.0.zip                                     100%   31MB  11.2MB/s   00:02
Unzipping archive
Copy exercise_000_initial_state-1.3.0.zip to node-2
exercise_000_initial_state-1.3.0.zip                                     100%   31MB  11.1MB/s   00:02
Unzipping archive
Copy exercise_000_initial_state-1.3.0.zip to node-3
exercise_000_initial_state-1.3.0.zip                                     100%   31MB  11.4MB/s   00:02
Unzipping archive
Copy exercise_000_initial_state-1.3.0.zip to node-4
exercise_000_initial_state-1.3.0.zip                                     100%   31MB  11.0MB/s   00:02
Unzipping archive
```

Log in on the different node (use a multi-session terminal like iTerm-2 on MacOS for efficiency) and run the exercise code using the `run` script. The `run` command takes a single argument which is the number of the exercise you want to run. For example, on `node-1`:

```
$ ./run 0
Running exercise_000_initial_state on node-1
```

The LEDs on the LED strip should blink in different colors for about 5 seconds.

## Addendum

### Driving a NeoPixel 8-LED strip

This section explains how to build the LED driver shared library on a Pi.

On a Raspberry-Pi, install build-tools (gcc, ...), _swig_ and _scons_:

```
sudo apt install build-essential
sudo apt-get install swig
sudo apt-get install scons
```

__Download and build software__ (see instructions in README.md in the repo) for driving NeoPixels: [rpi_ws281x](https://github.com/jgarff/rpi_ws281x)

Install JDK 8 (if not already installed):

```
$ sudo apt-get install oracle-java8-jdk
$ sudo apt-get update
```

Set `JAVA_HOME`

```
$ sudo update-alternatives --config java
There is 1 choice for the alternative java (providing /usr/bin/java).

  Selection    Path                                     Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-8-oracle/jre/bin/java   1081      auto mode
* 1            /usr/lib/jvm/java-8-oracle/jre/bin/java   1081      manual mode
```

This tells us that `JAVA_HOME` is `/usr/lib/jvm/java-8-oracle`

```
$ export JAVA_HOME=/usr/lib/jvm/java-8-oracle
$ git clone git@github.com:jgarff/rpi_ws281x.git
$ cd rpi_ws281x
$ rm -rf *.o
$ scons
$ mkdir java
$ cp python/*.i java
$ cd java
$ swig -package neopixel -java rpi_ws281x.i
$ gcc -c *.c -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux
$ gcc -shared -o librpi_ws281x.so ../*.o rpi_ws281x_wrap.o
$ ls -l librpi_ws281x.so
-rwxr-xr-x 1 akkapi akkapi 94444 Aug 15 13:18 librpi_ws281x.so
```

Running sample application `exercise_000_initial_state`:

```
$ ./run 0
```

## Hardware build instructions

- If you want to assemble the LED status strip yourself, detailed instructions can be found [here](LED-status-indicator-assembly-instructions.md).

- Assembling the Pi's to form a physical cluster is relatively straightforward. See diagram [Cluster set-up schema](images/Cluster-set-up-schema.pdf) to see how it all connects together.

repository: eloots/Pi-Akka-Cluster

gha_language: Scala

repo_name: eloots/Pi-Akka-Cluster


text:
---
layout: post
title: BlackBerry PlayBook
date: '2011-10-10 00:00:00'
---

Hey everyone,

It’s been a while since I posted on here.

I’ve just got back from [DroidCon UK 2011][1] and had a thoroughly good time. I will probably do a separate post later about the conference itself, but I was lucky enough to win a BlackBerry PlayBook while I was there and this post is about my impression of using my new toy. Basically BlackBerry had a stand there promoting their PlayBook, giving away two devices to those who dropped their business card in a pot. Now you may be wondering why BlackBerry was at an Android developers conference, well they’re releasing an Android ‘Player’ in the next PlayBook update which will mean that it can to run Android apps downloaded through it’s App World. Incidentally, the guy on the stand said that the update will be mid-November-ish.

Anyway, on with my impressions.

If I’m totally honest, when I got the email from the woman saying I’d won the PlayBook, I first thought it was spam, and then when realised it was real I then thought, how much are they fetching on eBay? Since then I’ve had a good play with it and can honestly say I’ve opinion has changed.

### QNX (OS)

First off, QNX is not perfect and I’m not claiming it is, but neither is Honeycomb. So I’ll start with a list of things which I think are good:

*   Proper App Task Management. I know Android’s has its inbuilt automatic Task Manager, and the improved of the ‘Recent App’ List in Honeycomb 3.1 has helped things, but PlayBook allows you easily switch running apps. Think of how Windows Mobile used to work with the task list. Running apps are also shown in a nice carousel on the Home screen which finding them easy.
*   There are just two control gestures you need to know when using QNX: drag down from the top of the device to show the menu (context specific to whatever app you’re running), and drag up from the bottom to show the Home screen. That’s it.
*   It’s very fluid and feels quick.
*   The browser is quick. The one thing I’ve always disliked about Android is its browser rendering speed, especially when compared to iOS. Samsung seems to have fixed that in its devices through its proprietary BitmapWebView, but stock Android’s WebKit is fairly slow. The PlayBook’s rendering speed is closer to that of iOS than Android’s.

Here’s a list of things that niggle me:

*   No portrait mode for most Apps (including the Home screen).
*   Lack of apps. Which will hopefully be ’fixed’ with the coming Android Player.
*   No email client (even a simple IMAP one would do).
*   No calendar.

### Hardware

BlackBerry has always excelled with its hardware, just look at its phones and the ergonomics it puts into its keyboards, so I expected the PlayBook to feel solid and it certainly feels it. I’m not going to talk much about this, but it’s definitely a good quality Tab in terms of build quality.

### Final words

It has it’s short-comings, the main ones being lack of apps, both 3rd party apps and ones which should have been bundled with the device, but I do feel QNX is nice to use. Will I be ditching my Honeycomb tab anytime soon? No. The PlayBook is a good device, and QNX is a nice OS but it’s simplistic and feels rushed overall.

 [1]: http://uk.droidcon.com/


text:
# Promise Snippets

Promises Pattern snippets for Sublime2

## Install

Clone this repository in your `Packages/` folder:

```
git clone git@github.com:thanpolas/promises-snippets.git
```

## Getting started

Just type `prom` on a javascript document and work with autocomplete.

The snippets are namespaced based on functionality, at most you'll have to type 4 chars and `Enter`:

snippet	Category	Description

promise       	New      	return new Promise(function(resolve, reject) { ... });

## Contributing
I am using this package as a helper for my workflow with Promises, feel free to do the same by submitting snippets that you use in yours.

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License)
© 2014 [Thanasis Polychronakis](https://github.com/thanpolas)

repository: thanpolas/promises-snippets

repo_name: thanpolas/promises-snippets