text:
---
layout: colorbleed
title: Wilberforce Colorbleed Unity plugin User Guide
---
# Contents
- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [How to use](#how-to-use)
    - [Parameters](#parameters)
    - [Performance Tips](#performance-and-other-tips)
- [Troubleshooting](#troubleshooting)
    - [Attaching Shader](#attaching-shader)
- [Contact Information](#contact-information)

# Introduction

Wilberforce Colorbleed (WC) is our Screen Space Indirect Lighting Plugin for Unity 5 (5.3.6 or higher)

You can [download free demo](https://projectwilberforce.github.io/cbdemo) or buy Wilberforce Colorbleed at [Unity Asset Store](https://www.assetstore.unity3d.com/#!/content/85066).

Please consider [rating the asset](https://www.assetstore.unity3d.com/en/#!/account/downloads/search=Colorbleed) to help others discover it.

- High performance and visual quality
- Supports Single Pass Stereo Rendering (SPSR) for Virtual Reality systems
- Compatible with Unity Post Processing Stack
- Compatible with all Unity rendering paths (Forward, Deferred and Legacy) and anti-aliasing
- Luminance sensitivity
- Option to reduce self-lighting
- Customizable blur
- Works well on screen borders
- Compatible with Unity 5.3 and higher

WC adds another layer of visual quality by simulation of indirect ambient light (i.e. light that reaches the surface by bouncing off of another surface, rather than directly from light source.) This results in objects "bleeding" their color on surfaces around them, making scenes appear more realistic. This effect also adds nice atmosphere to the image.

WC started as a feature for our [Volumetric Ambient Occlusion (VAO) Plugin](http://u3d.as/xzs), and thus been in development for quite some time. Integration in VAO imposed a lot of limitations, so we decided to create a standalone color bleeding plugin without restrictions. This means that WC already implements feedback from real applications and also wide range of performance optimizations.

We provide two algorithms - "Point Cloud" for real time applications and "Raymarching" for high quality and fast hardware. Raymarching is suitable for visualizations and still renders.

Both algorithms are fully dynamic without any necessary precomputing, which means that moving objects don't pose any extra problems.

Due to its Screen Space nature the algorithm is unaffected by level of geometry detail - runs the same way on both high and low-poly scenes.

WC is implemented as an image effect that gets attached to the camera. It features a variety of user-controlled settings, which lets designer to fine-tune the final appearance and balance performance.

Plugin is compatible with Unity Post Processing Stack (Deferred rendering path), all Unity rendering paths (Forward, Deferred and Legacy) and anti-aliasing.

See [forum for discussion](https://forum.unity3d.com/threads/colorbleed-image-effect.473033/) and contact us at<EMAIL_ADDRESS>for additional support. We are open to any questions or requests - after all this plugin started as as suggestion from one of our customers.

# Requirements

- Unity 5 (5.3.6 or higher; all editions including Personal)
- Shader Model 3.0:
*NVIDIA cards since 2004 (GeForce 6)*
*AMD cards since 2005 (Radeon X1300)*
*Intel cards since 2006 (GMA X3000)*
- Works on desktop platforms: DirectX 9.0c and higher, OpenGL
- Windows, Mac, Linux
- Not tested on mobile and web platforms

# Installation

1. Import from Asset Store.
2. Select your camera component.
![](camera.png)
3. From *Component* menu select *Image Effects -> Rendering -> Colorbleed*.
![](addcomponent.png)
4. Colorbleed effect should now be visible in the *Inspector* window.
![](inspector.png)
5. If property Colorbleed shader is not set to *"Hidden/Wilberforce/Colorbleed"* see Troubleshooting [section below](#attaching-shader) on how to fix it.
![](noshader.png)

# How to Use

## Parameters

WC effect behaviour is controlled by these parameters.

**Algorithm**
We provide two variants of the colorbleed effect.

- *Point Cloud*: Point cloud queries the color buffer once for each sample - this makes it fast and more suitable for real-time applications.
- *Raymarching*: Depth and color buffer are queried multiple times (as specified by *Raymarching Steps* parameter) at uniform intervals. This creates more accurate appearance at the cost of performance. Raymarching with lower step counts (~4) can be still usable for games applications depending on the available GPU resources. High step counts are aimed at models and scenes visualisations, screenshots etc.

**Radius**

Radius sets the distance of how far the algorithm reaches to sample surface colors. Higher radius means longer colorbleed caused by objects further away.

**Power**

Turn higher to create more pronounced result.

**Presence**

Presence makes the effect more pronounced towards the crease.

Presence turned off is closer to “physically-based” solution, however, adjust this to suit your scene and desired appearance.

You can also try increasing presence rather than radius to make effect more visible and save performance.

**Brightness**

This setting supresses the dark shadows. Use this if you want only the transfer of colors.

**Saturation**

Used to control saturation of the resulting color. When turned all the way down, the appearance is similar to [Ambient Occlusion](http://u3d.as/xzs).

**Backface Suppression**

Controls the degree of backface suppression. Note that complete suppression creates a sharp falloff of colorbleed at certain edges.

**Quality**

Number of samples used to calculate WC. Select lower settings if you need faster performance.

**Adaptive Sampling**

Adaptive sampling means lower number of samples is used on more distant areas of the image. Ideally causes no loss of detail.

- *Enabled Automatic*: Automatically determines where lower sample count should be used.
- *Enabled Manual*: Provides additional slider to fine-tune the change between the quality levels.

**Downsampled Pre-pass**

Speeds up the calculation by downsampling the parts with less colorbleed. Results in performance boost, especially for higher resolutions.

- *Greedy*: Skips areas that are below certain threshold of color in the downsampled prepass. Fast, but may cause small loss of detail.
- *Careful*: Instead of skipping computes colorbleed with low quality setting. Smaller performance gain but no loss of detail.

**Downsampling**

Reduces resolution of output, use this to gain performance at the cost of quality. Try lowering quality parameter first as this reduces quality dramatically. Having high quality setting with downsampling enabled serves no purpose.
Alternatively, use this option if you have some sort of supersampling enabled - as high pixel density would have adverse effect on performance without much visual impact.

### Rendering Pipeline

**Command Buffer**
Insert effect via command buffer (BeforeImageEffectsOpaque event)

**GBuffer Depth&Normal**
Take depth&normals from GBuffer of deferred rendering path, use this for better precision. Note that this feature will cause some performance drop.

**Intermediate Texture Format**

This lets you specify texture format for mixing colorbleed command buffer with scene. *Auto* is recommended (handles switching between HDR by default).

**Far Plane Source**

Source of Far Clipping Plane values. Some effects (notably Postprocessing Stack's Temporal Anti-aliasing) alter the *[_ProjectionParams](https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html)* variable which may cause flickering. If you are planning on using TAA or similar effect enable the *Camera* option to fix this.

### Luminance Sensitivity

Reduces colorbleed effect on bright surfaces - either light sources or strongly lit areas. We recommend enabling this in combination with downsampling to reduce the most visible artifact caused by reducing of the colorbleed texture. Also use this to prevent colorbleed on lamps, windows, screens etc.

- *Enable*: Toggles the effect on/off.
- *Mode*: What represents the brightness - either luminance or value component of HSV color model.
- *Threshold*: Controls the level of surface brightness that can still be affected by colorbleed.
- *Falloff Width*: Width of the area in which is the colorbleed gradually reduced.
- *Falloff Softness*: How fast is the colorbleed reduced.

**Enable Blur**

In case you are applying your own blur after WC effect, you can try turning this off to save performance. Blur step included in WC is fast and is part of its visual appearance, so you might consider keeping it on all the time. We include controls of size and sharpness. Note that high values (e.g. 7 and above) will slow down the computation. Sharpness does not affect performance.

**Output Colorbleed only**

Use for development to display only colorbleed component.

## Performance and other tips

**Performance tips**

- Use appropriate number of samples (*Quality* setting) - high enough to hide aliasing. There is nothing wrong with using 4-8 samples when radius is small enough.
- Consider using *Downsampling* at high screen resolutions.
- Judge the quality by the final image, not Colorbleed part only.
- Use *Adaptive Sampling* and *Downsampled Pre-pass* feature.

**Disabling Colorbleed for specific objects**

If you don't want some object to cast or receive color - set *Rendering Mode* of its material to *Fade* or *Transparent*. Or use plugin's *Luminance Sensitivity* option where possible.

# Troubleshooting

## Attaching shader

When Colorbleed effect is attached to the camera, its corresponding `Colorbleed.shader` file is automatically located and bound to *Colorbleed Shader* property. If this does not happen, make sure that `Colorbleed.shader` file can be found in the *Project* window under *Assets/Shaders* folder. Then bind this shader manually by drag&dropping it to *Colorbleed Shader* property in *Inspector* window.

Inspector shows no attached shader

Should instead look like this

# Contact Information
In case of questions or further issues, please contact us at<EMAIL_ADDRESS>


text:
Session 12: The Dawn of Transformers

[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/RajamannarAanjaram/badges/)
[![Awesome Badges](https://img.shields.io/badge/badges-awesome-green.svg)](https://github.com/RajamannarAanjaram/badges)

[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
[![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://GitHub.com/RajamannarAanjaram/)

### Problem Statement
Objective is to train a Spatial transformer on **`CIFAR-10`** dataset for 50 epochs and a explanation on what Spatial Transformer does.

### Spatial Transformers
- CNNs are not invariant to rotation and scale and more general affine transformations(meaning if the input images has more variations the model performs poorly).
- This gives raise to a technique called **`Spatial Transformer Networks`** (STN for short).

- **STN** allow a neural network to learn how to perform spatial transformations on the input image in order to enhance the geometric invariance of the model. For example, it can crop a region of interest, scale and correct the orientation of an image.
- We can apply the STN module to the input data directly, or even to the feature maps (output of a convolution layer).

  ### Architecture

  Spatial transformer networks boils down to three main components :
    - The localization network is a regular CNN which regresses the transformation parameters. The transformation is never learned explicitly from this dataset, instead the network learns automatically the spatial transformations that enhances the global accuracy.
    ```
    (localization): Sequential(
    (0): Conv2d(3, 8, kernel_size=(7, 7), stride=(1, 1))
    (1): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    (2): ReLU(inplace=True)
    (3): Conv2d(8, 10, kernel_size=(5, 5), stride=(1, 1))
    (4): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    (5): ReLU(inplace=True)
  )
    ```

    - The grid generator generates a grid of coordinates in the input image corresponding to each pixel from the output image.
    - The sampler uses the parameters of the transformation and applies it to the input image.

**Colab Notebook** [link](https://colab.research.google.com/drive/1KPC3hC1GiV-Cogv-yo8_7qzcV1DgheBW#scrollTo=sGlfCagJJSaD)

**GitHub Notebook** [link](https://github.com/RajamannarAanjaram/TSAI-Assignment/blob/master/12%20Dawn%20of%20Transformers/Saptial%20Transformers/SpatialTransformer.ipynb)

### Model Architecture

```
Net(
  (conv1): Conv2d(3, 10, kernel_size=(5, 5), stride=(1, 1))
  (conv2): Conv2d(10, 20, kernel_size=(5, 5), stride=(1, 1))
  (conv2_drop): Dropout2d(p=0.5, inplace=False)
  (fc1): Linear(in_features=500, out_features=50, bias=True)
  (fc2): Linear(in_features=50, out_features=10, bias=True)
  (localization): Sequential(
    (0): Conv2d(3, 8, kernel_size=(7, 7), stride=(1, 1))
    (1): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    (2): ReLU(inplace=True)
    (3): Conv2d(8, 10, kernel_size=(5, 5), stride=(1, 1))
    (4): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    (5): ReLU(inplace=True)
  )
  (fc_loc): Sequential(
    (0): Linear(in_features=160, out_features=32, bias=True)
    (1): ReLU(inplace=True)
    (2): Linear(in_features=32, out_features=6, bias=True)
  )
)
```
### Model Training logs

Adding last 5 epochs for training here
```
Train Epoch: 44 [0/50000 (0%)]	Loss: 1.421886
Train Epoch: 44 [32000/50000 (64%)]	Loss: 1.730358

Test set: Average loss: 1.1846, Accuracy: 5866/10000 (59%)

Train Epoch: 45 [0/50000 (0%)]	Loss: 1.334839
Train Epoch: 45 [32000/50000 (64%)]	Loss: 1.357687

Test set: Average loss: 1.1469, Accuracy: 6005/10000 (60%)

Train Epoch: 46 [0/50000 (0%)]	Loss: 1.443942
Train Epoch: 46 [32000/50000 (64%)]	Loss: 1.178336

Test set: Average loss: 1.2016, Accuracy: 5865/10000 (59%)

Train Epoch: 47 [0/50000 (0%)]	Loss: 1.353830
Train Epoch: 47 [32000/50000 (64%)]	Loss: 1.309253

Test set: Average loss: 1.1982, Accuracy: 5742/10000 (57%)

Train Epoch: 48 [0/50000 (0%)]	Loss: 1.397684
Train Epoch: 48 [32000/50000 (64%)]	Loss: 1.397693

Test set: Average loss: 1.2238, Accuracy: 5763/10000 (58%)

Train Epoch: 49 [0/50000 (0%)]	Loss: 1.472536
Train Epoch: 49 [32000/50000 (64%)]	Loss: 1.431374

Test set: Average loss: 1.1607, Accuracy: 5908/10000 (59%)

Train Epoch: 50 [0/50000 (0%)]	Loss: 1.189716
Train Epoch: 50 [32000/50000 (64%)]	Loss: 1.345627

Test set: Average loss: 1.1545, Accuracy: 6000/10000 (60%)

```

**complete model training and validation logs** can viewed [here](https://github.com/RajamannarAanjaram/TSAI-Assignment/blob/master/12%20Dawn%20of%20Transformers/Saptial%20Transformers/Logs.md)

### Model Results

### Contributors

| <centre>Name</centre> | <centre>Mail id</centre> |
| ------------ | ------------- |
| <centre>Amit Agarwal</centre>         |<EMAIL_ADDRESS>  |
| <centre>Pranav Panday</centre>         |<EMAIL_ADDRESS>  |
| <centre>Rajamannar A K</centre>         |<EMAIL_ADDRESS>  |
| <centre>Sree Latha Chopparapu</centre>         |<EMAIL_ADDRESS>  |\\

### References

https://brsoff.github.io/tutorials/intermediate/spatial_transformer_tutorial.html

repository: amitbcp/tsai-vision

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: amitbcp/tsai-vision


text:
Role for managing AWS instances
=========

This role manages AWS and mimic the behavior of ansible-role-cloud-infra

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

Same as the requirements for AWS modules.
- recent boto python module

Role Variables
--------------

~~~ yaml
# Which DC to use
aws_zone: null

#
...
~~~

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

    - hosts: servers
      roles:
         - { role: username.rolename, x: 42 }

License
-------

BSD

Author Information
------------------

repository: jtognazzi/ansible-role-aws-infra

branch_name: refs/heads/master

repo_name: jtognazzi/ansible-role-aws-infra


text:
# .env Sample

The `.env` file is used to initialize all enviroment variables in the development evironment. A popular solution to how you can organize and maintain your environment variables is to use a `.env` file. It makes it super easy to have one place where we can quickly read and modify them.

Create the `.env` file in the root of your app and add your variables and values to it. These are all the variables that are needed by WhatsBot. Description about these can be found in [app.json](./app.json).

```env
SESSION = ""
PMPERMIT_ENABLED = ""
MONGODB_URL = ""
YT_DATA_API_KEY = ""
DEFAULT_TR_LANG = ""
ENABLE_DELETE_ALERT = ""
OCR_SPACE_API_KEY = ""
INFOSPACE_API_KEY = ""
```

It is not mandatory to add all the variables in the `.env` file. Most of these have a default fallback value mentioned in [config.js](./config.js) in case it's not initialized in the dev environment.

At the bare minimum, you need to initialize atleast the following variables to make it work in your local environment.

```env
SESSION = ""
MONGODB_URL = ""
YT_DATA_API_KEY = ""
OCR_SPACE_API_KEY = ""
INFOSPACE_API_KEY = ""
```

- SESSION : Puppeteer Session. Get it by running genToken.js. As getToken.js creates a session.json file, this might not be necessary in a local environment as this variable has a fallback to the session.json file. It is mentioned here as it is the most inportant information needed by the bot to work.

- YT_DATA_API_KEY : Youtube DATA API key, grab it from <https:/>/cloud.google.com>.

- OCR_SPACE_API_KEY : Get it from <https://ocr.space/OCRAPI>.

- INFOSPACE_API_KEY : Get it from <https://infospace.club>.

- MONGODB_URL : Get it for free from cloud.mongodb.com. For a local mongodb instance in your system, this would be something like `mongodb://localhost:MONGO_PORT`. If you're using the default port then the url would be `mongodb://localhost:27017`.

repository: dqanshi/WhatsBot

repo_name: dqanshi/WhatsBot


text:
# Proxy classes here

Here is where the proxy classes, auto-generated by Orient, will be placed when launching the test-suite.

Bare in mind that you should change this path to your cache or tmp path (in Symfony2, for example, use "app/cache/Doctrine/OrientDB/Proxy").

You can change it in 2 lines: register the namespace in your autoloader:

    $classLoader = new SplClassLoader('Doctrine\OrientDB\Proxy', $symfony_root . "/app/cache");
    $classLoader->register();

and when you instantiate the Mapper:

    new Mapper($adapter, $symfony_root . "app/cache")

license: MIT

repository: doctrine/orientdb-odm

gha_language: PHP

gha_license_id: MIT

repo_name: doctrine/orientdb-odm


text:
<!-- AUTOGENERATED. See 'doc/build.jl' for source. -->
*LightGraphs.jl* implements the following graph operators. In general,
functions with two graph arguments will require them to be of the same type
(either both `Graph` or both `DiGraph`).
### complement
```
complement(g::LightGraphs.Graph)
complement(g::LightGraphs.DiGraph)
```
```rst
..  complement(s)

Returns the set-complement of :obj:`IntSet` ``s``.
```

Produces the [graph complement](https://en.wikipedia.org/wiki/Complement_graph) of a graph.

### reverse
```
reverse(g::LightGraphs.DiGraph)
```
```
reverse(s::AbstractString) -> AbstractString
```

Reverses a string

```
reverse(v [, start=1 [, stop=length(v) ]] )
```

Return a copy of `v` reversed from start to stop.

(`DiGraph` only) Produces a graph where all edges are reversed from the original.

### reverse!
```
reverse!(g::LightGraphs.DiGraph)
```
```rst
..  reverse!(v [, start=1 [, stop=length(v) ]]) -> v

In-place version of :func:`reverse`.
```

(`DiGraph` only) In-place reverse (modifies the original graph).

### blkdiag
```
blkdiag{T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, h::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph})
```
```
blkdiag(A...)
```

Concatenate matrices block-diagonally. Currently only implemented for sparse matrices.

Produces a graph with $|V(g)| + |V(h)|$ vertices and $|E(g)| + |E(h)|$ edges.

Put simply, the vertices and edges from graph `h` are appended to graph `g`.

### union
```
union{T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, h::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph})
```
```
union(s1,s2...)
∪(s1,s2...)
```

Construct the union of two or more sets. Maintains order with arrays.

Merges graphs `g` and `h` by taking the set union of all vertices and edges.

### intersect
```
intersect{T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, h::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph})
```
```
intersect(s1,s2...)
∩(s1,s2)
```

Construct the intersection of two or more sets. Maintains order and multiplicity of the first argument for arrays and ranges.

Produces a graph with edges that are only in both graph `g` and graph `h`.

Note that this function may produce a graph with 0-degree vertices.

### difference
```
difference{T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, h::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph})
```
Produces a graph with edges in graph `g` that are not in graph `h`.

Note that this function may produce a graph with 0-degree vertices.

### symmetric_difference
```
symmetric_difference{T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, h::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph})
```
Produces a graph with edges from graph `g` that do not exist in graph `h`, and vice versa.

Note that this function may produce a graph with 0-degree vertices.

### induced_subgraph
```
induced_subgraph{T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::T<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, iter)
```
Filters graph `g` to include only the vertices present in the iterable argument `vs`. Returns the subgraph of `g` induced by `vs`.

### join
```
join(g::LightGraphs.Graph, h::LightGraphs.Graph)
```
```
join(strings, delim, [last])
```

Join an array of `strings` into a single string, inserting the given delimiter between adjacent strings. If `last` is given, it will be used instead of `delim` between the last two strings. For example, `join(["apples", "bananas", "pineapples"], ", ", " and ") == "apples, bananas and pineapples"`.

`strings` can be any iterable over elements `x` which are convertible to strings via `print(io::IOBuffer, x)`.

Merges graphs `g` and `h` using `blkdiag` and then adds all the edges between  the vertices in `g` and those in `h`.

### tensor_product
```
tensor_product{G<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::G<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, h::G<:Union{LightGraphs.DiGraph,LightGraphs.Graph})
```
Returns the (tensor product)[https://en.wikipedia.org/wiki/Tensor_product_of_graphs] of `g` and `h`

### cartesian_product
```
cartesian_product{G<:Union{LightGraphs.DiGraph,LightGraphs.Graph}}(g::G<:Union{LightGraphs.DiGraph,LightGraphs.Graph}, h::G<:Union{LightGraphs.DiGraph,LightGraphs.Graph})
```
Returns the (cartesian product)[https://en.wikipedia.org/wiki/Tensor_product_of_graphs] of `g` and `h`

### crosspath
```
crosspath(len, h)
```
Replicate h len times and connect each vertex with its copies in a path


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

### Description

The Download Manager in Adobe Acrobat Professional and Reader 8.1.2 and earlier allows remote attackers to execute arbitrary code via a crafted PDF document that calls an AcroJS function with a long string argument, triggering heap corruption.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/0xCyberY/CVE-T4PDF
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# Techlearn
An e-learning portal

### About :

This is an e-learning portal developed using Django framework. Our primary aim is to provide free and efficient information and it is accessible for everyone.The site is under development phase.

### How did we get the Idea :

As a student we ponder over different sites when we stuck somewhere and most of the times we don’t find sufficient and efficient information, and even if we find the content is too vast to read and understand by ourselves. So to resolve all these problems we came up with making precise and effective notes that tends to cover most of the important things that is required.

### Technologies :

We have used Django, A web Framework of Python. Basically Django is an open source and is quite efficient for creating dynamic websites.We have used sqlite3 as the database as it is default for the django. For security purpose django itself encrypts all the private information so as a developer we don’t see the passwords of the user so our site can be reliable.

### Future Scope :

We are planning to use recommender system using Machine Learning, so that the topics which is most used by the users will be shown on top of their list.
We have planned to add meaning (both dictionary meaning and technical meaning) of most of the words. So that a user need not to refer other resources if they get stuck somewhere.

### Developers :

- Aditya Raman
- Arsh Deep

repository: ramanaditya/techlearn

repo_name: ramanaditya/techlearn


text:
---
layout: default
---

# 1998-11-02 - Computers as instruments of liberation

## Header Data

From: Tim May<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 171d0e893c3462ae6b18570410b1b25254704e7dd2417c7befb71fdd03c0e908

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1998-11-02 15:15:39 UTC

Raw Date: Mon, 2 Nov 1998 23:15:39 +0800

## Raw message

```
{% raw  %}From: Tim May<EMAIL_ADDRESS>Date: Mon, 2 Nov 1998 23:15:39 +0800
To<EMAIL_ADDRESS>Subject: Computers as instruments of liberation
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

"Wired News" carried an article reporting on a plan to  (somehow) spread
computers around the world, blah blah, and quoting John Gage at Sun on how
this would promote peace.

A couple of paragraphs have Cypherpunks resonances"

--begin excerpt--

Conference tackles ``techno-inequality''

By Judy DeMocker

SAN FRANCISCO (Wired) - When US farmers can call their cows home
individually using animal pagers, but the average teenager in Burkina Faso
has never made a
.....
Wiring developing nations could have some far-reaching consequences. One
might be that computer-based communications would be used to keep the
peace, according Net
Day co-founder John Gage, who works by day as Sun Microsystems' chief
scientist. When content from The New York Times can be translated into 30
Arab dialects, for
example, or when a remote Rawandan village has access to more perspectives
than the local magistrate, the Internet may become an instrument in
preventing violence.

``The Web gives people access to other voices, and instant access to
speaking about how the world really is,'' said Gage. ''If people can get
that, maybe that band of villagers
will think twice before going down the road and killing its neighbors.''

--end excerpt--

Fatuous nonsense. After all, those folks down the road may be taxing them,
and may need killing. Or those folks may use computer networks to connect
to others for the purposes of liberation.

I see computer networks as promoting secessionism, freedom fighting, and
resistance in general.

The New World Order, the One Worlders, see this as "terrorism."

Which is why strong encryption is needed. Which is why "they" oppose strong
encryption.

John Gage has a typically Fabian socialist view that somehow
computerization will lead to an orderly, peaceful world.

Me, I view networks as  the key to retribution and justice.

--Tim May

Y2K: A good chance to reformat America's hard drive and empty the trash.
---------:---------:---------:---------:---------:---------:---------:----
Timothy C. May              | Crypto Anarchy: encryption, digital money,
ComSec 3DES:<PHONE_NUMBER> | anonymous networks, digital pseudonyms, zero
W.A.S.T.E.: Corralitos, CA  | knowledge, reputations, information markets,
Licensed Ontologist         | black markets, collapse of governments.

{% endraw %}
```

## Thread

+ Return to [November 1998](/archive/1998/11)

+ Return to "[Petro <petro@playboy.com>](/authors/petro_petro_at_playboy_com_)"
+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"

+ 1998-11-02 (Mon, 2 Nov 1998 23:15:39 +0800) - Computers as instruments of liberation - _Tim May<EMAIL_ADDRESS>  + 1998-11-04 (Thu, 5 Nov 1998 02:34:02 +0800) - [Re: Computers as instruments of liberation](/archive/1998/11/6822730c457ea8bc0326cabea8430a618641ac4ec7d2647f8e07e9495b3c8008) - _Petro<EMAIL_ADDRESS>


text:
<!--- GENERATED BY gomplate from scripts/docs/monitor-page.md.tmpl --->

# collectd/nginx

 Monitors an nginx instance using our fork of the
collectd nginx plugin based on the [collectd nginx
plugin](https://collectd.org/wiki/index.php/Plugin:nginx).

See the [integrations
doc](https://github.com/signalfx/integrations/tree/master/collectd-nginx)
for more information.

Monitor Type: `collectd/nginx`

[Monitor Source Code](https://github.com/signalfx/signalfx-agent/tree/master/internal/monitors/collectd/nginx)

**Accepts Endpoints**: **Yes**

**Multiple Instances Allowed**: Yes

## Configuration

| Config option | Required | Type | Description |
| --- | --- | --- | --- |
| `host` | **yes** | `string` |  |
| `port` | **yes** | `integer` |  |
| `name` | no | `string` |  |
| `url` | no | `string` | The full URL of the status endpoint; can be a template (**default:** `http://{{.Host}}:{{.Port}}/nginx_status`) |
| `username` | no | `string` |  |
| `password` | no | `string` |  |
| `timeout` | no | `integer` |  (**default:** `0`) |

## Metrics

This monitor emits the following metrics.  Note that configuration options may
cause only a subset of metrics to be emitted.

| Name | Type | Description |
| ---  | ---  | ---         |
| `connections.accepted` | cumulative | Connections accepted by Nginx Web Server |
| `connections.handled` | cumulative | Connections handled by Nginx Web Server |
| `nginx_connections.active` | gauge | Connections active in Nginx Web Server |
| `nginx_connections.reading` | gauge | Connections being read by Nginx Web Server |
| `nginx_connections.waiting` | gauge | Connections waited on by Nginx Web Server |
| `nginx_connections.writing` | gauge | Connections being written by Nginx Web Server |
| `nginx_requests` | cumulative | Requests handled by Nginx Web Server |

repository: venkatudumula/signalfx-agent

repo_name: venkatudumula/signalfx-agent


text:
Here are some scripts about scraping I've written.

## Get the news

[getTitle.py](https://github.com/YingjieQiao/WebScraping/blob/master/Practices/getTitles.py) retrieves title and corresonding url link on hacker news.

## Tag count

Based on the data from the first 2 pages of https://stackoverflow.com/tags?page=1&tab=popular, [tagCount.py](https://github.com/YingjieQiao/WebScraping/blob/master/Practices/tagCount.py) produces a graph with languages on the x-axis and number of tags on the y-axis. In my current approach, I used 2 loops, i.e., created 2 BeautifulSoup objects to get 2 arrays.

## Quora Scraper

Type in the question you want to search on quora and it will automatically downloads all the answers of 100 relavant questions in one txt file. The [testfile.txt](https://github.com/YingjieQiao/WebScraping/blob/master/Practices/testfile.txt) here is generated running this [script](https://github.com/YingjieQiao/WebScraping/blob/master/Practices/quoraScraper.py).

repository: YingjieQiao/WebScraping

repo_name: YingjieQiao/WebScraping


text:
### Step fucking one - build docker image
\scripts\build-docker.sh

### Step 2 - run the image
In other repoos it is missing option "-k" (keeps the chain running after tests are done) and in general pointing to wrong files.
```
  docker run --name harmony-localnet-ganache --rm -p 9500:9500 -p 9800:9800 -p 9801:9801 -p 9501:9501 harmonyone/localnet-ganache -k
```
### Step 3 - import test wallet private key (only necessary if you want to do step #4)
```
exec -it harmony-localnet-ganache hmy keys import-private-key 1f84c95ac16e6a50f08d44c7bde7aff8742212fda6e4321fde48bf83bef266dc
```
### step 4 - Transfer funds to your personal address
```
docker exec -it harmony-localnet-ganache hmy transfer --from one155jp2y76nazx8uw5sa94fr0m4s5aj8e5xm6fu3 --from-shard 0 --to ONEYOURADDRESS --to-shard 0 --amount 10
```

### step 5 - Deploying the smart-contract
**create new .env file with contents:**
```
LOCALNET_PRIVATE_KEY='1f84c95ac16e6a50f08d44c7bde7aff8742212fda6e4321fde48bf83bef266dc'
TESTNET_PRIVATE_KEY='ENTER_PRIVATE_KEY_HERE'
MAINNET_PRIVATE_KEY='ENTER_PRIVATE_KEY_HERE'
```
This way you will be deploying contracts with the _one155jp2y76nazx8uw5sa94fr0m4s5aj8e5xm6fu3_ test wallet address

```
cd dapp-quickstart
yarn install
```

```
truffle migrate --network localnet --reset
```

### step 6 - interact with the contract through truffle
````
  truffle console --network localnet
  let instance = await Counter.deployed()
  instance
````

**Interacting with contract at specific address**
```
let specificInstance = await Counter.at("0x1234...");
```

[Truffle interacting-with-your-contracts](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)

### Troubleshooting Harmony localnet

Localnet runs as a docker container and you can see the logs using `docker logs --follow harmony-localnet-ganache` or enter into the container with `docker exec -it harmony-localnet-ganache bash`

## Deploying a sample dApp with truffle

The sample app provides a few smart-contract examples to start with created using [truffle](https://www.trufflesuite.com/docs/truffle/overview).

> NOTE: The dApp is already configured to use the account `one155jp2y76nazx8uw5sa94fr0m4s5aj8e5xm6fu3` for the deployment on the localnet. If you want to deploy on testnet and/or mainnet, or use another deployment account, you just need to set the corresponding private key in [dapp-example/.env](dapp-example/.env).

## Default settings

### Exposed ports by the localnet
| Shard | RPC | WS |
|-|-|-|
| 0 | localhost:9500 | localhost:9800 |
| 1 | localhost:9501 | localhost:9801 |

repository: GhengisWim/harmony-one-testnet

repo_name: GhengisWim/harmony-one-testnet


text:
---
id: serverjs
title: server.js
---

The server.js file is the equivelant of TiddlyWiki's tiddlywiki.js file. Except that it does more work. The file loads the settings file and parses it, then loads the preflighter, and passes them all to the `initServer` function. It also has an uncaughtException handler to log errors before the program crashes completely.

This means that TiddlyServer could also be implemented as part of a larger system, allowing the ServerConfig to be generated at startup and updated at any time during the server's lifetime. Most settings are accessed for each request, or updated on the `settings` event, but the preflighter function, bind address info, and server listeners will not be changed until the server is restarted, which should be doable with a `serverClose` event and then a new call to `initServer`.

The preflighter is still going to be your weapon of choice, allowing you to syphon off requests, select a different host from the tree, change the auth account and username applied to the request, and whatever other abilities the request and response objects give you.

The command line arguments are:

- `--dry-run`: Do everything except call server.listen(). Useful for checking settings.
- `--stay-on-error`: Start a setInterval loop to keep the process from exiting.

repository: someguynamedmatt/TiddlyServer

gha_language: TypeScript

repo_name: someguynamedmatt/TiddlyServer


text:
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you 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.
#
-->
[![build][travis-ci-image]][travis-ci-url]
[![npm version][npm-image]][npm-url]

# cordova-template-ngx-onsenui

You can start your new cordova project perfectly with this template.

This template uses:
* [Onsen UI](https://onsen.io/)
* [Angular](https://angular.io/)
* [Cordova](https://cordova.apache.org/)

## Requirements
* **Node.js:** _10.x_ or higher
* **Cordova:** _9.x_ or higher

---

## Installation

This template needs cordova or phonegap, for more information [cordova installation](https://cordova.apache.org/docs/en/latest/guide/cli/) or [phonegap installation](http://docs.phonegap.com/getting-started/1-install-phonegap/desktop/).

``` bash
$ cordova create hello com.example.hello HelloWorld --template cordova-template-ngx-onsenui
$ phonegap create hello com.example.hello HelloWorld --template cordova-template-ngx-onsenui
```

## Usage

You can use cordova or phonegap commands.

Example usage:
```
$ npm install
$ npm start
```
```
$ npm run build
$ cordova platform add android
$ cordova run android
$ cordova platform add ios
$ cordova run ios
```

[travis-ci-url]: http://travis-ci.org/puku0x/ngrx-todo
[travis-ci-image]: https://travis-ci.org/puku0x/ngrx-todo.svg?branch=master
[npm-url]: https://badge.fury.io/js/cordova-template-ngx-onsenui
[npm-image]: https://badge.fury.io/js/cordova-template-ngx-onsenui.svg


text:
# S3

    "Simple Storage Service"
    Object Storage only
    Data is spread over multiple facilities and devices.  Data is highly available.
    Each file can be 0 bytes to 5 TB
    Unlimited storage
    Bucket names must be unique globally.  The S3 namespace is universal.
    E.g. https://s3-eu-west-1.amazonaws.com/acoudguru
    A successful upload into S3 results in a HTTP 200.

## Data Consistency Model
    "Read after Write" consistency for PUTS of new objects.  You can read your file immediately after uploading it!
    "Eventual Consistency" for overwrites of PUTS and DELETES.

## General
    S3 is a key-value store
    Key is the name of the object
    Value is the data.
    Version ID is used for versioning.
    Metadata
    Subresources include "Policies", "Access Control Lists", "Cross Origin Resource Sharing" and "Transfer Acceleration".

## SLAs
    S3 is designed for 99.99% availability.
    Amazon guarantee 99.9% availability.
    Amazon guarantee 99.(11 9's)% durability.

## Features
### [Storage Classes ](https://aws.amazon.com/s3/storage-classes/)
    S3 Standard
      * Durable, Immediately Available, Frequently accessed.
      * 99.(11 9's) durability and 99.9% availability over a given year

    S3 Intelligent Tiering
      * Designed to optimise costs by automatically moving data between storage classes
      * Small monthly monitoring and auto-tiering fee
      * 99.(11 9's) durability and 99.9% availability over a given year

    S3-Standard-IA
      * Durable, Immediately Available, Infrequently accessed.
      * 99.(11 9's) durability and 99.9% availability over a given year
      * Low per GB storage price and per GB retrieval fee
      * Minimum object size of 128KB

    S3 One Zone
      * Durable, Immediately Available.
      * Useful for re-creatable data or secondary backups.
      * 99.(11 9's) durability of data in a single AZ.  If the AZ is lost, so is your data.
      * 99.5% availability over a given year
      * Minimum object size of 128KB

    S3 Glacier
      * 99.(11 9's) durability over multiple AZs over a given year
      * Three retrieval options that range from a few minutes to hours.
      * Minimum of 90 days of storage time per object.

    S3 Deep Glacier
      * 99.(11 9's) durability over multiple AZs over a given year
      * Lowest-cost storage class.
      * Designed for storage of data for 7-10 years.
      * Retrieval time within 12 hours

### Lifecycle Management
    - Two types of lifecycle actions
      * Transitions Actions - Moving an object between storage classes after a certain amount of time.
      * Expiration Actions - Defining when an object can be deleted from S3.

    - There are rules governing how soon an objection may be moved between storage classes. (i.e. how old or large an object must be in order to be eligible for moving).

### Versioning

	Versioning can be enabled at bucket level.
	If versioning is enabled, S3 keeps every previous version of a file after an PUT/DELETE operation applied to it.

	PUTting the same file creates a new version of the latest and set it as the latest version.
	DELETE operation simply puts a marker (delete marker) as the latest version of the target file.
	Therefore, it's similar to PUTting a delete marker as the latest version.

	The Standard GET operation simply returns the latest version to the client.
	Because a DELETE operation means inserting a marker as the latest version, an S3 client will see the file as deleted.

	In order to DELETE a specific version of a file, that version should be specified explicitly in the request.
	Otherwise, it refers to the latest version.

	If versioning is not enabled for the bucket, then the simply is physically overwritten with the PUTted version.
	DELETE actually deletes the file.

	One common point to remember with versioning - previous versions of the files also use storage capacity and
	will be counted towards your storage limit as well. As an exception DELETE MARKER only requires space with respect to
	the length of the key name you used for the actual file.

### Encryption
### ACLs and Policies

## Storage Tiers

### S3
    99.99% availability
    99.(11 9's)% durability
    Data storage across multiple devices and facilities.
    Designed for loss of 2 facilities.

### S3-IA
    Designed for less frequently accessed data.
    Supports rapid access
    Lower fee but you are charged a retrieval fee.

### S3 One Zone IA
    Same as S3-IA but stored on one AZ.
    99.5% availability
    99.(11 9's)% durability
    Cost is 20% less that S3-IA.

### Glacier
    For data that is archived.
    Recovery time is 3-5 hours.
    Very cheap.

### S3 Intelligent Tiering
    For data with unknown or unpredictable access pattern.
    2 tiers - Frequent and Infrequent Access
    AWS moves your data to the most cost-effective tier based on how frequently your data is accessed.
    99.9% availability
    99.(11 9's)% durability
    Small fee charged per month for each 1000 objects.

## Lifecycle Rules
![alt text](https://docs.aws.amazon.com/AmazonS3/latest/dev/images/SupportedTransitionsWaterfallModel.png "S3 Lifecycle Rules")
Credit: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html

    Objects must be stored at least 30 days in the current storage class before you can transition them to STANDARD_IA or ONEZONE_IA.
    Objects must be stored at least 30 days in the STANDARD_IA storage class before you can transition them to the ONEZONE_IA class
    The minimal storage duration period is 90 days for the GLACIER storage class and 180 days for DEEP_ARCHIVE.
    Consider aggregating many small objects into a smaller number of large objects to reduce transition request costs.

## S3 Charges
    Charged per GB
    Charged per requests
    Charged per Tags, Analytics and Inventory(?)
    Charged per download from S3. There is no charge for IN traffic to S3.
    Charged for "Transfer Acceleration".  TA used CloudFront to speed up upload times.

## S3 Security
    Buckets are private by default
    "Bucket Policies" applied at bucket level (written in JSON)
    "Access Control Lists" applied at object level and buckets (written in XML).
    ACLs describe which accounts/groups have read/write access to objects.
    Buckets can be configured to log all access to a bucket.  Logs can be written to another bucket.

## S3 Lab
    When creating a bucket, you can click a checkbox that will retain all versions of each object in this bucket.
    When creating a bucket, you can optionally select to encrypt your bucket.
    When uploading objects to your bucket, you may select ACLs and the storage class for this object.

## S3 Encryption
    Encryption in Transit
      SSL or TLS

    Encryption at Rest
      Server side encryption
        S3 Managed Keys (SSE-S3)
          Each object is encrypted with its own key.
          Each key is then encrypted with a master key which is regularly rotated.

        AWS Key Management Service or SSE-KMS
          Each object is encrypted with its own key.
          You are then given access to an "envelope" key which is used to encrypt each of the above keys.
          You also get an audit trail to log the use of your "envelope" key.
          You can supply your own key to use as the envelope key, or you may use the default key which Amazon provide.

        Server side encryption with Customer provided keys (SSE-C)
          AWS perform encryption/decryption but you provide the keys.

      Client side encryption
        You encrypt the files yourself before uploading them to S3.

### Enforcing encryption on S3 buckets
    Files are uploaded to S3 via HTTP PUT requests.
    "Expect: 100-continue" is a header in the PUT request.  This allows S3 to reject the request before the body has been submitted.
    To request a file to be encrypted on upload, the request must include "x-amz-server-side-encryption: AES256" or "x-amz-server-side-encryption: ams:kms"
    Your bucket policy may require that each header includes "x-amz-server-side-encryption".

## Cross Origin Resource Sharing (CORS)
    Allows bucket1 to access resources in bucket2.
    CORS must be enabled on bucket2.
    CORS is enabled by a <CORSConfiguration> block of XML which is applied to bucket2.
    The xml explicitly allows bucket1 to GET bucket2's resources.

## CloudFront
    A Content Delivery Network (CDN) is a network of geographically distributed servers that deliver content to a user based on the location of the user.

    A CDN is a service that speeds up upload and download times depending on your users' geographic location.

    S3 Transfer Acceleration makes use of CloudFront to achieve faster uploads into S3.

    CloudFront employs a collection of geographically distributed servers (Edge Locations) to act as a Cache for Users' objects in S3.

    The first time an object is request to S3, Amazon will store that object in a suitable Edge Location.  The next time that object is requested from a user in the same geographic location, it is downloaded from the Edge Location.

    Objects remain in an Edge Location for a period known as the Time To live (TTL).
    An Edge Location's cache may be manually cleared (called invalidation). This will incur an extra charge from Amazon.

    An "Origin" is the origin of all files that the CDN will distribute.  E.g. S3 Bucket, EC2 Instance, ELB or Route 53.
    A "Distrbution" is the name given to the CDN which contains a collection of Edge Locations.

    There are two CloudFront Distribution Types:
       * Web Distribution - Used for web sites.
       * RTMP - Used for Media Streaming.

# S3 Performance
    In July 2018, S3 performance was upgraded.
        * 3,500 PUT requests per second
        * 5,500 GET requests per second

    No need to randomise your objects keyname in order to prevent hot-spotting of an S3 server.

# From the FAQ

    https://aws.amazon.com/s3/faqs/

    Min file size is 0 bytes
    Max file size is 5 TB
    Max upload size is 5 GB
    If you want to upload a file greater than 5GB then you must use the [multi-part upload API](https://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html).
    You can use a multipart upload for objects from 5 MB to 5 TB in size.

    The S3 Standard storage class is designed for 99.99% availability
    The S3 Standard-IA storage class is designed for 99.9% availability
    The S3 One Zone-IA storage class is designed for 99.5% availability.

    You specify an AWS Region when you create your Amazon S3 bucket.
    Objects stored in the S3 One Zone-IA storage class are stored redundantly within a single Availability Zone in the AWS Region you select.
    The Amazon S3 One Zone-IA storage class replicates data within a single AZ.

    Customers may use four mechanisms for controlling access to Amazon S3 resources: Identity and Access Management (IAM) policies, bucket policies, Access Control Lists (ACLs), and Query String Authentication.
    With Query String Authentication, customers can create a URL to an Amazon S3 object which is only valid for a limited time.

    An Amazon VPC Endpoint for Amazon S3 is a logical entity within a VPC that allows connectivity only to S3.

    Amazon Macie is an AI-powered security service that helps you prevent data loss by automatically discovering, classifying, and protecting sensitive data stored in Amazon S3.

    Amazon S3 Standard, S3 Standard–IA, S3 One Zone-IA, and S3 Glacier are all designed to provide 99.999999999% durability of objects over a given year.
    For S3 data, best practice includes secure access permissions, Cross-Region Replication, versioning, and a functioning, regularly tested backup.

    Amazon S3 Intelligent-Tiering (S3 Intelligent-Tiering) is an S3 storage class for data with unknown access patterns or changing access patterns that are difficult to learn.
    S3 Intelligent-Tiering is designed for the same 99.999999999% durability as S3 Standard.
    S3 Intelligent-Tiering is designed for 99.9% availability.
    There are two ways to get data into S3 Intelligent-Tiering.  You can directly PUT into S3 Intelligent-Tiering by specifying INTELLIGENT_TIERING in the x-amz-storage-class header.  You can set lifecycle policies to transition objects from S3 Standard or S3 Standard-IA to S3 INTELLIGENT_TIERING.

    The S3 Standard-IA storage class is set at the object level and can exist in the same bucket as the S3 Standard or S3 One Zone-IA storage classes.
    S3 Standard-IA is designed for the same 99.999999999% durability as the S3 Standard and S3 Glacier storage classes.
    S3 Standard-IA is designed for 99.9% availability.
    There are two ways to get data into S3 Standard-IA. You can directly PUT into S3 Standard-IA by specifying STANDARD_IA in the x-amz-storage-class header. You can also set Lifecycle policies to transition objects from the S3 Standard to the S3 Standard-IA storage class.

    S3 One Zone-IA offers a 99% available SLA and is also designed for eleven 9’s of durability within the Availability Zone.
    Customers can use S3 One Zone-IA for infrequently-accessed storage, like backup copies, disaster recovery copies, or other easily re-creatable data.
    Amazon S3 One Zone-IA storage is 20% cheaper than Amazon S3 Standard-IA for storage by month.
    As with S3 Standard-Infrequent Access, if you delete a S3 One Zone-IA object within 30 days of creating it, you will incur an early delete charge.
    Like S3 Standard-IA, S3 One Zone-IA storage class has a minimum object size of 128KB.

    To retrieve Amazon S3 data stored in the S3 Glacier storage class, initiate a retrieval request using the Amazon S3 APIs or the Amazon S3 Management Console. The retrieval request creates a temporary copy of your data in the S3 RRS or S3 Standard-IA storage class while leaving the archived data intact in S3 Glacier.
    For all but the largest objects (250MB+), data accessed using Expedited retrievals are typically made available within 1-5 minutes. Objects retrieved using Standard retrievals typically complete between 3-5 hours. Bulk retrievals typically complete within 5-12 hours.
    Objects that are archived to Amazon S3 Glacier have a minimum of 90 days of storage, and objects deleted before 90 days incur a pro-rated charge equal to the storage charge for the remaining days.

    S3 Glacier Deep Archive is a new Amazon S3 storage class that provides secure and durable object storage for long-term retention of data that is accessed once or twice in a year.
    S3 Glacier Deep Archive is an ideal storage class to provide offline protection of your company’s most important data assets.
    S3 Glacier Deep Archive is up to 75% less expensive than S3 Glacier and provides retrieval within 12 hours using the Standard retrieval speed.
    S3 Glacier Deep Archive is designed for the same 99.999999999% durability as the S3 Standard and S3 Glacier storage classes. S3 Glacier Deep Archive is designed for 99.9% availability.
    The easiest way to store data in S3 Glacier Deep Archive is to use the S3 API to upload data directly. Just specify “S3 Glacier Deep Archive” as the storage class. You can accomplish this using the AWS Management Console, S3 REST API, AWS SDKs, or AWS Command Line Interface.  You can also begin using S3 Glacier Deep Archive by creating policies to migrate data using S3 Lifecycle.
    Tape Gateway, a cloud-based virtual tape library feature of AWS Storage Gateway, now integrates with S3 Glacier Deep Archive, enabling you to store your virtual tape-based, long-term backups and archives in S3 Glacier Deep Archive.
    To retrieve data stored in S3 Glacier Deep Archive, initiate a “Restore” request using the Amazon S3 APIs or the Amazon S3 Management Console. The Restore creates a temporary copy of your data in the S3 One Zone-IA storage class while leaving the archived data intact in S3 Glacier Deep Archive.
    Objects that are archived to S3 Glacier Deep Archive have a minimum of 180 days of storage, and objects deleted before 180 days incur a pro-rated charge equal to the storage charge for the remaining days.

    With S3 storage management features, you can use a single Amazon S3 bucket to store a mixture of S3 Glacier Deep Archive, S3 Standard, S3 Standard-IA, S3 One Zone-IA, and S3 Glacier data.

    Amazon S3 allows customers to run sophisticated queries against data stored without the need to move data into a separate analytics platform.
    S3 Select is an Amazon S3 feature that makes it easy to retrieve specific data from the contents of an object using simple SQL expressions without having to retrieve the entire object.
    With S3 Select, you can also perform operational investigations on log files in Amazon S3 without the need to operate or manage a compute cluster.

    Amazon Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL queries. Athena is serverless.
    To get started, just log into the Athena Management Console, define your schema, and start querying.

    Amazon Redshift Spectrum is a feature of Amazon Redshift that enables you to run queries against exabytes of unstructured data in Amazon S3 with no loading or ETL required.

    Amazon S3 event notifications can be sent in response to actions in Amazon S3 like PUTs, POSTs, COPYs, or DELETEs. Notification messages can be sent through either Amazon SNS, Amazon SQS, or directly to AWS Lambda.
    Amazon S3 event notifications enable you to run workflows, send alerts, or perform other actions in response to changes in your objects stored in S3.
    There are no additional charges for using Amazon S3 for event notifications. You pay only for use of Amazon SNS or Amazon SQS to deliver event notifications, or for the cost of running an AWS Lambda function.

    Amazon S3 Transfer Acceleration enables fast, easy, and secure transfers of files over long distances between your client and your Amazon S3 bucket.  As data arrives at an AWS Edge Location, data is routed to your Amazon S3 bucket over an optimized network path.
    To get started with S3 Transfer Acceleration enable S3 Transfer Acceleration on an S3 bucket using the Amazon S3 console, the Amazon S3 API, or the AWS CLI. After S3 Transfer Acceleration is enabled, you can point your Amazon S3 PUT and GET requests to the s3-accelerate endpoint domain name.

    You can add tags to new objects when you upload them or you can add them to existing objects. Up to ten tags can be added to each S3 object.
    Note that all changes to tags outside of the AWS Management Console are made to the full tag set. If you have five tags attached to a particular object and want to add a sixth, you need to include the original five tags in that request.

    The S3 Inventory report provides a scheduled alternative to Amazon S3’s synchronous List API.
    You can use the AWS Management Console or the PUT Bucket Inventory API to configure a daily or weekly inventory report for all the objects within your S3 bucket or a subset of the objects under a shared prefix.

    S3 Batch Operations is a feature that you can use to automate the execution, management, and auditing of a specific S3 request or Lambda function across many objects stored in Amazon S3.
    You should use S3 Batch Operations if you want to automate the execution of a single operation (like copying an object, or executing an AWS Lambda function) across many objects.

    Amazon S3 Object Lock is a new Amazon S3 feature that blocks object version deletion during a customer-defined retention period so that you can enforce retention policies as an added layer of data protection or for regulatory compliance.

    CloudWatch Request Metrics will be available in CloudWatch within 15 minutes after they are enabled.

    Cross-Region Replication is an Amazon S3 feature that automatically replicates data between AWS Regions
    CRR is configured at the S3 bucket level.
    Versioning must be enabled for both the source and destination buckets to enable CRR.
    You can configure separate S3 Lifecycle rules on the source and destination buckets. For example, you can configure a lifecycle rule to migrate data from the S3 Standard storage class to the S3 Standard-IA or S3 One Zone-IA storage class or archive data to S3 Glacier on the destination bucket.
    You can set up CRR across AWS accounts to store your replicated data in a different account in the target region.

repository: PaddyPowerBetfair/Cloud-Academy

repo_name: PaddyPowerBetfair/Cloud-Academy


text:
---
title: How I created this blog
date: '2019-01-30T21:53:50Z'
---

Inspired by this tweet from [Elijah Manor](https://twitter.com/elijahmanor)
![Elijah tweet](./elijah-tweet.png)
i decided to setup my own blog.

I quickly read through [this blog post](https://daveceddia.com/start-blog-gatsby-netlify/) by [Dave Ceddia](https://twitter.com/dceddia) and though at first I should just host this on my own server since I already have one.

Because I haven't finished configuring nginx on my server for subdomains and https I decided to check out [Netlify](https://netlify.com).

Less than an hour later, this blog is up and running. I'm still waiting on DNS propagation so https will activate, but the whole process was very easy.

repository: klauvi/blog

repo_name: klauvi/blog


text:
ATTENTION: This project is still in the works, not including a full demo yet.

# Single Message Transformation (SMT) for Kafka Connect to Filter String Messages

Single Message Transformation (SMT) is a great way to process single events as part of Kafka Connect's integration flow. No need to write source code. Just configuration as part of setting up your Kafka Connector connector.

This project shows how to build a simple SMT to filter String messages. If you want to build a SMT to process / transfor / filter / enrich / route a Struct or List event, this is hopefully still valuable: Understand the basics first, then take a look at the [source code of one of the other existing SMTs in the Kafka project on Github](https://github.com/apache/kafka/tree/trunk/connect/transforms/src/main/java/org/apache/kafka/connect/transforms) or check the [Unit Tests for these Transforms](https://github.com/apache/kafka/tree/trunk/connect/transforms/src/test/java/org/apache/kafka/connect/transforms).

## Intro to Single Message Transformation (SMT)

TODO Picture
TODO Link to Docs
TODO Link to Kafka Summit Video

TODO Comparison to Kafka Streams

## How to built a custom SMT?

- Create new project (e.g. Github)
- Add automated build system (e.g. Maven)
- Add Kafka Connect and Connect Transforms dependencies (to have access to Kafka Connect SMT API)
- Develop a simple “String Filter SMT”, e.g. by using another SMT as template, like [TimestampRouter SMT for String messages](https://github.com/apache/kafka/blob/trunk/connect/transforms/src/main/java/org/apache/kafka/connect/transforms/TimestampRouter.java)
- Build and generate JAR (without Kafka dependencies)
- Add the JAR to default Connect plugin path
https://docs.confluent.io/current/connect/userguide.html
- Start Connect via Confluent CLI
- Add connector including the SMT
- Test it
- Develop Unit Test

## Source Code Snippet
TODO

## Unit Test
TODO

## Demo Requirements
TODO

## Step-by-Step Guide
TODO


text:
# Heron Programming Language

![heron-logo-screenshot](https://user-images.githubusercontent.com/1759994/236684195-4cd18d88-8cfd-4744-8c50-590aed2892b0.png)

See a demo of 3D geometry in the browser at: [https://cdiggins.github.io/heron-language](https://cdiggins.github.io/heron-language)

# About Heron

Heron is a small cross-platform language that was designed for ease of use, performance, and safety with a JavaScript like syntax. Heron emphasizes pure functional programming code, but looks like a traditional imperative or object-oriented code.

The Heron implementation was written in TypeScript and uses the [Myna parsing library](https://github.com/cdiggins/myna-parser)
and the [cdiggins/type-inference](https://github.com/cdiggins/type-inference) project.

# Type Inference

The most interesting feature of Heron is the fact that it supports type-inference of polymorphic higher-order functions.

![heron-example](https://user-images.githubusercontent.com/1759994/236684430-ee00d3c9-6fa6-4f3f-9511-7e319ca367c5.png)

The [type inference module was developed as its own standalone library](https://github.com/cdiggins/type-inference) so that it can be reused in other projects.

# Citation

To formally cite this project please use:

```
@software{Heron Language,
  author = {Diggins, Christopher},
  title = {Heron Programming Language},
  url = {https://github.com/cdiggins/heron-language},
  year = {2018},
}
```

## Status - Retired

Heron is not under active development. Many features and design ideas from Heron have influenced the [Plato language](https://github.com/cdiggins/plato).

## Heron Design Goals

Heron is intended as a language for expressing libraries of algorithms, that can be reused within other languages as opposed to a language for writing full applications.

Heron is a fully statically typed language that does not require type annotations in most cases (it supports type inference), so it looks and feels like a dynamic language, with the potential efficiency, safety, and tooling of a compiled language.

The Heron design is influenced most heavily by JavaScript, Haskell, C#, Scala, GLSL, and Scheme, but other languages play a role as well. Heron has a powerful module system built into the language, and a language versioning scheme for maintaining backwards compatibility while the language evolves.

Current development on Heron is focused on numerical array processing, such as required in sound and image processing, and data visualization in 2D and 3D. The reference implementation generates JavaScript, but a C++ generator is planned as well.

Heron is built on the principle of emphasizing functional programming, immutable data structures, and type safety while minimizing complexity.

## Implementation

The v0.1 implementation of Heron is written in TypeScript and generates JavaScript. A Heron to C++ compiler is being planned.

The language implementation is quite small and simple compared to  other strongly typed languages.

Please [reach out to<EMAIL_ADDRESS>if you have a use case for Heron in other contexts and perhaps we can work together.

# Files and Modules

```
language heron:std:0.1;

module heron:intrinsics:0.1
{
    function main() {
        print("Hello world");
    }
}
```

At the top of every Heron source code file is a language version statement. This is intended to facilitate backwards compatibility and smooth language evolution. The language version statement has the form `language name:dialect:version;`. The language name is always `heron` and for now the only supported dialect is the `std`. The current language version is `0.1`.

All code must be defined within a named module. In Heron v0.1 files can contain only one module.

Like the language version statement module names have three parts separated by colon character (e.g. `organization:project:version`). The first part is the organization name, the second is the project/library name, and the third is the version identifier. A module name part can be a combination of letters, numbers, hypen, underscore, or dot characters.

## Top Level Forms

At the top-level scope of a module the following definitions are allowed:

* Functions
* Intrinsic
* Variables
* Imports
* Types

### Function Definitions

Heron supports named functions and anonymous functions. Both function forms support either expression bodies or statement bodies.

```
// Named function with statement body
function sum(xs) {
    var result = 0;
    for (var x in xs)
        result += x;
    return result;
}

// Anonymous function with statement body
var sum = (xs) => {
    var result = 0;
    for (var x in xs)
        result += x;
    return result;
}

// Named function with expression body
function sum(xs) =
    xs.reduce(0, op+);

// Anonymous function with expression body
var sum = (xs) =>
    xs.reduce(0, op+);
```

#### Function Overloads

Unlike JavaScript and TypeScript Heron allows the same name to be used for multiple functions. Like other strongly typed language, multiple functions may have the same name if they differ by the inferred type signature.

When multiple function can be chosen from a single name, the function with the type parameter that best matches the types of the expressions is chosen. If there is ambiguity, the most general type is chosen. This means that if you have an overloaded set of fucntions with ambiguity (like `op+`) then at least one function should have a generic implementation.

#### Operator Overloads

Most binary operators can be overloaded. The Heron compiler maps operator calls to functions that have the letters `op` before the operator symbol (e.g. `op+`, `op<=`, `op..` etc.). This allows operators to be passed as function arguments. For several examples of operator definitions see the `intrinsics.heron` file.

### Intrinsics

An intrinsic is a primitive function that the compiler has built-in knowledge of. Intrinsics usually have type annotations provided, otherwise the most generic type signature is assumed (e.g. `Func<T0, T1, TR>`).

The module named `heron:intrinsics:0.1` is implicitly loaded in every file of a project, without having to be explicitly imported.

### Module Variable Declarations

Variables declared at the module level cannot be rebinded. Apart from that module variables are the same as regular variables.

### Imports

Import statements can occur anywhere, but affect the whole module. All definitions from the imported module are resolved as if they were declared within the importing module level scope.

Imported modules must have the same or lesser language version than the importing module. (e.g. Heron 2.3.2 can import Heron 2.2.4 but not Heron 2.5.0). Version 1.0.0 and above of Heron is not guaranteed to be backwards compatible with pre-1.0.0 versions of Heron.

## Statements

Heron has the following statements:

* Variable declarations
* While statements
* Do/while statements
* For statement
* Compound Statement
* If statement
* Empty statement

### For Statements

The for loop in Heron is similar to a for-each statement in many languages, or the for-of statement in JavaScript.

`for (var x in 0..100) print(x);`

A singled named variable is assigned each value of the array expression in order. In the above example the range operator is used to create am array of values from 0 to 99 inclusively.

## Expressions

Heron has the following expression forms:

* Binary arithmetical operators `+ - * / %`
* Binary comparison operators `< > <= >= == !=`
* Boolean operators `&& || ^^`
* Array indexing: access `xs[i]` and assignment `xs[i] = x`
* Postfix increment and decrement `++ --`
* Ternary conditional operator `?:`
* Lambda expression `(args) => body`
* Regular function call: `f(arg0, arg1, ..., argN)`
* Method call syntax `arg0.f(arg1, ..., argN)`
* Propery syntax `arg0.f`
* Variable binding expression `var name in expr`
* Assignment `= += = *= /= %=`

## Function Calls and Object Oriented Syntax

Heron is explicitly not an object oriented language, but supports a dot syntax enabling method and property chaining.

In Heron every function is a static function (there is no implicit `this` variable) but you can also call any function using a dot syntax, with the first argument on the left of the function. If the the function is a unary function (has only one argument) then when using dot syntax the parentheses are omitted, giving it the appearance of a computed property.

```
function sqr(x) = x * x;
function multiply(x, y) = x * y;

// The following two are equivalent and print 36
print(sqr(6));
print(6.sqr);

// The following two are equivalent and print 42
print(multiply(6, 7));
print(6.multiply(7))

// The following is a compilation error, it would be equivalent to writing `sqr(6)()`
print(6.sqr())
```

# The Heron Type System

Heron is a strongly typed programming language. This means that all variables have a type that is determined at compile-time.

## Type Inference

Variable types are deduced from the types of the expressions assigned to them. Function argument types are deduced from how the arguments are used within the function: the mosts specific type satisfying all constraints (i.e. the usage) is assigned.

## Supported Types

Heron v0.1 supports the following types:

```
    Float
    Float2
    Float3
    Float4
    Int
    Bool
    Array<T>
    ArrayBuilder<T>
    Func<T0, T1, ..., TN, R>
    Mesh
```

These are declared in the intrinsics module, but in v0.1 new types can't' be added without adding support in the compiler.

## Type Casts

The following casts happen implicitly:

```
    Float <- Int
    Float2 <- Float
    Float3 <- Float, Float2
    Float4 <- Float, Float2, Float3
```

## Arrays

Arrays cannot be modified: you cannot assign new values or add or remove values. You can only do that with an `ArrayBuilder` instance which can be constructed from an `Array`.

Arrays support two basic operations:

```
    intrinsic count<T>(xs: Array<T>): Int;
    intrinsic at<T>(xs: Array<T>, i: Int): T;
```

The basic array constructor takes the number of items in the array and a function that generates values in the array for each index:

```
    intrinsic array<T>(n: Int, f: Func<Int, T>): Array<T>;
```

The range operator is defined as follows:

```
    function op.. (from: Int, upto: Int): Array<Int>
        = array(upto - from, (i) => i + from);
```

In the default implementation is a rich set of arrays operations defined as a library. See the [source code](input/array.heron) for the implementations of different functions.

### Common Immutable Array Operations

There most used building block operations used when processing arrays:

```
    map(xs: Array<T>, f: Func<T, U>): Array<U>;
    filter(xs: Array<T>, f: Func<T, Bool>): Array<T>;
    reduce(xs: Array<T>, U init, Func<T, U, U> f): U;
    zip(xs: Array<T>, ys: Array<U>, f: Func<T, U, V>): Array<V>;
    slice(xs: Array<T>, from: Int, to: Int): Array<T>;
```

## ArrayBuilder

An array builder is another immutable data type that allows the user to set values on an array using familiar indexing assignment syntax, and supports adding elements to the end of the array.

An `ArrayBuilder` supports the same operations as an `Array` with additional operations:

```
    push<T>(xs: ArrayBuilder<T>, x: T): ArrayBuilder<T>;
    set<T>(xs: ArrayBuilder<T>, i: Int, x: T): ArrayBuilder<T>;
```

Note that "setting" or "pushing" onto an `ArrayBuilder` instance, creates a new instance: it does not affect the original.

An `ArrayBuilder` supports an index assignment syntax:

```
    xs[i] = 42
```

Which is rewritten by the compiler as:

```
    xs = xs.set(i, 42);
```

An `ArrayBuilder` can be constructed from an `Array` as follows:

```
    intrinsic mutable<T>(xs: Array<T>): ArrayBuilder<T>;
```

Example of using `ArrayBuilder`:

```
    var xs = [1,2,3].mutable
    xs[0] = 5;
    print(xs[0]); // 5

    xs = xs.setAt(0, -1);
    print(xs[0]); // -1

    xs.setAt(0, 3);
    print(xs[0]); // Still -1

    xs = xs.push(9);
    print(xs.count); // 4
```

### QuickSort: An ArrayBuilder Example

The following is an example of a quick-sort algorithm written using the `ArrayBuilder`

```
    function partition(a, lo, hi) {
        var p = a[lo];
        var i = lo - 1;
        var j = hi + 1;
        while (true) {
            do { i++; } while (a[i] < p);
            do { j--; } while (a[j] > p);
            if (i >= j) return j;
            swapElements(a, i, j);
        }
    }

    function qsort(a, lo, hi) {
        if (lo < hi) {
            var p = partition(a, lo, hi);
            qsort(a, lo, p);
            qsort(a, p+1, hi);
        }
        return a;
    }

    function sort(xs)
        = xs.mutable.qsort(0, xs.count-1).immutable;
```

# Appendices

* [A comparison of Heron to JavaScript / TypeScript](comparison.md)
* [A brief history of the Heron language](history.md)

repository: cdiggins/heron-language

repo_name: cdiggins/heron-language


text:
# Deploy containers using Elastic Container Service and CloudFormation

ECS and Fargate give you a lot of control over how you want to deploy containers, and how you would like them to be networked and accessed. This repository contains CloudFormation templates to help you setup several common architectures across both AWS ECS on EC2 and AWS ECS on AWS Fargate.

To get started use the AWS CLI to execute the following command. This will create a role that enables ECS on your account, so the following reference templates will work properly:

```
aws iam create-service-linked-role --aws-service-name ecs.amazonaws.com
```

Next choose one of the following common architecture stacks which many customers use. The templates can be deployed either using the AWS CLI, or in the AWS CloudFormation console.

### Publically networked service, with public load balancer

This is a service with direct access to the internet, and exposed publically to the internet behind a public load balancer so that people can access it. The service has a public IP address so it can initiate direct communication to other things on the internet.  This approach is one of the most simple for public facing services.

![public subnet public lb](images/public-subnet-public-lb.png)
__EC2 hosted:__

1. Deploy the [EC2 Cluster with fully public network](cluster/cluster-ec2-public-vpc.yml)
2. Deploy the [external, public ALB](ingress/alb-external.yml) ingress
3. Deploy the [public load balanced EC2 service template](service/service-ec2-public-lb.yml)

__Fargate hosted:__

1. Deploy the [Fargate cluster with public subnet](cluster/cluster-fargate-public-vpc.yml)
2. Deploy the [external, public ALB](ingress/alb-external.yml) ingress
3. Deploy the [public load balanced Fargate service template](service/service-fargate-public-subnet-public-lb.yml)

### Privately networked service, with public load balancer

This is a service protected inside a private subnet, with no direct internet access. Because the service does not have public IP address it must initiate outbound connections through a NAT Gateway, which communicates to the external internet on the service's behalf. However, you may still want to give the public limited access to the service via a load balancer which is public.

![private subnet public lb](images/private-subnet-public-lb.png)
__EC2 hosted:__

1. Deploy the [EC2 Cluster with fully private network](cluster/cluster-ec2-private-vpc.yml)
2. Deploy the [external, public ALB](ingress/alb-external.yml) ingress
3. Deploy the [public load balanced EC2 service template](service/service-ec2-public-lb.yml)

__Fargate hosted:__

1. Deploy the [Fargate cluster with public subnet](cluster/cluster-fargate-private-vpc.yml)
2. Deploy the [external, public ALB](ingress/alb-external.yml) ingress
3. Deploy the [private subnet, public load balanced Fargate service template](service/service-fargate-private-subnet-public-lb.yml)

### Privately networked service, with private load balancer

This is a service which is protected inside a private subnet. Not only does it not have a public IP address, but it also behind a private load balancer which can only be accessed by your own services. This is often used for internal services, where one frontend service communicates to a backend service which the public is not intended to directly access. In the diagram below notice how someone from the public internet initiates the blue connection to the public facing service in the public subnet, but that service can then initiate a green connection the private internal service:

![private subnet private lb](images/private-subnet-private-lb.png)
__EC2 hosted:__

1. Deploy the [EC2 Cluster with fully private network](cluster/cluster-ec2-private-vpc.yml)
2. Deploy the [internal, private ALB](ingress/alb-internal.yml) ingress
3. Deploy the [public load balanced EC2 service template](service/service-ec2-public-lb.yml)

__Fargate hosted:__

1. Deploy the [Fargate cluster with private subnet](cluster/cluster-fargate-private-vpc.yml)
2. Deploy the [internal, private ALB](ingress/alb-internal.yml) ingress
3. Deploy the [private subnet, private load balanced Fargate service template](service/service-fargate-private-subnet-private-lb.yml)

### Privately networked service, with service discovery

This service type is privately networked, so it only has a private IP address, and can't receive any traffic directly from the internet. Rather than using a load balancer, this service uses a service discovery mechanism to register's its private IP address for others to discover. Another service or user can use DNS based discovery or API based discovery to get the direct IP address of the container and talk directly to it. This approach is fantastic for internal communications between private services in the same private tier of your application.

![private subnet private service discovery](images/private-subnet-private-service-discovery.png)
__EC2 hosted:__

_While this combination is currently possible via the API and console, it is not included here because it is pending full CloudFormation support for `bridge` mode networking combined with service discovery. Check [this example template](service/service-ec2-private-discovery.yml) to see how it will look once support is added._

__Fargate hosted:__

1. Deploy the [Fargate cluster with private subnet](cluster/cluster-fargate-private-vpc.yml)
2. Deploy the [internal service discovery](ingress/service-discovery-internal.yml) ingress
3. Deploy the [private subnet, private service discovery Fargate service template](service/service-fargate-private-subnet-private-discovery.yml)

## Your ingress address

__ALB Ingress:__

Once the service stack is deployed check the outputs tab of the ingress stack that you deployed to get the URL to use to access your containers. Note that an external ALB's URL will be accessible to the public from any computer, but an internal ALB's URL will only be accessible if you make the request from an instance inside the VPC, with the appropriate security group. If you want to test spin up a Cloud 9 development environment in the VPC, add its security group to the load balancer's security group and execute a `curl` command.

__Service Discovery Ingress:__

For service discovery things are a little different. The service is available at `<service name>.<domain>` where `domain` is the domain address you entered when you created the service discovery ingress. Once again if you are using a private, internal servicex discovery endpoint the DNS name will only resolve for hosts inside the VPC. You can test this by adding a Cloud 9 development environment to the VPC and executing a command like:

```
dig +short nginx.service.production
```

## Further customizations

Note that these baseline templates have only HTTP listeners (no SSL support) but this can be easily added to the templates once you create or import an SSL certificate into Amazon Certificate Manager. Additionally, you may want to customize the default autoscaling rules that are embedded in the service template.

repository: boale/quoteAppAPI

gha_language: JavaScript

repo_name: boale/quoteAppAPI


text:
# TableView
A RecyclerView that looks like a TableView with a fixed header that can scroll horizontally and vertically at the same time.

![TableView Preview](https://media.giphy.com/media/cY9n8HTNHLJqxFzOsg/giphy.gif)

---

## Features
- Both horizontal and vertical scrollable
- Searchable

---

## License

This project is licensed under the terms of the **MIT** license.


text:
# SpringDataNeo4jHelloWorld

This is a project to experiment with Spring Data and Neo4j.  It is inspired by the example domain in the Neo4j Spring
  Data Quick Start.  You can find it at http://projects.spring.io/spring-data-neo4j/#quick-start

## Prerequisites
* Maven 3.2+
* Java 1.8

## Rest API

Operations

* Get all movies
    * Route: /movies
    * Method: GET

* Add a movie
    * Route: /movies
    * Method: POST
    * Params:
        * title

* Get details about a movie
    * Route: /movies/{id}
    * Method: GET

* Get actors for a movie
    * Route: /movies/{id}/actors
    * Method: GET

* Add an actor to a movie
    * Route: /movies/{id}/actors
    * Method: POST
    * Params:
        * actorName
        * roleName

* Get all actors
    * Route: /actors
    * Method: GET

license: Unlicense

gha_language: Java

gha_license_id: Unlicense


text:
GeoPointCompass
===============

This iOS Xcode project shows how to create a simple compass that points at the direction to a custom geo location
that you can specify with latitude and longitude.

Import GeoPointCompass.h, GeoPointCompass.m and the arrow.png image to your project (or you can provide your own image
for the compass.

Usage
-----

Create the image for the compass
`UIImageView *arrowImageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 200, 100, 100)];`

`arrowImageView.image = [UIImage imageNamed:@"arrow.png"];`

`[self.view addSubview:arrowImageView];`

`geoPointCompass = [[GeoPointCompass alloc] init];`

Set the arrowImageView to be used as the compass image

`[geoPointCompass setArrowImageView:arrowImageView];`

Set coordinates of the location to be used for calculating the angle

`geoPointCompass.latitudeOfTargetedPoint = 48.858093;`

`geoPointCompass.longitudeOfTargetedPoint = 2.294694;`

repository: mohsinalimat/GeoPointCompass

repo_name: mohsinalimat/GeoPointCompass


text:
# MT-Budget_Tracker

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Description

You earn money, you spend money, you respect money. You're diligent about keeping track of your expenses, no matter where you are. That's why we give you our simple Budget Tracker. But sometimes you are sitting on the subway or in an elevator shaft and your Tracker can't reach the network to make sure everything is saved on the Tracker's server. Don't worry!
**Burn some incense, you won't be insenced. Your good cents sense will be sent when the network is sensed!**

## TABLE OF CONTENTS

1. [Installation](#Installation)
2. [Usage](#Usage)
3. [Contributing](#Contributing)
4. [Tests](#Tests)
5. [Questions/Contact](#Questions/Contact)
6. [License](#License)

## Installation

Simply navigate to https://polar-springs-63842.herokuapp.com.

## Usage

When you navigate to the site, you'll see a field that shows how much money you have **deposited** to your tracker. If the number is negative, you best get some dough! (None of my business.)

Right below that, you'll see a few fields where you can enter the name of a transaction and the amount. Click "Add Funds" or "Subtract Funds" appropriately. The newest transaction will appear at the top of a table, and below all that, there is a handy-dandy chart so you can see the ups and downs of your cash flow.

![Loaded page](images/loaded.png)

Now, for some behind-the-scenes magic. If you are recording your spending while disconnected from the network, your transactions will be saved in what we in the computing world call "on your device". OK, we actually called it "IndexedDB", which is a form of local storage for data. Below you will see a few transactions that were added while we disconnected the Tracker from the internet.

![Offline Page](images/offline.png)

It was a chocolate croissant and an apricot loaf from a bakery. Delicious. I know you were wondering.

This final image shows some more behind-the-scenes magic. You can see on the left the transactions are there, but on the right is a representation of the place where your transactions are being stored so that when you access Budget Tracker the next time, they'll all be there. Looking on the right, you'll see the last three items in the list are the last three transactions I added.

![Back Online](images/back-online.png)

And I'll be using the apricot loaf to make French Toast while listening to Broadway musicals.

## Contributing

If you would like to contribute to this project, please contact me with the information below. You are incouraged to follow the [Contributor Covenant](https://www.contributor-covenant.org/).

## Tests

There are no included tests for this project. Testing during development simply involved a lot of connecting and disconnecting the server so that the functionality good be monitored.

## Questions/Contact

GitHub Profile: [https://github.com/Torontow](https://github.com/Torontow)
Email: [mtorontow0<EMAIL_ADDRESS>
## License

This project is covered under MIT license.

[Top](#MT-Budget_Tracker)


text:
# Adding New Block Attributes

This article describes the steps needed to add more block data.

The example used is if adding a `isCollidable` data type to the blocks.

## Step 1: Edit the Server Voxel Data

Go to the [`ServerVoxel`](https://github.com/Hopson97/open-builder/blob/master/src/server/scripting/server_game_data.h) object and add the data as needed.

Example:

```cpp
bool isCollidable = true;
```

## Step 2: Edit the `blocks.obd` file to add the new attribute

For every block, you need to add the new data in for each one in the [`blocks.lua`](https://github.com/Hopson97/open-builder/blob/master/game/blocks.lua) file.

Example

```
isCollidable = true
```

## Step 3: Load the data

Go to [`ServerGameData`](https://github.com/Hopson97/open-builder/blob/master/src/server/scripting/server_game_data.cpp) constructor and load get data from the addVoxel() function

Example:

```cpp
voxel.isCollidable = voxelData["collidable"].get<bool>();
```

## Step 4: Update the docs

Go to [`Lua_Voxels.md](https://github.com/Hopson97/open-builder/blob/master/docs/Lua_Voxels.md) and update the relevent sections describing the new attribute.

Example

In the example:

```lua
collidable = true,
```

In the main table that says the format:

`| collidable   | Boolean | Whether this voxel can be collided with.   |`

## Step 5: Client Voxel Data

If the client will need this data as well, then these sub-steps will be needed too

### Step 5.1: Edit the Client Voxel Data

Go to [`ClientVoxel`](https://github.com/Hopson97/open-builder/blob/master/src/client/world/client_voxel.cpp) object and add the data as needed.

Example:

```cpp
bool isCollidable = true;
```

### Step 5.2: Edit comment for `ClientCommand::GameRegistryData`

Go to [`net_command.h`](https://github.com/Hopson97/open-builder/blob/master/src/common/common/network/net_command.h`) and add your new data to the comment for `ClientCommand::GameRegistryData`.

Example:

`// u8: Whether the block is collidable or not`

### Step 5.3: Send the data

Go to the [`Server class`](https://github.com/Hopson97/open-builder/blob/master/src/server/network/server.cpp) and find `Server::sendGameData`.

Add the data to the packet using `operator <<`, and cast before-hand if needed

Example:

```cpp
u8 isCollidable = static_cast<u8>(voxel.isCollidable);
//...
packet << isCollidable;
```
### Step 5.4 Receieve the data

Go to [`client_commands.cpp`](https://github.com/Hopson97/open-builder/blob/master/src/client/network/client_commands.cpp) `Client::onGameRegistryData` function, and find where the blocks are loaded from.

Add your new data.

Example

```cpp
u8 isCollidable = 0;
//...
packet >> isCollidable;
//...
voxelData.isCollidable = isCollidable;
```

## Complete!

You are now able to use the data in the engine

repository: sheilsarda/open-builder

repo_name: sheilsarda/open-builder


text:
# OptGet
A set of annotation processors each of its **generates getter methods**  that wrap a returned value by `java.util.Optional` for fields without of any accessor. Designed for informational and/or testing purposes and are used mainly on DTOs.

## Requirements
* set the getter method name according to the type of a field generated for (`is` prefix for `boolean` types and `get` one for any other types);
* avoid generating a getter method if one is already exists;
* use the `ofNullable` method for nullable values and `of` for non-null ones;
* make a generated getter method accessible at least through the Reflection API.

## Getting started
Run a standalone sample project JAR (the bash script populates just a set of environment variables for convenience):

```
$ ./scripts/run <TYPE>
```

...where `<TYPE>` is meant one of the [processor types](#processor-types) (e.g. `$ ./scripts/run ast`).

## Processor types
There are a few implementations of the processors called _processor types_:
* `ast` - transform the AST using [Lombok](https://projectlombok.org/);
* `byt` - modify bytecode at runtime using [ASM](https://asm.ow2.io/);
* `ref` - modify (refactor) source files using [JavaParser](https://javaparser.org/).

## Environment variables
* `OG_JARPATH` - path to a jarfile that contains a Java agent (used by ASM).
* `OG_SRCPATH` - source root directories separated by colons (used by JavaParser).

## Afterword
There are too little information about how to create an annotation processor that modifies existing Java classes therefore I've published this repo. Hope it helps someone to be aware in the topic more faster than I made it.

**Don't forget to start the repo if it so :)**

Code released under the MIT License in 2018 by [Yurii Rabeshko](https://twitter.com/yarbshk).

repository: yarbshk/optget

repo_name: yarbshk/optget


text:
# alpine-base

A Docker image for running just about anything within a container, based on Alpine Linux.
This image belongs to a suite of images [documented here][dockeralpine].

Image size is ~13.8 MB.

## Features

This image features:

- [Alpine Linux][alpinelinux]
- [s6][s6] and [s6-overlay][s6overlay]
- [go-dnsmasq][godnsmasq]

## Versions

- `3.1.0`, `latest` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v3.0.1/alpine-base/Dockerfile)
- `3.0.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v3.0.0/alpine-base/Dockerfile)
- `2.0.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v2.0.0/alpine-base/Dockerfile)
- `1.2.1` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v1.2.1/alpine-base/Dockerfile)
- `1.2.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v1.2.0/alpine-base/Dockerfile)
- `1.1.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v1.1.0/alpine-base/Dockerfile)
- `1.0.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v1.0.0/alpine-base/Dockerfile)

[See VERSIONS.md for image contents.](https://github.com/smebberson/docker-alpine/blob/master/alpine-base/VERSIONS.md)

## Usage

To use this image include `FROM smebberson/alpine-base` at the top of your `Dockerfile`. Starting from `smebberson/alpine-base` provides you with the ability to easily start any service using s6. s6 will also keep it running for you, restarting it when it crashes.

[Read more about extending this image with your own services](https://github.com/smebberson/docker-alpine/tree/master/#using-services).

### DNS

Prior to v4.4, Alpine Linux did not support the `search` keyword in `resolv.conf`. This breaks many tools that rely on DNS service discovery, in particular, Kubernetes, Docker Cloud, Consul, Rancher.

To overcome these issues, `alpine-base` includes the lightweight container-only DNS server [go-dnsmasq][godnsmasq] to resolve these issues.

That means that any image extending this image will now work with [Docker Cloud service discovery and links](https://docs.docker.com/docker-cloud/apps/service-links/) and [Kubernetes service discovery](https://github.com/kubernetes/kubernetes/blob/master/docs/user-guide/services.md#dns).

**Note**: despite Alpine Linux v4.4 adding support for the `search` keyword, `go-dnsmasq` has been retained for compatibility. It may or may not be included in future versions.

## Example

An example of using this image can be found in [examples/user-alpine](alpinebaseexample).

[alpinebaseexample]: https://github.com/smebberson/docker-alpine/tree/master/examples/user-alpine
[godnsmasq]: https://github.com/janeczku/go-dnsmasq
[dockeralpine]: https://github.com/smebberson/docker-alpine

repository: abh/docker-alpine

repo_name: abh/docker-alpine


text:
# TypeScript Boilerplate (React with Express)

**Please feel free to raise a pull request if you think there's anything else worth adding to this project. Use at own risk. :)**

## Introduction

This boilerplate code is built using predominantly TypeScript with yarn. The frontend is built in React with a backend running an Express server coupled with Webpack to minify and serve it accordingly with SASS CSS. Babel, ESLint and Prettier have also been implemented with TypeScript support to maintain code cleanliness.

## Getting Started

Clone the project to your local device and install the dependencies by running:

### `yarn`

## Run App in Dev Mode

In order to get the application running in a local development mode to make changes with hot reloading, you will need to have two separate bash terminals open and will need to run

### `yarn start:webapp`

to get the front-end of the application running (`src/client`) and also

### `yarn start:server`

to get the server of the application running (`src/server`) in the root folder of each terminal session respectively.

## Run App in Production Mode

In order to run the web application in production mode, you can just run

### `yarn start`

which will automatically build and serve the frontend and backend simultaneously.

## Linting

In order to run a linting check you can run

### `yarn lint`

and similarly to fix any linting issues automatically you can run

### `yarn lint:fix`


text:
[Metadata]
title: Milking Cows - 2
date: 2015-04-10 22:48:01

[Tags]
difficulty: 3
categories: greedy
source: codeforces

[Description]

There are n cows sitting in a row, numbered from 1 to n from left to right. Each cow is either facing to the left or facing to the right. When Iahub milks a cow, all the cows that see the current cow get scared and lose one unit of the quantity of milk that they can give. A cow facing left sees all the cows with lower indices than her index, and a cow facing right sees all the cows with higher indices than her index. A cow that got scared once can get scared again (and lose one more unit of milk). A cow that has been milked once cannot get scared and lose any more milk. You can assume that a cow never loses all the milk she can give (a cow gives an infinitely amount of milk).

The farmer wants to lose as little milk as possible. Print the minimum amount of milk that is lost.

The number of cows is n (1 ≤ n ≤ 200000) will show in the first line. The second line contains n integers a1, a2, ..., an, where ai is 0 if the cow number i is facing left, and 1 if it is facing right.

### Sample test(s)

```
>> input
4
0 0 1 0
<< output
1
>> input
5
1 0 1 0 1
<< output
3
```

[Solution]

I know you guys have got multiple ideas about this problem, and of course, some of these solutions are "seems correct" as you guys can't **prove the correctness** of your idea.

```
< < > <
```

The example case 1, for example. It seems that it's hard to decide to milk which cow at the very beginning. Maybe we can start from the rightmost cow which looking left, or the leftmost one which looking right. However, it may lead you to some kinds of pitfalls. And makes you spend several hours more to find the final answer.

This problem looks quite easy. It's not. (Maybe you can get the "Accepted" quite easily without your proof. But it can't really do the trick when you are having an interview.)

> There's a certain category of questions that fall into that sweet spot of "takes a tiny bit of thinking but not too much."

So, before you make your final design, please make sure that your solution is reasonable, and make your best to prove its correctness.

I find an excellent [tutorial](http://codeforces.com/blog/entry/10476) for this problem.

For every two cows in that line. We get four scenarios.

1. \<left, left\>
We can start from the rightmost one. And no milk will be losed.

2. \<left, right\>
`<, >`. This two cows can't see each other. Arbitrary order will do.

3. \<right, right\>
Similar to scenario 1, start from the leftmost one.

4. \<right, left\>
`>, <`. This one is special, becase we can't make any strategy to avoid losing any milk. So, when we come across this kind of pair of cows. Add 1 to the final results.

And with some optimization tricks. We can find the final solution with O(n) time complexity and O(1) extra memory space.

```python
n = int(raw_input())
cows = map(int, raw_input().split())
cnt = 0
res = 0
for cow in cows:
    cnt += cow
    if not cow:
        res += cnt
print res
```

repository: intgraph/intgraph-content

repo_name: intgraph/intgraph-content