text:
# Cotton Flow Demo

This repository supplies a set of tutorials to present the main features of [Cotton 2](https://github.com/MantledIllusion/cotton-flow), which is an extension to Vaadin Flow.

The tutorials are divided into logical chapters with multiple tutorials each. Each tutorial has its own branch, so its code can be checked out individually.

The **README.md** of at the root of each branch will provide a step-by-step tutorial through each lesson. Note that from chapter 2 on, a Hura WebLaunch Setup (see chapter 1.b) from the master branch which is stripped down to be launched from an IDE is used for all the tutorials.

## Chapter 1: Cotton Flow Setups

Since Vaadin's Java API is based on the Servlet-API and Cotton is a mere extension of that Java API, Cotton can be run in all Servlet-API compatible environments.

The tutorials of this chapter provide several ways to build, run and deploy a Cotton-based Vaadin Flow application.

### 1.a: [Hura Web Setup](https://github.com/MantledIllusion/cotton-flow-demo/tree/01/a/hura_web_setup)

Since Cotton uses [Hura](https://github.com/MantledIllusion/hura) 2's core for injection, it can easily be combined with Hura Web, which provides an injected, Servlet-API based application environment.

It is ideal for adding extremely light-weight application environment injection when building a .WAR to deploy on application servers.

### 1.b: [Hura WebLaunch Setup](https://github.com/MantledIllusion/cotton-flow-demo/tree/01/b/hura_weblaunch_setup)

Since Cotton uses [Hura](https://github.com/MantledIllusion/hura) 2's core for injection, it can easily be combined with Hura WebLaunch, which extends Hura Web with [Undertow](https://github.com/undertow-io/undertow), a lightweight high-performance embedded application server.

This setup provides lightning fast application startup while packing a low profile .JAR with embedded application server.

### 1.c: [Spring WebMVC Setup](https://github.com/MantledIllusion/cotton-flow-demo/tree/01/c/spring_webmvc_setup)

Spring is the all-time favorite for building feature-heavy applications fast.

In combination with [Spring-WebMVC](https://github.com/spring-projects/spring-framework), Cotton can be build into a Spring environment .WAR, where Cotton is responsible for view injection while Spring injects environment beans like web service endpoints and database connectors.

### 1.d: [Spring-Boot Setup](https://github.com/MantledIllusion/cotton-flow-demo/tree/01/d/spring_boot_setup)

Spring is the all-time favorite for building feature-heavy applications fast.

In combination with [Spring-Boot](https://github.com/spring-projects/spring-boot), Cotton can be build into a Spring environment .JAR, where Cotton is responsible for view injection while Spring provides an embedded webserver and injects environment beans like web service endpoints and database connectors.

### 1.e: [Native Setup](https://github.com/MantledIllusion/cotton-flow-demo/tree/01/e/native_setup)

Vaadin uses Servlet-API; so a Cotton application can be build as a simple .WAR, without any strings attached.

## Chapter 2: Configuring the Environment

One thing is your application, the other is the environment it runs in. Whether its properties, singletons or security, all those things mark the boundaries your application grows in. Cotton offers several possibilities to configure that environment easily, so you can concentrate on building your application.

### 2.a: [Automatic Route Discovery](https://github.com/MantledIllusion/cotton-flow-demo/tree/02/a/automatic_route_discovery)

Vaadin maps URLs to views with **_Router_**, where all visitable views are registered.

When using external application servers, Servlet-API mechanisms will help Vaadin register components annotated with _@Route_ automatically.

When using an embedded one, you can delegate that job to Cotton.

### 2.b: [Defining Application-Level (Singleton) Beans](https://github.com/MantledIllusion/cotton-flow-demo/tree/02/b/define_app_level_beans)

Hura is responsible for injecting every kind of bean from the **_CottonServlet_** downward. Or put differently: no matter what setup is used, Hura injects all beans that have a session based lifecycle.

But most applications require beans whose lifecycle begins with the application starting up and does not end before the app shuts down: application level singleton beans.

That are beans like service endpoints, database controllers and so on. Their lifecycle is not bound to Cotton, but they need to be injected into beans whose lifecycle is. For that purpose, app-level singletons can be pre defined.

### 2.c: [Localization](https://github.com/MantledIllusion/cotton-flow-demo/tree/02/c/localization)

Adapting to a user's language is already important for desktop applications, but it is critical for the web since usually the whole world will have access to a site.

Vaadin Flow already comes with a set of features to fulfill this purpose, but Cotton is able to easily load translations into these features and to retrieve from them from every point in the application.

### 2.d: [Login & Access Restriction](https://github.com/MantledIllusion/cotton-flow-demo/tree/02/d/login_and_access_restriction)

The huge majority of applications require a login mechanism of some kind, either for access restriction and/or for determining which rights the current use owns.

Cotton offers a generic mechanisms that provide functionality for setting a current user and behaving differently according to that users rights.

### 2.e: [Consuming Metrics](https://github.com/MantledIllusion/cotton-flow-demo/tree/02/e/consuming_metrics)

Cotton implements the [TrailMetrics support for Vaadin Flow](https://github.com/MantledIllusion/trail-metrics/tree/master/trail-metrics-support-vaadin-flow) that enables dispatching session based metrics from anywhere in the application and even dispatches a set of general metrics itself.

If desired, all dispatched metrics can be consumed and then be used for any purpose desired.

## Chapter 3: Building Views

Vaadin is all about frontend, so its main concern is building views. Cotton provides a lot of assisting functionality for doing so, while remaining 100% compatible with native Vaadin functionality for situations when something specific has to be build.

### 3.a: [Component Factorizing](https://github.com/MantledIllusion/cotton-flow-demo/tree/03/a/component_factorizing)

Building UI in Vaadin requires creating and configuring lots and lots of UI components. Cotton contains a set of fluent component builders to cope with the repeated setter calling of components.

### 3.b: [The EventBus](https://github.com/MantledIllusion/cotton-flow-demo/tree/03/b/the_eventbus)

As frontends grow, there sooner or later will always be a need for sending messages between separated parts of the application. To prevent class dependency hell, it is better to decouple those parts since they do not need know each other, but make them exchange messages anonymously via event bus.

The injection framework Hura which is included in Cotton offers a build-in event bus, where subscribing beans to that bus are automatically hooked on and off with their life cycle. Cotton pre-configures that bus, so no events of session beans can leave their own session, making it impossible to mistakenly alert bus subscribers that are not meant to be contacted.

### 3.c: [Presenting Views](https://github.com/MantledIllusion/cotton-flow-demo/tree/03/c/presenting_views)

The MVP (Model/View/Presenter) pattern is a popular architectural pattern that can be applied to basically all types of frontends.

Cotton supports MVP by providing functionality of creating and hooking a presenter to a view, without allowing the view to be able to obtain a reference to that presenter.

### 3.d: [Building a Plugin UI](https://github.com/MantledIllusion/cotton-flow-demo/tree/03/d/building_a_plugin_ui)

In some cases it might be a great idea so take modularization of a frontend to the next level; by linking together the parts as separated plugins.

One example of such a situation might be the frontend for a _Service Oriented Architecture_ (SOA). With the application cleanly separated (for example into services for customer, order and product using _Domain Driven Design_), changes to those services could be deployed at any time without affecting the rest of the platform.

But with a monolith frontend, every API changing service deployment would have the effect of the complete frontend having to be redeployed as well. Using a plugin based frontend (with the single plugins of the frontend shaped just as the service), it would be possible to keep the frontend up and running while just deploying an updated plugin for the service.

Since Cotton uses Hura 2, basic plugin functionality is already on board, ready to be used.

### 3.e: [Building a responsive UI](https://github.com/MantledIllusion/cotton-flow-demo/tree/03/e/building_a_responsive_ui)

Building responsive web apps is hard in Vaadin, as the code being on the server is setting up layout and components, but you might want your application to completely change layout when being delivered to different platforms or screen sizes.

Cotton aids for this problem, by enabling developers to provide multiple implementations for the same route and just specifying which implementation able to handle which scenario.

## Chapter 4: Data Binding

Since Vaadin 8, data binding in the framework has been overhauled to support Java 8's lambdas for a simpler use of Vaadin's Java API.

Cotton integrates the data modeling framework [Epiphy](https://github.com/MantledIllusion/epiphy) for easier Vaadin data binding when handling complex Java POJO object models.

The major advantage of binding to a complex model instead of single values is that exchanging a model's root can be done in a single operation, which enables to refresh the data in a whole UI in just one call.

### 4.a: [Deep Model Binding](https://github.com/MantledIllusion/cotton-flow-demo/tree/04/a/deep_model_binding)

The Epiphy framework enables access to properties that are deep down a model's object tree only while only working with the tree's root. Cotton uses this feature to bind Vaadin components implementing the _**HasValue**_ interface to data deep down in an object tree.

### 4.b [MVP-Compliant Data Binding](https://github.com/MantledIllusion/cotton-flow-demo/tree/04/b/mvp_compliant_data_binding)

Cotton's MVP functionality allows applications to be split into view and logic code cleanly; and that goes for the data binding as well, where the model should be controlled elsewhere than it is bound.

### 4.c [Right Dependent Data Binding](https://github.com/MantledIllusion/cotton-flow-demo/tree/04/c/right_dependent_data_binding)

As business applications grow, they often become used by more than one type of user. As soon as there is more than one user group, the need will arise to restrict data access depending on the different groups, often upto field precision.

Cotton allows specifying the access mode per-field in the data binding, effectively preventing data from being modified (or even seen) by users without sufficient rights.

### 4.d [Numerated Model Binding](https://github.com/MantledIllusion/cotton-flow-demo/tree/04/d/numerated_modeL_binding)

Binding a single field to a single property is trivial; but Epiphy's also allows numerated properties in a model tree, such as listed or mapped ones.

Cotton allows binding properties to **Vaadin**'s **_DataProvider_**, which can be directly used in components such as **_Grid_** or **_RadioButtonGroup_**.

### 4.e [Binding Filtered DataProviders](https://github.com/MantledIllusion/cotton-flow-demo/tree/04/e/binding_filtered_dataproviders)

**Cotton**'s **_HasDataProviderBuilder_** allows configuring filterable **Vaadin** **_DataProvider_** instances on the fly for components like **_Grid_**, _CheckBoxGroup_ and **_RadioButtonGroup_**; and in case of **_Grid_** even enables binding filter inpout fields for columns with a simple one-liner.

repository: MantledIllusion/cotton-flow-demo

repo_name: MantledIllusion/cotton-flow-demo


text:
Standalone PostgreSQL server
============================

This example project shows you how to setup a postgresql server inside docker.

It uses the official `postgres` docker image which specifies a volume at `/var/lib/postgresql/data`.
We'll create an extra `postgres-data` container which will serve as persistent data container for that volume.

That way we can replace the `postgres` container (e.g. upgrade to a newer version) without losing data.

Read [Docker's documentation on volume containers][2] for more information on the topic.

`postgres-data.rocker`
----------------------

    {
        "image": "postgres",
        "entrypoint": ["echo", "Data container for the postgres container"]
    }

We replace the image's default entry point by a simple message.
That way, when you try to run the container it will stop again immediately, simply printing a log message that can be seen when issuing `docker logs postgres-data`.

`postgres.rocker`
-----------------

    {
        "image": "postgres",
        "volumesFrom": "postgres-data"
    }

This container will hold the actual PostgreSQL server.
The `volumesFrom` directive tells Docker to add all the volumes of `postgres-data` to the `postgres` container.

This only works because the official [`postgres` Dockerfile][1] already specifies Postgres' data directory as volume. If it didn't, we'd have to add a `"volume": "/var/lib/postgresql/data"` directive to our `postgres-data.rocker`.

rocker implicitly adds all the containers specified in a `volumesFrom` directive to the list of dependencies for that container and will therefore create/run `postgres-data` before `postgres`.

Running rocker
--------------

You can create and run the above containers by issuing

    rocker run postgres

in the project directory.

That call implicitly launches `rocker run postgres-data` before creating the actual `postgres` container

[1]: https://github.com/docker-library/postgres/blob/bfca9b8a92a99ccfc8f04933b7ecc29a108c7f49/9.4/Dockerfile
[2]: https://docs.docker.com/userguide/dockervolumes/#creating-and-mounting-a-data-volume-container

repository: mreithub/rocker

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mreithub/rocker


text:
# Autoposting: comic books

You can post random [comic xkcd](https://xkcd.com/) to your community in [VK.COM](https://vk.com/) with [VK API](https://vk.com/dev/).

## How to install

Python 3 should be installed.

- Download the code.
- Create `.env` file. Put there [access_token](https://vk.com/dev/implicit_flow_group):
```
ACCESS_TOKEN="your token"
```
- Install packages with `pip`:
```
pip install -r requirements.txt
```
- Run the code:
```
python main.py
```

## Project's puprose

The code is written for educational purposes as a task in web-development course on the [Devman](https://dvmn.org/).

license: MIT

repository: MokkoFm/autoposting-comic-books

repo_name: MokkoFm/autoposting-comic-books


text:
> [Go to French version](/fr/Règlements/Décrets,%20ordonnances%20et%20règlements%20statutaires/84/901.md)

# Regulations Respecting Zoning at St. Catharines Airport

**SOR/84-901**

Enabling authorities:
- [AERONAUTICS ACT](/en/Acts/Revised%20Statutes%20of%20Canada/A/A-2.md)

Date registered: 8 November 1984

----------

Her Excellency the Governor General in Council, on the recommendation of the Minister of Transport, pursuant to section 6[*] of the [Aeronautics Act](/en/Acts/Revised%20Statutes%20of%20Canada/A/A-2.md), is pleased hereby to approve the annexed Regulations respecting zoning at St. Catharines Airport, made by the Minister of Transport.

*: S.C. 1976-77, c. 28, s. 2 and 49

## Short Title

**1** These Regulations may be cited as the St. Catharines Airport Zoning Regulations.

## Interpretation

**2**

- **(1)** In these Regulations,

***airport*** means St. Catharines Airport at St. Catharines, in the regional Municipality of Niagara and in the City of St. Catharines, in the Province of Ontario; (*aéroport*)

***airport reference point*** means the point described in Part I of the schedule; (*point de repère de l’aéroport*)

***approach surface*** means an imaginary inclined plane that extends upward and outward from each end of a strip, which approach surface is more particularly described in Part II of the schedule; (*surface d’approche*)

***Minister*** means the Minister of Transport; (*ministre*)

***outer surface*** means an imaginary surface located above and in the immediate vicinity of the airport, which outer surface is more particularly described in Part III of the schedule; (*surface extérieure*)

***strip*** means the rectangular portion of the landing area of the airport, including the runway, prepared for the take-off and landing of aircraft in a particular direction, which strip is more particularly described in Part IV of the schedule; (*bande*)

***transitional surface*** means an imaginary inclined plane that extends upward and outward from the lateral limits of a strip and its approach surfaces, which transitional surface is more particularly described in Part V of the schedule. (*surface de transition*)

- **(2)** For the purposes of these Regulations, the assigned elevation of the airport reference point is 95 m above sea level.

## Application

**3** These Regulations apply to all the lands, including public road allowances, adjacent to or in the vicinity of the airport, which lands are more particularly described in Part VI of the schedule.

## General

**4** No person shall erect or construct, on any land to which these Regulations apply, any building, structure or object or any addition to any existing building, structure or object, the highest point of which will exceed in elevation at the location of that point
- **(a)** the approach surface of any strip;
- **(b)** the outer surface; or
- **(c)** any transitional surface.

## Natural Growth

**5** Where an object of natural growth on any land to which these Regulations apply exceeds in elevation any of the surfaces referred to in paragraphs 4(a), (b) and (c), the Minister may make a direction that the owner or occupier of the land on which that object is growing remove the excessive growth.

## Disposal of Waste

**6** No owner or occupier of any land to which these Regulations apply shall permit that land or any part of it to be used for the disposal of any waste that is edible by or attractive to birds.

### **SCHEDULE**
**(s. 2 and 3)**

**PART I**
## Description of Airport Reference Point

The airport reference point, shown on St. Catharines Airport Zoning Plan No. 26-047-81-67, Sheet 5, dated March 30, 1984, is a point distant 100 m measured northwesterly at right angles to the centre line of runway 06-24, from a point distant 615 m measured northeasterly along the said centre line from the southwesterly end of the said runway.

**PART II**
## Description of the Approach Surfaces

The approach surfaces, shown on St. Catharines Airport Zoning Plan No. 26-047-81-67, Sheets 1, 2, 4, 5, 6, 8, 9, 10, 11 and 12 dated March 30, 1984, are surfaces abutting each end of the strips associated with the runways designated 06-24, 10-28 and 01-19 and are described as follows:

**(a)** a surface abutting the end of the strip associated with runway approach 06 consisting of an inclined plane having a ratio of 1 m measured vertically to 50 m measured horizontally rising to an imaginary horizontal line drawn at right angles to the projected centre line of the strip and distant 15 000 m measured horizontally from the end of the strip; the outer ends of the imaginary horizontal line being 2 400 m from the projected centre line; said imaginary horizontal line being 300 m above the elevation at the end of the strip;

**(b)** a surface abutting the end of the strip associated with runway approach 24 consisting of an inclined plane having a ratio of 1 m measured vertically to 50 m measured horizontally diverging at a rate of 15% from each side of the strip end and rising to its intersection with the Canada-United States International Boundary;

**(c)** a surface abutting the end of the strip associated with runway approach 10 consisting of an inclined plane having a ratio of 1 m measured vertically to 40 m measured horizontally rising to an imaginary horizontal line drawn at right angles to the projected centre line of the strip and distant 2 500 m measured horizontally from the end of the strip; the outer ends of the imaginary horizontal line being 280 m from the projected centre line; said imaginary horizontal line being 62.5 m above the elevation at the end of the strip;

**(d)** a surface abutting the end of the strip associated with runway approach 28 consisting of an inclined plane having a ratio of 1 m measured vertically to 40 m measured horizontally rising to an imaginary horizontal line drawn at right angles to the projected centre line of the strip and distant 2 400 m measured horizontally from the end of the strip; the outer ends of the imaginary horizontal line being 280 m from the projected centre line; said imaginary horizontal line being 62.5 m above the elevation at the end of the strip;

**(e)** a surface abutting the end of the strip associated with runway approach 01 consisting of an inclined plane having a ratio of 1 m measured vertically to 40 m measured horizontally rising to an imaginary horizontal line drawn at right angles to the projected centre line of the strip and distant 2 500 m measured horizontally from the end of the strip; the outer ends of the imaginary horizontal line being 280 m from the projected centre line; said imaginary horizontal line being 62.5 m above the elevation at the end of the strip; and

**(f)** a surface abutting the end of the strip associated with runway approach 19 consisting of an inclined plane having a ratio of 1 m measured vertically to 40 m measured horizontally rising to an imaginary horizontal line drawn at right angles to the projected centre line of the strip and distant 2 500 m measured horizontally from the end of the strip; the outer ends of the imaginary horizontal line being 280 m from the projected centre line; said imaginary horizontal line being 62.5 m above the elevation at the end of the strip.

**PART III**
## Description of the Outer Surface

The outer surface, shown on St. Catharines Airport Zoning Plan No. 26-047-81-67, Sheets 1 to 9, dated March 30, 1984, is an imaginary surface located at a common plane established at a constant elevation of 45 m above the assigned elevation of the airport reference point except where that common plane is less than 9 m above the surface of the ground, the imaginary surface is located at 9 m above the surface of the ground.

**PART IV**
## Description of the Strips

The strips, shown on St. Catharines Airport Zoning Plan No. 26-047-81-67, Sheet 5, dated March 30, 1984, are described as follows:

**(a)** the strip associated with runway 06-24 being 300 m in width, 150 m being on each side of the centre line of the runway, and 1644.08 m in length;

**(b)** the strip associated with runway 10-28 being 60 m in width, 30 m being on each side of the centre line of the runway, and 667.10 m in length;

**(c)** the strip associated with runway 01-19 being 60 m in width, 30 m being on each side of the centre line of the runway, and 822.22 m in length.

**PART V**
## Description of Each Transitional Surface

Each transitional surface, shown on St. Catharines Airport Zoning Plan No. 26-047-81-67, Sheets 1, 2, 4, 5, 6, 8 and 9, dated March 30, 1984, is a surface consisting of an inclined plane rising at a ratio of 1 m measured vertically to 7 m measured horizontally at right angles to the centre line and centre line produced of each strip extending upward and outward from the lateral limits of each strip and its approach surfaces to an intersection with the outer surface or another transitional surface of an adjoining strip.

**PART VI**
## Description of the Lands to Which These Regulations Apply

The boundary of the outer limits of lands, shown on St. Catharines Airport Zoning Plan No. 26-047-81-67, Sheets 1 to 12, dated March 30, 1984 is described as follows:

Commencing at the southwesterly corner of Lot 181 in the geographic Township of Niagara, now in the Municipality of the Town of Niagara-on-the-Lake;

THENCE northerly along the western boundary of the said Lot 181 to its intersection with the production northeasterly of the southern boundary of Lot 1 Concession 9 of the geographic Township of Grantham, now in the Municipality of Niagara-on-the-Lake;

THENCE southwesterly along the said production across the road allowance between the geographic Township of Niagara and the geographic Township of Grantham to the southeasterly corner of the said Lot 1 Concession 9 in the geographic Township of Grantham;

THENCE southwesterly along the southern boundary of Lots 1 and 2 Concession 9 of the geographic Township of Grantham to the southwesterly corner of the said Lot 2 Concession 9;

THENCE southwesterly in a straight line across the road allowance between Lots 2 and 3 Concession 9 in the said Township to the southeasterly corner of Lot 3 Concession 9 in the said Township;

THENCE southwesterly along the southern boundary of Lots 3 and 4 Concession 9 in the said Township to the southwesterly corner of Lot 4 Concession 9;

THENCE northerly along the western boundary of Lot 4 Concession 9 to the northwesterly corner of Lot 4 Concession 9;

THENCE northerly in a straight line across the road allowance between Concessions 8 and 9 in the geographic Township of Grantham to the southwesterly corner of Lot 4 Concession 8;

THENCE southwesterly in a straight line across the road allowance between Lots 4 and 5 to the southeasterly corner of Lot 5 Concession 8 in the said Township;

THENCE southwesterly along the southern boundary of Lots 5 and 6 Concession 8 to the southwesterly corner of Lot 6 Concession 8;

THENCE in a straight line across the road allowance between Lots 6 and 7 to the southeasterly corner of Lot 7 Concession 8;

THENCE southwesterly along the southern boundary of Lot 7 Concession 8 to its intersection with the boundary between the Municipality of the Town of Niagara-on-the-Lake and the City of St. Catharines;

THENCE northerly along the said boundary between municipalities to its intersection with the southern boundary of Lot 8 Concession 7;

THENCE southwesterly along the southern boundary of Lot 8 to the southwesterly corner of Lot 8 Concession 7;

THENCE in a straight line across the road allowance between Lots 8 and 9 to the southeasterly corner of Lot 9 Concession 7;

THENCE southwesterly along the southern boundary of Lot 9 to the southwesterly corner of the said Lot 9;

THENCE northerly along the western boundary of Lot 9 Concession 7 to its intersection with the southeastern limit of approach surface (06);

THENCE along the southeastern limit of approach surface 06 on an azimuth of 224°10′36″ to a point being the most southerly corner of said approach surface, the co-ordinates of which are N 4 772 039.864 E 637 469.295;

THENCE along the southwestern limit of approach surface 06 on an azimuth of 322°42′27″ a distance of 4 800 m to a point being the northwesterly corner of said approach surface, the co-ordinates of which are N 4 775 857.983 E 634 561.457;

THENCE along the northern limit of approach surface 06 on an azimuth of 61°14′18″ to its intersection with the eastern limit of Grantham Avenue as established by Plan 359, registered in the Registry Office for the Registry Division of Niagara North;

THENCE northerly along the eastern boundary of Grantham Avenue as established by Registered Plan 359, to the northwesterly corner of Lot 1 Registered Plan 359;

THENCE northerly in a straight line across Welland Avenue to the southwesterly corner of Lot 187 Corporation Plan No. 5;

THENCE northerly along the eastern boundary of Grantham Avenue as established by Corporation Plan No. 5, plans 103, 142, 378, 202, all registered in the Registry Office for the Registry Division of Niagara North, to the southern boundary of Carlton Street;

THENCE northerly in a straight line across Carlton Street to the intersection of the northern boundary of Carlton Street with the eastern boundary of Grantham Avenue;

THENCE northerly along the eastern boundary of Grantham Avenue as established by Plan 260, Corporation Plans No. 5 and 448 all registered in the Registry Office for the Registry Division of Niagara North, and Plans M-46 and M-26 registered in the Registry Office for the Land Titles Division of Niagara North, to the southern boundary of Scott Street;

THENCE northerly in a straight line across Scott Street to the intersection of the northern boundary of Scott Street with the eastern boundary of Grantham Avenue;

THENCE northerly along the eastern boundary of Grantham Avenue as established by Plans 346, 450, 471, 365 Corporation Plan No. 5 all registered in the Registry Office for the Registry Division of Niagara North, to the southern boundary of Linwell Road;

THENCE easterly along the southern boundary of Linwell Road as established by Corporation Plan No. 5 and Plan 365, both registered in the Registry Office for the Registry Division of Niagara North, to the northeasterly corner of Lot 123 Corporation Plan No. 5;

THENCE northerly in a straight line across Linwell Road to the southeasterly corner of Lot 48 Corporation Plan No. 5;

THENCE northerly along the eastern boundary of Lot 48 Corporation Plan No. 5 to a point in Parnell Road being the northeasterly corner of the said Lot 48;

THENCE northeasterly along the southern boundary of Parnell Road as established by Corporation Plan No. 5, and Plans 587 and 233, all registered in the Registry Office for the Registry Division of Niagara North, to the northeasterly corner of Lot 4 Plan 233;

THENCE northeasterly in a straight line across Lot 55 Corporation Plan No. 5 to the northwesterly corner of Lot 57 Corporation Plan No. 5;

THENCE northeasterly along the northern boundary of Lot 57 Corporation Plan No. 5 to the northeasterly corner of the said Lot 57;

THENCE northeasterly in a straight line across Lot 61 Corporation Plan No. 5 to the northwesterly corner of Lot 60 on the said Plan;

THENCE northeasterly along the northern boundary of Lot 60 on the said plan to the northeasterly corner of the said Lot 60;

THENCE northeasterly in a straight line across Read Road to the northwesterly corner of Lot 69 Corporation Plan No. 5;

THENCE northerly in a straight line across Lakeshore Road to the southwesterly corner of Lot 29 Corporation Plan No. 5;

THENCE northerly along the western boundary of Lot 29 and Lot 30 Corporation Plan No. 5 to the limit of Lake Ontario;

THENCE easterly along the limit of Lake Ontario to the point in the said limit where it is intersected by the eastern boundary of Lot 27 Corporation Plan No. 5;

THENCE southerly along the eastern boundary of the said Lot 27 to a point distant 340 m measured northerly along the eastern boundary from the southeasterly corner of the said Lot 27;

THENCE easterly in a straight line across Lots 26 and 23 Corporation Plan No. 5 to a point in the eastern boundary of the said Lot 23 distant 170 m measured northerly from the southeasterly corner of the said Lot 23;

THENCE southerly in a straight line across Lakeshore Road to the northeasterly corner of Lot 81 Corporation Plan No. 5;

THENCE northeasterly along the southern boundary of Lakeshore Road as established by a plan registered in the Registry Office for the Registry Division of Niagara North under Instrument 198440, to the northeasterly corner of Lot 92 Corporation Plan No. 5;

THENCE southerly along the eastern boundary of Lots 92, 93 and 94 Corporation Plan No. 5 to the point in the eastern boundary of Lot 94 Corporation Plan No. 5 where it is intersected by the westerly production of the northern boundary of Lot 164 in the geographic Township of Niagara;

THENCE easterly in a straight line across the road allowance between the geographic Township of Grantham and the geographic Township of Niagara to the northwesterly corner of Lot 164 in the geographic Township of Niagara;

THENCE easterly along the northern boundary of Lot 164 in the geographic Township of Niagara to the northeasterly corner of the said Lot 164;

THENCE southerly along the eastern boundary of Lot 164 in the geographic Township of Niagara to the southeasterly corner of the said Lot 164;

THENCE easterly in a straight line across the road allowance between Lots 165 and 158 in the geographic Township of Niagara to the northwesterly corner of the said Lot 158;

THENCE easterly along the northern boundary of Lot 158 in the geographic Township of Niagara to the northeasterly corner of the said Lot 158;

THENCE southerly along the eastern boundary of the said Lot 158 to the point where it is intersected by the northeasterly limit of approach surface (24);

THENCE northeasterly along the northeastern limit of approach surface (24) on an azimuth of 44°10′36″ to a point in the International Boundary in the Niagara River distant 472.19 m on an azimuth of 333°09′58″ from Turning Point 109;

THENCE southeasterly along the International Boundary on an azimuth of 153°09′58″ a distance of 472.19 m to Turning Point 109;

THENCE southeasterly along the International Boundary on an azimuth of 126°08′13″ a distance of 1 453.89 m to Turning Point 110;

THENCE southerly along the International Boundary on an azimuth of 171°07′23″ a distance of 664.98 m to Turning Point 111;

THENCE southerly along the International Boundary on an azimuth of 184°44′03″ a distance of 1 077.57 m to Turning Point 112;

THENCE southerly along the International Boundary on an azimuth of 172°36′55″ a distance of 109.27 m to the point where the International Boundary is intersected by the southeasterly limit of approach surface 24;

THENCE southwesterly along the southeasterly limit of approach surface 24 on an azimuth of 241°14′18″ to its intersection with the eastern boundary of Lot 121 in the geographic Township of Niagara;

THENCE southerly along the eastern boundary of Lot 121 to the southeasterly corner of Lot 121 in the said Township;

THENCE southerly in a straight line across the road allowance between Lots 121 and 122 to the northeasterly corner of Lot 122 in the geographic Township of Niagara;

THENCE southerly along the eastern boundary of Lots 122 and 123 to the southeasterly corner of Lot 123 in the said Township;

THENCE southerly in a straight line across the road allowance between Lots 123 and 124 to the northeasterly corner of Lot 124 in the geographic Township of Niagara;

THENCE southerly along the eastern boundary of Lots 124 and 125 to the southeasterly corner of Lot 125 in the said Township;

THENCE southerly in a straight line across the road allowance between Lots 125 and 126 to the northeasterly corner of Lot 126 in the geographic Township of Niagara;

THENCE southerly along the eastern boundary of Lots 126 and 127 to the southeasterly corner of Lot 127 in the said Township;

THENCE southerly in a straight line across the road allowance between Lots 127 and 128 to the northeasterly corner of Lot 128 in the geographic Township of Niagara;

THENCE southerly along the eastern boundary of Lots 128 and 129 to the southeasterly corner of Lot 129 in the said Township;

THENCE southerly in a straight line across the road allowance between Lots 129 and 130 to the northeasterly corner of Lot 130 in the geographic Township of Niagara;

THENCE southerly along the eastern boundary of Lots 130 and 131 to the southeasterly corner of Lot 131 in the said Township;

THENCE westerly along the southerly boundary of Lot 131 to the southwesterly corner of Lot 131 in the said Township;

THENCE westerly in a straight line across the road allowance between Lots 131 and 146 to the southeasterly corner of Lot 146 in the geographic Township of Niagara;

THENCE southerly in a straight line across the road allowance between Lots 146 and 145 to the northeasterly corner of Lot 145 in the geographic Township of Niagara;

THENCE southerly along the eastern boundary of Lots 145 and 144 to the southeasterly corner of Lot 144 in the said Township;

THENCE westerly along the southern boundary of Lot 144 to the point where it is intersected by the production northerly of the line between the east and west halves of Lot 143 in the geographic Township of Niagara;

THENCE southerly in a straight line across the road allowance between Lots 144 and 143 to the point in the northern boundary of Lot 143 where it is intersected by the line between the east and west halves of Lot 143;

THENCE southerly along the line between the east and west halves of Lot 143 to a point in the southern boundary of Lot 143;

THENCE westerly along the southern boundary of Lot 143 to the southeasterly corner of Lot 143;

THENCE westerly in a straight line across the road allowance between Lots 143 and 180 to the southeasterly corner of Lot 180 in the geographic Township of Niagara;

THENCE westerly along the southern boundary of Lot 180 to a point in the said southern boundary where it is intersected by the line between the east and west halves of Lot 181 in the geographic Township of Niagara;

THENCE southerly along the line between the east and west halves of Lot 181 to a point in the southern boundary of Lot 181;

THENCE westerly along the southern boundary of Lot 181 to the southwesterly corner of Lot 181 in the said Township being the POINT OF COMMENCEMENT.

repository: TravisMadill/CanadianLaws

path: /en/Regulations/Statutory Orders and Regulations/84/901.md

repo_name: TravisMadill/CanadianLaws


text:
# Chronicle Bytes

Chronicle Bytes contains all the low level memory access wrappers.  It is built on Chronicle Core's direct memory and OS system call access.

Chronicle Bytes has a similar purpose to Java NIO's ByteBuffer with some extensions.

The API supports.

 - 64-bit sizes
 - UTF-8 and ISO-8859-1 encoded strings.
 - thread safe off heap memory operations.
 - deterministic release of resources via reference counting.
 - compressed data types such as stop bit encoding.
 - elastic ByteBuffer wrappers which resize as required.
 - parsing text and writing text directly to off heap bytes.

# Comparison of access to native memory

| Access                                              | ByteBuffer       | Netty IOBuffer  | Aeron UnsafeBuffer | Chronicle Bytes     |
|--------------------------------------------|:---------------:|:---------------:|:--------------------:|:--------------------:|
| Read/write primitives in native memory |  yes               | yes                 |  yes                      |  yes                     |
| Separate Mutable interfaces                 | run time check | run time check |  yes                      |  yes                     |
| Read/Write UTF8 strings                      |  no                |   no                | String                   |  any CharSequence + Appendable |
| Read/Write ISO-8859-1 strings             |  no                |  no                 | ?                         |  any CharSequence + Appendable |
| Support Endianness                            | Big and Little   | Big and Little   |  Big and Little        | Native only           |
| Size of buffer                                     |  31-bit            |  31-bit            |  31-bit                  | 63-bit                  |
| Elastic ByteBuffers                              |  no                 |  yes                | no                        | yes                      |
| Disable bounds checks                        |  no                 | no                 | set globally           | by buffer              |
| Wrap an address                                 | no                 | no                  | yes                       | yes                      |
| Thread safe read/write, CAS and atomic add operations            | no                  |no                  | int, long                | int, long, float and double |
| Streaming access                                | yes                 |yes                 | no                        | yes                      |
| Deterministic release of memory           | Internal API     | Internal API     | Caller's responsibility | yes                     |
| Separate read and write position           | no                 | yes                 | na                         | yes                      |

repository: minhpascal/Chronicle-Bytes

repo_name: minhpascal/Chronicle-Bytes


text:
# How to monitor certain port traffic

On Mac you can use `tcpdump` as follow:

## Example, monitor traffic for port 9000

```bash

sudo tcpdump -v -i any port 9000

```

repository: pabloviquez/til

repo_name: pabloviquez/til


text:
# TL;DR

This module would bring up a fully functional EKS cluster. If everything goes as expected, then you should be able to run kubectl commands against the cluster.

## 1. QuickStart

```
gen3 workon <profile> <commons_name>_eks
```

Ex.
```
$ gen3 workon cdistest test-commons_eks
```

## 2. Table of content

- [1. QuickStart](#1-quickstart)
- [2. Table of Contents](#2-table-of-contents)
- [3. Overview](#3-overview)
- [4. Variables](#4-variables)
  - [4.1 Required Variables](#41-required-variables)
  - [4.2 Optional Variables](#42-optional-variables)
- [5. Outputs](#5-outputs)
- [6. Considerations](#6-considerations)
- [7. Adding a Secondary Subnet](#7-adding-a-seconday-subnet)

## 3. Overview

Once you workon the workspace, you may want to edit the config.tfvars accordingly.

There are mandatory variables, and there are a few other optionals that are set by default in the variables.tf file, but you could change them accordingly.

Ex.
```
generic-commons@cdistest_admin ~ % cat .local/share/gen3/cdistest/test-commons_eks/config.tfvars
vpc_name   = "test-commons"
ec2_keyname = "test-commons_automation_dev"
users_policy = "test-commons"
```

## 4. Variables

### 4.1 Required Variables

| Name | Description | Type | Default |
|------|-------------|:----:|:-----:|
| vpc_name | Usually the same name as the commons. This VPC must exists arelady otherwise, the execution will fail. Additionally, it worth mentioning that logging and vpc must esist before running this. | string | n/a |
| ec2_keyname | An existing key pair in EC2 that we want in the k8s worker nodes. | string | n/a |
| users_policy | This is the policy that was created before that allows the cluster to access the users bucket in bionimbus. Usually the same name as the VPC, but not always. | string | n/a |

### 4.2 Optional Variables

| Name | Description | Type | Default |
|------|-------------|:----:|:-----:|
| instance_type | For k8s workers | string | t3.large |
| peering_cidr | CIDR were your adminVM belongs to. | string | <IP_ADDRESS>/20 |
| eks_version | Version for EKS cluster | string | 1.14 |
| availability_zones | AZs where to deploy the kubernetes worker nodes. Could be automated. | list |  ["us-east-1a","us-east-1d","us-east-1d"] |
| worker_drive_size | Volume size for the k8s workers | string | 30GB |
| jupyter_instance_type | For k8s jupyter workers | string | t3.medium |
| workflow_instance_type | For k8s workflow workers | string | t3.2xlarge |
| bootstrap_script | Script to initialize the workers | string | [bootstrap.sh](https://github.com/uc-cdis/cloud-automation/tree/master/flavors/eks) |
| jupyter_bootstrap_script | Script to initialize the jupyter workers | string | [bootstrap.sh](https://github.com/uc-cdis/cloud-automation/tree/master/flavors/eks) |
| jupyter_worker_drive_size | Drive Size for jupyter workers | string | 30GB |
| peering_cidr | AdminVM's CIDR for peering connections | string | <IP_ADDRESS>/20 (PlanX CSOC) |
| jupyter_asg_desired_capacity | # of jupyter workers | number | 0 |
| jupyter_asg_max_size | Max # of jupyter workers | number | 10 |
| jupyter_asg_min_size | Min # of jupyter workers | number | 0 |
| workflow_asg_desired_capacity | # of jupyter workers | number | 0 |
| workflow_asg_max_size | Max # of jupyter workers | number | 50 |
| workflow_asg_min_size | Min # of jupyter workers | number | 0 |
| iam-serviceaccount | iam/service account to your cluster | boolean | false |
| cidrs_to_route_to_gw | CIDR you want to skip the proxy when going out | list | [] |
| workers_subnet_size | Whether you want your workers on a /24 or /23 subnet, /22 is available, but the VPC module should have been deployed using the `network_expansion = true` variable, otherwise wks will fail | number | 24 |
| oidc_eks_thumbprint | OIDC to use for service account intergration | string | \<AWS DEFAULT\> |
| domain_test | If ha-proxy a domain to check internet access | string | gen3.io |
| ha_squid | If enabled, this should be set to true | boolean | false |
| dual_proxy | If migrating from single to ha, set to true, should not disrrupt connectivity | boolean | false |
| sns_topic_arn | SNS topic ARN for alerts | string | "arn:aws:sns:us-east-1:433568766270:planx-csoc-alerts-topic" |
| secondary_cidr_block | A secondary CIDR range that will get allocated the the workflow autoscaling group | string | "" |

## 5. Outputs

| Name | Description |
|------|-------------|
| kubeconfig | kubeconfig file to talk to kubernetes |
| config_map_aws_auth | configmap that sets permissions to incorporate the worker nodes into the cluster |

## 6. Considerations

* We are using AWS EKS ready AMIs, even though there might be other options out there, we are using these ones as for now.

Said AMIs uses amazon linux, which default user is `ec2-user`.

* When tfapply is ran, there will be two outputs `config_map_aws_auth` and `kubeconfig`.

`config_map_aws_auth` is a configmap that sets permissions to incorporate the worker nodes into the cluster. This is applied automatically, but in case it doesn't, copy this output and apply it to the cluster.
`kubeconfig` is the config file for kubernetes, it is not saved automatically in the right path, therefore you must put it where your KUBECONFIG var points to.

These outputs are also saved into a file in terraform space. You can access it by running `gen3 cd`, there is a `<commons-name>_output_eks` folder that  contains the files in question.

* `iam-serviceaccount` must only be used with EKS 1.13+, if you are running 1.12 or bellow, you must upgrade first. Additionally, you won't be able to enable this on the same run for upgrading out of 1.12. Upgrade must come first.

## 7. Adding a Secondary subnet

If you are running workflow nodes and running into IP exhaustion issues, you can add a secondary CIDR range to create a new subnet for the workflow nodes to run in. You will need to add/run it in the VPC/commons module and then here, as the VPC/commons module will attach the new CIDR range to the VPC, and this module will update the autoscaling groups to use it. Some functionality, like checking logs, will not work for up to 4 hours after the change, as the EKS api needs to run a job to refresh the whitelisted CIDR ranges. However, the pods should still be able to come up and work as usual during this time.

repository: uc-cdis/cloud-automation

gha_language: Shell

repo_name: uc-cdis/cloud-automation


text:
# BookSearch
Django app. to search for books by their names, authors, ids, or publish years.

-After migrating to the database run in the terminal: python manage.py shell < import_db.py
-Before running the app, set variable for SECRET_KEY in the environment


text:
# CodeReview-Shield [![Code Review](http://www.zomis.net/codereview/shield/?qid=95459&dummy)](http://codereview.stackexchange.com/q/95459/31562)

get a shields.io-like 'shield' for your Code Review question

# Usage

Add this to your GitHub repository `README.md` file, or anywhere else that supports markdown:

    [![Code Review](http://www.zomis.net/codereview/shield/?qid=qqqqq)](http://codereview.stackexchange.com/q/qqqqq/uuuuuuu)

Replace `qqqqq` with the question id and `uuuuuuu` with your user id.

The quickest way to create your shield is to use the [Code Review Shield creator](http://www.zomis.net/codereview/shield/create.html) and paste the 'share' link for your question.

# Modes

By default, the shield decides the mode depending on the status of the question.

- If the question does not have any answers, the mode `score` is used with red background
- If the question has answers but no accepted answers, the mode `answers` is used with orange background
- If the question has an accepted answer, the mode `views` is used with green background

You can specify the mode yourself in the URL by using `&mode=yourmode`, for example:

### score mode

    [![Code Review](http://www.zomis.net/codereview/shield/?qid=95459&mode=score)](http://codereview.stackexchange.com/q/95459/31562)

[![Code Review](http://www.zomis.net/codereview/shield/?qid=95459&mode=score)](http://codereview.stackexchange.com/q/95459/31562)

### answers mode

    [![Code Review](http://www.zomis.net/codereview/shield/?qid=95459&mode=answers)](http://codereview.stackexchange.com/q/95459/31562)

[![Code Review](http://www.zomis.net/codereview/shield/?qid=95459&mode=answers)](http://codereview.stackexchange.com/q/95459/31562)

### views mode

    [![Code Review](http://www.zomis.net/codereview/shield/?qid=95459&mode=views)](http://codereview.stackexchange.com/q/95459/31562)

[![Code Review](http://www.zomis.net/codereview/shield/?qid=95459&mode=views)](http://codereview.stackexchange.com/q/95459/31562)

repository: Zomis/CodeReview-Shield

gha_language: PHP

repo_name: Zomis/CodeReview-Shield


text:
# 65.5. Examples

The PostgreSQL source distribution includes several examples of index operator classes for SP-GiST, as described in [Table 63.1](https://www.postgresql.org/docs/10/static/spgist-builtin-opclasses.html#SPGIST-BUILTIN-OPCLASSES-TABLE). Look into `src/backend/access/spgist/` and `src/backend/utils/adt/` to see the code.

repository: pgsql-tw/gitbook-docs

gha_language: HTML

gha_license_id: MIT

repo_name: pgsql-tw/gitbook-docs


text:
# Gatsby Theme Catalyst Helium

**WIP**

This is a minimalist MDX based personal blog theme that ties together the core theme, blog theme, header and footer themes and then uses this as a basis to create a complete website. Git is used as the CMS.

**Additional Documentation**

[Read the docs on Github](https://github.com/ehowey/gatsby-theme-catalyst)

**Demos:**

- [gatsby-starter-catalyst-helium](https://gatsby-starter-catalyst-helium.netlify.app/)

**Catalyzing Start**

```sh
# create a new Gatsby site using the catalyst writer starter site
gatsby new catalyst-hydrogen https://github.com/ehowey/gatsby-starter-catalyst-hydrogen
```

## Theme options

WIP

repository: ckumabe/gatsby-theme-catalyst

repo_name: ckumabe/gatsby-theme-catalyst


text:
# Interpreters

## What is interpreter?

Interpreter allows developer separate data to smaller chunks based on his own rules. In ACF extension, we used it to split into parts Fetched Data based on data object's shape.

For now, we have 2 possible interpreters.

## Root

There we have access to plain data, fetched straight from the API. If your data contains multiple sections/rows - it could be a good place to split it. For real, we are straight in Root Component's Render Function.

Before looking at example let's answer the utmost important question.

### What is TheRoot functional component doing?
1. Getting given data (downloaded from API) by props
2. Separating data to the smaller parts, called SectionData.
3. Load Section/AlternativeSection component and provide here proper data.

### How to add my own hook in an extension?
Add interpret function to your extension object inside root object which is inside middleware object (middleware.root.**interpret**). It has to have 3 arguments

```
data - response data to process
chosenSection - section component, it can be Vue Component Object, or just a string if the corresponding component is registered globally
h - createElement function, used by VueJS to create VNode
```

### Real Life Example
Let's create **interpret** hook function which will separate data and render a few sections. Each section should be present in data.acf.sections array. So we have a plain function in our plugin:
```ts
const plugin: WPExtension = {
  middleware: {
    root: {
      interpret (data, chosenSection, h) {

      }
    }
  }
}
```

It should return an Array of VNodes or throw an error if conditions aren't fulfilled. So prepare the corresponding structure:
```ts
const plugin: WPExtension = {
  middleware: {
    root: {
      interpret (data, chosenSection, h) {
        const wpSections = []

        if(MY_CONDITIONS) {

        } else {
          throw new Error('Conditiong is not fullfilled')
        }

        return wpSections
      }
    }
  }
}
```

Okay, we have a basic function's body. Now ask yourself. What is the condition? In our example we want to use _data.acf.sections_ later. So we need to make sure _data.acf_ is an object which contains _sections_ key. Our condition will be something like:
```js
if(data.acf && data.acf.sections) { }
```

Inside of it, we should iterate over _data.acf.sections_. By each iteration, we will create a VNode and push it to the array.
```ts
const plugin: WPExtension = {
  middleware: {
    root: {
      interpret (data, chosenSection, h) {
        const wpSections = []

        if(data.acf && data.acf.sections) {
          for(let el of data.acf.sections) {
            wpSections.push(
              h(chosenSection, {
                props: {
                  data: el
                }
              })
            )
          }
        } else {
          throw new Error('Conditions are not fullfilled')
        }

        return wpSections
      }
    }
  }
}
```

That's the whole middleware.root.**interpret** function from ACF Extension.
If you would like to learn more about h/createElement function, you can do it [here](https://vuejs.org/v2/guide/render-function.html#createElement-Arguments)

## Section

To better understand the idea of extending Section created lifecycle hook (Section interpret), firstly we have to answer the question.

### What is Section's created doing?
1. Getting given data (from the Root) by props
2. Separating data to the smaller parts, called ColumnData.
3. Add information to ColumnData like Block component's name and the number of columns
4. Creating the class name for a section, that describes the number of columns
5. Load Column/AlternativeColumn component and provide here proper data.

### What can we do with the hook?
The primary purpose is to allow developers to design alternative data separating mechanism. For example, in ACF Extension, we use this hook to separate section to columns and load custom __Block components__.

### How to add my own hook in an extension?
As the main purpose of extending section is interpreting data. To add our own interpreter, inside 'section', create a **interpret** function with one argument - data. Moreover, you have to keep this structure inside 'middleware'. Everything that is modifying a data we will keep inside 'middleware'
```
data - data to process
```
The hook must return Object containing at least 3 certain keys:
```
columns - an array of data about each column
columnAmount - the number of columns provided data contains
anyFilledColumn - Is any column filled? If each one is empty, there is no point to render the whole Section
```

### Base _section.interpret_ structure
```js
middleware: {
  section: {
    interpret (data) {
      if(SOME_CONDITIONS) {
        throw new Error('Bad data structure')
      }

      const columns = data['columns']
      const columnAmount = 2
      let anyFilledColumn = false

      return {
        columns,
        anyFilledColumn,
        columnAmount
      }
    }
  }
}
```

To each object in the columns array, you have to add 2 information:
```
cmpName - Component name which will be rendered inside column (default value should be "Default")
columnAmount - the number of columns in row
```

If something goes wrong just throw an error.

repository: alty-ir/core

repo_name: alty-ir/core


text:
# Stack Overflow Sentiment
This simple project uses Google BigQuery & Google Cloud Natural Language API to analyse Stack Overflow comment sentiment. Developed using Python 2.7.x (but should work with Python 3.x though too). The queries and datasets used are all public. You can find the links below.

## Dependencies
There are some Python modules needed. Simply run this.
```pip install -r requirements.txt```

## To run:

```python sentiment/stackoverflow_sentiment.py <path_to_service_account_json_file> <dataset>```

## Links

### Blog post
https://shinesolutions.com/2016/12/20/analysing-stack-overflow-comment-sentiment-using-google-cloud-platform/

### Google Tools
https://cloud.google.com/natural-language/
https://cloud.google.com/bigquery/

### Google APIs
https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/bigquery
https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/language

### Motivation
https://cloud.google.com/blog/big-data/2016/12/google-bigquery-public-datasets-now-include-stack-overflow-q-a

## Public stuff

### Datasets

#### Stack Overflow Public Dataset (BigQuery)
Here's the public dataset in BigQuery for Stackoverflow
https://bigquery.cloud.google.com/dataset/bigquery-public-data:stackoverflow

#### My Public Dataset (BigQuery)
Here you can find the tables that I created with my queries and the results of the NL-API
https://bigquery.cloud.google.com/dataset/stackoverflow-sentiment:sentiment

### Queries

#### Best day to post a question on Stack Overflow
https://bigquery.cloud.google.com:443/savedquery/1056242102418:63c31fe61a7c4d53ae3ef22f30203881

#### Correctly spelled BigQuery - it's one word! :-)
https://bigquery.cloud.google.com:443/savedquery/1056242102418:b4117babd35c41e78aa0ab8c69f42257

#### Overall % sentiment
https://bigquery.cloud.google.com:443/savedquery/1056242102418:864b7503d0d3407bb97b08350fbdc311

#### Overall sentiment counts
https://bigquery.cloud.google.com:443/savedquery/1056242102418:9a7847826552407aa690db60a1276feb

#### Average sentiment
https://bigquery.cloud.google.com:443/savedquery/1056242102418:7b4dccb9c54b45ed86c4876df5e4794a

#### Comments on questions asked by noobs for 2016 and for JavaScript, Java and Python tags
https://bigquery.cloud.google.com:443/savedquery/1056242102418:1c6c51620ee24e878cb361e0e236426b

#### Counts of negative comments
https://bigquery.cloud.google.com:443/savedquery/1056242102418:57b1910592874c3fa4db79a103797cd9

repository: Yachitha/stackoverflow-sentiment

repo_name: Yachitha/stackoverflow-sentiment


text:
+++
coolinthe80slastmod = "YYYYMMDD"
date = "2000-01-03T12:00:00+02:00"
draft = false
streamtitle = "Explanatory Notes"
timeless = "true"
title = "Setup"

+++

## Installation

Generic installation instructions are [here](https://gohugo.io/themes/installing/)

### Site configuration

To "make it yours" (even though we all know this theme is *mine*), change the bits of the following toml file that start with TK (and get rid of the TK)

---
```toml
#Adjust all settings that start with TK to customise this theme to your site.  Also remove the TK
theme = "would-have-been-cool-in-the-80s"
baseurl = "TK http://mysite.com"
languageCode = "en-us"
title = "TK MY SITE'S TITLE"

[params]
  aboutpage = "TK name-of-the-about-post" #This makes the "about" link in the header function.  It must be the exact filename of your about page without the file extension.  E.g. if your about page is called "mysiteabout.md" then enter in "mysiteabout"
  author = "TK Your Name" #Goes in the meta info of your webpage to help identify you as the author of the content
  copyrightstatement = "TK A copyright statement of your choosing." #Will appear in the footer of each page.
  description = "TK A description that will appear in the html meta" #Goes in the meta info of your webpage to describe the content of your site
  siteclass = "TK MY SITE'S SUBTITLE" #Optional.  If you set it, it will display a subtitle in a contrasting color (adjustable within the CSS) on the site's index page.
  tagline = "TK My site's witty tagline" #Optional.  If you set it, it will display a tagline for the website underneath the titles.  By default it appears italicized.
```
---

### CSS

The CSS is adapted from [HTML5 Boilerplate](http://gohugo.io).  Just a few layout and color tweaks.  There are some override styles and a few custom ones prefixed with "whbcit8".  In terms of font choice: geometric sans-serifs, monospace, and perhaps even slab serifs all seem to work fine.

That's about it.  I could have done more I'm sure with pagination and all that crap but I was basically going for one step beyond a MVP, as well as teaching myself HTML5 and CSS3, and this Hugo thingy.

### Individual page configuration

Page configuration is largely unchanged from the default but there are some additional bits in the archetype (the template that defines default page settings) which enable additional features.  It's explained in the comments in the toml file below.

---
```toml
+++
streamtitle="" #Optional.  If you set it, it will display a subtitle in a contrasting color (adjustable within the CSS) on the individual page.
timeless = "false" #Optional.  If you set it, it will determine whether the post displays date features (displaying a date on the post summary on the index page, date in the page title).  Changing the value to true suppresses all of these features, with the exception of the last modified date shown by the pedrolastmod parameter
draft=true
pedrolastmod="YYYYMMDD" #Optional.  If you set it, it will display a Last Modified Date under the footer.  This is not automated at all, nor formatted, but simply provides a basic ability to indicate that the creation date differs from the modified date.  If left unchanged, it will display the created date.
+++

LOREM IPSUM PAGE CONTENT GOES HERE
```
---


text:
---
layout: post
title: Android flash / 刷机基础知识，关于 recovery, bootloader
categories: [ cm, android ]
tags: [ adb, fastboot, bootloader, root, unlock, flash, recovery ]
---

* 参考
  * <https://www.makeuseof.com/tag/whats-custom-recovery-exploring-cwm-twrp-friends/>
  * <https://tektab.com/2015/10/31/android-bootloaderfastboot-mode-and-recovery-mode-explained/>
  * [TWRP]

[XDA-Developers forum]: http://forum.xda-developers.com/
[TWRP]: http://twrp.me/

## 总览

An Android device consists of several pieces of software, which include the bootloader, radio, recovery, and system.

* bootloader
  * the first piece of software that is run when your device turns on — it decides whether to load the recovery, or load Android (“system”) and the radio.
* radio
  * simply the controller for your antennas, which give you a cellular connection to your carrier’s towers
* recovery
  * simply put, is a runtime environment (think “mini operating system”) separate from Android that can perform various system-related tasks. The stock recovery on most Android devices can apply OTA (over-the-air) updates, delete user and cache content (for factory reset purposes), and allow external tools from a microSD card to run functions on the device.

* Android booting process, recovery mode, boot-loader/fastboot mode
  * ![](android-booting-process.png)

## Third-party Recovery / Custom Recovery

The top two most popular custom recoveries are **ClockworkMod (CWM)** and **[Team Win Recovery Project (TWRP)][TWRP]**.

![](cwm_backup.jpg){: style="width=50%"}

![](twrp_recovery.jpg){: style="width=50%"}

TWRP 比 CWM 界面易操作，功能更多些。

### Other Custom Recoveries

If you’re curious about recoveries other than CWM and TWRP, you should definitely check out the [XDA-Developers forum] for more recoveries that support your device.

Search by going to your device’s subforum and looking for threads with a "Recovery" tag on them.

## 刷机版本

### Stock Android

* <https://www.maketecheasier.com/what-is-stock-android/>

Stock Android, also called “vanilla” Android, is the most basic version of the Android operating system available.

Stock Android is also typically not reskinned or redesigned by the phone’s manufacturer (OEM).

### ROM

* 参考：
  * <https://www.makeuseof.com/tag/what-are-the-best-custom-android-roms/>

* XDA Developers forums <http://forum.xda-developers.com/>
* CyanogenMod <http://www.cyanogenmod.org/>
* LineageOS
  * <https://lineageos.org>
  * 第三方 ROM CyanogenMod 团队解散，变成了目前的 Lineage OS 团队。
* AOKP <http://aokp.co/>
* Paranoid Android  <https://plus.google.com/107979589566958860409/posts>
* PAC ROM  <http://pac-rom.com/>

## 刷机脚本

### Nexus 5x - bullhead

* flash-all.bat

  ~~~
  @ECHO OFF

  PATH=%PATH%;"%SYSTEMROOT%\System32"
  fastboot flash bootloader bootloader-bullhead-bhz31b.img
  fastboot reboot-bootloader
  ping -n 5 <IP_ADDRESS> >nul
  fastboot flash radio radio-bullhead-m8994f-<IP_ADDRESS>.01.img
  fastboot reboot-bootloader
  ping -n 5 <IP_ADDRESS> >nul
  fastboot -w update image-bullhead-opm2.171019.029.zip

  echo Press any key to exit...
  pause >nul
  exit
  ~~~

repository: netmicrobe/witech

repo_name: netmicrobe/witech


text:
# Using Rails, how can I set my primary key to not be an integer-typed column?

## Question

I'm using Rails migrations to manage a database schema, and I'm creating a simple table where I'd like to use a non-integer value as the primary key (in particular, a string). To abstract away from my problem, let's say there's a table `employees` where employees are identified by an alphanumeric string, e.g. `"134SNW"`.

I've tried creating the table in a migration like this:

    create_table :employees, {:primary_key => :emp_id} do |t|
        t.string :emp_id
        t.string :first_name
        t.string :last_name
    end

What this gives me is what seems like it completely ignored the line `t.string :emp_id` and went ahead and made it an integer column. Is there some other way to have rails generate the PRIMARY_KEY constraint (I'm using PostgreSQL) for me, without having to write the SQL in an `execute` call?

**NOTE**: I know it's not best to use string columns as primary keys, so please no answers just saying to add an integer primary key. I may add one anyway, but this question is still valid.

## Answer

Unfortunately, I've determined it's not possible to do it without using `execute`.

Why it doesn't work
-------------------

By examining the ActiveRecord source, we can find the code for `create_table`:

In [`schema_statements.rb`](http://github.com/rails/rails/blob/5a7d31913bb16977ec85d55de34ac0d79b512d62/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L161):

    def create_table(table_name, options={})
      ...
      table_definition.primary_key(options[:primary_key] || Base.get_primary_key(table_name.to_s.singularize)) unless options[:id] == false
      ...
    end

So we can see that when you try to specify a primary key in the `create_table` options, it creates a primary key with that specified name (or, if none is specified, `id`). It does this by calling the same method you can use inside a table definition block: `primary_key`.

In [`schema_statements.rb`](https://github.com/rails/rails/blob/a63f7a136401b59db52fb802180f6c9793d83bc2/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L89):

    def primary_key(name)
      column(name, :primary_key)
    end

This just creates a column with the specified name of type `:primary_key`. This is set to the following in the standard database adapters:

    PostgreSQL: "serial primary key"
    MySQL: "int(11) DEFAULT NULL auto_increment PRIMARY KEY"
    SQLite: "INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL"

The workaround
--------------

Since we're stuck with these as the primary key types, we have to use `execute` to create a primary key that is not an integer (PostgreSQL's `serial` is an integer using a sequence):

    create_table :employees, {:id => false} do |t|
      t.string :emp_id
      t.string :first_name
      t.string :last_name
    end
    execute "ALTER TABLE employees ADD PRIMARY KEY (emp_id);"

And as [Sean McCleary mentioned](https://stackoverflow.com/questions/1200568/using-rails-how-can-i-set-my-primary-key-to-not-be-an-integer-typed-column/1429146#1429146), your ActiveRecord model should set the primary key using `set_primary_key`:

    class Employee < ActiveRecord::Base
      set_primary_key :emp_id
      ...
    end

repository: stackflow-io/stackflow

repo_name: stackflow-io/stackflow


text:
---
title: About the Rig Veda API
description: Fetches metadata of the Rig Veda richas, suktas, and mandals.
author: Anindita Basu
og_title: About the Rig Veda API
og_description: Fetches metadata of the Rig Veda richas, suktas, and mandals.
og_image: images/signboard.png
---

# About the Rig Veda API

This API contains metadata from Rig Veda Samhita. Data from the other three samhitas (Yajurveda, Samaveda, and Atharvaveda) are not included, because most of the verses in these three samhitas are a repetition of the verses in Rig Veda Samhita.

The data is from the following books:

- Rig Veda Samhita, the English translation according to H. H. Wilson and the Bhashya of Sayanacharya, by Ravi Prakash Arya and K. L. Joshi (Volumes 1 through 4)
-  [The Practical Sanskrit-English Dictionary, by V. S. Apte](https://dsal.uchicago.edu/dictionaries/apte/)

The data is returned in the following format:

=== "Schema"

    ```json
    {
      "mandal": 0,
      "sukta": 0,
      "meter": "string",
      "sungby": "string",
      "sungbycategory": "string",
      "sungfor": "string",
      "sungforcategory": "string"
    }
    ```

=== "Example response"

    ```json
	{
    	"mandal": 10,
	    "meter": "Jagati",
	    "sukta": 75,
	    "sungby": "Sindhukshit Praiyamedh",
	    "sungbycategory": "human male",
	    "sungfor": "Ganga",
	    "sungforcategory": "divine female"
	}
	```

In Rig Veda, books (or mandals) contain chapters, and chapters (or suktas) contain verses (or richas). A book has several chapters. A sukta has several verses. Within a sukta, each verse can be in different meter and addressed to more than one god. Within a sukta, the verses can be composed by more than one poet. See the following entity-relationship diagram.

``` mermaid
erDiagram
  Mandal ||--|{ Sukta : contains
  Sukta ||--|{ verse : contains
  verse ||--|| poet : is_sung_by
  verse ||--|| meter : is_in
  verse ||--|{ god : is_sung_for
```

Rig Veda API fetches the metadata of verses and, therefore, contains a separate entry for each of these possibilities wherever they occur.

For example, consider sukta 24 of mandal 1. It has verses addressed to five gods, all in different meters. The API response for the verses in this mandal-sukta combination is something like this:

```json
  {
    "mandal": 1,
    "sukta": 24,
    "sungby": "Shunahshep Ajigarti",
    "sungbycategory": "human male",
    "sungfor": "Ka",
    "sungforcategory": "divine male",
    "meter": "Trishtup"
  },
  {
    "mandal": 1,
    "sukta": 24,
    "sungby": "Shunahshep Ajigarti",
    "sungbycategory": "human male",
    "sungfor": "Agni",
    "sungforcategory": "divine male",
    "meter": "Trishtup"
  },
  {
    "mandal": 1,
    "sukta": 24,
    "sungby": "Shunahshep Ajigarti",
    "sungbycategory": "human male",
    "sungfor": "Savita",
    "sungforcategory": "divine male",
    "meter": "Gayatri"
  },
  {
    "mandal": 1,
    "sukta": 24,
    "sungby": "Shunahshep Ajigarti",
    "sungbycategory": "human male",
    "sungfor": "Bhaga",
    "sungforcategory": "divine male",
    "meter": "Gayatri"
  },
  {
    "mandal": 1,
    "sukta": 24,
    "sungby": "Shunahshep Ajigarti",
    "sungbycategory": "human male",
    "sungfor": "Varun",
    "sungforcategory": "divine male",
    "meter": "Trishtup"
  }
```

## Related

-  [Rig Veda API reference](api_rv.md)
-  [Tutorial: Vedic soliloquies](how_to_soliloquy.md)
-  [Tutorial: Vedic dialogues](how_to_dialogues.md)
-  [Dataviz: Meters pie chart](datavis_meters_pie.md)

{%include 'common/coffee.md'%}

repository: AninditaBasu/indica

gha_language: Jupyter Notebook

repo_name: AninditaBasu/indica


text:
# DynamicsFscmPackageImport

Solution has only generic package file generation logic. A sample package template is added as an example.
Package templates can be stored in a blob container with DmfProjectName.zip file name so you don't have to remember(configure) the template file names.

Run the function app project on your local and go to http://localhost:7071/api/GenerateDataPackage using a browser to download the updated package file

repository: b-a-s-h-e-e-r/DynamicsFscmPackageImport

branch_name: refs/heads/main

repo_name: b-a-s-h-e-e-r/DynamicsFscmPackageImport


text:
# TU_Chem - is a repo for compiling teaching resources for recitation and lab at Temple University. [Notebooks can be rendered here](https://robraddi.github.io/teaching.html).

Note: This collection of notebooks, quizzes, practice exams, etc. that I have put together for assisting the teaching of undergraduate chemistry courses at Temple University. These are not for profit and strictly for teaching purposes. Although, the bulk of work is my own labor, a substantial amount of material inside these notebooks has been compiled from various textbooks and internet sources. I thank all who have contributed.


text:
# Sanity Checks

When configuring the slurm script must ensure the following is strictly exact:

1.

players:
- NHIDDEN
- NHEADS

```
NHIDDEN % NHEADS == 0
```

2.

players:
- GLOBAL_BATCH_SIZE
- MICRO_BATCH_SIZE
- DP_SIZE

```
GLOBAL_BATCH_SIZE % (MICRO_BATCH_SIZE * DP_SIZE) == 0
```

3.

players:
- NLAYERS
- PP_SIZE

```
NLAYERS % PP_SIZE == 0
```

4.

5. Curriculum Learning Constraints

- min_difficulty % 8 = 0 (to enable Tensor Core acceleration)

- json ds config can't have numbers with '_' in them - invalid json - careful with substitutions.

## Restaring from existing checkpoint constraints

XXX: quite a few of these - need to start collecting them all

- can't change TP-size (But ok to change PP)

- can't change max-lr or will get:

```
AnnealingLR: class input value 1e-05 and checkpointvalue 3e-05 for learning rate do not match
```

repository: bigscience-workshop/bigscience

gha_license_id: NOASSERTION

repo_name: bigscience-workshop/bigscience


text:
---
title: 'Pumpkin Drop 2019 Photos'
media_order:<PHONE_NUMBER>2_4e20f919e4_k.jpg
date: '2020-04-16 20:29'
taxonomy:
    tag:
        - Photography
hide_git_sync_repo_link: false
blog_url: /blog
show_sidebar: true
show_breadcrumbs: true
show_pagination: true
header_image: '0'
hide_from_post_list: false
feed:
    limit: 10
---

Photos from **Pumpkin Drop 2019** have been uploaded to our [Flickr photo archive](https://flic.kr/s/aHsmMxFexQ).

![](49766825962_4e20f919e4_k.jpg)

===

Special thanks to Shu Fay Ung for taking pictures!

_Please remember to credit the original photographer when using any of these pictures._

repository: caltech-big-t/big-t-site

repo_name: caltech-big-t/big-t-site


text:
# User Manual for the Presentation

## Appointing Channel for Presentation

In order to let connected channels use Watson's services and stream data, **Director View** (this page) must select them as a candidate. Once a channel appears in the channel list, click the select button next to its name and state to appoint it as a candidate. The selected channel will now have access to use the microphone to start the Watson speech-to-text service.

## States for Channels

* **`IDLE`** – This is the default state for the connected channel. No action has been taken yet on either Director's or channels' part.
* **`APPOINTED`** – Once the Director View has selected a channel for candidacy, and the channel has picked up on it.
* **`MEDIA`** – The channel has succesfully allowed the browser to use a microphone.
* **`READY`** – Channel is ready to start recording and streaming data. The channel is a candidate and a microphone has been selected.
* **`FINISHED`** – Recording has been stopped. Sending the data to Watson's Tone Analyzer.
* **`ANALYZED`** – The channel's data has been analyzed and it is ready to use.
* **`ERROR`** – The channel didn't successfully allow the use of the microphone. The process can not be continued. This state can only happen after the `APPOINTED` state.

gha_language: JavaScript


text:
## Raft

### Getting Started

```go
package main

import (
	"github.com/shortlink-org/shortlink/pkg/raft"
)

func main() {
	r, err := raft.New(raft.Config{
		Name:     "node1",
		BindAddr: "localhost:8001",
	})
	if err != nil {
		panic(err)
	}

	r.Go(func() {
		// Do something
	})
}
```

### Raft server states

```mermaid
stateDiagram-v2
    Start     --> Follower: times out, start election
    Follower  --> Candidate: times out, start election
    Candidate --> Candidate: timeout, new election
    Candidate --> Leader: win election
    Candidate --> Follower: receive vote from majority
```

#### Docs

+ [The Raft Consensus Algorithm](https://raft.github.io/)

repository: shortlink-org/shortlink

gha_language: Go

repo_name: shortlink-org/shortlink


text:
# ZeroDowntime
This repo contains the slides and demo scripts for my Zero Downtime database deploys talk.

# Purpose of demo
You are trying to build a new feature, but you are concerned about performance. You decide that it would be beneficial
to deploy the code to production, but to hide it behind a Feature Toggle / Feature Flag. This will allow you to test
the performance of your code, on production workloads, before you expose it to your users. It will also make it really
easy to enable, disable or throttle the new code based on performance so you can easily roll it back or throttle it
down to avoid crashing the server while you try to improve performance.

If all goes well, you should be able to monitor your improvements based on rich feedback from production. By the time
you are ready to enable the feature in production, and expose it to your users, you should be highly confident that
it will perform as required. What's more, if it doesn't work, you should be able to disable it with ease, effectively
rolling back the change with minimul effort or risk.

# Demo instructions
1. Create the demo databases by running CREATE_DATABASES.sql against a demo SQL instance.
2. Insert the demo data by running INSERT_DATA.sql.

    You should now have a Facebook and a Toggles database.
    The Toggles database should have a Feature table containing a single row of data (a feature called 'live buttons').
    The Facebook database should have two tables, Relationship and User. Each should be populated with sample data.
    The Facebook database should have a stored procedure called FriendsOf, which can return either an old (fast but
        basic) or a new (slow but detailed) version of a report on a given users friends.
    If you would like to experiment with more/less test data you can use the Redgate SQL Data Generator file to experiment
        with different sized datasets. (SQL Data Generator comes with a free trial licence, but if you've used it you'll
        need a licence.)

3. Execute the following command against the Facebook database:

    EXEC dbo.FriendsOf @UserId = 5

    This should return all the IDs of the given Users friends. It's fast but basic.

4. Update the data in Toggles.dbo.Feature such that the Feature 'live buttons' has 'darkLanuch' enabled and rerun the
       stored procedure. This should run more slowly but return the same data. It's running the new code in the backgroud
       but only showing the original code.
5. This performance won't do. If all the users are using the expensive version of the query you'll crash the server. You
       need to throttle down your dark launch while you tune the query. Go back to the Toggles.dbo.Feature table and set
       the Throttle to 50. Now only 50% of executions will run the new, poor performing code. Try running the sproc again
       and note that 50% of the time it runs fast and 50% of the time it runs slowly. You can also check the messages to
       confirm which version of the code was executed.
6. Now tune the query. Observe that the FriendsOf stored procedure uses dynamic SQL to switch between the new and the old
       version of the code. Roughly halfway throught the script is the @NewSql script which contains a dreaded cursor.
       Even worse, this Cursor includes the line:
              WAITFOR DELAY''00:00:00.200'';
       Either delete or comment out this line.
7. Try re-running the sproc and check the messages to verify whether you ran the old or new version of the code. (Remember,
       you are still throttled at 50%!) This time it should run faster regardless of whether you are running the new or old
       version of the code. Throttle back up to 100. You want to verify that the new code runs nice and fast every time,
       even under full production load.
8. When you are happy with the performance, and perhaps after you have imagined that you have let it run for a few days
       through your regular usage peaks, while continuously monitoring performance etc, you are ready to enable the feature
       for your users. Go back to Toggles.dbo.Feature and flip Enabled from a 0 to a 1 for the 'live buttons feature.
9. Re-run the procedure one more time. Now it should not only run quickly, but it should also return a much richer dataset.

repository: Alex-Yates/ZeroDowntime

repo_name: Alex-Yates/ZeroDowntime


text:
{
  "date" : "2019-12-16",
  "keywords" : [ "OTS", "file", "extension", "file format", "Excel", "Spreadsheet" ],
  "author" : {
    "display_name" : "Kashif Iqbal"
  },
  "draft" : "false",
  "toc" : true,
  "description" : "Learn about OTS file format and APIs that can create and open OTS files.",
  "title" : "OTS - OpenDocument Spreadsheet Template File Format",
  "linktitle" : "OTS",
  "menu" : {
    "docs" : {
      "parent" : "spreadsheet"
    }
  },
  "lastmod" : "2021-01-19"
}

## What is an OTS file?

A file with .ots extension is an OpenDocument Spreadsheet Template file that is created with the Calc application software included in Apache OpenOffice. Calc application software is the similar to Excel available in Microsoft Office. OTS file format is used to create templates that contain predefine settings related to styles, font, data, spreadsheet layout, and formatting. OTF files have `mime-type application/vnd.oasis.opendocument.spreadsheet-template`. These template files can be used as a starting point to generate and save actual data files that are saved in [ODS file format](/spreadsheet/ods/). OTS files can be used with applications such as OpenOffice and LibreOffice.

## OTS File Format

OTS files are saved in OASIS' OpenDocument XML-based file format that comprises of a collection of several subdocuments with a package as a [ZIP](/compression/zip/) archive. Each zip archive stores part of the complete document and each subdocument stores a particular aspect of the document. For example, one subdocument contains the style information and another subdocument contains the content of the document. A typical ODF document has the following components:

### Content.xml

The content.xml file contains the actual content of the document. This doesn't include binary data such as images, however.
```
<text:h style-name="Heading_2">This is a title</text:h>
<text:p style-name="Text_body"/>
<text:p style-name="Text_body">
   This is a paragraph. The formatting information is
   in the Text_body style. The empty text:p tag above
   is a blank paragraph (an empty line).
</text:p>
```

### Styles.xml

The styles.xml file contains styling information and is heavily used for formatting and layout. Styles types include:

 * Paragraph styles
 * Page styles
 * Character styles
 * Frame styles
 * List styles

### Meta.xml

The meta.xml file contains information about the file metadata such as Author, Last Modified Date, etc.
```
<meta:creation-date>2003-09-10T15:31:11</meta:creation-date>
<dc:creator>Daniel Carrera</dc:creator>
<dc:date>2005-06-29T22:02:06</dc:date>
<dc:language>es-ES</dc:language>
<meta:document-statistic
      table-count="6" object-count="0"
      page-count="59" paragraph-count="676"
      image-count="2" word-count="16701"
      character-count="98757"/>
```
### Settings.xml

The `settings.xml` file includes document level settings such as zoom factor and cursor position.

## References ##

* [OpenDocument 1.2 specification](https://www.oasis-open.org/standards#opendocumentv1.2)
* [OpenDocument - By Wikipedia](https://en.wikipedia.org/wiki/OpenDocument)

gha_language: Mathematica


text:
# RTv1 - @WeThinkCode_
RTv1 is a basic raytracer, that render at least a cone, sphere, plane, and cylinder. ALl objects must have shadows, and specuarity.

### What is RTv1?
[RTv1][1] is an individual project at [WeThinkCode_][2] that requires us to recreate a raytracer that uses the principles of computer graphics to render basic shapes in a window. It uses some of the funtions found in the [Libft][3] library. It also uses a graphics library, [Minilibx][4] in this case.

### What is in the Project?

Take a look in the [Project instructions][1]. The project has 2 sections:

1.  **Main Programme:** A basic programme that raytraces and renders basic shapes.
2.  **Bonus Additions:** Adding more features to the raytracer, like multiple harsh spots and reflections.

### The Mechanics behind it all?

The goal is to create a program called RTv1 from the source files, and use that to render out the scenes given.

To create that file, after downloading/cloning this project, **cd** into the project, copy all the files from the sub folders to the root directory and finally, call make:

	git clone https://github.com/pmotala/rtv1
	cd rtv1
	make

You should see a *RTv1* file and some object files (.o).

Now to clean up (removing the .o files and the .c files from the root), call the function:
	make clean

### How do I use the programme?

You have to tell the file where your map file resides, for example:

`RTv1 scenes/scene.txt`

`RTv1` is the name of programme you've compiled.
`scene/scene.txt` is the directory to your scene files.

You can find scenes files here: [scenes][5].

Enjoy.

[1]: https://github.com/pmotala/rtv1/blob/master/document/rtv1.en.pdf "RTv1 PDF"
[2]: https://www.wethinkcode.co.za "WeThinkCode_"
[3]: https://github.com/pmotala/libft "Libft"
[4]: https://github.com/dannywillems/minilibx "Minilibx"
[5]: https://github.com/pmotala/rtv1/blob/master/scenes/


text:
# highscore

Easily find and rank keywords in long texts.

*2019-10-19* I archived this project as there hasn't been any recent activity and I have moved on to other projects. You can still download and use it though.

## Features

* configurable to rank different types of words different (uppercase, long words, etc.)
* rate based on amount (%) of vowels and consonants in a string
* directly get keywords from String objects
* blacklist words via a plain text file, String or an Array of words (per language if needed)
* optionally, configure a whitelist and only words from that list will get ranked
* uses word stemming if necessary (requires the `fast-stemmer` or `stemmer` gem)
* merge together Keywords from multiple sources
* contains a CLI tool that operates on STDIN/OUT and is configurable via parameters
* can use `bloomfilter-rb` gem for better performance (optional)
* words on the bonus list will receive a higher score

## Installation

* `[sudo] gem install highscore`

For better blacklist perfomance, use the `bloomfilter-rb` gem:

* `[sudo] gem install bloomfilter-rb`

To use word stemming, you need to have the `fast-stemmer` (C extension) or `stemmer` gem installed:

* `[sudo] gem install fast-stemmer`
* `[sudo] gem install stemmer`

## Examples

```ruby
text = Highscore::Content.new "foo bar"
text.configure do
  set :multiplier, 2
  set :upper_case, 3
  set :long_words, 2
  set :long_words_threshold, 15
  set :short_words_threshold, 3      # => default: 2
  set :bonus_multiplier, 2           # => default: 3
  set :vowels, 1                     # => default: 0 = not considered
  set :consonants, 5                 # => default: 0 = not considered
  set :ignore_case, true             # => default: false
  set :word_pattern, /[\w]+[^\s0-9]/ # => default: /\w+/
  set :stemming, true                # => default: false
end

# get only the top 50 keywords
text.keywords.top(50).each do |keyword|
  keyword.text   # => keyword text
  keyword.weight # => rank weight (float)
end

# you could also just use a string
keywords = "Foo bar baz".keywords(blacklist) do
  set :multiplier, 10
end
```

The result is either a Highscore::Keywords object or an Array (depending on whether it's sorted or not) that you
can iterate over. Each object in there is a Highscore::Keyword that has methods `text` and `weight`.

```ruby
keywords = "Foo bar is not bar baz".keywords(Highscore::Blacklist.load(['baz']))

keywords.rank.each do |k|
  puts "#{k.text} #{k.weight}"
end

# prints:
# Foo 3.0
# bar 2.0
# not 1.0
```

Have a look at `bin/highscore`, you can run highscore on your CLI and feed it with text on STDIN.

## Blacklisting and Whitelisting

### Using a custom blacklist to ignore keywords

```ruby
# setting single words
blacklist = Highscore::Blacklist.new
blacklist << 'foo'

# load a string/array
blacklist = Highscore::Blacklist.load "a string"
blacklist = Highscore::Blacklist.load %w{an array}

# loading from a file (separated by whitespace)
blacklist = Highscore::Blacklist.load_file "blacklist.txt"

# loading the default blacklist (falls back automatically if not explicit given)
blacklist = Highscore::Blacklist.load_default_file

# inject the blacklist into the content class
content = Highscore::Content.new "a string", blacklist
```

### Using a whitelist instead of ranking all words

```ruby
# construct and inject it just like a blacklist
whitelist = Highscore::Whitelist.load %w{these are valid keywords}
content = Highscore::Content.new "invalid words", whitelist
```

### Using bonus words

```ruby
# construct and inject it just like a blacklist
bonuslist = Highscore::Bonuslist.load %w{bonus words}
content = Highscore::Content.new "A string with bonus words in it", bonuslist
```

## I18n

```ruby
# Load a default blacklist
blacklist_default = Highscore::Blacklist.load "mister"
text = Highscore::Content.new "oui mister interesting", blacklist_default
text.keywords.top(3).join " "

# => prints "interesting oui"

# Load a rudimentary blacklist for French
blacklist_francais = Highscore::Blacklist.load "oui"
text.add_wordlist blacklist_francais, :french
text.keywords(:lang => :fr).top(3).join " "

# => prints "interesting mister"
```

## Author

Original author: Dominik Liebler<EMAIL_ADDRESS>
## License

(The MIT License)

Copyright (c) 2017 Dominik Liebler and contributors

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

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

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: domnikl/highscore

gha_language: Ruby

repo_name: domnikl/highscore


text:
# tf-CMT
Personal implementation of CMT: Convolutional Neural Networks Meet Vision Transformers in tensorflow.
Paper: https://arxiv.org/abs/2107.06263
All suggestions are welcome.

## Usage

An example of model is shown below:
```python
import tensorflow
from tf_CMT.model import CMT_Model

model = CMT_Model(Block_num     = [3,12], # Number of CMT_Blocks in each stage
                  K             = 2,      # HyperParam to reduce the complexity of self-attention to O(N^2/k^2)
                  n_heads       = 4,      # Number of heads
                  head_dim      = 256,    # The latent dimension of self-attention
                  filters       = 256,    # Number of filters of CNNs
                  num_classes   = 10,     # Number of output classes
                  usePosBias    = True,   # Use learnable positional bias
                  output_logits = True    # Output logits or not
                 )

test_image = tf.random.normal([1, 224, 224, 3])
model(test_image) # Output shape is (1,10)
```
Beware:
For each stage, the input will be downsampled by a 2x2 2D-CNN Layer with stride=2.
Please be aware of your input sizes at each stage.

## Evalutation
The CMT model is evalutated by MNIST handwritten dataset, and reached val_acc of 0.9892 at epoch=5.
Details are shown in CMT_Demo.ipynb.

repository: eternalding/tf-CMT

repo_name: eternalding/tf-CMT


text:
# OutlookTabCtrl

![Example](./image.png)

## Introduction

This control is another kind of tabs. Tabs are displayed as horizontal stripes and can be collapsed into buttons located in a separate area. Each tab is assigned its own window, which is shown when you click on the tab. An additional button can be displayed in the button area. You can use it to show menu, for example.

The control is derived from `CWnd` and is a common control based on MFC. It is possible to put it on any window: main frame, dialog, etc.

## Using the Code

To create the control and add elements to it, you can do the next steps:

```cpp
#include "OutlookTabCtrl.h"

OutlookTabCtrlEx<OutlookTabCtrlCustom1> m_TabCtrl;
CListCtrl m_List1, m_List2;

...

if( !m_TabCtrl.Create(this, WS_CHILD | WS_VISIBLE,CRect(10,10,100,200), ID_OutlookTabCtrl) )
    return -1;    // error.

// Create an ImageList with icons for tabs displayed as stripes.
m_TabCtrl.CreateStripeImage(NULL,IDB_STRIPE_NORMAL,IDB_STRIPE_DISABLE,true,24);
// Create an ImageList with icons for tabs displayed as buttons.
m_TabCtrl.CreateButtonImage(NULL,IDB_BUTTON_NORMAL,IDB_BUTTON_DISABLE,true,16);

// Create child controls.
if( !m_List1.Create(WS_CHILD | WS_CLIPCHILDREN | LVS_REPORT, CRect(0,0,0,0), &m_TabCtrl,ID_List1) ||
    !m_List2.Create(WS_CHILD | WS_CLIPCHILDREN | LVS_REPORT, CRect(0,0,0,0), &m_TabCtrl,ID_List2) )
    return -1;    // error.
m_List1.InsertColumn(0,"Mail",LVCFMT_LEFT,100);
m_List2.InsertColumn(0,"Calendar",LVCFMT_LEFT,100);

// Add child items in the m_TabCtrl.
if( !m_TabCtrl.AddItem(&m_List1,"Mail",0,0) ||
    !m_TabCtrl.AddItem(&m_List2,"Calendar",1,1) )
    return -1;    // error.

// Load state from registry.
if( !m_TabCtrl.LoadState(AfxGetApp(),"OutlookTabCtrl","State") )
    m_TabCtrl.PushVisibleItem();    // create default state.

m_TabCtrl.Update();
````

The `OutlookTabCtrl` class does not draw itself. To do this, inherit from the `OutlookTabCtrl::Draw` class and implement its functions. A pointer to `OutlookTabCtrl::Draw` must be passed to the control by calling the `SetDrawManager` function. The classes `OutlookTabCtrlCustom1`, `OutlookTabCtrlCustom2`, `OutlookTabCtrlCustom3`, `OutlookTabCtrlCustom4` are ready-made implementations of the `OutlookTabCtrl::Draw` class. Each of them renders `OutlookTabCtrl` in its own style. The `OutlookTabCtrlEx` class helps you combine `OutlookTabCtrl` with the render class. For example, like this: `OutlookTabCtrlEx<OutlookTabCtrlCustom2> ctrl;` .

The `OutlookTabCtrl::IRecalc` interface sets the sizes of the areas in the control. The `OutlookTabCtrl` class has its own `OutlookTabCtrl::IRecalc` implementation. But you can also make your own implementation of the `OutlookTabCtrl::IRecalc` interface and pass a pointer to it in the control using the `SetRecalcManager` function.

There are also three additional classes: `Ability`, `Notify`, and `ToolTip`. The `Ability` class allows the user to select any tab. `Notify` informs about the occurrence of some event. `ToolTip` manages the creation of tooltips for tabs in button state. A pointer to the implementation of each of the classes must also be passed to `OutlookTabCtrl`.

Windows for all new added items should have the unique identifiers. Items can be in the state of a stripe or button. By default, an item is added as a stripe. The user should call the `Update` function to show the results that are set by functions `DeleteItem`, `SetItemWindow`, `SelectItem`, etc. You can hide an item (`ShowItem`) or block it (`DisableItem`). It is also possible to get the index of an item among all visible items (`GetVisibleIndexByHandle`) or in general among all items in the control (`GetIndexByHandle`). A control can save and load the position of its elements and their visibility from the registry or another source (`LoadState`/`SaveState`). This is only part of the possibilities. To learn more, take a look at the public interface of the `OutlookTabCtrl` class.

Good luck! :-)

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate?business=HTC7VHPDL6U54&item_name=Thank+you+for+your+donation.+This+will+help+me+develop+great+things+further.&currency_code=USD)

license: Unlicense

repository: eaglexmw-gmail/OutlookTabCtrl

repo_name: eaglexmw-gmail/OutlookTabCtrl


text:
---
layout: default
published: true
---

##General

Logger is a PL/SQL logging and debugging framework.

## Step-by-step guide

## Installation

Download the software
https://github.com/OraOpenSource/Logger/tree/master/releases
Download the latest Version and unzip the file.

Installation via SQL*plus

Navigate to your logger directory using command line.
Such as: cd Users\<username>\Downloads\logger_3.1.0

Connect with SQL*plus as sysdba or any user with sysdba-permissions, to your instance.
Such as: sqlplus usr/pass@hostname.network:port/remote_service_name

![logger1]({{site.baseurl}}/images/logger1.png)
....

## Best practices

## Code examples

```sql
select 1 from dual
```

## Links for further information and details:

[Logger API Manual](http://github.oraopensource.com/flatdoc?repo=logger&path=docs%2FLogger+API.md)
[Developer Guide](http://github.oraopensource.com/flatdoc?repo=logger&path=docs%2FDevelopment+Guide.md)
...

repository: cczarski/DOAG-PL-SQL-Coding-Conventions

repo_name: cczarski/DOAG-PL-SQL-Coding-Conventions