text:
![100% test coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)

# ScrollTrack
> Associates an event emitter with an element to broadcast its position in the viewport with respect to the scroll position of a container.

[Demos](http://kettle-modules.s3.amazonaws.com/scroll-track/stress.html)

Borrowing heavily from the [scrollMonitor](https://npmjs.com/scrollmonitor) package, ScrollTrack implements the standard Node event emitter in
place of the custom implementation used by ScrollMonitor. ScrollTrack also (subjectively) simplifies the code base, uses transpiled ES6 classes,
has full test coverage, supports `vh`-based offsets, and addresses a few (subjective) bugs.

The module consists of a `ScrollElementContainer` class and a `ScrollElement` class. By default, when required, the module instantiates a singleton
instance of `ScrollElementContainer` and exports it. Therefore, when creating a new `ScrollElement` (via `ScrollElementContainer.create()`), the
`ScrollElement` is added to the singleton and available globally (assuming you have a reference to the module on a given module). This approach will
avoid adding additional scroll and resize listeners to the window even if you require the module from multiple places in your project.

To create a new container, do not instantiate a new `ScrollElementContainer`. Instead, call the singleton's `createContainer` method. This will ensure
that your new container still uses the singleton for capturing `scroll` and `resize` events (rather than piling on more listeners unneccesarily).

Capturing scroll and resize events on the window can quickly cause performance issues. The module is designed to avoid such issues by implementing the
architecture defined above, while also using [passive event listening](https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md) when available. Passive event listening provides performance-conscientious scroll and
resize event tracking on the window (or any `ScrollElementContainer` item).

This module's only dependencies are the [`events`](https://www.npmjs.com/package/events) module, which provides access to the native node `EventEmitter` in
a browser environment, and the [`debounce`](https://www.npmjs.com/package/debounce) module to debounce the resize event listener on the window.

## Installation
Install via npm:

```sh
$ npm i scroll-track
```

## Basic Usage
```javascript
// Exports the ScrollElementContainer singleton
const scrollTrack = require('scroll-track');

const el = document.querySelector('.some-selector');
// NOTE: the create method will throw an error if passed an invalid selector string
const tracker = scrollTrack.create(el);
// or, const tracker = scrollTrack.create('.some-selector');
// or, const tracker = scrollTrack.create(10);
// or, const tracker = scrollTrack.create({top: 10, bottom: 20});

tracker.once('enter-viewport', () => console.log('entered viewport'));
tracker.on('exit-viewport', () => console.log('exited viewport'));
````

## ScrollElement
Create watcher objects with `scrollMonitor.create(item)`. An optional second argument lets you receive events before or after this element
enters the viewport. _See "[Offsets](#offsets)"_.

`item` can be one of the following:
* `Element` - the ScrollElement will watch the area contained by the DOM element.
* `Object` - `top` and `bottom` properties will be used to set the ScrollElement's `top` and `bottom` properties.
* `Number` - the ScrollElement will watch a 1px area this many pixels from the top. Negative numbers will watch from the bottom.
* `String` - it will use the string as a CSS selector and watch the first match.
* `NodeList / Array` - it will use the first DOM element.

ScrollElement are automatically recalculated on the first scroll event after the height of the document changes.
They will also fire events immediately after an event listener is attached if appropriate.

### ScrollElement Properties
* `ScrollElement.isInViewport` - true if any part of the element is visible, false if not.
* `ScrollElement.isFullyInViewport` - true if the entire element is visible [^1].
* `ScrollElement.isAboveViewport` - true if any part of the element is above the viewport.
* `ScrollElement.isBelowViewport` - true if any part of the element is below the viewport.
* `ScrollElement.top` - distance from the top of the document to the top of this watcher.
* `ScrollElement.bottom` - distance from the top of the document to the bottom of this watcher.
* `ScrollElement.height` - top - bottom.
* `ScrollElement.watchItem` - the element, number, or object that this watcher is watching.

[^1]: If the element is larger than the viewport `isFullyInViewport` is true when the element spans the entire viewport.

### ScrollElement Methods
* `ScrollElement.recalculateLocation` - recalculates the location of the element in relation to the document.
* `ScrollElement.getOffsets` - returns an object that defines the top and bottom offsets of this watcher.
* `ScrollElement.destroy` - removes this ScrollElement and its event listeners.
* `ScrollElement.lock` - locks the ScrollElement at its current location.
* `ScrollElement.unlock` - unlocks the ScrollElement.

ScrollElement is an instance of `EventEmitter`, so it also has familiar methods such as `on`, `once`, `removeListener`, etc.
Review all inherited methods from the [Node events documentation](https://nodejs.org/api/events.html).

These methods are automatically called by the `ScrollElementContainer`, but they can be called manually if necessary:
* `ScrollElement.update` - updates the boolean properties in relation to the viewport. Does not trigger events.
* `ScrollElement.triggerCallbacks` - triggers any callbacks that need to be called.

### ScrollElement Events
* `visibility-change` - when the element enters or exits the viewport.
* `state-change` - similar to `visibility-change` but is also called if the element goes from below the viewport to above it in one scroll event or when the element goes from partially to fully visible or vice versa.
* `enter-viewport` - when the element enters the viewport.
* `fully-enter-viewport` - when the element is completely in the viewport [^2].
* `exit-viewport` - when the element completely leaves the viewport.
* `partially-exit-viewport` - when the element goes from being fully in the viewport to only partially [^3].

[^2]: If the element is larger than the viewport `fully-enter-viewport` will be triggered when the element spans the entire viewport.
[^3]: If the element is larger than the viewport `partially-exit-viewport` will be triggered when the element no longer spans the entire viewport.

### ScrollElement Locking

Sometimes you want to change the element you're watching, but want to continue watching the original area. One common use case is setting
`position: fixed` on an element when it exits the viewport, then removing positioning when it when it reenters.

```javascript
const scrollTrack = require('scroll-track');
const tracker = scrollTrack.create(element);

tracker.lock();

tracker.on('exit-viewport', () => {
  element.classList.add('fixed');
});

tracker.on('enter-viewport', () => {
  element.classList.remove('fixed');
});
```

Because the watcher was locked, the scroll monitor will not recalculate its location until unlocked.

### ScrollElement Offsets
If you want to trigger an event when the edge of an element is near the edge of the viewport, you can use offsets. The offset
is the second argument to `ScrollElementContainer.create()`. You can also create viewport-height-relative offsets by passing a
string suffixed with `vh`.

This will trigger events when an element gets within 200px of the viewport:

```javascript
const scrollTrack = require('scroll-track');

scrollTrack.create(element, 200);
```

This will trigger when the element is 200px inside the viewport:

```javascript
const scrollTrack = require('scroll-track');

scrollTrack.create(element, -200);
```

If you only want it to affect the top and bottom differently:

```javascript
const scrollTrack = require('scroll-track');

scrollTrack.create(element, {top: 200, bottom: 50});
```

 If you only want it to affect the top and not the bottom:

```javascript
const scrollTrack = require('scroll-track');

scrollTrack.create(element, {top: 200});
 ```

This will trigger when the element when it is 1 viewport height from entering the view:

```javascript
const scrollTrack = require('scroll-track');

scrollTrack.create(element, {top: '100vh'});
```

## ScrollElementContainer
### ScrollElementContainer Properties
* `ScrollElementContainer.viewportTop` - distance from the top of the document to the top of the viewport.
* `ScrollElementContainer.viewportBottom` - distance from the top of the document to the bottom of the viewport.
* `ScrollElementContainer.viewportHeight` - height of the viewport.
* `ScrollElementContainer.contentHeight` - height of the document.

### ScrollElementContainer Methods
* `ScrollElementContainer.createContainer(containerElement)` - returns a new ScrollElementContainer that can be used just like the scrollTrack module.
* `ScrollElementContainer.create(item, offsets)` - returns a new watcher. `item` is a DOM element, NodeList, CSS selector, an object with .top and .bottom properties, or a number.
* `ScrollElementContainer.update()` - update all ScrollElements within the ScrollElementContainer and trigger their events.
* `ScrollElementContainer.recalculateLocations()` - recalculate the location of all unlocked ScrollElements and trigger events if needed.

### Creating a ScrollElementContainer
By default, the `container` for any `ScrollElement` created via the `ScrollElementContainer.create()` method will be the window.
If you want to create a `ScrollElement` within a container element, first create a container, and then call that container's `create` method to create a `ScrollElement` within it.

```javascript
const containerEl = document.querySelector('.container');
const container = scrollMonitor.createContainer(containerEl);

const scrollEl = document.querySelector('.some-element');
const scrollElement = container.create(scrollEl);

scrollElement.on('enter-viewport', () => console.log('.some-element has entered the viewport'));
scrollElement.on('exit-viewport', () => console.log('.some-element has left the viewport'));
```

## Tests, Coverage, Docs, Demos and Building for Release

To run the tests:

```shell
$ npm test
```

To generate a coverage report:

```shell
$ npm run coverage
```

To generate documentation:

```shell
$ npm run docs
```

To generate the demos:

```shell
$ npm run demo
```

To generate a bundle for distribution:

```shell
$ npm run dist
```

To run a watch when authoring new examples:

```shell
$ npm run watch
```

repository: kettle/scroll-track

repo_name: kettle/scroll-track


text:
# 753. Cracking the Safe

Difficulty: Hard

https://leetcode.com/problems/cracking-the-safe/

There is a box protected by a password. The password is n digits, where each letter can be one of the first k digits 0, 1, ..., k-1.

You can keep inputting the password, the password will automatically be matched against the last n digits entered.

For example, assuming the password is "345", I can open it when I type "012345", but I enter a total of 6 digits.

Please return any string of minimum length that is guaranteed to open the box after the entire string is inputted.

**Example 1:**
```
Input: n = 1, k = 2
Output: "01"
Note: "10" will be accepted too.
```
**Example 2:**
```
Input: n = 2, k = 2
Output: "00110"
Note: "01100", "10011", "11001" will be accepted too.
```
**Note:**
1. n will be in the range [1, 4].
2. k will be in the range [1, 10].
3. k^n will be at most 4096.

Companies: Google

Related Topics: Depth-first Search

license: MIT

repository: jiadaizhao/LeetCode

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: jiadaizhao/LeetCode


text:
# Bills
The application was created for the purposes of roles between friends.
The project includes an interface through which we enter data into the database. The database assigns debts to the indicated person with a description of what the amount is due for.Thanks to this application, settlements were not so easy, just enter the amount, description of the amount and the person who owes you and the system will count the values yourself.

## Technologies

-Java

-MySql

-Spring Boot

-Hibernate

-Vaadin

>**creating a user interface**

![image](https://user-images.githubusercontent.com/43965599/119955827-bb1f5f00-bfa0-11eb-9141-29df1bfca995.png)

#**Adding records to the database**

![image](https://user-images.githubusercontent.com/43965599/119957536-70064b80-bfa2-11eb-8223-2d53278995fe.png)

#**Deleting  records to the database**

![image](https://user-images.githubusercontent.com/43965599/119958679-8cef4e80-bfa3-11eb-9846-873ffae0d739.png)

#**Debt list**

![image](https://user-images.githubusercontent.com/43965599/119958502-63362780-bfa3-11eb-9c76-bb9dbd81e99b.png)

License
----

MIT

**Free Software**

gha_language: JavaScript


text:
[//]: <author> (Andrew Schreiber)
[//]: <title> (TBA Bulk Data using Big Query)
[//]: <updated> (10/01/2020)

[[toc]]

## Accessing Bulk TBA Data

As you may have noticed, accessing the TBA API is pretty easy if you need to see one team or one event but what if you wanted to see something else, like how often Team 254 has Red Bumpers. For stuff like that TBA has an mirror of their data to a publicly queryable data set available at [https://thebluealliance.com/bigquery](https://thebluealliance.com/bigquery).

Simply put, it's a database that you can ask questions. If you're familiar with querying other databases using SQL it should feel fairly similar.

### Description of Some Tables

#### Team
This table describes information about any FRC Team in the database. This doesn't exactly mean that team ever competed and in some cases [only existed at off season events](https://www.thebluealliance.com/team/666). So, sadly, it's not as easy to find the list of all FRC teams by looking here.

#### Event
Should be fairly obvious, the only big catch is that it includes off season events. As a general trick you can filter by `event_type_enum < 7` to exclude unofficial events or only include [certain types of events](https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/event_type.py#L2), there is also an `official` column that works just as well but doesn't let you exclude things like Einstein which can sometimes skew data.

#### EventTeam
This is the join table that let's you go between Event and Team.

#### Match
This is where things get fun, it contains every match TBA has. The catch it's stored oddly because of how the Google infrastructure that TBA works on holds data. This means that getting things like if a team won a match can be difficult. This table joins back on Event, but inside the `alliances_json` you can also join back to Team.

### Querying Data
You'll need to create a project and enable Big Query in it, the good news this is free. At the time of writing it's in a dropdown next to the words "Google Cloud Platform". Let's start with a simple query.

```
SELECT
  team.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.eventTeam`
WHERE
  event.name = "2014abca"
 ```

 This query is about as simple as it gets. It says to select the `name` on the `team` structure from the `EventTeam` table where the `name` of the `event` is "2014abca". If we wanted to see a different list of teams we could change the event name. The thing to note is that in both of these cases we are actually looking at the `RECORD` type stored on this table, so those names are really the names of the keys.

 ### Joining Data

 Listening teams that competed in a season is fairly easy, you just need to join to the Event table and filter on the `Event.year`

 ```
 SELECT
  DISTINCT team.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.eventTeam` AS ET
JOIN `tbatv-prod-hrd.the_blue_alliance.event` as E
  ON E.__key__.name = ET.event.name
WHERE
  E.year = 2016
AND E.event_type_enum < 7
```

When you join you need to tell it what table you are joining in and on what. I typically find it nice to alias the table swith an `as` to minimize my typing.

### Helpful Queries

#### Create a table of team wins

Helpful if you need to find all wins by a team, mostly a base for aggregating the data with GROUP BY and COUNT clauses

```
-- This is a gnarly function to determine if a team won a match. Bear in mind it specifically does won.
-- !won can include lost or tied, it also doesn't account for red cards
CREATE TEMP FUNCTION
  won(team STRING,
    json STRING)
  RETURNS BOOL
  LANGUAGE js AS """
    var alliances = JSON.parse(json);
     var alliance = alliances.blue.teams.indexOf(team) >= 0? "blue": "red"
     var opp_alliance = alliance == "blue" ? "red" : "blue"
     var our_score = alliances[alliance].score;
     var opp_score = alliances[opp_alliance].score;
     return our_score > opp_score;
  """;
SELECT
  tm,
  M.__key__.name as match_id,
  won(tm,
    alliances_json) AS won,
  event.name as event_id,
FROM
  `tbatv-prod-hrd.the_blue_alliance.match` AS M,
  UNNEST(M.team_key_names) AS tm
JOIN `tbatv-prod-hrd.the_blue_alliance.event` AS E
  ON M.event.name = E.__key__.name
WHERE E.year >= 2005
-- Let's be honest, TBA data is sketchy prior to 2005 at best.
-- Uncomment to limit to a specific team
-- AND tm = 'frc33'

-- Uncomment to limit to a specific event
-- AND E.__key__.name = "2014abca"

-- Uncomment to limit to a specific year
-- AND E.year == 2018

-- Filter out any off seasons, though you could just as easily only grab districts or such
-- https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/event_type.py#L2
AND E.event_type_enum < 7

```

#### List teams at an event

Helpful to find a list of teams at an event, just update the event name.
```
SELECT
  team.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.eventTeam`
WHERE
  event.name = "2014abca"
```

##### Teams that attended BOTH events

This one is actually showing a handy trick, if you construct two sets of things you can do set intersections on them. This would work with most of the queries here.

```
SELECT
  team.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.eventTeam`
WHERE
  event.name = "2018mimil"

INTERSECT DISTINCT

SELECT
  team.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.eventTeam`
WHERE
  event.name = "2018misou"
```

#### Teams in a season

Maybe less useful for most but still handy to have, bear in mind ordering will be alphanumeric not numeric.

```
SELECT
  DISTINCT team.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.eventTeam` AS ET
JOIN `tbatv-prod-hrd.the_blue_alliance.event` as E
  ON E.__key__.name = ET.event.name
WHERE
  E.year = 2016
AND E.event_type_enum < 7
```

#### Events a team attended
```
SELECT
  DISTINCT event.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.eventTeam` as ET
JOIN `tbatv-prod-hrd.the_blue_alliance.event` as E
  ON E.__key__.name = ET.event.name
WHERE
  E.year = 2016
  AND team.name = "frc33"
  AND E.event_type_enum < 7
```

#### Awards a team won

```
SELECT
  name_str,
  event.name
FROM
  `tbatv-prod-hrd.the_blue_alliance.award`,
  UNNEST(team_list) AS TM
WHERE
  TM.name = "frc33"
  AND year > 2005
```

repository: abidingabi/recalc

branch_name: refs/heads/main

repo_name: abidingabi/recalc


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

### Description

Cacti before 1.2.6 allows IDOR (Insecure Direct Object Reference) for accessing any graph via a modified local_graph_id parameter to graph_xport.php. This is a different vulnerability than CVE-2019-16723.

### POC

#### Reference
- https://medium.com/@hussainfathy99/exciting-news-my-first-cve-discovery-cve-2023-37543-idor-vulnerability-in-cacti-bbb6c386afed

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

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# Before you add new test cases...

## File naming convention
### `<src filename(noext)>_test.cpp`
ex) `smt_test.cpp` includes the tests for `smt.cpp`.

## Test suite naming convention
### `Unit<SrcFilename(noext)><SuiteName>`
ex) `UnitSMTTest`, `UnitTensorTest`.
**Unit** prefix is important: this distinguishes unit tests from tests for passes.

## Test case naming convention
Name them as you like, just use `CamelCase`.

repository: iCodeIN/mlir-tv

repo_name: iCodeIN/mlir-tv


text:
> [Go to French version](/fr/Règlements/Textes%20réglementaires/2016/18.md)

# Transfer of Duties Order

**SI/2016-18**

Enabling authorities:
- [PUBLIC SERVICE REARRANGEMENT AND TRANSFER OF DUTIES ACT](/en/Acts/Revised%20Statutes%20of%20Canada/P/P-34.md)

Date registered: 20 April 2016

----------

His Excellency the Governor General in Council, on the recommendation of the Prime Minister, pursuant to paragraph 2(a)[a] of the [Public Service Rearrangement and Transfer of Duties Act](/en/Acts/Revised%20Statutes%20of%20Canada/P/P-34.md)[b], transfers from the Privy Council Office to the Treasury Board the control and supervision of that portion of the federal public administration in the Privy Council Office known as the Canadian Secretariat to the Canada-U.S. Regulatory Cooperation Council, effective April 1, 2016.

a: S.C. 2003, c. 22, s. 207

b: R.S., c. P-34

repository: TravisMadill/CanadianLaws

repo_name: TravisMadill/CanadianLaws


text:
#audio-encryption

A simple and elegant way for peer-to-peer communication through audio encryption and decryption.

##Idea

Instead of the usual hashing techniques converting text into some gibberish, here we employ a similar method except we do the same the thing to audio data.

* Helps in easy transmission and sharing of data through short distances without using the internet (using devices which can decrypt the data)
* Compatibility of above method in any OS due to use .wav files
* Application of FFTs over primes becomes harder to decrypt
* This is a task-specific encryption/decryption since it cannot be used in all instances, but will surely come to use somewhere, sometime

# For the website

use commands.

mysql -u root -p
Enter password
create database <databasename>
eg : create database encryption;

cd audio_encrytption/website/audio_encrytption/audio_encrytption
vim settings.py

Now find the term Database and put all the information about your Database as suggested.

cd ..

python manage.py makemigrations
python manage.py migrate

python manage.py runserver


text:
QBGradientLabel
===============

Simple label that draws a gradient as the background. Offers multiple ways to initialize or change color. Written in Both ObjC and Swift

Getting Started
=================

Install
--------------------
1. Load files under GradientLabel in sample project to your own project.
2. `#import "QGGradientLabel.h"`

Usage
--------------------
Look at header methods in h file for usage.

Example:

```
UIColor *lightBlue = [UIColor colorWithRed:97.0/255.0 green:118.0/255.0 blue:155.0/255.0 alpha:1.0];
UIColor *darkBlue = [UIColor colorWithRed:2.0/255.0 green:31.0/255.0 blue:84.0/255.0 alpha:1.0];
QBGradientLabel *plainLabel = [[QBGradientLabel alloc] initWithFrame:CGRectMake(20, 20, 200, 40) darkColor:lightBlue andLightColor:darkBlue];
```

![QBLog](http://www.topbalancesoftware.com/apps/gitmedia/gradientlabel.png)

MIT License
--------------------
    The MIT License (MIT)

    Copyright (c) 2014 Ruben Nieves

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

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

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


text:
---
layout: post
title: "KM and Aviation or Aerospace"
date: 2014-03-28 13:41:31 -0400
comments: true
categories: [academic libraries, knowledge management, LIS658]
---

**Preface:**

This semester I am teaching a knowledge management (KM) course. I
will be posting entries throughout the semester that describe,
critique, summarize, outline, etc. KM articles that my students
are not reading. The purpose here is to leverage the amount of
material I can expose them to.

**Article under discussion:**

This post is about:

Harvey, D. J., & Holdsworth, R. (2005). Knowledge management
in the aerospace industry. *Proceedings of the 2005 IEEE
International Professional Communication Conference*, 237-243.
doi:[10.1109/IPCC.2005.1494182](http://dx.doi.org/10.1109/IPCC.2005.1494182)

The article was picked after searching for the term **knowledge
management** in [CiteULike](http://www.citeulike.org/) and
browsing the results.

**Notes and discussion:**

The article begins by stressing not only the size of the aerospace
industry, which includes both civilian and military aspects, but
also the diversity of its workforce and the diversity of the
companies that support the industry. Furthermore, the safety and
the economics of the industry are both significant to lives and
sensitive to minor fluctuations. Managing knowledge in such a
context is not just an organizational problem, it is an
industry-wide problem.

Nice passage on the expectation of KM:

> In essence, like any other industry, the aerospace industry
> expects that any knowledge management initiatives will produce
> cheaper products more quickly without compromising product or
> personnel safety while maintaining an acceptable level of
> business risk (p. 238).

Issues that are barriers to effective knowledge management systems
and practices:

- compliance with regulations
- safety concerns
- merging "process rigor" (p. 238) with KM in order to create
  flexibility
- insuring information is not lost (keeping tacit knowledge)
- issues of reporting errors, disclosure, and trust in the
  industry; "information context" (p. 238). Good quote:

> It is about information context and optimisation of information
> to maximize knowledge where and when it is required. Providing
> people (e.g., the flying public) with information that they do
> not need, cannot understand, or may misinterpret is equally as
> bad as not providing information that they do need; it does not
> increase "real" knowledge (pp. 238-239).

- issues with competency and with authority; the problem of
  "equating information with knowledge" (p. 239)

One key need here, the authors argue, is that knowledge management
should help make regulation more effective. The issue here is with
decision making, characteristics and contexts of information,
access to the right information and excluding the irrelevant,
increase flexibility, foster knowledge sharing, wisdom, and
storage.

Part of the problem:

> For large aerospace companies, the problem is not so much the
> technologies, but the logistics and costs involved in
> implementation of the technologies and knowledge management
> processes (p. 240).

The authors discuss issues related to intellectual property (with
respect to commercial industry) and to classified information
(with respect to government and military agencies). A number of
other complex issues are discussed --- issues that highlight the
unique knowledge management challenges that face the aerospace
industry.

Under the section of **People Issues**, a good quote about
communication:

> Particularly in defence aerospace, there are large costs
> involved in just making collaboration and communication possible
> (p. 241).

The above leads to a question that can be asked of other areas in
general: what's the cost of collaboration? what's the cost of not
collaborating?

The authors raise a point about issues of organizational
structure, such that payment and terms of employment are generally
linked not to one's level of knowledge or skill but to one's level
of "accountability and responsibility" (p. 241).

There are cultural implications in the above hierarchy, the
authors essentially stress. Management rank themselves by, for
example, their budgets and staff size. Scientists and engineers,
however, rank themselves by what they know. This would create
organizational tensions.

Overall, a nice article that provides additional context about KM
issues.

repository: cseanburns/research-notebook

extension: markdown

repo_name: cseanburns/research-notebook


text:
---
id: 715
title: Story telling as a webmaking task
date: 2012-06-18T14:53:19+00:00
author: David Ascher
layout: post

restapi_import_id:
  - 5780561eab8f6
original_post_id:
  - "715"
categories:
  - Mozilla
  - webmaker
---
In a new-thing-for-me, I’m working with a group of four students from the Center for Digital Media as part of their Masters program, on a design-led project that ties to Mozilla.  Specifically, [these folks](http://blogs.gnwc.ca/Cucumber/the-team/) are working on a project they call The Cucumber, which is (in my words), trying to make a tool that lets any traveler easily create a compelling micro-documentary about a place they like, using the tools of the open web.

At this point, they’ve done a bunch of thinking, blackboard sketches, paper prototypes, and more, and they’re making good progress, but _they need your help_!  In particular, they’ve got a hypothesis that by preparing a few templates and story-telling concepts, they can define a design framework that everyone could use to make something compelling.

If you’re interested, it’d be great if you could check out their [questionnaire](http://blogs.gnwc.ca/Cucumber/2012/06/15/tell-your-story-and-test-our-recipe/) and do a “pretend story-telling” — think of a place you want to document, and fill in [the form](http://blogs.gnwc.ca/Cucumber/2012/06/15/tell-your-story-and-test-our-recipe/) — it will only take a few minutes, and be very helpful to the team!


text:
# Vigilance

Vigilance is a simple command-line tool meant to ensure code quality metrics are met within codebases.

![Build status](https://travis-ci.org/belvedere-trading/vigilance.svg?branch=master)

## Quickstart

Vigilance can be installed from PyPi with `pip`.

```
pip install vigilance
```

The tool has a very simple interface:

```
vigilance --help
Usage: vigilance [OPTIONS]

  Runs Vigilance with the specified configuration file. The default
  configuration file if no options are passed is vigilance.yaml within the
  current working directory.

Options:
  --config FILENAME  Path to the vigilance configuration file
  --help             Show this message and exit.
```

All of Vigilance's functionality is controlled by the configuration file used by the tool. The configuration file defines:

1. The quality suites that must be verified
   * Analogous to code quality tools
2. The locations of the quality report for each suite
   * Contains the actual quality information for the codebase
3. The associated constraints that should be enforced upon the codebase
   * The metrics that a codebase must meet

These concepts will be explained more thoroughly later in the documentation.

If no configuration file is specified, Vigilance will look for a `vigilance.yaml` file in the current working directory.

For example, you could run Vigilance on its own code coverage report by calling the following set of command from the root of its source directory:

```
pip install .
pip install -r test_required_packages.req
python setup.py coverage
vigilance
```

If the quality enforcement succeeds, Vigilance will exit with a return code of 0; any other return code indicates a problem. A negative return code means that the tool failed while a positive code means that the quality metrics of the code base do not meet the configured constraints.

The configuration for Vigilance's own quality enforcement looks like:

```yaml
suites:
  cobertura:
    report: coverage.xml
    constraints:
      -
        type: global
        line: 80
        branch: 80
        complexity: 0
      -
        type: ignore
        paths:
          - vigilance/suite.py
      -
        type: file
        path: vigilance/constraint.py
        branch: 50
      -
        type: package
        name: vigilance
        branch: 75
  doxygen:
    report: doxygen.err
    constraints:
      -
        type: documentation
```

In this configuration file, we can see that two different quality suites have been defined: "cobertura" and "doxygen". These suite names must match the name of a quality suite (either built-in or from a plugin) known to Vigilance. Each suite defines the location of its quality report (the "report" key) and the constraints that the codebase must meet. For the "cobertura" suite, there are 4 total constraints defined. In the same order that they appear in the file, these are:

1. Globally, the codebase must have a line coverage of 80%, a branch coverage of 80%, and a complexity score of 0.
2. The file `vigilance/suite.py` should be ignored entirely from coverage enforcement.
3. The file `vigilance/constraint.py` is required to have a branch coverage of only 50% (rather than the global 80%).
4. The package `vigilance` is required to have a branch coverage of only 75% (rather than the global 80%). This stanza is equivalent to setting the global branch coverage constraint to 75%, but has been included as a sort of regression test.

Configuration file format changes depending on the type of quality report being inspected. For more detail about Vigilance configuration, please see the configuration section below.

## Configuring plugins

Vigilance ships with a dynamic plugin that allows users to make additional functionality available to the quality enforcement system. Plugins can be configured in one of three different locations:

1. The VIGILANCE_PLUGINS environment variable.
2. A `.vigilance` file within the directory in which Vigilance is run.
3. A `setup.cfg` file within the directory in which Vigilance is run.

The locations will be checked in that order and only the first location that contains information will be used. The actual plugin configuration is simply a comma-delimited list of plugins classes of the form `module.name:ClassName,other.module:AnotherPlugin`. If either of the available file sources, the files should be INI formatted, e.g.

```ini
[vigilance]
plugins = module.name:ClassName,other.module:AnotherPlugin
```

If the environment variable is used, the value of the variable should be the raw comma-delimited string.

## Concepts in detail

Before attempting to understand the implementation or configuraton details of Vigilance, it will be helpful to first understanding the conceptual model under which it operates. Vigilance models code quality enforcement into a few fundamental pieces:

* Quality reports (and their associated parsers), which are composed of
* Quality items, which must meet
* Quality constraints, which are defined by the user with
* Configuration stanzas

Please refer to the following sections for more detail about each of these concepts. Once the concepts are understood, the configuration file and authoring of Vigilance plugins should be fairly straightforward.

### Quality reports

Quality reports are the persisted output from an external code quality tool. Possible examples include code coverage reports, documentation generation output, or code complexity analysis. The quality report is how Vigilance gleans information about the quality of a codebase. For the remainder of the concepts documentation, we will consider a code coverage report as generated by [Cobertura](http://cobertura.github.io/cobertura/) (mainly because this is the coverage tool used to enforce code coverage on Vigilance's own codebase).

To make things a bit more concrete, this is a small snippet of what a Cobertura quality report might look like (pulled from a previous Vigilance coverage report):

```xml
<?xml version="1.0" ?>
<coverage branch-rate="0.8478" line-rate="0.9229" timestamp="1509394341434" version="4.0">
        <!-- Generated by coverage.py: https://coverage.readthedocs.org -->
        <!-- Based on https://raw.githubusercontent.com/cobertura/web/f0366e5e2cf18f111cbd61fc34ef720a6584ba02/htdocs/xml/coverage-03.dtd -->
        <sources>
                <source>/Users/jkaye/git/vigilance</source>
        </sources>
        <packages>
                <package branch-rate="0.825" complexity="0" line-rate="0.9102" name="vigilance">
                        <classes>
                                <class branch-rate="1" complexity="0" filename="vigilance/__init__.py" line-rate="1" name="__init__.py">
                                        <methods/>
                                        <lines>
                                                <line hits="1" number="4"/>
                                                <line hits="1" number="6"/>
                                                <line hits="1" number="7"/>
                                        </lines>
                                </class>
                                <class branch-rate="1" complexity="0" filename="vigilance/configuration.py" line-rate="0.9844" name="configuration.py">
                                ...
```

### Quality items

A quality report is conceptually nothing more than a collection of quality items. Each quality item is an individual data point that Vigilance is able to inspect and compare against the constraints configured by the user. For example, the interesting pieces from the quality report above are the `<package>` and `<class>` elements; therefore, these are the "quality items" that Vigilance will extract from the coverage report (actually, it's the default Cobertura plugin that performs this extraction, but we will get to that in more detail later).

Essentially, you can think of quality items as the pieces of data from a quality report that Vigilance will validate constraints against.

### Quality constraints

Quality constraints are the metrics that Vigilance will enforce against the quality items that it extracts from the quality report. Continuing with our code coverage example, possible constraints could be:

* Line coverage
* Branch coverage
* Cyclomatic complexity

As a user, we want line and branch coverage to remain high as our codebase changes through time, and complexity to remain low. These represent the constraints that Vigilance will enforce upon the codebase.

### Configuration stanzas

Finally, configuration stanzas are the means by which Vigilance determine's the user's desired constraints. The Vigilance configuration file has a fixed structure, but its dynamic value interpretation allows the tool to provide a significant amount of flexibility (provided that the plugins one uses are well written).

The configuration file that defines the aforementioned constraints for the coverage report looks like:

```yaml
suites:
  cobertura:
    report: coverage.xml
    constraints:
      -
        type: global
        line: 80
        branch: 80
        complexity: 0
      -
        type: ignore
        paths:
          - vigilance/suite.py
      -
        type: file
        path: vigilance/constraint.py
        branch: 50
      -
        type: package
        name: vigilance
        branch: 75
```

The individual stanzas are the list elements within the "constraints" key. Each stanza has at least a "type" key that defines the type of constraint that it is (within the context of the current plugin). The rest of the keys within each stanza are implementation specific; for this example, "line" and "branch" are minimum coverages (specified as percentages) while "complexity" is a maximum complexity score. Each of these constraints will be applied to the quality items extracted from the quality report based upon the type of its configuration stanza.

Please see the [plugin tooling section](#Tooling) for more information about how global/filtered constraints interact with one another.

## Plugins

All functionality from Vigilance is provided via plugins. Each plugin consists of four components (closely mapped to the concepts defined above) that together form a "quality suite". The suite contains everything that Vigilance requires to do its job:

1. A key. This is the unique name for the plugin that allows Vigilance to interpret the quality report and constraints from its configuration file
2. A report parser. This parses the textual representation of the quality report into Vigilance quality items
   * The report's associated quality items
3. Constraints.
4. Configuration stanzas.

### Default plugins

Vigilance comes with a set of default plugins that are automatically distributed along with its installation. Currently, the default plugins are:

* [Cobertura](https://github.com/belvedere-trading/vigilance/wiki/Cobertura)
* [Doxygen](https://github.com/belvedere-trading/vigilance/wiki/Doxygen)

### Writing a plugin

Once the Vigilance concepts are well understood, writing a new plugin is fairly straightforward. A plugin author will need to define:

1. The test metrics for their suite. These are the individual atoms of data that constraints will compare against quality items.
2. The [quality items](https://belvedere-trading.github.io/vigilance/classvigilance_1_1representation_1_1_quality_item.html) that comprise the quality report.
3. The [report parser](https://belvedere-trading.github.io/vigilance/classvigilance_1_1parser_1_1_parser.html) that parses the quality report.
4. The [constraints](https://belvedere-trading.github.io/vigilance/classvigilance_1_1constraint_1_1_constraint.html) that can be enforced.
5. The [configuration stanzas](https://belvedere-trading.github.io/vigilance/classvigilance_1_1configuration_1_1_configuration_stanza.html) that translate Vigilance configuration YAML into constraints.

Once the above have been defined, the entire quality suite can be assembled by defining a subclass of [AbstractPlugin](https://belvedere-trading.github.io/vigilance/classvigilance_1_1plugin_1_1_abstract_plugin.html). This subclass can then be made available to Vigilance's plugin system once the code is installed into the same Python environment as Vigilance itself.

The source of [the Cobertura plugin](https://github.com/belvedere-trading/vigilance/blob/master/vigilance/default_suites/cobertura.py) is a good place to start for an example of how to write a plugin of your own.

### Tooling

Vigilance contains a set of tools that make writing plugins a bit easier for users of the tool. These tools can be found in the [vigilance.plugin.tooling](https://belvedere-trading.github.io/vigilance/tooling_8py.html) module.

Currently, the tools available are a set of [ConfigurationStanza]() implementations that could be useful to many different types of plugins. The implementations can be broken down into two groups:

1. The global stanza
2. The filter stanzas

The global stanza (called [BaseStanza]() in the code) is meant to define the global quality metrics that should be applied to the codebase. This is the stanza that parses the "global" configuration key in the example configuration files above. The stanza accepts any constraint labels defined by the plugin's quality suite as keys and uses their corresponding values as the constraints. The filter stanzas share the same parsing functionality as the global stanza (actually, they derive from BaseStanza).

The key to the useful behavior between the filter/global stanzas lies in how the Vigilance enforcer decides which constraints should be applied to any given quality item. For each item, if any filter exists for a single constraint, only the filtered constraint will be applied. This makes it easy to configure many different permutations of quality metrics by defining multiple filters that override only one or two constraints applied to a subset of the codebase.

### API documentation

Full Doxygen documentation can be found at [the GitHub pages for this project](https://belvedere-trading.github.io/vigilance/).

repository: belvedere-trading/vigilance

gha_language: Python

repo_name: belvedere-trading/vigilance


text:
starter
=======

An osxc playbook, for Miyamoto Daisuke.

Original document is [here](https://github.com/osxc/starter).

## Introduction

Welcome to osxc !

osxc is a simple configuration tool for OS X (in fact, it just makes it easier for you to use ansible on OS X).

You can reach our (temporarily not updated and old) [website](http://osxc.github.io) if you want to know more. But don't follow the instructions there to get started, just stay here for that !

## Get started

> **Warning:** All of this is subject to change, just be sure you're able to reach this page to see the latest instructions when it'll be updated. Don't worry though, we will not change brutally the structure of your current repo (not like we did with legacy). All we are going to do is add a CLI tool.

> **Additional Note:** If you're installing system-wide `sudo ansible-galaxy install -r requirements.yml` otherwise edit `ansible.cfg` and comment out `roles_path:./roles` to install the roles in your osxc.starter fork before running **Step 5**.

1. Be sure to have the XCode Command-Line tools installed: `xcode-select --install`
2. Easy_install pip, and then pip install Ansible: `sudo easy_install pip; sudo pip install ansible` (or `sudo pip install --upgrade ansible` if Ansible has already been installed via pip and needs upgrading to 1.8+)
3. While that's happening [Fork original repo](https://github.com/osxc/starter/fork) and then clone your fork anywhere you want on your machine: `git clone https://github.com/<yourname>/starter.git ~/src/osxc; cd ~/src/osxc`
4. Take a quick look at `configuration.yml` and `installation.yml` customizing to your liking.
5. Start osxc with `ansible-galaxy install -r requirements.yml && ansible-playbook desktop.yml -K`

At the end, you'll only need to repeat step 5.

Now you're ready to further tweak the configuration we gave you. Have fun ! (You may want to read the [Ansible documentation](http://docs.ansible.com/index.html) in this case ...)

## Learn More

If you want to get more documentation or just want to see what osxc can do for you, here's a [repository list on ansible galaxy](https://galaxy.ansible.com/list#/users/6499) where you can find all the publicly available roles for osxc.


text:
# CS294-112 HW 1: Imitation Learning
# nthomas Reproduction Instructions

Create the requisite directories

```
mkdir expert_data
mkdir training_accuracies
```

## Section 3
To get the table in section 3, run:

```
./scripts/run_halfcheetah.sh 20 | grep return
./scripts/run_hopper.sh 20 | grep return
```

This will output the raw values, mean, and standard deviation of the returns of the expert policy and the behavioral cloning policy.

To recreate the results for different rollout numbers of the expert policy, run:

```
./scripts/run_halfcheetah.sh 1 | grep return > output.txt && \
./scripts/run_halfcheetah.sh 5 | grep return >> output.txt && \
./scripts/run_halfcheetah.sh 10 | grep return >> output.txt && \
./scripts/run_halfcheetah.sh 15 | grep return >> output.txt && \
./scripts/run_halfcheetah.sh 20 | grep return >> output.txt

```

This will output the raw values, mean, and standard deviation of the returns of the expert policy and the behavioral cloning policy into output.txt. Manually pick out the pieces of data necessary and then plot them.

## Section 4
To recreate the dagger plots, run

```
# generate expert data
python run_expert.py experts/Ant-v1.pkl Ant-v1 --num_rollouts 20 --expert_data_filename expert_data/expert_data_Ant-v1.pkl
# run dagger
python dagger.py Ant-v1 --expert_data_filename expert_data/expert_data_Ant-v1.pkl --expert_policy_file experts/Ant-v1.pkl --num_rollouts 20 --training_steps 10000
```

A figure should appear in the current directory called `dagger_mean_reward_Ant-v1.png`.

repository: thomas-a-neil/homework

repo_name: thomas-a-neil/homework


text:
# Webhooks

[Webhook attributes](https://app.lokalise.com/api2docs/curl/#object-webhooks)

## Fetch webhooks

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-webhooks-get)

```elixir
{:ok, webhooks} = ElixirLokaliseApi.Webhooks.all(project_id, page: 2, limit: 1)

webhook = hd(webhooks.items)
webhook.webhook_id
```

## Fetch a single webhook

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-webhook-get)

```elixir
{:ok, webhook} = ElixirLokaliseApi.Webhooks.find(project_id, webhook_id)

webhook.webhook_id
```

## Create webhook

[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-webhook-post)

```elixir
data = %{
  url: "http://bodrovis.tech/lokalise",
  events: ["project.imported"]
}

{:ok, webhook} = ElixirLokaliseApi.Webhooks.create(project_id, data)

webhook.url
```

## Update webhook

[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-webhook-put)

```elixir
data = %{
  events: ["project.exported"]
}

{:ok, webhook} = ElixirLokaliseApi.Webhooks.update(project_id, webhook_id, data)

webhook.webhook_id
```

## Delete webhook

[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-webhook-delete)

```elixir
{:ok, resp} = ElixirLokaliseApi.Webhooks.delete(project_id, webhook_id)

resp.webhook_deleted
```

## Regenerate webhook secret

[Doc](https://app.lokalise.com/api2docs/curl/#transition-regenerate-a-webhook-secret-patch)

```elixir
{:ok, resp} = ElixirLokaliseApi.Webhooks.regenerate_secret(project_id, webhook_id)

resp.project_id
resp.secret
```

repository: kianmeng/elixir-lokalise-api

gha_license_id: NOASSERTION

repo_name: kianmeng/elixir-lokalise-api


text:
---
layout: post
title:      "CSS Grid, Just the Basics"
date:       2018-10-19 14:18:09 -0400
permalink:  css_grid_just_the_basics
---

This week I started working through Wes Bos' course on [CSS Grid](https://cssgrid.io/).  I've only worked through the first 3rd of the course so far, and I should be finished by next week.  But I wanted to share some of the tips I've learned so far, as I have a feeling I'll be using these a lot more in the coming weeks, months, years...

Oh, also, before I forget, the course is well laid out, FREE, and seriously helpful!  Wes is a Really clear teacher, and doesn't make assumptions about what you know.  He sidebars and explains other ancillary concepts that will help you gain a deeper understanding of the subject material.  I highly recommend the course!  He even has an [AMA](https://github.com/wesbos) (Ask Me Anything) GitHub page, and answers tons of questions very quickly.

### Set Your CSS Colors as Variables
You can set the palette of your main colors right from the get go, making it easier to style and them your page.

In your main .css file (or really any .css file you wish):

```
:root {
  --purple: #870bed;
  --gold: #f9e316;
	--white: #f7f6f2;
}
```

And then to use in your project, still in your .css file:

```
html {
  color: var(--gold)
}
```

Simple as that.  But will help keep your colors standard, with no fuss over remembering the hex-code to get the same continuous look.

### Download the Firefox Developer Edition when doing CSS Work
In the beginning of the course, Wes recommended downloading the Firefox Developer Edition program.  I've been a Chrome convert for years now, and am accustomed to those devtools, so I had to be convinced, but it **Didn't Take Long**.

As soon as you open the console in the newly downloaded Firefox browser, go to the **Inspector** tab and in the sub-area on the lower right, choose the **Layout** tab, and it's beautiful, well-organized, and lets you dissect the page to really see what space you're working with, both what you've explicitly designed already, and which areas allow for more flexibility.

In the future, I'll be using this browser when doing anything CSS.  I'll probably devote a future post about the devtools on their own.

### Grid, just the basics
This portion is just the basics, just the basics.

To get started, all you would need is some HTML using a parent element of class="container" and however many children elements of class="item" you wish.

The CSS is:

```
    .container {
      display: grid;
      grid-template-columns: 200px 400px;
      grid-template-rows: 150px 100px;
      grid-gap: 30px;
      grid-auto-rows: 150px;
    }

  .item {
    display: grid;
    justify-content: center;
    align-items: center;
    border: 5px solid rgba(0, 0, 0, 0.03);
    font-size: 20px;
    background-color: var(--purple);
  }
```

`display` is just to alert the browser you'll be using **grid** instead of **flex** or some other configuration.

`grid-template-columns` or `rows` sets the length of those respective elements, and how many of each you would like.

`grid-gap` is the space set aside between the various grid boxes.

`grid-auto-rows` will set the height of future rows you might add after the specifically delineated rows you account for in `grid-template-rows`.   For instance, if you have the above `grid-template-rows: 150px 100px` and end up using 10 "item" elements, the first 4 elements will be put into the first two rows (because each row has 2 columns (hence 2 columns * 2 rows = 4 elements total)), which leaves you with 6 extra "items" to place correctly.  By using `grid-auto-rows` the browser now knows to place 2 "item"s per row, and each extra row should have a height of 150px.

I've never found organizing web pages to be this easy, so I'm psyched to continue along and finish this up next week!

And good news, according to [Can I Use](https://caniuse.com/), CSS Grid is supported on almost 88% of browsers, so whatever you're creating will be seen as you intended almost everywhere.

Happy gridding!


text:
## Oligarcher

A Chrome/Firefox extension to replace the word "billionaire" - conventionally
used in US media when talking about someone in the US or Europe with
assets over a billion dollars - with the word "oligarch" conventionally used in
US media when talking about someone from Russia with assets over a billion
dollars.

license: Unlicense

repository: jknowles/oligarcher

repo_name: jknowles/oligarcher


text:
---
title: Greek time
date: 2021-09-08
permalink: /posts/2021/9/greek-time/
tags:
---

My wife's parents were born in Greece, and all her blood relatives, except her
sister, were raised in Greece. I was raised in a white, upper-middle class
American family in New Jersey. As you might expect, I struggled to
understand my wife's family's conception of time.

Here's the way I originally understood "Greek time": Greeks are always late.
The Greeks even make fun of themselves for this. I once heard this joke: Two
Greek bump into one another in the market and make a plan to meet
up that evening. One friend will come to the other's house, which is a
ten minute walk away, sometime around 6. By 6:30, the visitor still hasn't
arrived, so the host calls her friend, who says on the phone, "Yes, yes, I'm
coming now!" At 6:45, the visitor still hasn't arrived, so the host calls
again, and the friend says, again, "Yes, yes, I'm coming now!" By 7, the visitor
isn't there, so the friend calls a third time, and this time the visitor loses
her temper: "How do you expect me to get over to your house when you are
calling me all the time?"

I don't think the Greeks are alone in being perceived this way by people like
me. (To be fair, I didn't really perceive of the Greeks at all for my early
life; I thought of all Greeks as ancient until I had a crush on one.) I've
heard of "Mediterranean time", "island time", etc. etc. Apparently, in Brazil,
you can refer to "[English
time](https://www.dailymail.co.uk/travel/travel_news/article-3708645/Be-half-hour-late-Greece-bang-time-Japan-different-nations-globe-value-punctuality-revealed.html)" if you want to be clear that a
rendezvous should be at the literal clock time that was discussed.

But I wasn't ungenerous in thinking that Greeks were late. I understand that
practices differ in different cultures. I thought that Greek time was a
difference in understanding about what it
meant to be politely "on time". When my wife and I host parties, we always joke about
who will arrive at the party's nominal start time (when we are still finishing cooking),
who will show up a courteous
15 minutes late, an acceptable 30 minutes late, or a lackadaisacal one hour late. I
appreciated that "on time" depends on things like what the social event is. You
should definitely not be an hour late for a sit-down dinner party, but you can
be an hour late for a standing-room-only cocktail party (back in the misty ages
of 2019 when we had such events).

Greek time, I reasoned, was mostly the same as my time, just delayed by
somewhere between 30 and 120 minutes. When my in-laws planned parties, I
noticed that they would tell the Americans one start time, and they would tell
the Greeks a time about an hour earlier, to make sure that everyone showed up
together. (The Greek-Americans were unpredictable.)

Over time, I've come to understand that Greek time is a much more complex,
rich, and rewarding thing than I first understood. I'll try to explain using an analogy that I came up
with but which Greeks might say is hugely incorrect. Regardless, it helped
me understand, so I hope it might help you understand too.

The Greek language has at least three words for "time": *chronos*, *ora*, and
*kairos*. *Chronos*, from which we get English words like "chronological" and
"chronometer", refers to the literal and sequential passage of time. In modern
Greek, *chronos* can also mean "one year". *Ora*, literally "the hour" or "one
hour", also refers to clock time. In Greek, "what time is it?" is literally
"what is the *ora*?"

*Kairos* is sometimes interchangeable with *chronos* and *ora*, but it has a
more metaphorical flavor. It refers to time in the sense of being the opportune
moment.  But if you say it's the right
*kairos* to call, you mean something more. Maybe you're now in the mood to talk
to your friend. Maybe you have a story that you really want to tell them.
(Confusingly, *kairos* also means "weather", but I think this overall fits in
my picture. It's the right *ora* to go to the beach if you're following an
itinerary; it's the right *kairos* to go to the beach if it's sunny.)

I was raised to believe that the "time" you should go to a party or go to
dinner or call a friend has everything to do with the clock. If you agreed on a
clock time, that's the clock time you must be there. But I came to appreciate
that, for the Greeks, there are many factors affecting when it's the right
"time" to do something, and these things only have a rough relation to clock
time. The right time for dinner is surely some time in the evening, but it has
to do with how hungry we're feeling, whether we've come up with a good plan, if
people are feeling antsy or relaxed, whether we've gotten everything else done,
etc. etc.

Since this revelation, clock time feels like an insipid, one-dimensional way to address the
multifaceted concept of when is the right "time" to do things. It's like being
asked to rate every food on a scale of 1 to 10. I hate ham, so that's a 1, and
I love (real horitatiki) Greek salad, so that's a 10. But will I eat some ham
on (Western) Easter? Yes.  No (but just barely). How can a 1 to 10 scale express the fact that
every food has a time and place, and that what I want to eat has to do with
what I've eaten recently, where we're eating, and who I'm eating with? And how
can a single clock time express a family's mutual desire to embark on some
activity?

I don't disagree that Greek time is, roughly speaking, 60 minutes behind
American time, any more than I deny that the mean height of US men is 14 cm
higher than the mean height of US women. But just as mean height ignores all
variability in height, and all the other interesting variations in human forms, and
all the complexity of what we mean by "sex", so also it pains me to say that
Greek time is just American time, but delayed by 60 minutes. And I no longer think
it's that the Greeks are unable to mentally adjust to American time, it's more that
they don't want to give up this richer conception of time and exchange it for
a bleak and unforgiving mathematical datum.


text:
sync-hub
========

Sync-hub helps to keep your files securely in sync across devices, with an easy-to-deploy server in your control.

This software is in **pre-alpha**. Please wait using it until it reached at least beta.

* * *

Sync-hub offers:

* File synchronization across devices using a central server (a hub) in your full control.
* Encryption on client-side, end-to-end, keeping your data safe even if the hub is compromised.
* Relies on proven technology, such as [Unison](https://www.cis.upenn.edu/~bcpierce/unison/) for efficient data syncing and [gocryptfs](https://nuetzlich.net/gocryptfs/) (a successor of [EncFS](https://vgough.github.io/encfs/)) for state-of-the-art encryption.
* Incremental backup of encrypted data, with easy roll-back.

The Hub
-------

Sync-hub can be deployed in a one-click fashion on a fresh Ubuntu machine or VPS from any provider by installing and configuring various components that all focus on doing one job well: supporting sync across devices whilst keeping the data safe and secure.

Security
--------

Many cloud storage providers claim to protect user files with encryption, but do that on their servers. As the providers have the encryption keys, they can (and so can hackers) decrypt data if they want to or are legally forced to.

The only way to ensure your data cannot be peeked at is to use so called [end-to-end encryption](https://en.wikipedia.org/wiki/End-to-end_encryption), so to encrypt BEFORE it leaves your device, with only you being in posession of the encryption keys.

Even the few providers that claim to use end-to-end encryption, or rely on peer-to-peer technology that promises communication between devices directly, require closed-source client software to be installed which could just as well provide backdoor access or simply submit local encryption keys elsewhere.

General security features of Sync-Hub:
* Files are encrypted on the device (end-to-end encryption), exclusively using open source based software;
* Only encrypted data is synced to and from the Hub. If the Hub gets compromised, data are safe;
* Sync-hub also stores files on your device in an encrypted state, by using the [cryptographic file system](https://en.wikipedia.org/wiki/Filesystem-level_encryption) [gocryptfs](https://nuetzlich.net/gocryptfs/), which encrypts files individually using chunked AES-GCM ([Galois Counter Mode](https://en.wikipedia.org/wiki/Galois/Counter_Mode)) and encrypts filenames with AES-EME ([ECB-Mix-ECB](https://eprint.iacr.org/2003/147.pdf)). If someone gains access to the content of your home directory without being able to mount the cryptographic file system, data are safe;
* Syncing happens over [SSH](https://en.wikipedia.org/wiki/Secure_Shell), which provides a secure channel over an unsecured network to transfer data, using [Unison](https://www.cis.upenn.edu/~bcpierce/unison/).

Security settings of the Hub:
* SSH Key-Based Authentication (instead of password-based);
* Automatic (unattended) security updates;
* Generic firewall ([UFW](https://help.ubuntu.com/community/UFW);
* Protection against agressive login attempts ([Fail2Ban](https://github.com/fail2ban/fail2ban).

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

For experts, start with a completely fresh Debian Stable or Ubuntu LTS 64-bit machine. On the machine...

Clone this repository:

	$ git clone https://github.com/jerogee/sync-hub
	$ cd sync-hub

_Optional:_ Download my PGP key and then verify that the sources were signed
by me:

	INSTRUCTIONS HERE

Begin the installation.

	$ sudo setup/start.sh

repository: jerogee/sync-hub

repo_name: jerogee/sync-hub


text:
---
hidden: true
---

### Troubleshooting
If the status is in error state you can describe the clusterpair to get more information by running:

```text
kubectl describe clusterpair remotecluster
```

{{<info>}}
You might need to perform additional steps for [GKE](/portworx-install-with-kubernetes/cloud/gcp/gke) and [EKS](/portworx-install-with-kubernetes/cloud/aws/aws-eks/).
{{</info>}}

repository: DSridharC/pxdocs

repo_name: DSridharC/pxdocs


text:
# OrchestraManager

An app that allows users and administrators to keep track of orchestra personnel.

## User stories
* As a user, I'd like to visit a page to see a list of all orchestra members.
* As a user, I'd like to click an orchestra member's entry in the list to visit their profile page, which should include more details about them.
* As a user, I'd like the option to visit an "About" page that explains what the orchestra is, and what they do.
* As a user, I'd like all data persisted in a database, so it's always there when I need it.
* As an administrator, I want to add new members to the orchestra. (User authentication is not required).
* As an administrator, I want to edit orchestra member profiles, in case I make a mistake, or need to update their details.
* As an administrator, need the option to delete an orchestra member, in case they leave the orchestra.

## Instructions for setup

* If you don't have a free account on Firebase, where the database for this project will need to reside, please do so at [Firebase's website](https://firebase.google.com/).
* Then in the dashboard area of the site, click the *Create a New Project* option, provide `orchestra-manager` as the name, and select your country/region from the dropdown menu.
* You'll then see an *Overview* area; select *Add Firebase to your web app*.
* Firebase should respond with a pop-up window such as `apiKey`, `authDomain`, etc. Copy and paste all that in a temporary area for use in a moment.
* Still in your Firebase console, close the popup window and click *Database* on the left menu, find under "Realtime Database" the *Rules* tab and click on that.
* Change the rules to look like this:
```
{
  "rules": {
    ".read": "true",
    ".write": "true"
  }
}
```
...and *Publish*. Then hit the *Data* tab to return to your empty database.
* Clone the repository using the `git clone` command.
* Navigate to the top of your local cloned directory and run:
1. $ npm install
2. $ bower install
3. $ bower install bootstrap --save`
4. $ npm install<EMAIL_ADDRESS>firebase --save
* Create a `src/app/api-keys.ts` file and copy the following into it:
```
export var masterFirebaseConfig = {
    apiKey: "xxxx",
    authDomain: "xxxx.firebaseapp.com",
    databaseURL: "https://xxxx.firebaseio.com",
    storageBucket: "xxxx.appspot.com",
    messagingSenderId: "xxxx"
  };
```
You'll want to add the strings that were provided by Firebase that you saved from the popup window in Firebase. You only need the parameters outlined in the `api-keys.ts` file.

* Visit your Firebase Console again, click on the *Database* option, select the three vertical dots on the right-hand side of the grey bar with your database URL on it.

* Select *Import JSON* from this menu, and upload the `sample-members.json` file at the top level of the project directory.
* The database should now have records! Run `ng serve` at the command line and visit `http://localhost:4200/` in your web browser!

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Technologies Used
* Angular 2
* Typescript
* Javascript
* HTML
### License

Copyright 2017 Michael Dunlap

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

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

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

repository: sagaquisces/orchestra-manager

repo_name: sagaquisces/orchestra-manager


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

### Description

In Airspan AirSpot 5410 version <IP_ADDRESS>-4 and under there exists a stored XSS vulnerability. As the binary file /home/www/cgi-bin/login.cgi does not check if the user is authenticated, a malicious actor can craft a specific request on the login.cgi endpoint that contains a base32 encoded XSS payload that will be accepted and stored. A successful attack will results in the injection of malicious scripts into the user settings page.

### POC

#### Reference
- http://packetstormsecurity.com/files/168114/FLIX-AX8-1.46.16-Remote-Command-Execution.html

#### Github
- https://github.com/ARPSyndicate/cvemon


text:
# Changelog

## 0.0.5

### Feature {#feat_0_0_5}

* feat: update error return code table
* feat: add configuration compatibility
* feat: add sqlalchemy extension with liqueur
* feat: upgrade capital api to 2.13.23
* feat: applog module

### Bug fixes {#fix_0_0_5}

* fix: generate comtypes cache when api install and move to util.py
* fix: package require issue
* fix: lacks argments in auto install class

## 0.0.4

### Bug fixes {#fix_0_0_4}

* fix: lacks argments in auto install class

## 0.0.3

### Feature {#feat_0_0_3}

* feat: add packages helper class for automatic installation
* feat: subscription function

### Bug fixes {#fix_0_0_3}

* fix: make sure the del operator work well
* fix: enhance the subscription manager class

## 0.0.2

### Feature {#feat_0_0_2}

* feat: Capital API library automatic installation
* feat: add stock list subscription feature
* feat: add public message function
* feat: remove unuseless enumeration
* feat: make delegation excute function be private
* feat: add terminate function

### Bug fixes {#fix_0_0_2}

* fix #2: make sure hook action work after connected
* fix: correct the subscription configuration load
* fix: correct the enumeration value

branch_name: refs/heads/dev


text:
---
hrs_structure:
  division: '1'
  volume: '2'
  title: '6'
  chapter: '54'
  section: 54-65
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0054-0065
    parent: HRS0054
    name: 54-65 Agreements for joint use of utilities
weight: 15200
title: Agreements for joint use of utilities
full_title: 54-65 Agreements for joint use of utilities
---
**§54-65 Agreements for joint use of utilities.** The board of water supply may enter into such arrangements and agreements as it deems proper for the joint use with any other person, firm, or corporation owning the same or having jurisdiction of the same, of poles, conduits, towers, stations, aqueducts, and reservoirs for the operation of any of the properties under its jurisdiction. [L 1949, c 86, §15; RL 1955, §146-114; [HRS §54-65](/title-6/chapter-54/section-54-65/)]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
[Home](./index.md) > [@firebase/storage](./storage.md) > [UploadTask](./storage.uploadtask.md)

## UploadTask interface

Represents the process of uploading an object. Allows you to monitor and manage the upload.

Signature:

```typescript
export interface UploadTask
```

## Properties

|  Property | Type | Description |
|  --- | --- | --- |
|  [snapshot](./storage.uploadtask.snapshot.md) | [UploadTaskSnapshot](./storage.uploadtasksnapshot.md) | A snapshot of the current task state. |

## Methods

|  Method | Description |
|  --- | --- |
|  [cancel()](./storage.uploadtask.cancel.md) | Cancels a running task. Has no effect on a complete or failed task. |
|  [catch(onRejected)](./storage.uploadtask.catch.md) | Equivalent to calling then(null, onRejected). |
|  [on(event, nextOrObserver, error, complete)](./storage.uploadtask.on.md) | Listens for events on this task.Events have three callback functions (referred to as next, error, and complete).If only the event is passed, a function that can be used to register the callbacks is returned. Otherwise, the callbacks are passed after the event.Callbacks can be passed either as three separate arguments or as the next, error, and complete properties of an object. Any of the three callbacks is optional, as long as at least one is specified. In addition, when you add your callbacks, you get a function back. You can call this function to unregister the associated callbacks. |
|  [pause()](./storage.uploadtask.pause.md) | Pauses a currently running task. Has no effect on a paused or failed task. |
|  [resume()](./storage.uploadtask.resume.md) | Resumes a paused task. Has no effect on a currently running or failed task. |
|  [then(onFulfilled, onRejected)](./storage.uploadtask.then.md) | This object behaves like a Promise, and resolves with its snapshot data when the upload completes. |

repository: ChaseKnowlden/firebase-js-sdk

repo_name: ChaseKnowlden/firebase-js-sdk


text:
# Unity interface for GameControllerizer

Fastest way to build an original game controller for Unity !

This is the interface description for Unity InputSystem. With a [GameControllerizer](https://github.com/GameControllerizer/GettingStarted) and this code, you can connect microcontroller (ex. micro:bit, RasPi) or sensors to Unity without coding such as uart, http, bluetooth...

---

By the default, [GameControllerizer](https://github.com/GameControllerizer/GettingStarted) is recognized as a simple Joystick.
With this codes, it is recognized as a Gamepad (1-dpad, 2 -sticks and 12-buttons).

![image0](./images/image0.png)

![image1](./images/image1.png)

![image2](./images/image2.png)

repository: GameControllerizer/GcUnityIF

repo_name: GameControllerizer/GcUnityIF


text:
---
title: "Vision transformer assisting rheumatologists in screening for capillaroscopy changes in systemic sclerosis: an artificial intelligence model "
date: 2022-12-12
publishDate: 2022-11-09T00:00:00.000000Z
authors: [ Alexandru Garaiman, farhadzad,  Carina Mihai, nicoperez, Nikitas Gkikopoulos, Mike Oliver Becker, Oliver Distler, michaelkrauthammer, Britta Maurer]
publication_types: ["2"]
abstract: "
**Objectives**

The first objective of this study was to implement and assess the performance and reliability of a vision transformer (ViT)-based deep-learning model, an ‘off-the-shelf’ artificial intelligence solution, for identifying distinct signs of microangiopathy in nailfold capilloroscopy (NFC) images of patients with SSc. The second objective was to compare the ViT’s analysis performance with that of practising rheumatologists.

**Methods**
NFC images of patients prospectively enrolled in our European Scleroderma Trials and Research group (EUSTAR) and Very Early Diagnosis of Systemic Sclerosis (VEDOSS) local registries were used. The primary outcome investigated was the ViT’s classification performance for identifying disease-associated changes (enlarged capillaries, giant capillaries, capillary loss, microhaemorrhages) and the presence of the scleroderma pattern in these images using a cross-fold validation setting. The secondary outcome involved a comparison of the ViT’s performance vs that of rheumatologists on a reliability set, consisting of a subset of 464 NFC images with majority vote–derived ground-truth labels.

**Results**
We analysed 17 126 NFC images derived from 234 EUSTAR and 55 VEDOSS patients. The ViT had good performance in identifying the various microangiopathic changes in capillaries by NFC [area under the curve (AUC) from 81.8% to 84.5%]. In the reliability set, the rheumatologists reached a higher average accuracy, as well as a better trade-off between sensitivity and specificity compared with the ViT. However, the annotators’ performance was variable, and one out of four rheumatologists showed equal or lower classification measures compared with the ViT.

**Conclusions**
The ViT is a modern, well-performing and readily available tool for assessing patterns of microangiopathy on NFC images, and it may assist rheumatologists in generating consistent and high-quality NFC reports; however, the final diagnosis of a scleroderma pattern in any individual case needs the judgement of an experienced observer."

featured: true

summary: The first objective of this study was to implement and assess the performance and reliability of a vision transformer (ViT)-based deep-learning model, an ‘off-the-shelf’ artificial intelligence solution, for identifying distinct signs of microangiopathy in nailfold capilloroscopy (NFC) images of patients with SSc. The second objective was to compare the ViT’s analysis performance with that of practising rheumatologists.

publication: "*British Society for Rheumatology*"
url_pdf: "https://academic.oup.com/rheumatology/advance-article/doi/10.1093/rheumatology/keac541/6798619?login=false"
doi: "10.1093/rheumatology/keac541"
---

repository: uzh-dqbm-cmi/lab-website

gha_language: TeX

repo_name: uzh-dqbm-cmi/lab-website


text:
---
id: memory
title: Memory Use
---

#### File based factors

Octopus has been designed to minimise disk accesses by buffering frequently accessed resources in main memory. In other words, rather than making lots of short disk reads and using little main memory, octopus prefers to making few large disk reads, and use more main memory. This is beneficial for a number of reasons, especially in a cluster setting. There are essentially two resources which octopus actively buffers: read data and reference sequence. Both these can be controlled by the user:

* `--max-reference-cache-footprint` (`-X`) controls the reference buffer size.
* `--target-read-buffer-footprint` (`-B`) controls the read buffer size. This is not a hard limit, but for most normal samples octopus will respect this.

Both options are specified in all the standard memory units (e.g. `500Mb`, `2G`, `4GB`, etc). Note both buffer sizes are shared between threads, so `--target-read-buffer-footprint=2Gb` using two threads would mean 1GB per thread. This is important is it determines the size of thread 'jobs', and can therefore have a significant impact on throughput and overall runtime.

#### Other factors

The other factors to consider when optimising memory usage are:

* Multithreading: More threads means more memory overhead. A good starting point is to 'budget' an extra 100MB per additional thread, however, this will also depend on your data and the factors below, so some trial and error may be required.
* Calling model: Simpler models use less memory.
* Model setup: The parameterisation of the calling model can have a large influence on short term memory usage. For example setting `--max-joint-genotypes` (in the trio or population model) to a very large memory may mean requests for large memory blocks.

repository: luntergroup/octopus

branch_name: refs/heads/develop

repo_name: luntergroup/octopus


text:
# CommentGroup Component

A re-usable custom component wrapper around [semantic-ui-react Comment.Group](https://react.semantic-ui.com/views/comment)

# Sequence Diagram

```mermaid
sequenceDiagram
participant App
participant CommentGroup
participant SemanticUI
    App ->> CommentGroup: Import CommentGroup;
    CommentGroup ->> SemanticUI : Import Properties
    SemanticUI ->> CommentGroup : Export Properties
    CommentGroup ->> App : Export CommentGroup
```


text:
---
title: "Assembly Preparation"
slug: "assembly-preparation"
description: "Shorten the time it takes to assemble your FarmBot by following these preliminary steps"
---

* toc
{:toc}

{%
include callout.html
type="info"
title="15 minutes"
content="This is the estimated time it will take for assembly preparation."
%}

# Organize your parts

When you first open up your FarmBot hardware package, pull out all of the component bags and boxes so that you develop a full idea of what's included, and so that you can place them on a table in locations that make sense to you. For the most part, components are already organized inside the boxes, but it is still good to take a look over everything.

{%
include callout.html
type="warning"
title="Handle with care"
content="The aluminum extrusions may have sharp corners and edges."
%}

{%
include callout.html
type="success"
title="We'll make it right"
content="If anything is missing or damaged from your box of components, let us know right away at [support@farm.bot](mailto:support@farm.bot). We'll ship out replacement parts as soon as we can."
%}

# Plan accordingly

FarmBot Genesis is a complex machine with over 1,000 components in total. Be prepared to spend the following amount of time assembling your FarmBot. Remember, these are just assembly time estimations. Depending on your skill level you may need more or less time. Consider assembling FarmBot with a friend to significantly speed things up and help reduce mistakes.

|Subassembly                   |Estimate Time (Genesis)       |Genesis XL                    |Genesis MAX                   |
|------------------------------|------------------------------|------------------------------|------------------------------|
|Supporting Infrastructure     |8 hours
(raised bed)       |12 hours
(raised bed)      |8 hours
(pier blocks)
|Tracks                        |2 hours                       |4 hours                       |12 hours
|Gantry                        |2 hours                       |2 hours                       |2 hours
|Cross-Slide                   |1 hour                        |1 hour                        |1 hour
|Z-Axis                        |1 hour                        |1 hour                        |1 hour
|Cables and Tubing             |2 hours                       |3 hours                       |3 hours
|UTM                           |30 minutes                    |30 minutes                    |30 minutes
|Electronics Box               |30 minutes                    |30 minutes                    |30 minutes
|Tools                         |1 hour                        |1 hour                        |1 hour
|**TOTAL**                     |**18 hours**                  |**25 hours**                  |**29 hours**

# What's next?

 * [Supporting Infrastructure](../supporting-infrastructure.md)

repository: onumag/farmbot-genesis

repo_name: onumag/farmbot-genesis


text:
# Raspberry 4  provisioning ap wifi using hostapd and dnsmasq

## 1. Introduction

* When power on RPI, if  their is no wifi connection, the wifi AP will  automatically run.( these ssid and password can be modified in `./config_ap/hostapd.conf`)
    * SSID : RPIWifiConfig
    * password :<PHONE_NUMBER>
* When connecting to AP the setup page  will automatically  show off (only test on iphone  and Ipad and some android phone). By using  this page  you can configure to  connect  to your  own AP.

## 2. Requisition software

* Setup wifi country code

    ```
    sudo raspi-config
    #------>4. Location Options
    #-------------->I4 Change Wi-fi Country
    #---------------------> US United States
    ```

* Libs and software packages

    ```sh
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install -y python curl git  build-essential tmux  nano hostapd dnsmasq

    # don't  let it done  auto
    # stop  current running instance
    sudo systemctl stop dnsmasq.service
    # disable restart service
    sudo systemctl disable dnsmasq.service

    sudo systemctl stop hostapd
    sudo systemctl unmask hostapd
    sudo systemctl disable hostapd
    ```

* NodeJS v12:

    ```sh
    # install nvm  and nodejs
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

    source ~/.bashrc

    nvm install v12
    # The  sudo only recognize the PATH  in secure_path in file in /etc/sudoers
    # To see more details : run cmd :
    # sudo visudo
    # alias node and npm to  /usr/bin sothat thay can be found  and run in sudo mode
    sudo ln -s "$(which node)" /usr/bin/node
    sudo ln -s "$(which node)" /usr/lib/node
    sudo ln -s "$(which npm)"  /usr/bin/npm
    ```

## 3. Install WIFI AP and captiveportal

```sh
cd SoftAP
chmod +x  setup.sh
sudo ./setup.sh
```

After  running setup  you can have your own AP in next reboot. Or if  you want  to  bring it up now to test:
```sh
sudo /usr/bin/autohotspot.sh
```
or
```
cd bin
sudo ./check_connect_then_start_soft_ap
```

The more details  about setup, this will bring up  3 service:
* dnsmasg:
    * DHCP server for  wifi AP o wlan0
    * Fake DNS server  which  ressolve all the DNS queries  from connected device of  this AP  to <IP_ADDRESS>, where  the  nodejs web captiveportal listen on port  <IP_ADDRESS>:80
* hostapd :
    * Once shoot start when powerup : check if no wifi connection on wlan0 then start AP ( wifi Access Point) depend on  hostapd  application. If having connection, don't start AP mode.
* captiveportal.service :
    * This is run nodejs express  application as wificonfiguration  to let user  can  config  the  SSID and  password of wifi, they want  to connect to.
    * This bind on all interface of  RPI (  wlan0 and eth0)  at port 80
    * Redirect all unhandle uri to root url "/"
    * Only support http (  https may support in future)

Boot process:
* `./bin/check_connect_then_start_soft_ap.sh` :  Check wifi in  90 sec, if no wifi connection  then run  `./bin/start_ap_fork.sh`
    *  Start hostapd  app with  config in `./config_ap/hostapd.conf`
    *  Wait 60 sec then start fake dns serser  and dhcpserver on  `wlan0`by running `dnsmasq`  with config in `./config_ap/dnsmasq.conf`
* Start flashpage nodejs webserver with sudo to listen  all and create captive Portal the  webserver src  in  `CaptivePortal`

## 4. Reference link
* [https://www.raspberryconnect.com/projects/65-raspberrypi-hotspot-accesspoints/158-raspberry-pi-auto-wifi-hotspot-switch-direct-connection](https://www.raspberryconnect.com/projects/65-raspberrypi-hotspot-accesspoints/158-raspberry-pi-auto-wifi-hotspot-switch-direct-connection)
* [https://www.shellvoide.com/wifi/how-to-setup-captive-portal-login-with-rogue-ap-nginx/](https://www.shellvoide.com/wifi/how-to-setup-captive-portal-login-with-rogue-ap-nginx/)
* [https://socifi-doc.atlassian.net/wiki/spaces/SC/pages/94371841/DNS+Fix+to+keep+Android+Splash+Page+and+the+Captive+Portal+Notification+active](https://socifi-doc.atlassian.net/wiki/spaces/SC/pages/94371841/DNS+Fix+to+keep+Android+Splash+Page+and+the+Captive+Portal+Notification+active)

gha_language: Shell