text:
# Frequently Asked Questions

## When will Arwes be ready for production?

Arwes is currently in [alpha release](https://stackoverflow.com/questions/40067469).
It means there is ongoing development with breaking changes. APIs and guidelines
can change as they get completed.

The project will be ready for production when it has a stable and tested API.

Check out [Project Task Boards](https://github.com/arwes/arwes/projects).

## What is the development status?

You can check the [next.arwes.dev](https://next.arwes.dev) website and its playground
to check out functionalities and components sandboxes.

## Can I use it in React Native and other environments?

Arwes version 1.x is intended to support only web environments with latest
technologies.

The project may offer support for other environments in future versions.

You can use tools to embed the web apps into other environments such as
mobile with [Apache Cordova](https://cordova.apache.org) or [Electron](https://electronjs.org)
in desktop, or simply make it a [PWA](https://developers.google.com/web/progressive-web-apps).

## What about Arwes for AR/VR?

Since we can build AR/VR apps for the web now, Arwes can be used for such projects.
But for Arwes version 1.0, there is no plan to build/test specific tools for
that.

Once the project is stable, we can start defining how Arwes can be implemented
for AR/VR.

## What browsers are supported?

Latest version of Chromium, Firefox, and Safari, for Android, iOS, and desktop.

## Does Arwes only work with specific UI libraries such as [React](https://reactjs.org)?

There are functional packages which are agnostic to the UI library used. These have
more low level APIs which are intended to be used with the implementation packages
which are UI library specific.

For example, `@arwes/animator` is the main animator functionalities without external
dependencies which could be used with any UI library, and `@arwes/react-animator`
is its implementation in React.

## What about SSR/SSG?

Arwes is built in tools that can be easily setup for server-side rendering (SSR)
or used as static generated markup/JavaScript sites as the [JAMstack](https://jamstack.org),
so definitely you can use Arwes with frameworks such as [Next](https://nextjs.org),
[Gatsby](http://gatsbyjs.org), or [Remix](https://remix.run).

But Arwes requires a few more setup steps to make it work for such requirements
due to its design, sound, and animation systems. It is recommended to use simple
SPA (single page apps) since they are simpler to setup.

## Can I build SEO-friendly sites with Arwes?

Arwes is a framework with rich sound and animations effects so there are a few
extra considerations to take for SEO sites/apps. But definitely, the sites built
with Arwes can be SEO-friendly.

## Why does Arwes use CSSinJS for some UI components?

Since UI elements are more dynamic and rich, a more complex theming is required.
Building static CSS for such components can become more arduous, so a CSSinJS styling
solution can simplify this aspect, though it is not required.

See [A Unified Styling Language](https://medium.com/seek-blog/a-unified-styling-language-d0c208de2660).

Some UI components require to setup theming directly in JavaScript due to their APIs,
so there is no way to use simple CSS for styling.

## What about using declarative HTML animation tools?

The main animation functionalities reside in the `@arwes/animator` package.
It is agnostic from the HTML animation tool. But the recommended tool
to be used with the animations implementations is [motion.dev](https://motion.dev).

There are no specific APIs for declarative tools like [react-spring](https://www.react-spring.io)
or [Framer Motion](https://www.framer.com/motion).

Since the animation API is still in early testing, more production experience
will be needed to properly create stable and versatile abstractions for creating
and composing component animations with imperative and declarative methodologies.

repository: arwes/arwes

branch_name: refs/heads/next

gha_language: TypeScript

repo_name: arwes/arwes


text:
REX: MARVEL APP
================

Project using ReactJS ( with React Router and RefluxJS ), SASS, Gulp, and Browserify

---

### Getting up and running

1. Run `npm install` from the root directory
2. Run `gulp dev`
3. To prepare assets for production, run the `gulp prod`

---

Demo: http://designbuildplay.io/projects/_marvel-app/build/

license: MIT

repository: josh-deprogram/MARVEL-ReactJS-Reflux

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: josh-deprogram/MARVEL-ReactJS-Reflux


text:
# 0x0C-web_stack_debugging_1

## Description

This Repo has some of my (David John Coleman II) projects for a software development program.
The focus of these projects have been learning Bash and other sysadmin/ devops
technologies.

## Environment

* __OS:__ Ubuntu 14.04 LTS
* __Language:__ Bash
* __Style:__ Shellcheck v. 0.3.3

## Assignment

Using your debugging skills, find out what's keeping your Ubuntu container's
Nginx installation from listening on port 80. Feel free to install whatever
tool you need, start and destroy as many containers as you need to debug the
issue. Then, write a Bash script with the minimum number of commands to
automate your fix.

__Requirements:__

* Nginx must be running, and listening on port 80 of all the server's active
  IPv4 IPs
* Write a Bash script that configures a server to the above requirements

## Author

David John Coleman II, http://www.davidjohncoleman.com/

## License

MIT License


text:
---
layout: blog
title: "Skin Screening Program 5/10"
---

The Rutherford Health Department will be conducting a **Free Skin Cancer Screening Program for Rutherford residents on Wednesday, May 10, 2017, between the hours of 9:00 AM – 11:00 AM at the Health Center, 184 Park Avenue, Rutherford, NJ.**

Preethi Ramaswamy, MD a board certified dermatologist who specializes in the diagnosis and treatment of skin cancers will be performing the screening.

One in five Americans will be diagnosed with skin cancer in the course of a lifetime. Skin cancer is curable if diagnosed early. Melanoma, an aggressive form of skin cancer is rising among young men and women between the ages of 20 and 39. If you have moles that are irregular and are changing in shape, size or color, please participate in the skin cancer screening event.

Appointments are required for the screening.

Those interested in attending this program and/or obtaining more information can contact the Public Health Nurses at<PHONE_NUMBER> between 8:30 and 4:00 PM Monday through Friday.

branch_name: refs/heads/beta

gha_language: HTML

gha_license_id: MIT


text:
# MvnPluginConfig - Opens list of maven plugins in browser's window.

## Installation

Install gem from command line:

```bash
gem install mvn_plugin_config
```

or add this line to to your Gemfile:

```ruby
gem "mvn_plugin_config"
```

and then execute:

```bash
bundle
```

## Usage

Use it:

```bash
mvn-plugin-config
```

It will start sinatra application on port 5678 and load start page in the browser.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
# AjsDoc
#### TypeScript documentation browser

Copyright ©2016-2017 Atom Software Studios<br>
Released under the MIT License

---

> AjsDoc is currently developed together with other Ajs related projects. Latest sources are always available at https://github.com/atomsoftwarestudios/AjsDev

---

Currently, there are two examples running publicly:

http://ajsfw.azurewebsites.net - logging off

http://ajsdoc.azurewebsites.net - logging on (console will popup 15s after refresh, its quiet expensive but logging to memory only)

both versions are not optimized from the size perspective (no uglify or other tools used yet) and are cappable of running offline in browser or as a web app for mobiles (icon on homescreens).

---

### Table of Contents

- [Introduction](#introduction)
- [Features](#features)
- [Visual Studio prerequisites & setup](#visual-studio-prerequisites--setup)
- [Build](#build)
- [Usage](#usage)
- [Known bugs](#known-bugs)
- [License](#license)
- [Contribution](#contribution)

---

### Introduction

AjsDoc is an example application using the Ajs Framework. Currently, the Ajs Visual Studio Project is included in the AjsDoc Visual Studio Solution and the last recent version of the Ajs Framework is sotred in this repository as both projects are currently developed and debugged together.

The JSON documentation data for AjsDoc are required to be generated with the TypeDoc (https://github.com/TypeStrong/typedoc).

---

### Features

- Guide & Examples
      - HTML based reference guide

- Reference guide
      - Generated from TypeScript code using TypeDoc
      - HTML Code documentation supported

- HTML Code (both, static & code documentation)
   - Supported tags (this will be highly probably changed to standard JSDoc):
      - #example url
         - Includes the example to the HTML code (make sure the code is HTML escaped so < > & and others  are properly replaced)
         - Must be on the separate line
      - #chart url
         - Includes svg chart to the HTML code
	 - Must be on the separate line

- Ajs Feature Examples (directly in the code)
   - Complete offline application support
   - Boot process and configuration
   - Resource loading including the InitialProgressBar
   - Application resource loading and management
   - Templating
   - Visual State management
   - Visual State transition
   - View Component state management
   - View Component state filtering
   - Session state management
   - Models for the static JSON data
   - Debugging tools

- Tools
   - tocgen.ps1 (powershell) -> generator of the toc.json file from the folder structure of the static html documents

---

### Visual Studio prerequisites & setup

- The Visual Studio should be in version 2015 (Enterprise, Professional, Community) - curently tested with Enterprise version only.

- The TypeScript 2.1.5 extension must be installed (https://www.typescriptlang.org/#download-links)

- GitHub extension for Visual Studio is highly recommended (https://visualstudio.github.com/)

---

### Build

The project is the Visual Studio solution 2015 and should not be a problem to clone:

```
https://github.com/atomsoftwarestudios/AjsDoc.git
```

compile it and run/debug in both, debug and release vesrions under the local IIS Express.

Please, report all issues with the compilation and running here on GitHub.

---

### Usage

```
Please note the implementation of template(s) for all types is not currently complete. Feel free to contibute.
```

The JSON data grabbed from the TypeDoc must be provided. The JSDoc code documentation can contain HTML tags to format the output as desired.

Following statements already are or will available (as TypeDoc filters the original JSoc):

```
#example <root_relative_path>            Inserts the example file to the target document
#chart <root_relative_path>              Inserts the svg chart to the target document
```

TBD

---

### Known bugs

Documentation for the latest version of the Ajs and AjsDoc can't be generated using the TypeDoc as it does not support some required features
(see [issue #399](https://github.com/TypeStrong/typedoc/issues/399) for details)

---

### License

For details see the [License]{./LICENSE} file

---

### Contribution

Contibution is more than welcome.

repository: atomsoftwarestudios/AjsDoc

repo_name: atomsoftwarestudios/AjsDoc


text:
# Cantaloupe

A USB Micro B to dual CAN bus board that utilizes an Atmel ATSAME70N19 in a TFBGA-100 package. My first BGA project.

## Board Stackup

Thickness | Layer
--------- | -----
1.4mil (1oz) | Top Copper
6.7mil | Prepreg
0.7mil (0.5oz) | Layer 2 Copper
47mil | Core
0.7mil (0.5oz) | Layer 3 Copper
6.7mil | Prepreg
1.4mil (1oz) | Bottom Copper

Full specs can be found at http://docs.oshpark.com/services/four-layer/

## OSHPark Renders

![Board Top](https://cloud.githubusercontent.com/assets/4998806/26280302/36b75b54-3d9b-11e7-91a0-2d803002b715.png)
![Board Bottom](https://cloud.githubusercontent.com/assets/4998806/26280303/36b7c4f4-3d9b-11e7-85e9-f542c11cf251.png)

## Licensing

This project uses part of the Atmel Software Framework (ASF) and part of the ARM Cortex-M7 Core CMSIS library. Licensing information can be found in the `ASF` and `CMSIS` folders, respectively.

All other files are licensed under the MIT license unless otherwise specified.

repository: dvdfreitag/Cantaloupe

repo_name: dvdfreitag/Cantaloupe


text:
# Sprint Ceremony Minutes

Date: 03-04-21

Members present:

* Nathan Tate
* Ryan Goode
* Ryan Scott

## Demo

  This sprint, we completed:

* Added killable enemies into the level, of varying sizes and behavior
* Added health pickups for the player to receive in order to restore health
* Added early-stage level transitions for future use to progress through different levels
* Improved the walking animations for the player character sprite
* Added Canvas background to the level that follows player movement for better visuals
* Added new level background art that matches the color palette of the rest of the level<br>
  Here are screenshots of what we did:

  ![Thing](images/sprint2Screenshot.png)

### Good

* Added more gameplay elements to the first and second levels
* Create a procedure to edit Godot scene files, preventing future merge conflicts
* Restructured game files to better organize scripts, assets, and scenes
* Reduced the number of merge conflicts (sprint-wide)

### Bad

* Merge conflict at the beginning of the sprint hindered progress slightly
* Overestimated amount of work that team could accomplish in one sprint
* Time Management skills of the team still need improvement

### Actionable Commitments

* As a team, we will...
* As a team, we will create more issues in the project board on GitHub in more to better track progress of tasks, as well as hold every team member accountable to their objectives.
* As a team, we will prioritze the assignment portion of the sprint work.
*As a team, we will stay more informed on each other's objectives while working on our own, in an effort to reduce any merge conflicts.

## Planning

  Points | Story
  -------|--------
  9| As a user, I want a title screen that looks good and can assist me in accessing the different functions of the game.
  6| As a user, I want to be able to pause the game if I need to, in order to step away or stop playing for a short amount of time.
  4| As a user, I want game music that is enjoyable and further immerses me into the game's mood.
  6| As an administrator, I want a seamless consolidation of individual game components to ensure timely completion and reduce opportunities for error.
  6| As a user, I want an in-game HUD that gives me relevant in-game information.

repository: IUS-CS/project-coffee-capo-games

branch_name: refs/heads/main

gha_language: GDScript

repo_name: IUS-CS/project-coffee-capo-games


text:
---
published: true
title: Tomtom
tags: hardware gps
---
> The OpenTom project has documented the TomTom hardware and software to allow custom software builds to run - [opentom ](https://github.com/george-hopkins/opentom) / [2021](https://github.com/buoncri/Working-2021-OpenTom)

- [run Linux on your TomTom GPS](https://raulbalanza.me/2020/06/24/opentom-run-linux-on-your-tomtom-gps/)

Model: Tomtom 4EV52 Z1230.

- [openstreetmap](https://wiki.openstreetmap.org/wiki/TomTom)
- [TomTom Hardware](https://zzzontomtom.wordpress.com/tomtom-hardware/) - ARM920T CPU + xxx
	- [Tomtom XL](https://web.archive.org/web/20110916021631/http://opentom.org/TomTom_XL)
    - [Getting to the console of your TomTom](https://zzzontomtom.wordpress.com/getting-to-the-console-of-your-tomtom/) - the easiest way is to attach via Bluetooth.
    	- Once attached, hit Enter several times. And some more several times. And… after all it should show you a login prompt. Login as root with no password (huh, anyone to hack into my TomTom?).


text:
# Pixel 4 can ‘Export frames’ from recorded video with new Google Photos editor UI

Published at: **2019-11-02T17:50:11+00:00**

Author: **Abner Li**

Original: [9to5Google](https://9to5google.com/2019/11/02/pixel-4-video-export-frames/)

The Pixel 4 and Pixel 4 XL’s video capabilities have mostly been criticized for not supporting 4K 60FPS capture. However, the 2019 Made by Google phones do have a new feature that lets you “Export frames” from any recorded video.
You can easily grab stills from any video shot on the Pixel 4. In Google Photos, there’s a new “Edit” UI where the timeline is now at the very bottom of this screen. The “Stabilize” and “Rotate” actions are now icons, while there’s a new “Export frame” button dead center.
Tapping after selecting a point will save that still to your gallery in 1080×1920 or 2160×3840 resolution. The quality is not as good as an actual image, but this export frames shortcut for Pixel 4 video is convenient nevertheless. This feature would be quite useful on all other devices as part of Google Photos.
If you capture video from the main Camera UI through the new ability to press and hold on the shutter, Pixel 4 will save up to 10 shots in HDR quality. There’s a dedicated “Export HDR shots” button in the new Google Photos UI. When recording through this mode, swiping up to a video’s “Info” sheet has a “Shots in this video” timeline. This capability is reminiscent of Top Shot for Motion Photos introduced on the Pixel 3 last year.
The Pixel 4’s export frames feature for video with the new UI is available on Google Photos 4.28 and later.

        More about Pixel 4:

        Thanks Philip!

FTC: We use income earning auto affiliate links. More.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# abandonware downloader

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

Small, personal project to play with [puppeteer](https://github.com/GoogleChrome/puppeteer/).

It crawls webs with abandonware to download them.

* [myabandonware.com](https://www.myabandonware.com/)

## Motivation

I love abandonware. Everyone who's been born in the in the `90s or before should!

The thing is, now, there are games providers ([Steam](https://store.steampowered.com), [GoG](https://www.gog.com/), etc.) but, what happens if _someday_ this sites stop working? Also, this sites don't provide **all** kind of old games (there are some honorable mentions, but come on, you know it's true).

See also: [DISCLAIMER](./DISCLAIMER.md).

repository: danikaze/abandonware-downloader

repo_name: danikaze/abandonware-downloader


text:
Water Recycling Data Test
- Data source (kaggle)
    - https://www.kaggle.com/ekleenkaur17/iot-sensing-data-for-recycled-water

Objective
The data set is simple enough so it allows us to bench the basic methods and
start some simple projects. It would also allow us to explore specific
methodologies in detail (once we have built up a fundamental knowledge of the
data set)


text:
---
title: "com.snc.time_card.update.resource"
description: "Property"
---

Description: (DEPRECATED: This property has been deprecated and replaced by 'Update actual hours and cost in resource plan' field in Time Sheet Policies) </br>
Update the project/user's resource allocation record based on the hours entered in the time card

Value: `false`

repository: ASHISH-SERVICENOW/sn

repo_name: ASHISH-SERVICENOW/sn


text:
# Halide - WebAssembly Fork #

Fork of Halide, with a modification of the webassembly branch.

For original README, see README\_original.md .

## Instructions ##

Clone the webassembly branch:
```
git clone -b "webassembly" https://github.com/rajeevgUCI/Halide.git
```
Then, see the instructions in that branch's README.

repository: rajeevgUCI/Halide

gha_license_id: NOASSERTION

repo_name: rajeevgUCI/Halide


text:
# Using Prometheus

Prometheus is a monitoring tool often used with Kubernetes.

Prometheus support, then the metrics that are generated by services using the
Prometheus exposition format can be exported from the cluster and made visible
as external metrics in Cloud Monitoring.

## Add reposit chat

 helm repo add bitnami https://charts.bitnami.com/bitnami

## Reposit list

 helm repo  list

## Criate namespace

kubectl create namespace monitoring

## Install prometheus-operator

helm install prometheus-operator bitnami/prometheus-operator --namespace monitoring

### ** Please be patient while the chart is being deployed **

Watch the Prometheus Operator Deployment status using the command:

    kubectl get deploy -w --namespace monitoring -l app.kubernetes.io/name=prometheus-operator-operator,app.kubernetes.io/instance=prometheus-operator

Watch the Prometheus StatefulSet status using the command:

    kubectl get sts -w --namespace monitoring -l app.kubernetes.io/name=prometheus-operator-prometheus,app.kubernetes.io/instance=prometheus-operator

Prometheus can be accessed via port "9090" on the following DNS name from within your cluster:

    prometheus-operator-prometheus.monitoring.svc.cluster.local

To access Prometheus from outside the cluster execute the following commands:

    echo "Prometheus URL: http://<IP_ADDRESS>:9090/"
    kubectl port-forward --namespace monitoring svc/prometheus-operator-prometheus 9090:9090

Watch the Alertmanager StatefulSet status using the command:

    kubectl get sts -w --namespace monitoring -l app.kubernetes.io/name=prometheus-operator-alertmanager,app.kubernetes.io/instance=prometheus-operator

Alertmanager can be accessed via port "9093" on the following DNS name from within your cluster:

    prometheus-operator-alertmanager.monitoring.svc.cluster.local

To access Alertmanager from outside the cluster execute the following commands:

    echo "Alertmanager URL: http://<IP_ADDRESS>:9093/"
    kubectl port-forward --namespace monitoring svc/prometheus-operator-alertmanager 9093:9093

repository: agnaldom/prometheus

repo_name: agnaldom/prometheus


text:
### [CVE-2023-2395](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-2395)
![](https://img.shields.io/static/v1?label=Product&message=SRX5308&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3D%204.3.5-3%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-79%20Cross%20Site%20Scripting&color=brighgreen)

### Description

A vulnerability classified as problematic has been found in Netgear SRX5308 up to 4.3.5-3. This affects an unknown part of the component Web Management Interface. The manipulation of the argument Login.userAgent leads to cross site scripting. It is possible to initiate the attack remotely. The exploit has been disclosed to the public and may be used. The identifier VDB-227673 was assigned to this vulnerability. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.

### POC

#### Reference
- https://github.com/leetsun/IoT/tree/main/Netgear-SRX5308/15
- https://vuldb.com/?id.227673

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

repository: trickest/cve

repo_name: trickest/cve


text:
# Wind Chill Temperature Revised by Tony Liang

Made using Java SE 1.8.

Computes the wind-chill temperature. Includes invalid input checking.

Wind Chill Temperature Formula

![alt text][logo]

[logo]: https://github.com/tliang1/Java-Practice/raw/master/Practice/Intro-To-Java-8th-Ed-Daniel-Y.-Liang/Chapter-3/Chapter03P20/images/instructions/wind_chill_temperature_formula.png "Wind Chill Temperature Formula"

# Project Setup

### Eclipse IDE Instructions
1. Open Eclipse.
2. Create a new project.
3. Right click the folder of the project and click Import.
4. Drop down the General folder and click File System.
5. Click Next.
6. Click Browse and click the location of the folder that contains the src folder and its files to import.
7. On the left side, drop down the selected folder, click the src folder, and click Finish.
8. In the Package Explorer tab, drop down the project folder, the src folder, and the package and click WindChillTemperatureRevised.java.
9. Run the program.

# How To Use
1. Enter the outside temperature in degrees Fahrenheit (Must be between -58°F and 41°F inclusive).
2. Enter the wind speed in miles per hour (Must be greater than or equal to 2 mph).


text:
# momothereal/wiki

This is a small side-project to index the entirety of Wikipedia in ElasticSearch, and to search it in a web page.

Temporarily hosted on: https://wikipedia.momoperes.ca (using a free-trial of Elastic Cloud, so it will stop working by April 2020).

## Structure

* **api**: A Spring Boot REST service to query ElasticSearch
* **ingest**: A multiprocessing Python app to download and index a dump of English Wikipedia
* **search-tool**: An Angular 9 Material web app to search the index using the REST API

## Getting Started

* Dependencies
  * Maven 3.x, JDK 11+
  * Python 3.7+
  * Pipenv
  * Node.js 12+ and Yarn

* Ingest some documents. In the `ingest` directory:
  * Create a file named `.env` and add the following config:
    ```
    ES_HOST=http://my-elasticsearch-instance:9243
    ES_USER=elastic
    ES_PASS=*******
    ```
  * Run `pipenv install`
  * Make a directory named `dumps`
  * Look in the `master.py` file. Adjust the `BASE_URL` and `POOL_SIZE` for a better mirror depending on your location, and CPU count
  * Find a suitable dump date on https://dumps.wikimedia.org/enwiki/, e.g. 20200301
  * Start ingesting with `pipenv run python master.py 20200301`

* Run the API. In the `api` directory:
  * Set your terminal's environment variables like in the .env file above
  * Run `mvn spring-boot:run`

* Run the front-end app. In the `search-tool` directory:
  * Run `yarn`
  * Run `yarn start`
  * Open `http://localhost:4200`. You should be able to search for stuff.

## Using Docker

* Run `docker-compose pull`
* Run `docker-compose up -d`
* Open `http://localhost:8081`. Note that the API may take a few minutes to start up, as the image first compiles the program.

repository: aramperes/wiki

repo_name: aramperes/wiki


text:
# StreamUtility.CreatePartialStream method

Uses [`RebasedStream`](../RebasedStream.md) and/or [`TruncatedStream`](../TruncatedStream.md) to create a read-only partial stream wrapper.

```csharp
public static Stream CreatePartialStream(Stream stream, long offset, long? length,
    Ownership ownership)
```

| parameter | description |
| --- | --- |
| stream | The stream to wrap. |
| offset | The desired offset into the wrapped stream, which is immediately seeked to that position. |
| length | The desired length of the partial stream (optional). |
| ownership | Indicates the ownership of the wrapped stream. |

## Return Value

The read-only partial stream wrapper.

## Remarks

If *offset* is zero and *length* is null, the stream is returned unwrapped.

## See Also

* enum [Ownership](../Ownership.md)
* class [StreamUtility](../StreamUtility.md)
* namespace [Faithlife.Utility](../../Faithlife.Utility.md)

<!-- DO NOT EDIT: generated by xmldocmd for Faithlife.Utility.dll -->

repository: Faithlife/FaithlifeUtility

gha_language: C#

repo_name: Faithlife/FaithlifeUtility


text:
# Hair Salon Administration Page

#### An app that allows the user to manage a hair salons clients and stylists, 9 Dec 2016

#### By Jim Padilla

## Description

This Ruby app has a front end interface where a user can create clients and stylists. The user can also update and delete these entries and assign clients to a stylist.

## Setup/Installation Requirements

* Clone from Github:
  * $ git clone https://github.com/JPCodes/hair-salon-ruby
  * $ cd hair-salon-ruby
  * $ bundle install

For the database functionality, use the terminal to run these commands to get the proper databases and tables installed:

```
$ postgres
$ psql
CREATE DATABASE hair_salon;
\c hair_salon;
CREATE TABLE stylists (id serial PRIMARY KEY, name varchar, phone varchar);
CREATE TABLE clients (id serial PRIMARY KEY, name varchar, stylist_id int);
CREATE DATABASE hair_salon_test WITH TEMPLATE hair_salon;
```

* Run it in the browser:
  * navigate to http://localhost:4567

## Support and contact details

Github: [JPCodes](https://github.com/JPCodes)
Twitter: [jp_code2015](https://twitter.com/jp_code2015)

## Technologies Used

* Bootstrap
* Ruby
  * Sinatra
  * Rspec
  * Capybara
  * PG
* SQL
  * PSQL

### License

MIT License

Copyright (c) 2016 Jim Padilla

repository: JPCodes/hair-salon-ruby

repo_name: JPCodes/hair-salon-ruby


text:
*   Add `authenticate_by` when using `has_secure_password`.

    `authenticate_by` is intended to replace code like the following, which
    returns early when a user with a matching email is not found:

    ```ruby
    User.find_by(email: "...")&.authenticate("...")
    ```

    Such code is vulnerable to timing-based enumeration attacks, wherein an
    attacker can determine if a user account with a given email exists. After
    confirming that an account exists, the attacker can try passwords associated
    with that email address from other leaked databases, in case the user
    re-used a password across multiple sites (a common practice). Additionally,
    knowing an account email address allows the attacker to attempt a targeted
    phishing ("spear phishing") attack.

    `authenticate_by` addresses the vulnerability by taking the same amount of
    time regardless of whether a user with a matching email is found:

    ```ruby
    User.authenticate_by(email: "...", password: "...")
    ```

    *Jonathan Hefner*

*   Remove deprecated `ActiveRecord::DatabaseConfigurations::DatabaseConfig#spec_name`.

    *Rafael Mendonça França*

*   Remove deprecated `ActiveRecord::Connection#in_clause_length`.

    *Rafael Mendonça França*

*   Remove deprecated `ActiveRecord::Connection#allowed_index_name_length`.

    *Rafael Mendonça França*

*   Remove deprecated `ActiveRecord::Base#remove_connection`.

    *Rafael Mendonça França*

*   Load STI Models in fixtures

    Data from Fixtures now loads based on the specific class for models with
    Single Table Inheritance. This affects enums defined in subclasses, previously
    the value of these fields was not parsed and remained `nil`

    *Andres Howard*

*   `#authenticate` returns false when the password is blank instead of raising an error.

    *Muhammad Muhammad Ibrahim*

*   Fix `ActiveRecord::QueryMethods#in_order_of` behavior for integer enums.

    `ActiveRecord::QueryMethods#in_order_of` didn't work as expected for enums stored as integers in the database when passing an array of strings or symbols as the order argument. This unexpected behavior occurred because the string or symbol values were not casted to match the integers in the database.

    The following example now works as expected:

    ```ruby
    class Book < ApplicationRecord
      enum status: [:proposed, :written, :published]
    end

    Book.in_order_of(:status, %w[written published proposed])
    ```

    *Alexandre Ruban*

*   Ignore persisted in-memory records when merging target lists.

    *Kevin Sjöberg*

*   Add a new option `:update_only` to `upsert_all` to configure the list of columns to update in case of conflict.

    Before, you could only customize the update SQL sentence via `:on_duplicate`. There is now a new option `:update_only` that lets you provide a list of columns to update in case of conflict:

    ```ruby
    Commodity.upsert_all(
      [
        { id: 2, name: "Copper", price: 4.84 },
        { id: 4, name: "Gold", price: 1380.87 },
        { id: 6, name: "Aluminium", price: 0.35 }
      ],
      update_only: [:price] # Only prices will be updated
    )
    ```

    *Jorge Manrubia*

*   Remove deprecated `ActiveRecord::Result#map!` and `ActiveRecord::Result#collect!`.

    *Rafael Mendonça França*

*   Remove deprecated `ActiveRecord::Base.configurations.to_h`.

    *Rafael Mendonça França*

*   Remove deprecated `ActiveRecord::Base.configurations.default_hash`.

    *Rafael Mendonça França*

*   Remove deprecated `ActiveRecord::Base.arel_attribute`.

    *Rafael Mendonça França*

*   Remove deprecated `ActiveRecord::Base.connection_config`.

    *Rafael Mendonça França*

*   Filter attributes in SQL logs

    Previously, SQL queries in logs containing `ActiveRecord::Base.filter_attributes` were not filtered.

    Now, the filter attributes will be masked `[FILTERED]` in the logs when `prepared_statement` is enabled.

    ```
    # Before:
      Foo Load (0.2ms)  SELECT "foos".* FROM "foos" WHERE "foos"."passw" = ? LIMIT ?  [["passw", "hello"], ["LIMIT", 1]]

    # After:
      Foo Load (0.5ms)  SELECT "foos".* FROM "foos" WHERE "foos"."passw" = ? LIMIT ?  [["passw", "[FILTERED]"], ["LIMIT", 1]]
    ```

    *Aishwarya Subramanian*

*   Remove deprecated `Tasks::DatabaseTasks.spec`.

    *Rafael Mendonça França*

*   Remove deprecated `Tasks::DatabaseTasks.current_config`.

    *Rafael Mendonça França*

*   Deprecate `Tasks::DatabaseTasks.schema_file_type`.

    *Rafael Mendonça França*

*   Remove deprecated `Tasks::DatabaseTasks.dump_filename`.

    *Rafael Mendonça França*

*   Remove deprecated `Tasks::DatabaseTasks.schema_file`.

    *Rafael Mendonça França*

*   Remove deprecated `environment` and `name` arguments from `Tasks::DatabaseTasks.schema_up_to_date?`.

    *Rafael Mendonça França*

*   Merging conditions on the same column no longer maintain both conditions,
    and will be consistently replaced by the latter condition.

    ```ruby
    # Rails 6.1 (IN clause is replaced by merger side equality condition)
    Author.where(id: [david.id, mary.id]).merge(Author.where(id: bob)) # => [bob]
    # Rails 6.1 (both conflict conditions exists, deprecated)
    Author.where(id: david.id..mary.id).merge(Author.where(id: bob)) # => []
    # Rails 6.1 with rewhere to migrate to Rails 7.0's behavior
    Author.where(id: david.id..mary.id).merge(Author.where(id: bob), rewhere: true) # => [bob]
    # Rails 7.0 (same behavior with IN clause, mergee side condition is consistently replaced)
    Author.where(id: [david.id, mary.id]).merge(Author.where(id: bob)) # => [bob]
    Author.where(id: david.id..mary.id).merge(Author.where(id: bob)) # => [bob]

    *Rafael Mendonça França*

*   Remove deprecated support to `Model.reorder(nil).first` to search using non-deterministic order.

    *Rafael Mendonça França*

*   Remove deprecated rake tasks:

    * `db:schema:load_if_ruby`
    * `db:structure:dump`
    * `db:structure:load`
    * `db:structure:load_if_sql`
    * `db:structure:dump:#{name}`
    * `db:structure:load:#{name}`
    * `db:test:load_structure`
    * `db:test:load_structure:#{name}`

    *Rafael Mendonça França*

*   Remove deprecated `DatabaseConfig#config` method.

    *Rafael Mendonça França*

*   Rollback transactions when the block returns earlier than expected.

    Before this change, when a transaction block returned early, the transaction would be committed.

    The problem is that timeouts triggered inside the transaction block was also making the incomplete transaction
    to be committed, so in order to avoid this mistake, the transaction block is rolled back.

    *Rafael Mendonça França*

*   Add middleware for automatic shard swapping.

    Provides a basic middleware to perform automatic shard swapping. Applications will provide a resolver which will determine for an individual request which shard should be used. Example:

    ```ruby
    config.active_record.shard_resolver = ->(request) {
      subdomain = request.subdomain
      tenant = Tenant.find_by_subdomain!(subdomain)
      tenant.shard
    }
    ```

    See guides for more details.

    *Eileen M. Uchitelle*, *John Crepezzi*

*   Remove deprecated support to pass a column to `type_cast`.

    *Rafael Mendonça França*

*   Remove deprecated support to type cast to database values `ActiveRecord::Base` objects.

    *Rafael Mendonça França*

*   Remove deprecated support to quote `ActiveRecord::Base` objects.

    *Rafael Mendonça França*

*   Remove deprecacated support to resolve connection using `"primary"` as connection specification name.

    *Rafael Mendonça França*

*   Remove deprecation warning when using `:interval` column is used in PostgreSQL database.

    Now, interval columns will return `ActiveSupport::Duration` objects instead of strings.

    To keep the old behavior, you can add this line to your model:

    ```ruby
    attribute :column, :string
    ```

    *Rafael Mendonça França*

*   Remove deprecated support to YAML load `ActiveRecord::Base` instance in the Rails 4.2 and 4.1 formats.

    *Rafael Mendonça França*

*   Remove deprecated option `:spec_name` in the `configs_for` method.

    *Rafael Mendonça França*

*   Remove deprecated  `ActiveRecord::Base.allow_unsafe_raw_sql`.

    *Rafael Mendonça França*

*   Fix regression bug that caused ignoring additional conditions for preloading has_many-through relations.

    Fixes #43132

    *Alexander Pauly*

*   Fix `has_many` inversing recursion on models with recursive associations.

    *Gannon McGibbon*

*   Add `accepts_nested_attributes_for` support for `delegated_type`

    ```ruby
    class Entry < ApplicationRecord
      delegated_type :entryable, types: %w[ Message Comment ]
      accepts_nested_attributes_for :entryable
    end

    entry = Entry.create(entryable_type: 'Message', entryable_attributes: { content: 'Hello world' })
    # => #<Entry:0x00>
    # id: 1
    # entryable_id: 1,
    # entryable_type: 'Message'
    # ...>

    entry.entryable
    # => #<Message:0x01>
    # id: 1
    # content: 'Hello world'
    # ...>
    ```

    Previously it would raise an error:

    ```ruby
    Entry.create(entryable_type: 'Message', entryable_attributes: { content: 'Hello world' })
    # ArgumentError: Cannot build association `entryable'. Are you trying to build a polymorphic one-to-one association?
    ```

    *Sjors Baltus*

*   Use subquery for DELETE with GROUP_BY and HAVING clauses.

    Prior to this change, deletes with GROUP_BY and HAVING were returning an error.

    After this change, GROUP_BY and HAVING are valid clauses in DELETE queries, generating the following query:

    ```sql
    DELETE FROM "posts" WHERE "posts"."id" IN (
        SELECT "posts"."id" FROM "posts" INNER JOIN "comments" ON "comments"."post_id" = "posts"."id" GROUP BY "posts"."id" HAVING (count(comments.id) >= 2))
    )  [["flagged", "t"]]
    ```

    *Ignacio Chiazzo Cardarello*

*   Use subquery for UPDATE with GROUP_BY and HAVING clauses.

    Prior to this change, updates with GROUP_BY and HAVING were being ignored, generating a SQL like this:

    ```sql
    UPDATE "posts" SET "flagged" = ? WHERE "posts"."id" IN (
        SELECT "posts"."id" FROM "posts" INNER JOIN "comments" ON "comments"."post_id" = "posts"."id"
    )  [["flagged", "t"]]
    ```

    After this change, GROUP_BY and HAVING clauses are used as a subquery in updates, like this:

    ```sql
    UPDATE "posts" SET "flagged" = ? WHERE "posts"."id" IN (
        SELECT "posts"."id" FROM "posts" INNER JOIN "comments" ON "comments"."post_id" = "posts"."id"
        GROUP BY posts.id HAVING (count(comments.id) >= 2)
    )  [["flagged", "t"]]
    ```

    *Ignacio Chiazzo Cardarello*

*   Add support for setting the filename of the schema or structure dump in the database config.

    Applications may now set their the filename or path of the schema / structure dump file in their database configuration.

    ```yaml
    production:
      primary:
        database: my_db
        schema_dump: my_schema_dump_filename.rb
      animals:
        database: animals_db
        schema_dump: false
    ```

    The filename set in `schema_dump` will be used by the application. If set to `false` the schema will not be dumped. The database tasks are responsible for adding the database directory to the filename. If a full path is provided, the Rails tasks will use that instead of `ActiveRecord::DatabaseTasks.db_dir`.

    *Eileen M. Uchitelle*, *Ryan Kerr*

*   Add `ActiveRecord::Base.prohibit_shard_swapping` to prevent attempts to change the shard within a block.

    *John Crepezzi*, *Eileen M. Uchitelle*

*   Filter unchanged attributes with default function from insert query when `partial_inserts` is disabled.

    *Akshay Birajdar*, *Jacopo Beschi*

*   Add support for FILTER clause (SQL:2003) to Arel.

    Currently supported by PostgreSQL 9.4+ and SQLite 3.30+.

    *Andrey Novikov*

*   Automatically set timestamps on record creation during bulk insert/upsert

    Prior to this change, only updates during an upsert operation (e.g. `upsert_all`) would touch timestamps (`updated_{at,on}`). Now, record creations also touch timestamp columns (`{created,updated}_{at,on}`).

    This behaviour is controlled by the `<model>.record_timestamps` config, matching the behaviour of `create`, `update`, etc. It can also be overridden by using the `record_timestamps:` keyword argument.

    Note that this means `upsert_all` on models with `record_timestamps = false` will no longer touch `updated_{at,on}` automatically.

    *Sam Bostock*

*   Don't require `role` when passing `shard` to `connected_to`.

    `connected_to` can now be called with a `shard` only. Note that `role` is still inherited if `connected_to` calls are nested.

    *Eileen M. Uchitelle*

*   Add option to lazily load the schema cache on the connection.

    Previously, the only way to load the schema cache in Active Record was through the Railtie on boot. This option provides the ability to load the schema cache on the connection after it's been established. Loading the cache lazily on the connection can be beneficial for Rails applications that use multiple databases because it will load the cache at the time the connection is established. Currently Railties doesn't have access to the connections before boot.

    To use the cache, set `config.active_record.lazily_load_schema_cache = true` in your application configuration. In addition a `schema_cache_path` should be set in your database configuration if you don't want to use the default "db/schema_cache.yml" path.

    *Eileen M. Uchitelle*

*   Allow automatic `inverse_of` detection for associations with scopes.

    Automatic `inverse_of` detection now works for associations with scopes. For
    example, the `comments` association here now automatically detects
    `inverse_of: :post`, so we don't need to pass that option:

    ```ruby
    class Post < ActiveRecord::Base
      has_many :comments, -> { visible }
    end

    class Comment < ActiveRecord::Base
      belongs_to :post
    end
    ```

    Note that the automatic detection still won't work if the inverse
    association has a scope. In this example a scope on the `post` association
    would still prevent Rails from finding the inverse for the `comments`
    association.

    This will be the default for new apps in Rails 7. To opt in:

    ```ruby
    config.active_record.automatic_scope_inversing = true
    ```

    *Daniel Colson*, *Chris Bloom*

*   Accept optional transaction args to `ActiveRecord::Locking::Pessimistic#with_lock`

    `#with_lock` now accepts transaction options like `requires_new:`,
    `isolation:`, and `joinable:`

*   Adds support for deferrable foreign key constraints in PostgreSQL.

    By default, foreign key constraints in PostgreSQL are checked after each statement. This works for most use cases,
    but becomes a major limitation when creating related records before the parent record is inserted into the database.
    One example of this is looking up / creating a person via one or more unique alias.

    ```ruby
    Person.transaction do
      alias = Alias
        .create_with(user_id: SecureRandom.uuid)
        .create_or_find_by(name: "DHH")

      person = Person
        .create_with(name: "David Heinemeier Hansson")
        .create_or_find_by(id: alias.user_id)
    end
    ```

    Using the default behavior, the transaction would fail when executing the first `INSERT` statement.

    By passing the `:deferrable` option to the `add_foreign_key` statement in migrations, it's possible to defer this
    check.

    ```ruby
    add_foreign_key :aliases, :person, deferrable: true
    ```

    Passing `deferrable: true` doesn't change the default behavior, but allows manually deferring the check using
    `SET CONSTRAINTS ALL DEFERRED` within a transaction. This will cause the foreign keys to be checked after the
    transaction.

    It's also possible to adjust the default behavior from an immediate check (after the statement), to a deferred check
    (after the transaction):

    ```ruby
    add_foreign_key :aliases, :person, deferrable: :deferred
    ```

    *Benedikt Deicke*

*   Allow configuring Postgres password through the socket URL.

    For example:
    ```ruby
    ActiveRecord::DatabaseConfigurations::UrlConfig.new(
      :production, :production, 'postgres:///?user=user&password=secret&dbname=app', {}
    ).configuration_hash
    ```

    will now return,

    ```ruby
    { :user=>"user", :password=>"secret", :dbname=>"app", :adapter=>"postgresql" }
    ```

    *Abeid Ahmed*

*   PostgreSQL: support custom enum types

    In migrations, use `create_enum` to add a new enum type, and `t.enum` to add a column.

    ```ruby
    def up
      create_enum :mood, ["happy", "sad"]

      change_table :cats do |t|
        t.enum :current_mood, enum_type: "mood", default: "happy", null: false
      end
    end
    ```

    Enums will be presented correctly in `schema.rb`. Note that this is only supported by
    the PostgreSQL adapter.

    *Alex Ghiculescu*

* Avoid COMMENT statements in PostgreSQL structure dumps

    COMMENT statements are now omitted from the output of `db:structure:dump` when using PostgreSQL >= 11.
    This allows loading the dump without a pgsql superuser account.

    Fixes #36816, #43107.

    *Janosch Müller*

*   Add support for generated columns in PostgreSQL adapter

    Generated columns are supported since version 12.0 of PostgreSQL. This adds
    support of those to the PostgreSQL adapter.

    ```ruby
    create_table :users do |t|
      t.string :name
      t.virtual :name_upcased, type: :string, as: 'upper(name)', stored: true
    end
    ```

    *Michał Begejowicz*

## Rails 7.0.0.alpha2 (September 15, 2021) ##

*   No changes.

## Rails 7.0.0.alpha1 (September 15, 2021) ##

*   Remove warning when overwriting existing scopes

    Removes the following unnecessary warning message that appeared when overwriting existing scopes

    ```
    Creating scope :my_scope_name. Overwriting existing method "MyClass.my_scope_name" when overwriting existing scopes
    ```

     *Weston Ganger*

*   Use full precision for `updated_at` in `insert_all`/`upsert_all`

    `CURRENT_TIMESTAMP` provides differing precision depending on the database,
    and not all databases support explicitly specifying additional precision.

    Instead, we delegate to the new `connection.high_precision_current_timestamp`
    for the SQL to produce a high precision timestamp on the current database.

    Fixes #42992

    *Sam Bostock*

* Add ssl support for postgresql database tasks

    Add `PGSSLMODE`, `PGSSLCERT`, `PGSSLKEY` and `PGSSLROOTCERT` to pg_env from database config
    when running postgresql database tasks.

    ```yaml
    # config/database.yml

    production:
      sslmode: verify-full
      sslcert: client.crt
      sslkey: client.key
      sslrootcert: ca.crt
    ```

    Environment variables

    ```
    PGSSLMODE=verify-full
    PGSSLCERT=client.crt
    PGSSLKEY=client.key
    PGSSLROOTCERT=ca.crt
    ```

    Fixes #42994

    *Michael Bayucot*

*   Avoid scoping update callbacks in `ActiveRecord::Relation#update!`.

    Making it consistent with how scoping is applied only to the query in `ActiveRecord::Relation#update`
    and not also to the callbacks from the update itself.

    *Dylan Thacker-Smith*

*   Fix 2 cases that inferred polymorphic class from the association's `foreign_type`
    using `String#constantize` instead of the model's `polymorphic_class_for`.

    When updating a polymorphic association, the old `foreign_type` was not inferred correctly when:
    1. `touch`ing the previously associated record
    2. updating the previously associated record's `counter_cache`

    *Jimmy Bourassa*

*   Add config option for ignoring tables when dumping the schema cache.

    Applications can now be configured to ignore certain tables when dumping the schema cache.

    The configuration option can table an array of tables:

    ```ruby
    config.active_record.schema_cache_ignored_tables = ["ignored_table", "another_ignored_table"]
    ```

    Or a regex:

    ```ruby
    config.active_record.schema_cache_ignored_tables = [/^_/]
    ```

    *Eileen M. Uchitelle*

*   Make schema cache methods return consistent results.

    Previously the schema cache methods `primary_keys`, `columns`, `columns_hash`, and `indexes`
    would behave differently than one another when a table didn't exist and differently across
    database adapters. This change unifies the behavior so each method behaves the same regardless
    of adapter.

    The behavior now is:

    `columns`: (unchanged) raises a db error if the table does not exist.
    `columns_hash`: (unchanged) raises a db error if the table does not exist.
    `primary_keys`: (unchanged) returns `nil` if the table does not exist.
    `indexes`: (changed for mysql2) returns `[]` if the table does not exist.

    *Eileen M. Uchitelle*

*   Reestablish connection to previous database after after running `db:schema:load:name`

    After running `db:schema:load:name` the previous connection is restored.

    *Jacopo Beschi*

*   Add database config option `database_tasks`

    If you would like to connect to an external database without any database
    management tasks such as schema management, migrations, seeds, etc. you can set
    the per database config option `database_tasks: false`

    ```yaml
    # config/database.yml

    production:
      primary:
        database: my_database
        adapter: mysql2
      animals:
        database: my_animals_database
        adapter: mysql2
        database_tasks: false
    ```

    *Weston Ganger*

*   Fix `ActiveRecord::InternalMetadata` to not be broken by `config.active_record.record_timestamps = false`

    Since the model always create the timestamp columns, it has to set them, otherwise it breaks
    various DB management tasks.

    Fixes #42983

*   Add `ActiveRecord::QueryLogs`.

    Configurable tags can be automatically added to all SQL queries generated by Active Record.

    ```ruby
    # config/application.rb
    module MyApp
      class Application < Rails::Application
        config.active_record.query_log_tags_enabled = true
      end
    end
    ```

    By default the application, controller and action details are added to the query tags:

    ```ruby
    class BooksController < ApplicationController
      def index
        @books = Book.all
      end
    end
    ```

    ```ruby
    GET /books
    # SELECT * FROM books /*application:MyApp;controller:books;action:index*/
    ```

    Custom tags containing static values and Procs can be defined in the application configuration:

    ```ruby
    config.active_record.query_log_tags = [
      :application,
      :controller,
      :action,
      {
        custom_static: "foo",
        custom_dynamic: -> { Time.now }
      }
    ]
    ```

    *Keeran Raj Hawoldar*, *Eileen M. Uchitelle*, *Kasper Timm Hansen*

*   Added support for multiple databases to `rails db:setup` and `rails db:reset`.

    *Ryan Hall*

*   Add `ActiveRecord::Relation#structurally_compatible?`.

    Adds a query method by which a user can tell if the relation that they're
    about to use for `#or` or `#and` is structurally compatible with the
    receiver.

    *Kevin Newton*

*   Add `ActiveRecord::QueryMethods#in_order_of`.

    This allows you to specify an explicit order that you'd like records
    returned in based on a SQL expression. By default, this will be accomplished
    using a case statement, as in:

    ```ruby
    Post.in_order_of(:id, [3, 5, 1])
    ```

    will generate the SQL:

    ```sql
    SELECT "posts".* FROM "posts" ORDER BY CASE "posts"."id" WHEN 3 THEN 1 WHEN 5 THEN 2 WHEN 1 THEN 3 ELSE 4 END ASC
    ```

    However, because this functionality is built into MySQL in the form of the
    `FIELD` function, that connection adapter will generate the following SQL
    instead:

    ```sql
    SELECT "posts".* FROM "posts" ORDER BY FIELD("posts"."id", 1, 5, 3) DESC
    ```

    *Kevin Newton*

*   Fix `eager_loading?` when ordering with `Symbol`.

    `eager_loading?` is triggered correctly when using `order` with symbols.

    ```ruby
    scope = Post.includes(:comments).order(:"comments.label")
    => true
    ```

    *Jacopo Beschi*

*   Two change tracking methods are added for `belongs_to` associations.

    The `association_changed?` method (assuming an association named `:association`) returns true
    if a different associated object has been assigned and the foreign key will be updated in the
    next save.

    The `association_previously_changed?` method returns true if the previous save updated the
    association to reference a different associated object.

    *George Claghorn*

*   Add option to disable schema dump per-database.

    Dumping the schema is on by default for all databases in an application. To turn it off for a
    specific database, use the `schema_dump` option:

    ```yaml
    # config/database.yml

    production:
      schema_dump: false
    ```

    *Luis Vasconcellos*, *Eileen M. Uchitelle*

*   Fix `eager_loading?` when ordering with `Hash` syntax.

    `eager_loading?` is triggered correctly when using `order` with hash syntax
    on an outer table.

    ```ruby
    Post.includes(:comments).order({ "comments.label": :ASC }).eager_loading?
    # => true
    ```

    *Jacopo Beschi*

*   Move the forcing of clear text encoding to the `ActiveRecord::Encryption::Encryptor`.

    Fixes #42699.

    *J Smith*

*   `partial_inserts` is now disabled by default in new apps.

    This will be the default for new apps in Rails 7. To opt in:

    ```ruby
    config.active_record.partial_inserts = true
    ```

    If a migration removes the default value of a column, this option
    would cause old processes to no longer be able to create new records.

    If you need to remove a column, you should first use `ignored_columns`
    to stop using it.

    *Jean Boussier*

*   Rails can now verify foreign keys after loading fixtures in tests.

    This will be the default for new apps in Rails 7. To opt in:

    ```ruby
    config.active_record.verify_foreign_keys_for_fixtures = true
    ```

    Tests will not run if there is a foreign key constraint violation in your fixture data.

    The feature is supported by SQLite and PostgreSQL, other adapters can also add support for it.

    *Alex Ghiculescu*

*   Clear cached `has_one` association after setting `belongs_to` association to `nil`.

    After setting a `belongs_to` relation to `nil` and updating an unrelated attribute on the owner,
    the owner should still return `nil` on the `has_one` relation.

    Fixes #42597.

    *Michiel de Mare*

*   OpenSSL constants are now used for Digest computations.

    *Dirkjan Bussink*

*   Adds support for `if_not_exists` to `add_foreign_key` and `if_exists` to `remove_foreign_key`.

    Applications can set their migrations to ignore exceptions raised when adding a foreign key
    that already exists or when removing a foreign key that does not exist.

    Example Usage:

    ```ruby
    class AddAuthorsForeignKeyToArticles < ActiveRecord::Migration[7.0]
      def change
        add_foreign_key :articles, :authors, if_not_exists: true
      end
    end
    ```

    ```ruby
    class RemoveAuthorsForeignKeyFromArticles < ActiveRecord::Migration[7.0]
      def change
        remove_foreign_key :articles, :authors, if_exists: true
      end
    end
    ```

    *Roberto Miranda*

*   Prevent polluting ENV during postgresql structure dump/load.

    Some configuration parameters were provided to pg_dump / psql via
    environment variables which persisted beyond the command being run, and may
    have caused subsequent commands and connections to fail. Tasks running
    across multiple postgresql databases like `rails db:test:prepare` may have
    been affected.

    *Samuel Cochran*

*   Set precision 6 by default for `datetime` columns.

    By default, datetime columns will have microseconds precision instead of seconds precision.

    *Roberto Miranda*

*   Allow preloading of associations with instance dependent scopes.

    *John Hawthorn*, *John Crepezzi*, *Adam Hess*, *Eileen M. Uchitelle*, *Dinah Shi*

*   Do not try to rollback transactions that failed due to a `ActiveRecord::TransactionRollbackError`.

    *Jamie McCarthy*

*   Active Record Encryption will now encode values as UTF-8 when using deterministic
    encryption. The encoding is part of the encrypted payload, so different encodings for
    different values result in different ciphertexts. This can break unique constraints and
    queries.

    The new behavior is configurable via `active_record.encryption.forced_encoding_for_deterministic_encryption`
    that is `Encoding::UTF_8` by default. It can be disabled by setting it to `nil`.

    *Jorge Manrubia*

*   The MySQL adapter now cast numbers and booleans bind parameters to string for safety reasons.

    When comparing a string and a number in a query, MySQL converts the string to a number. So for
    instance `"foo" = 0`, will implicitly cast `"foo"` to `0` and will evaluate to `TRUE` which can
    lead to security vulnerabilities.

    Active Record already protect against that vulnerability when it knows the type of the column
    being compared, however until now it was still vulnerable when using bind parameters:

    ```ruby
    User.where("login_token = ?", 0).first
    ```

    Would perform:

    ```sql
    SELECT * FROM `users` WHERE `login_token` = 0 LIMIT 1;
    ```

    Now it will perform:

    ```sql
    SELECT * FROM `users` WHERE `login_token` = '0' LIMIT 1;
    ```

    *Jean Boussier*

*   Fixture configurations (`_fixture`) are now strictly validated.

    If an error will be raised if that entry contains unknown keys while previously it
    would silently have no effects.

    *Jean Boussier*

*   Add `ActiveRecord::Base.update!` that works like `ActiveRecord::Base.update` but raises exceptions.

    This allows for the same behavior as the instance method `#update!` at a class level.

    ```ruby
    Person.update!(:all, state: "confirmed")
    ```

    *Dorian Marié*

*   Add `ActiveRecord::Base#attributes_for_database`.

    Returns attributes with values for assignment to the database.

    *Chris Salzberg*

*   Use an empty query to check if the PostgreSQL connection is still active.

    An empty query is faster than `SELECT 1`.

    *Heinrich Lee Yu*

*   Add `ActiveRecord::Base#previously_persisted?`.

    Returns `true` if the object has been previously persisted but now it has been deleted.

*   Deprecate `partial_writes` in favor of `partial_inserts` and `partial_updates`.

    This allows to have a different behavior on update and create.

    *Jean Boussier*

*   Fix compatibility with `psych >= 4`.

    Starting in Psych 4.0.0 `YAML.load` behaves like `YAML.safe_load`. To preserve compatibility,
    Active Record's schema cache loader and `YAMLColumn` now uses `YAML.unsafe_load` if available.

    *Jean Boussier*

*   `ActiveRecord::Base.logger` is now a `class_attribute`.

    This means it can no longer be accessed directly through `@@logger`, and that setting `logger =`
    on a subclass won't change the parent's logger.

    *Jean Boussier*

*   Add `.asc.nulls_first` for all databases. Unfortunately MySQL still doesn't like `nulls_last`.

    *Keenan Brock*

*   Improve performance of `one?` and `many?` by limiting the generated count query to 2 results.

    *Gonzalo Riestra*

*   Don't check type when using `if_not_exists` on `add_column`.

    Previously, if a migration called `add_column` with the `if_not_exists` option set to true
    the `column_exists?` check would look for a column with the same name and type as the migration.

    Recently it was discovered that the type passed to the migration is not always the same type
    as the column after migration. For example a column set to `:mediumblob` in the migration will
    be casted to `binary` when calling `column.type`. Since there is no straightforward way to cast
    the type to the database type without running the migration, we opted to drop the type check from
    `add_column`. This means that migrations adding a duplicate column with a different type will no
    longer raise an error.

    *Eileen M. Uchitelle*

*   Log a warning message when running SQLite in production.

    Using SQLite in production ENV is generally discouraged. SQLite is also the default adapter
    in a new Rails application.
    For the above reasons log a warning message when running SQLite in production.

    The warning can be disabled by setting `config.active_record.sqlite3_production_warning=false`.

    *Jacopo Beschi*

*   Add option to disable joins for `has_one` associations.

    In a multiple database application, associations can't join across
    databases. When set, this option instructs Rails to generate 2 or
    more queries rather than generating joins for `has_one` associations.

    Set the option on a has one through association:

    ```ruby
    class Person
      has_one :dog
      has_one :veterinarian, through: :dog, disable_joins: true
    end
    ```

    Then instead of generating join SQL, two queries are used for<EMAIL_ADDRESS>
    ```
    SELECT "dogs"."id" FROM "dogs" WHERE "dogs"."person_id" = ?  [["person_id", 1]]
    SELECT "veterinarians".* FROM "veterinarians" WHERE "veterinarians"."dog_id" = ?  [["dog_id", 1]]
    ```

    *Sarah Vessels*, *Eileen M. Uchitelle*

*   `Arel::Visitors::Dot` now renders a complete set of properties when visiting
    `Arel::Nodes::SelectCore`, `SelectStatement`, `InsertStatement`, `UpdateStatement`, and
    `DeleteStatement`, which fixes #42026. Previously, some properties were omitted.

    *Mike Dalessio*

*   `Arel::Visitors::Dot` now supports `Arel::Nodes::Bin`, `Case`, `CurrentRow`, `Distinct`,
    `DistinctOn`, `Else`, `Except`, `InfixOperation`, `Intersect`, `Lock`, `NotRegexp`, `Quoted`,
    `Regexp`, `UnaryOperation`, `Union`, `UnionAll`, `When`, and `With`. Previously, these node
    types caused an exception to be raised by `Arel::Visitors::Dot#accept`.

    *Mike Dalessio*

*   Optimize `remove_columns` to use a single SQL statement.

    ```ruby
    remove_columns :my_table, :col_one, :col_two
    ```

    Now results in the following SQL:

    ```sql
    ALTER TABLE "my_table" DROP COLUMN "col_one", DROP COLUMN "col_two"
    ```

    *Jon Dufresne*

*   Ensure `has_one` autosave association callbacks get called once.

    Change the `has_one` autosave callback to be non cyclic as well.
    By doing this the autosave callback are made more consistent for
    all 3 cases: `has_many`, `has_one`, and `belongs_to`.

    *Petrik de Heus*

*   Add option to disable joins for associations.

    In a multiple database application, associations can't join across
    databases. When set, this option instructs Rails to generate 2 or
    more queries rather than generating joins for associations.

    Set the option on a has many through association:

    ```ruby
    class Dog
      has_many :treats, through: :humans, disable_joins: true
      has_many :humans
    end
    ```

    Then instead of generating join SQL, two queries are used for<EMAIL_ADDRESS>
    ```
    SELECT "humans"."id" FROM "humans" WHERE "humans"."dog_id" = ?  [["dog_id", 1]]
    SELECT "treats".* FROM "treats" WHERE "treats"."human_id" IN (?, ?, ?)  [["human_id", 1], ["human_id", 2], ["human_id", 3]]
    ```

    *Eileen M. Uchitelle*, *Aaron Patterson*, *Lee Quarella*

*   Add setting for enumerating column names in SELECT statements.

    Adding a column to a PostgreSQL database, for example, while the application is running can
    change the result of wildcard `SELECT *` queries, which invalidates the result
    of cached prepared statements and raises a `PreparedStatementCacheExpired` error.

    When enabled, Active Record will avoid wildcards and always include column names
    in `SELECT` queries, which will return consistent results and avoid prepared
    statement errors.

    Before:

    ```ruby
    Book.limit(5)
    # SELECT * FROM books LIMIT 5
    ```

    After:

    ```ruby
    # config/application.rb
    module MyApp
      class Application < Rails::Application
        config.active_record.enumerate_columns_in_select_statements = true
      end
    end

    # or, configure per-model
    class Book < ApplicationRecord
      self.enumerate_columns_in_select_statements = true
    end
    ```

    ```ruby
    Book.limit(5)
    # SELECT id, author_id, name, format, status, language, etc FROM books LIMIT 5
    ```

    *Matt Duszynski*

*   Allow passing SQL as `on_duplicate` value to `#upsert_all` to make it possible to use raw SQL to update columns on conflict:

    ```ruby
    Book.upsert_all(
      [{ id: 1, status: 1 }, { id: 2, status: 1 }],
      on_duplicate: Arel.sql("status = GREATEST(books.status, EXCLUDED.status)")
    )
    ```

    *Vladimir Dementyev*

*   Allow passing SQL as `returning` statement to `#upsert_all`:

    ```ruby
    Article.insert_all(
      [
        { title: "Article 1", slug: "article-1", published: false },
        { title: "Article 2", slug: "article-2", published: false }
      ],
      returning: Arel.sql("id, (xmax = '0') as inserted, name as new_name")
    )
    ```

    *Vladimir Dementyev*

*   Deprecate `legacy_connection_handling`.

    *Eileen M. Uchitelle*

*   Add attribute encryption support.

    Encrypted attributes are declared at the model level. These
    are regular Active Record attributes backed by a column with
    the same name. The system will transparently encrypt these
    attributes before saving them into the database and will
    decrypt them when retrieving their values.

    ```ruby
    class Person < ApplicationRecord
      encrypts :name
      encrypts :email_address, deterministic: true
    end
    ```

    You can learn more in the [Active Record Encryption
    guide](https://edgeguides.rubyonrails.org/active_record_encryption.html).

    *Jorge Manrubia*

*   Changed Arel predications `contains` and `overlaps` to use
    `quoted_node` so that PostgreSQL arrays are quoted properly.

    *Bradley Priest*

*   Add mode argument to record level `strict_loading!`.

    This argument can be used when enabling strict loading for a single record
    to specify that we only want to raise on n plus one queries.

    ```ruby
    developer.strict_loading!(mode: :n_plus_one_only)

    developer.projects.to_a # Does not raise
    developer.projects.first.client # Raises StrictLoadingViolationError
    ```

    Previously, enabling strict loading would cause any lazily loaded
    association to raise an error. Using `n_plus_one_only` mode allows us to
    lazily load belongs_to, has_many, and other associations that are fetched
    through a single query.

    *Dinah Shi*

*   Fix Float::INFINITY assignment to datetime column with postgresql adapter.

    Before:

    ```ruby
    # With this config
    ActiveRecord::Base.time_zone_aware_attributes = true

    # and the following schema:
    create_table "postgresql_infinities" do |t|
      t.datetime "datetime"
    end

    # This test fails
    record = PostgresqlInfinity.create!(datetime: Float::INFINITY)
    assert_equal Float::INFINITY, record.datetime # record.datetime gets nil
    ```

    After this commit, `record.datetime` gets `Float::INFINITY` as expected.

    *Shunichi Ikegami*

*   Type cast enum values by the original attribute type.

    The notable thing about this change is that unknown labels will no longer match 0 on MySQL.

    ```ruby
    class Book < ActiveRecord::Base
      enum :status, { proposed: 0, written: 1, published: 2 }
    end
    ```

    Before:

    ```ruby
    # SELECT `books`.* FROM `books` WHERE `books`.`status` = 'prohibited' LIMIT 1
    Book.find_by(status: :prohibited)
    # => #<Book id: 1, status: "proposed", ...> (for mysql2 adapter)
    # => ActiveRecord::StatementInvalid: PG::InvalidTextRepresentation: ERROR:  invalid input syntax for type integer: "prohibited" (for postgresql adapter)
    # => nil (for sqlite3 adapter)
    ```

    After:

    ```ruby
    # SELECT `books`.* FROM `books` WHERE `books`.`status` IS NULL LIMIT 1
    Book.find_by(status: :prohibited)
    # => nil (for all adapters)
    ```

    *Ryuta Kamizono*

*   Fixtures for `has_many :through` associations now load timestamps on join tables.

    Given this fixture:

    ```yml
    ### monkeys.yml
    george:
      name: George the Monkey
      fruits: apple

    ### fruits.yml
    apple:
      name: apple
    ```

    If the join table (`fruit_monkeys`) contains `created_at` or `updated_at` columns,
    these will now be populated when loading the fixture. Previously, fixture loading
    would crash if these columns were required, and leave them as null otherwise.

    *Alex Ghiculescu*

*   Allow applications to configure the thread pool for async queries.

    Some applications may want one thread pool per database whereas others want to use
    a single global thread pool for all queries. By default, Rails will set `async_query_executor`
    to `nil` which will not initialize any executor. If `load_async` is called and no executor
    has been configured, the query will be executed in the foreground.

    To create one thread pool for all database connections to use applications can set
    `config.active_record.async_query_executor` to `:global_thread_pool` and optionally define
    `config.active_record.global_executor_concurrency`. This defaults to 4. For applications that want
    to have a thread pool for each database connection, `config.active_record.async_query_executor` can
    be set to `:multi_thread_pool`. The configuration for each thread pool is set in the database
    configuration.

    *Eileen M. Uchitelle*

*   Allow new syntax for `enum` to avoid leading `_` from reserved options.

    Before:

    ```ruby
    class Book < ActiveRecord::Base
      enum status: [ :proposed, :written ], _prefix: true, _scopes: false
      enum cover: [ :hard, :soft ], _suffix: true, _default: :hard
    end
    ```

    After:

    ```ruby
    class Book < ActiveRecord::Base
      enum :status, [ :proposed, :written ], prefix: true, scopes: false
      enum :cover, [ :hard, :soft ], suffix: true, default: :hard
    end
    ```

    *Ryuta Kamizono*

*   Add `ActiveRecord::Relation#load_async`.

    This method schedules the query to be performed asynchronously from a thread pool.

    If the result is accessed before a background thread had the opportunity to perform
    the query, it will be performed in the foreground.

    This is useful for queries that can be performed long enough before their result will be
    needed, or for controllers which need to perform several independent queries.

    ```ruby
    def index
      @categories = Category.some_complex_scope.load_async
      @posts = Post.some_complex_scope.load_async
    end
    ```

    Active Record logs will also include timing info for the duration of how long
    the main thread had to wait to access the result. This timing is useful to know
    whether or not it's worth to load the query asynchronously.

    ```
    DEBUG -- :   Category Load (62.1ms)  SELECT * FROM `categories` LIMIT 50
    DEBUG -- :   ASYNC Post Load (64ms) (db time 126.1ms)  SELECT * FROM `posts` LIMIT 100
    ```

    The duration in the first set of parens is how long the main thread was blocked
    waiting for the results, and the second set of parens with "db time" is how long
    the entire query took to execute.

    *Jean Boussier*

*   Implemented `ActiveRecord::Relation#excluding` method.

    This method excludes the specified record (or collection of records) from
    the resulting relation:

    ```ruby
    Post.excluding(post)
    Post.excluding(post_one, post_two)
    ```

    Also works on associations:

    ```ruby
    post.comments.excluding(comment)
    post.comments.excluding(comment_one, comment_two)
    ```

    This is short-hand for `Post.where.not(id: post.id)` (for a single record)
    and `Post.where.not(id: [post_one.id, post_two.id])` (for a collection).

    *Glen Crawford*

*   Skip optimised #exist? query when #include? is called on a relation
    with a having clause.

    Relations that have aliased select values AND a having clause that
    references an aliased select value would generate an error when
    #include? was called, due to an optimisation that would generate
    call #exists? on the relation instead, which effectively alters
    the select values of the query (and thus removes the aliased select
    values), but leaves the having clause intact. Because the having
    clause is then referencing an aliased column that is no longer
    present in the simplified query, an ActiveRecord::InvalidStatement
    error was raised.

    A sample query affected by this problem:

    ```ruby
    Author.select('COUNT(*) as total_posts', 'authors.*')
          .joins(:posts)
          .group(:id)
          .having('total_posts > 2')
          .include?(Author.first)
    ```

    This change adds an addition check to the condition that skips the
    simplified #exists? query, which simply checks for the presence of
    a having clause.

    Fixes #41417.

    *Michael Smart*

*   Increment postgres prepared statement counter before making a prepared statement, so if the statement is aborted
    without Rails knowledge (e.g., if app gets killed during long-running query or due to Rack::Timeout), app won't end
    up in perpetual crash state for being inconsistent with PostgreSQL.

    *wbharding*, *Martin Tepper*

*   Add ability to apply `scoping` to `all_queries`.

    Some applications may want to use the `scoping` method but previously it only
    worked on certain types of queries. This change allows the `scoping` method to apply
    to all queries for a model in a block.

    ```ruby
    Post.where(blog_id: post.blog_id).scoping(all_queries: true) do
      post.update(title: "a post title") # adds `posts.blog_id = 1` to the query
    end
    ```

    *Eileen M. Uchitelle*

*   `ActiveRecord::Calculations.calculate` called with `:average`
    (aliased as `ActiveRecord::Calculations.average`) will now use column-based
    type casting. This means that floating-point number columns will now be
    aggregated as `Float` and decimal columns will be aggregated as `BigDecimal`.

    Integers are handled as a special case returning `BigDecimal` always
    (this was the case before already).

    ```ruby
    # With the following schema:
    create_table "measurements" do |t|
      t.float "temperature"
    end

    # Before:
    Measurement.average(:temperature).class
    # => BigDecimal

    # After:
    Measurement.average(:temperature).class
    # => Float
    ```

    Before this change, Rails just called `to_d` on average aggregates from the
    database adapter. This is not the case anymore. If you relied on that kind
    of magic, you now need to register your own `ActiveRecord::Type`
    (see `ActiveRecord::Attributes::ClassMethods` for documentation).

    *Josua Schmid*

*   PostgreSQL: introduce `ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.datetime_type`.

    This setting controls what native type Active Record should use when you call `datetime` in
    a migration or schema. It takes a symbol which must correspond to one of the configured
    `NATIVE_DATABASE_TYPES`. The default is `:timestamp`, meaning `t.datetime` in a migration
    will create a "timestamp without time zone" column. To use "timestamp with time zone",
    change this to `:timestamptz` in an initializer.

    You should run `bin/rails db:migrate` to rebuild your schema.rb if you change this.

    *Alex Ghiculescu*

*   PostgreSQL: handle `timestamp with time zone` columns correctly in `schema.rb`.

    Previously they dumped as `t.datetime :column_name`, now they dump as `t.timestamptz :column_name`,
    and are created as `timestamptz` columns when the schema is loaded.

    *Alex Ghiculescu*

*   Removing trailing whitespace when matching columns in
    `ActiveRecord::Sanitization.disallow_raw_sql!`.

    *Gannon McGibbon*, *Adrian Hirt*

*   Expose a way for applications to set a `primary_abstract_class`.

    Multiple database applications that use a primary abstract class that is not
    named `ApplicationRecord` can now set a specific class to be the `primary_abstract_class`.

    ```ruby
    class PrimaryApplicationRecord
      self.primary_abstract_class
    end
    ```

    When an application boots it automatically connects to the primary or first database in the
    database configuration file. In a multiple database application that then call `connects_to`
    needs to know that the default connection is the same as the `ApplicationRecord` connection.
    However, some applications have a differently named `ApplicationRecord`. This prevents Active
    Record from opening duplicate connections to the same database.

    *Eileen M. Uchitelle*, *John Crepezzi*

*   Support hash config for `structure_dump_flags` and `structure_load_flags` flags.
    Now that Active Record supports multiple databases configuration,
    we need a way to pass specific flags for dump/load databases since
    the options are not the same for different adapters.
    We can use in the original way:

    ```ruby
    ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags = ['--no-defaults', '--skip-add-drop-table']
    # or
    ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags = '--no-defaults --skip-add-drop-table'
    ```

    And also use it passing a hash, with one or more keys, where the key
    is the adapter

    ```ruby
    ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags = {
      mysql2: ['--no-defaults', '--skip-add-drop-table'],
      postgres: '--no-tablespaces'
    }
    ```

    *Gustavo Gonzalez*

*   Connection specification now passes the "url" key as a configuration for the
    adapter if the "url" protocol is "jdbc", "http", or "https". Previously only
    urls with the "jdbc" prefix were passed to the Active Record Adapter, others
    are assumed to be adapter specification urls.

    Fixes #41137.

    *Jonathan Bracy*

*   Allow to opt-out of `strict_loading` mode on a per-record base.

    This is useful when strict loading is enabled application wide or on a
    model level.

    ```ruby
    class User < ApplicationRecord
      has_many :bookmarks
      has_many :articles, strict_loading: true
    end

    user = User.first
    user.articles                        # => ActiveRecord::StrictLoadingViolationError
    user.bookmarks                       # => #<ActiveRecord::Associations::CollectionProxy>

    user.strict_loading!(true)           # => true
    user.bookmarks                       # => ActiveRecord::StrictLoadingViolationError

    user.strict_loading!(false)          # => false
    user.bookmarks                       # => #<ActiveRecord::Associations::CollectionProxy>
    user.articles.strict_loading!(false) # => #<ActiveRecord::Associations::CollectionProxy>
    ```

    *Ayrton De Craene*

*   Add `FinderMethods#sole` and `#find_sole_by` to find and assert the
    presence of exactly one record.

    Used when you need a single row, but also want to assert that there aren't
    multiple rows matching the condition; especially for when database
    constraints aren't enough or are impractical.

    ```ruby
    Product.where(["price = %?", price]).sole
    # => ActiveRecord::RecordNotFound      (if no Product with given price)
    # => #<Product ...>                    (if one Product with given price)
    # => ActiveRecord::SoleRecordExceeded  (if more than one Product with given price)

    user.api_keys.find_sole_by(key: key)
    # as above
    ```

    *Asherah Connor*

*   Makes `ActiveRecord::AttributeMethods::Query` respect the getter overrides defined in the model.

    Before:

    ```ruby
    class User
      def admin
        false # Overriding the getter to always return false
      end
    end

    user = User.first
    user.update(admin: true)

    user.admin # false (as expected, due to the getter overwrite)
    user.admin? # true (not expected, returned the DB column value)
    ```

    After this commit, `user.admin?` above returns false, as expected.

    Fixes #40771.

    *Felipe*

*   Allow delegated_type to be specified primary_key and foreign_key.

    Since delegated_type assumes that the foreign_key ends with `_id`,
    `singular_id` defined by it does not work when the foreign_key does
    not end with `id`. This change fixes it by taking into account
    `primary_key` and `foreign_key` in the options.

    *Ryota Egusa*

*   Expose an `invert_where` method that will invert all scope conditions.

    ```ruby
    class User
      scope :active, -> { where(accepted: true, locked: false) }
    end

    User.active
    # ... WHERE `accepted` = 1 AND `locked` = 0

    User.active.invert_where
    # ... WHERE NOT (`accepted` = 1 AND `locked` = 0)
    ```

    *Kevin Deisz*

*   Restore possibility of passing `false` to :polymorphic option of `belongs_to`.

    Previously, passing `false` would trigger the option validation logic
    to throw an error saying :polymorphic would not be a valid option.

    *glaszig*

*   Remove deprecated `database` kwarg from `connected_to`.

    *Eileen M. Uchitelle*, *John Crepezzi*

*   Allow adding nonnamed expression indexes to be revertible.

    Previously, the following code would raise an error, when executed while rolling back,
    and the index name should be specified explicitly. Now, the index name is inferred
    automatically.

    ```ruby
    add_index(:items, "to_tsvector('english', description)")
    ```

    Fixes #40732.

    *fatkodima*

*   Only warn about negative enums if a positive form that would cause conflicts exists.

    Fixes #39065.

    *Alex Ghiculescu*

*   Add option to run `default_scope` on all queries.

    Previously, a `default_scope` would only run on select or insert queries. In some cases, like non-Rails tenant sharding solutions, it may be desirable to run `default_scope` on all queries in order to ensure queries are including a foreign key for the shard (i.e. `blog_id`).

    Now applications can add an option to run on all queries including select, insert, delete, and update by adding an `all_queries` option to the default scope definition.

    ```ruby
    class Article < ApplicationRecord
      default_scope -> { where(blog_id: Current.blog.id) }, all_queries: true
    end
    ```

    *Eileen M. Uchitelle*

*   Add `where.associated` to check for the presence of an association.

    ```ruby
    # Before:
    account.users.joins(:contact).where.not(contact_id: nil)

    # After:
    account.users.where.associated(:contact)
    ```

    Also mirrors `where.missing`.

    *Kasper Timm Hansen*

*   Allow constructors (`build_association` and `create_association`) on
    `has_one :through` associations.

    *Santiago Perez Perret*

Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activerecord/CHANGELOG.md) for previous changes.

license: MIT,Ruby

repository: NARKOZ/rails

detected_licenses: MIT Ruby

repo_name: NARKOZ/rails


text:
# php-node-adx-bootstrap
Simple administrative dashboard for php-node.

## Installation
1. Merge directories in `.private` with php-node repo.
2. Place `adx-bootstrap` into web root directory.
3. Run the `schema.sql` to add sample user forms.
4. Optionally, create a user with group name `Administrators` to work with.

## Usage
1. Navigate into `/adx-bootstrap/` from your server.
2. Login with a user containing `Administrators` user group.
3. Accessible forms will appear inside the main menu in the top left corner.
4. Create forms in `::User Forms` page, manage users in `::Users` page.

repository: Victopia/php-node-adx-bootstrap

gha_language: JavaScript

repo_name: Victopia/php-node-adx-bootstrap


text:
# nodal-angular

Welcome to the Angular SPA plugin for [Nodal](https://github.com/keithwhor/nodal)!

This module contains some simple CLI tools for working with a new Angular project,
as well as an initializer that compiles your Angular SPA for you.

## Installation

Installation is simple.

1. Begin a new Nodal project with `nodal new`
2. In your new project directory, type `npm install nodal-angular --save`
3. Now type `nodal-angular init`
4. Next, go to `app/app.js` and find the following line:

```javascript
/* Import Initializers */
const StaticAssetInitializer = Nodal.require('initializers/static_asset_initializer.js');
```

Add the following line:

```javascript
const AngularInitializer = require('nodal-angular').Initializer;
```

5. In the same file, find:

```javascript
/* Initializers */
this.initializers.use(StaticAssetInitializer);
```

And change it to:

```javascript
/* Initializers */
this.initializers.use(AngularInitializer);
this.initializers.use(StaticAssetInitializer);
```

Make sure you assign your AngularInitializer *first*! It copies files to be
served by your StaticAssetInitializer.

All Done!

repository: keithwhor/nodal-angular

repo_name: keithwhor/nodal-angular


text:
+++
title = "How to boot with Thunderbolt 3 support"

date = 2018-09-25T22:58:00
lastmod = 2018-09-25T22:58:00
draft = false

# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
authors = ["Peter Rong"]

tags = ["Linux", "Geek", "HowTo"]
summary = "Some maneuvers to boot with Thunderbolt 3 support"

+++

Starting from ThinkPad T470, there is a [Thunderbolt](https://en.wikipedia.org/wiki/Thunderbolt_(interface)) 3 port to the left of the machine.
I didn't have the chance to use it until I got a Thunderbolt Adapter from Bytedance to help me use my MacBook.
 That doesn't sound convenient at all!)
The adapter came with an HDMI port, USB3.0 Type A and a USB3.0 Type C.
With the adapter, I connected my Dell Screen to it.
What many people don't know is that Dell Screens usually comes with a USB Hub inside.
So I connected the Hub to the adapter too.
Then the problem came: When booting, my screen works once grub starts up, yet my keyboard won't, which is connected to screen and then connects to the adapter and to my computer through TB3.

First, something you should know:

Thunderbolt 3 has different security modes to protect your device.
The modes are:

* none (or legacy): just accept any device plugged in
* user: user needs to authenticate the device
* secure: same as user but with an additional random key to automatically recognize the device the next time you plug in
* dponly: only allow for the DisplayPort functionality, nothing else

TB3 will allow display upon startup, this requires low-security clearance.
But other devices like keyboard cannot.
Since TB3 directly connects to your PCIe and an attacker can use an external device to interact with your device through TB3 even if your device is locked.
In this case, the external malicious device can be my keyboard, my poor TP has no way to know.
Hence, It is not safe to turn your TB3 to none safety mode.
And such mode is likely to be removed in the future.

So here is the fix.

Fire up your laptop and go into [BIOS](https://en.wikipedia.org/wiki/BIOS).
I will not talk about how to do that, you figure it out yourself!
For ThinkPad users, go Config -> Thunderbolt(TM) 3.
Here I set Security level to Secure Connection.
In _Support in Pre Boot Environment_ I disabled Thunderbolt(TM) device but leave USB device on so my keyboard can start up.
Regarding _Wake by Thunderbolt(TM)3_, the description is:
"Enable or disable Wake Feature with Thunderbolt(TM) 3 Port. If you select Enabled, the
battery life during low power state may become shorter."
I couldn't find anything about this feature but [this post](http://thinkdeploy.blogspot.com/2017/02/new-ThinkPad-bios-settings-for.html) which basically repeats the BIOS description verbatim.
But for the sake of my battery, I disabled it anyway.

## Reference
[Thunderbolt (interface)](https://en.wikipedia.org/wiki/Thunderbolt_(interface))
[ThunderBolt Security Levels and Linux desktop](https://eischmann.wordpress.com/2017/06/29/thunderbolt-security-levels-and-linux-desktop/)
[Introducing bolt: Thunderbolt 3 security levels for GNU/Linux](https://christian.kellner.me/2017/12/14/introducing-bolt-thunderbolt-3-security-levels-for-gnulinux/)
[New ThinkPad BIOS Settings for Thunderbolt 3](http://thinkdeploy.blogspot.com/2017/02/new-thinkpad-bios-settings-for.html)

repository: DataCorrupted/peter-site

gha_language: Shell

repo_name: DataCorrupted/peter-site


text:
[Jenkins docker image](https://hub.docker.com/r/devildominator/jenkins_with_android/) configured for Android development.

## Pull the Docker image
```
$ docker pull devildominator/jenkins_with_android
```

## Run the Docker image
```
$ docker run -p 8080:8080 devildominator/jenkins_with_android
```

repository: devildominator/docker-images

repo_name: devildominator/docker-images


text:
### [CVE-2017-4918](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-4918)
![](https://img.shields.io/static/v1?label=Product&message=Horizon%20View%20Client%20for%20Mac&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Command%20injection%20vulnerability&color=brighgreen)

### Description

VMware Horizon View Client (2.x, 3.x and 4.x prior to 4.5.0) contains a command injection vulnerability in the service startup script. Successful exploitation of this issue may allow unprivileged users to escalate their privileges to root on the Mac OSX system where the client is installed.

### POC

#### Reference
- https://www.vmware.com/security/advisories/VMSA-2017-0011.html

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/lnick2023/nicenice
- https://github.com/qazbnm456/awesome-cve-poc
- https://github.com/xbl3/awesome-cve-poc_qazbnm456


text:
# Config environment loader

[![Build Status](https://travis-ci.com/opxcore/config-environment.svg?branch=master)](https://travis-ci.com/opxcore/config-environment)
[![Coverage Status](https://coveralls.io/repos/github/opxcore/config-environment/badge.svg?branch=master)](https://coveralls.io/github/opxcore/config-environment?branch=master)
[![Latest Stable Version](https://poser.pugx.org/opxcore/config-environment/v/stable)](https://packagist.org/packages/opxcore/config-environment)
[![Total Downloads](https://poser.pugx.org/opxcore/config-environment/downloads)](https://packagist.org/packages/opxcore/config-environment)
[![License](https://poser.pugx.org/opxcore/config-environment/license)](https://packagist.org/packages/opxcore/config-environment)

## Installing

```
composer require opxcore/config-environment
```

## Important notice

All environment variables are stored in static property so any instance of environment would have access to the same set
of environment variables.

## Usage

```php
use OpxCore\Config\Environment;

$environment = new Environment($path);
```

where `$path` is directory where environment file is placed.

### Loading environment

To load environment variables from file call `$environment->load($filename)`, where `$filename` is a name of file. **All
variables would be stored locally, not affecting any of $_ENV, $_SERVER and so on**.

Additional arguments is `load($filename, $safe, $silent)`. If `$safe` is set to `true` variables would not be
overwritten if they are already present. If `$silent` is set to `true` no exceptions would be thrown. Function
returns `true` if environment file wss processed successfully, `false` in case of any errors.

### Reading environment variables

`$environment->get($key, $default)` returns environment variable if it set, otherwise returns value assigned to default
or return value of callable passed to as default.

`$environment->has($key)` returns `true` is environment variable set, `false` otherwise.

### Manipulations

`$environment->set($key, $value, $safe)` sets value to environment. If `$safe` is set to `true` variables would not be
overwritten if they are already present. Passed values of string type it would be parsed (see below), others would be
set as is.

`$environment->unset($key)` removes variable from environment.

## Format

Each line of environment must contain one value, consisting of variable name and its value separated by `=` sign. Other
words, part of line before `=` sign would be used as variable name, another part would be value of variable.

For example:

```dotenv
APP_NAME=My awesome application
```

Each value would be parsed according next rules:

### String

Each quoted value would be converted to unquoted strings.

```dotenv
DB_CONNECTION="mysql"
DB_HOST="<IP_ADDRESS>"
```

Result of `$environment->get('DB_HOST')` would be `'<IP_ADDRESS>'`.

### Boolean

If value is `true` or `false` it would be converted to `boolean` type.

```dotenv
CACHE_ENABLE=true
304_RESPONSE=false
```

### Null

Null values would set to `null`

```dotenv
CACHE_DRIVER=null
```

### Array

Arrays must start with `[` and ends with `]`. Items must be separated by commas. Each item would be parsed according
this rules. **Nested arrays are not supported**.

```dotenv
BROADCAST_DRIVER=[log,telegram]
```

### Numbers

If value represents any of number format it would be converted to integer or float.

```dotenv
COUNT=42
MULTIPLIER=1.05
FLOAT=0.15E-10
```

If parser would not recognise type of value, original string would be returned.

```dotenv
APP_KEY=base64:0vqkPYSbwPm3MOzdxQJ76Ps6pouZRjN5xPx3b+dm628=
```

Result of `$environment->get('APP_KEY')` would be `'base64:0vqkPYSbwPm3MOzdxQJ76Ps6pouZRjN5xPx3b+dm628='`.

repository: opxcore/config-environment

repo_name: opxcore/config-environment


text:
# Surf Data

# Unsurfable Conditions
Un-Surfable Wind Directions
- wind Directions: SW, S or W, NW above 15knots
- swell < 1.5m

# willy Weather API to use

 Search by location Query

Forcasts - Sunrise/ Sunset
- firstlightdatetime
- lastlightdatetime

Forcasts - Swell
- dateTime, directionText, Height, Period
* need to use this data through different times during the day.

Forcasts - Wind
- datetime, directionText, speed,
* need to use this data through different times during the day.

Forcasts - Tide
- datetime, type
* need to use this data through different times during the day.

# Places to surf when the swell is small above 1.6m

   Scaborough
   Wind
   - Optimal wind direction = SE, E
   - Optimal wind strength = < 11knots
   Swell: > 1.7m < 2.3m
   - minimum swell required = 1.7m
   - max surfable swell = 2.4m
   - Swell direction = W, SW, N
   Tide: Low
   Diffuclty: Beginner

   Trigg Point
   Wind
   - Optimal wind direction = SE, E
   - Optimal wind strength = < 12knots
   Swell
   - minimal swell required = > 1m
   - max surfable swell = < 2.5m
   Swell Direction: W, SW, N
   Tide:
   - low tide
   Difficulty: Intermediate

   Cottesloe Reef
   Wind
   - Optimal wind direction = SE, E
   - Optimal wind strength = < 15knots
    Swell:
    - minimal swell required = > 1.5m
    - max swell required = < 2.5m
    - swell direction, W, SW, N
    Tide: high
    Difficulty: Beginner

    Secret Harbour
    Wind
    - Optimal wind direction = SE, E
    - Optimal wind strength = < 10knts
    Swell:
   - minimum swell required > 1.8m
   - max swell required < 2.2m
    Swell Direction: S, SW, N
    Tide: low
    Difficulty: Intermediate

    Lancelin (Back Beach)
    Wind
   - Optimal wind direction = SE, E
   - Optimal wind strength = < 10knts
    Swell
    - Minimum Swell Required > 1.6m
    - Maximum Swell < 2M
    Swell Direction: S, SW, N
    Tide: low
    Difficutly: Beginner

    Alkimos
    Wind
    - Optimal wind direction = SE, E
    - Optimal wind strength = < 10knts
    Swell
    - Minimum Swell Required > 1.6m
    - Maximum Sweel required < 2m
    Swell Direction: S, SW, N
    Tide: high
    Difficulty: Advanced

    Mettams (Trigg on willyweather )
    Wind
    - Optimal wind direction = SE, E
    - Optimal wind strength = < 10knts
   Swell
    Minimum Swell Required > 1.8m
    Maximum Swell < 2.6m
    Swell Direction: S, SW, N
    Tide: high
    Difficulty: intermediate

 # Where surf when the swell is big  Above 2m

   Rottnest Island (Stricklands-Bay)
   Wind
   - Optimal wind direction = N, NE
   - Optimal wind strength = < 20knts
   Swell
   minimum swell required > 2m
   Max swel < 3m
   Tide: high
   difficulty: Advanced

   Cottesloe MainBreak
   Wind
   - Optimal wind direction = S, E, SE
   - Optimal wind strength = < 12knts
   Swell
   minimum swell required > 2m
   Max swel < 5m
   Tide: Low
   difficulty: Intermediate

   Leighton
   Wind
   - Optimal wind direction = E
   - Optimal wind strength = < 12knots
   Swell
   minimum swell required > 2m
   Max swell < 3m
   Tide: low
   Difficulty: Beginner

  Cables Artificial Reef
   Wind
   - Optimal wind direction = SE, E
   - Optimal wind strength = < 15knots
   Swell
   minimum swell required > 2.5m
   Max swel < 6m
   Tide: High
   Difficulty: Advanced

  # Where to surf in Bad Weather Conditions

   Sandtrax
   Wind Direction SW, W, S
   Wind Strength < 25knt
   Swell < 3m and above
   Swell Direction < W, SW, SSW, N
   Tide: Low
   Difficulty: Beginner

   Cottesloe MainBreak

   Wind Direction SW, W, S
   Wind Strength < 25knt
   Swell < 3m and above
   Swell Direction < W, SW, SSW, N
   Tide: Low
   Difficulty: Advanced

path: /Project documents/Data.md