text:
# KEP-1847: Auto delete PVCs created by StatefulSet

- [Release Signoff Checklist](#release-signoff-checklist)
- [Summary](#summary)
- [Motivation](#motivation)
  - [Goals](#goals)
  - [Non-Goals](#non-goals)
- [Proposal](#proposal)
  - [Background](#background)
  - [Changes required](#changes-required)
  - [User Stories](#user-stories)
    - [Story 0](#story-0)
    - [Story 1](#story-1)
    - [Story 2](#story-2)
    - [Story 3](#story-3)
  - [Notes/Constraints/Caveats (optional)](#notesconstraintscaveats-optional)
  - [Risks and Mitigations](#risks-and-mitigations)
- [Design Details](#design-details)
  - [Objects Associated with the StatefulSet](#objects-associated-with-the-statefulset)
  - [Volume delete policy for the StatefulSet created PVCs](#volume-delete-policy-for-the-statefulset-created-pvcs)
    - [whenScaled policy of Delete.](#-policy-of-)
    - [whenDeleted policy of Delete.](#-policy-of--1)
    - [Non-Cascading Deletion](#non-cascading-deletion)
    - [Mutating PersistentVolumeClaimRetentionPolicy](#mutating-)
  - [Cluster role change for statefulset controller](#cluster-role-change-for-statefulset-controller)
  - [Test Plan](#test-plan)
    - [Unit tests](#unit-tests)
      - [Integration tests](#integration-tests)
      - [E2E tests](#e2e-tests)
      - [Upgrade/downgrade & feature enabled/disable tests](#upgradedowngrade--feature-enableddisable-tests)
  - [Graduation Criteria](#graduation-criteria)
    - [Alpha release](#alpha-release)
    - [Beta release](#beta-release)
    - [GA release](#ga-release)
  - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
  - [Version Skew Strategy](#version-skew-strategy)
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
  - [Feature Enablement and Rollback](#feature-enablement-and-rollback)
      - [How can this feature be enabled / disabled in a live cluster?](#how-can-this-feature-be-enabled--disabled-in-a-live-cluster)
      - [Does enabling the feature change any default behavior?](#does-enabling-the-feature-change-any-default-behavior)
      - [Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?](#can-the-feature-be-disabled-once-it-has-been-enabled-ie-can-we-roll-back-the-enablement)
      - [What happens if we reenable the feature if it was previously rolled back?](#what-happens-if-we-reenable-the-feature-if-it-was-previously-rolled-back)
      - [Are there any tests for feature enablement/disablement?](#are-there-any-tests-for-feature-enablementdisablement)
  - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
      - [How can a rollout fail? Can it impact already running workloads?](#how-can-a-rollout-fail-can-it-impact-already-running-workloads)
      - [What specific metrics should inform a rollback?](#what-specific-metrics-should-inform-a-rollback)
      - [Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?](#were-upgrade-and-rollback-tested-was-the-upgrade-downgrade-upgrade-path-tested)
      - [Is the rollout accompanied by any deprecations and/or removals of features, APIs,](#is-the-rollout-accompanied-by-any-deprecations-andor-removals-of-features-apis)
  - [Monitoring Requirements](#monitoring-requirements)
      - [How can an operator determine if the feature is in use by workloads?](#how-can-an-operator-determine-if-the-feature-is-in-use-by-workloads)
      - [What are the SLIs (Service Level Indicators) an operator can use to determine](#what-are-the-slis-service-level-indicators-an-operator-can-use-to-determine)
      - [What are the reasonable SLOs (Service Level Objectives) for the above SLIs?](#what-are-the-reasonable-slos-service-level-objectives-for-the-above-slis)
      - [Are there any missing metrics that would be useful to have to improve observability](#are-there-any-missing-metrics-that-would-be-useful-to-have-to-improve-observability)
  - [Dependencies](#dependencies)
      - [Does this feature depend on any specific services running in the cluster?](#does-this-feature-depend-on-any-specific-services-running-in-the-cluster)
  - [Scalability](#scalability)
      - [Will enabling / using this feature result in any new API calls?](#will-enabling--using-this-feature-result-in-any-new-api-calls)
      - [Will enabling / using this feature result in introducing new API types?](#will-enabling--using-this-feature-result-in-introducing-new-api-types)
      - [Will enabling / using this feature result in any new calls to the cloud provider?](#will-enabling--using-this-feature-result-in-any-new-calls-to-the-cloud-provider)
      - [Will enabling / using this feature result in increasing size or count of the existing API objects?](#will-enabling--using-this-feature-result-in-increasing-size-or-count-of-the-existing-api-objects)
      - [Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?](#will-enabling--using-this-feature-result-in-increasing-time-taken-by-any-operations-covered-by-existing-slisslos)
      - [Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?](#will-enabling--using-this-feature-result-in-non-negligible-increase-of-resource-usage-cpu-ram-disk-io--in-any-components)
  - [Troubleshooting](#troubleshooting)
      - [How does this feature react if the API server and/or etcd is unavailable?](#how-does-this-feature-react-if-the-api-server-andor-etcd-is-unavailable)
      - [What are other known failure modes?](#what-are-other-known-failure-modes)
      - [What steps should be taken if SLOs are not being met to determine the problem?](#what-steps-should-be-taken-if-slos-are-not-being-met-to-determine-the-problem)
- [Implementation History](#implementation-history)
- [Drawbacks](#drawbacks)
- [Alternatives](#alternatives)

## Release Signoff Checklist

Items marked with (R) are required *prior to targeting to a milestone / release*.

- [X] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
- [X] (R) KEP approvers have approved the KEP status as `implementable`
- [X] (R) Design details are appropriately documented
- [X] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
  - [X] e2e Tests for all Beta API Operations (endpoints)
  - [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
- [X] (R) Graduation criteria is in place
- [X] (R) Production readiness review completed
- [X] (R) Production readiness review approved
  - [X] "Implementation History" section is up-to-date for milestone
- [X] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
- [ ] Supporting documentation e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes

[kubernetes.io]: https://kubernetes.io/
[kubernetes/enhancements]: https://git.k8s.io/enhancements
[kubernetes/kubernetes]: https://git.k8s.io/kubernetes
[kubernetes/website]: https://git.k8s.io/website

## Summary
The proposal is to add a feature to autodelete the PVCs created by StatefulSet.

## Motivation

Currently, the PVCs created automatically by the StatefulSet are not deleted when
the StatefulSet is deleted. As can be seen by the discussion in the issue
[55045](https://github.com/kubernetes/kubernetes/issues/55045) there are several use
cases where the PVCs which are automatically created are deleted as well. In many
StatefulSet use cases, PVCs have a different lifecycle than the pods of the
StatefulSet, and should not be deleted at the same time. Because of this, PVC
deletion will be opt-in for users.

### Goals

Provide a feature to auto delete the PVCs created by StatefulSet when the volumes are no
longer in use to ease management of StatefulSets that don't live indefinitely. As
application state should survive over StatefulSet maintenance, the feature ensures that
the pod restarts due to non scale down events such as rolling update or node drain do not
delete the PVC.

### Non-Goals

This proposal does not plan to address how the underlying PVs are treated on PVC deletion.
That functionality will continue to be governed by the reclaim policy of the storage class.

## Proposal

### Background

The `garbagecollector` controller is responsible for ensuring that when a StatefulSet
is deleted, the corresponding pods spawned from the StatefulSet are deleted as well.  The
`garbagecollector` uses an `OwnerReference` added to the `Pod` by the StatefulSet
controller to delete the Pod. This proposal leverages a similar mechanism to automatically
delete the PVCs created by the controller from the StatefulSet's VolumeClaimTemplate.

### Changes required

The following changes are required:

1. Add `persistentVolumeClaimRetentionPolicy` to the StatefulSet spec with the following fields.
   * `whenDeleted` - specifies if the VolumeClaimTemplate PVCs are deleted when
     their StatefulSet is deleted.
   * `whenScaled` - specifies if VolumeClaimTemplate PVCs are deleted when
     their corresponding pod is deleted on a StatefulSet scale-down, that is,
     when the number of pods in a StatefulSet is reduced via the Replicas field.

   These fields may be set to the following values.
   * `Retain` - the default policy, which is also used when no policy is
      specified. This specifies the existing behavior: when a StatefulSet is
      deleted or scaled down, no action is taken with respect to the PVCs
      created by the StatefulSet.
   * `Delete` - specifies that the appropriate PVCs as described above will be
      deleted in the corresponding scenario, either on StatefulSet deletion or scale-down.
2. Add `patch` to the statefulset controller rbac cluster role for `persistentvolumeclaims`.

### User Stories

#### Story 0
The user is happy with legacy behavior of a stateful set. They leave all fields
of `PersistentVolumeClaimRetentionPolicy` to `Retain`. Nothing traditional
StatefulSet behavior changes neither on set deletion nor on scale-down.

#### Story 1
The user is running a StatefulSet as part of an application with a finite lifetime. During
the application's existence the StatefulSet maintains per-pod state, even across scale-up
and scale-down. In order to maximize performance, volumes are retained during scale-down
so that scale-up can leverage the existing volumes. When the application is finished, the
volumes created by the StatefulSet are no longer needed and can be automatically
reclaimed.

The user would set `persistentVolumeClaimRetentionPolicy.whenDeleted` to `Delete, which
would ensure that the PVCs created automatically during the StatefulSet
activation is deleted once the StatefulSet is deleted.

#### Story 2
The user is cost conscious, and can sustain slower scale-up speeds even after a
scale-down, because scaling events are rare, and volume data can be
reconstructed, albeit slowly, during a scale up. However, it is necessary to
bring down the StatefulSet temporarily by deleting it, and then bring it back up
by reusing the volumes. This is accomplished by setting
`persistentVolumeClaimRetentionPolicy.whenScaled` to `Delete`, and leaving
`persistentVolumeClaimRetentionPolicy.whenDeleted` at `Retain`.

#### Story 3
User is very cost conscious, and can sustain slower scale-up speeds even after a
scale-down. The user does not want to pay for volumes that are not in use in any
circumstance, and so wants them to be reclaimed as soon as possible. On scale-up
a new volume will be provisioned and the new pod will have to
re-intitialize. However, for short-lived interruptions when a pod is killed &
recreated, like a rolling update or node disruptions, the data on volumes is
persisted. This is a key property that ephemeral storage, like emptyDir, cannot
provide.

User would set the `persistentVolumeClaimRetentionPolicy.whenScaled` as well as
`persistentVolumeClaimRetentionPolicy.whenDeleted` to `Delete`, ensuring PVCs are
deleted when corresponding Pods are deleted. New Pods created during scale-up
followed by a scale-down will wait for freshly created PVCs. PVCs are deleted as
well when the set is deleted, reclaiming volumes as quickly as possible and
minimizing expense.

### Notes/Constraints/Caveats (optional)

This feature applies to PVCs which are defined by the volumeClaimTemplate of a
StatefulSet. Any PVC and PV provisioned from this mechanism will function with
this feature. These PVCs are identified by the static naming scheme used by
StatefulSets. Auto-provisioned and pre-provisioned PVCs will be treated
identically, so that if a user pre-provisions a PVC matching those of a
VolumeClaimTemplate it will be deleted according to the deletion policy.

### Risks and Mitigations

Currently the PVCs created by StatefulSet are not deleted automatically. Using
`whenScaled` or `whenDeleted` set to `Delete` would delete the PVCs
automatically. Since this involves persistent data being deleted, users should
take appropriate care using this feature. Having the `Retain` behavior as
default will ensure that the PVCs remain intact by default and only a conscious
choice made by user will involve any persistent data being deleted.

This proposed API causes the PVCs associated with the StatefulSet to have
behavior close to, but not the same as, ephemeral volumes, such as emptyDir or
generic ephemeral volumes. This may cause user confusion. PVCs under this policy
will more durable than ephemeral volumes would be, as they are only deleted on
scale-down or StatefulSet deletion, and not on other pod deletion and recreation
events eviction or the death of their node.

User documentation will emphasize the race conditions associated with changing
policy or rolling back the feature concurrently with StatefulSet deletion or
scale-down. See below in [Design Detils](#design-details) for more information.

## Design Details

### Objects Associated with the StatefulSet

When a StatefulSet spec has a `VolumeClaimTemplate`, PVCs are dynamically created using a
static naming scheme, and each Pod is created with a claim to the corresponding PVC. These
are the precise PVCs meant when referring to the volume or PVC for Pod below, and these
are the only PVCs modified with an ownerRef. Other PVCs referenced by the StatefulSet Pod
template are not affected by this behavior.

OwnerReferences are used to manage PVC deletion. All such references used for
this feature will set the controller field to the StatefulSet. This will be used
to distinguish references added by the controller from, for example,
user-created owner references. When ownerRefs is removed, it is understood that
only those ownerRefs whose controller field matches the StatefulSet in question
are affected.

### Volume delete policy for the StatefulSet created PVCs

A new field named `PersistentVolumeClaimRetentionPolicy` of the type
`StatefulSetPersistentVolumeClaimRetentionPolicy` will be added to the StatefulSet. This
will represent the user indication for which circumstances the associated PVCs
can be automatically deleted or not, as described above. The default policy
would be to retain PVCs in all cases.

The `PersistentVolumeClaimRetentionPolicy` object will be mutable. The deletion
mechanism will be based on reconciliation, so as long as the field is changed
far from StatefulSet deletion or scale-down, the policy will work as
expected. Mutability does introduce race conditions if it is changed while a
StatefulSet is being deleted or scaled down and may result in PVCs not being
deleted as expected when the policy is being changed from `Retain`, and PVCs
being deleted unexpectedly when the policy is being changed to `Retain`. PVCs
will be reconciled before a scale-down or deletion to reduce this race as much
as possible, although it will still occur. The former case can be mitigated by
manually deleting PVCs. The latter case will result in lost data, but only in
PVCs that were originally declared to have been deleted. Life does not always
have an undo button.

#### `whenScaled` policy of `Delete`.

If `persistentVolumeClaimRetentionPolicy.whenScaled` is set to `Delete`, the Pod will be
set as the owner of the PVCs created from the `VolumeClaimTemplates` just before
the scale-down is performed by the StatefulSet controller.  When a Pod is
deleted, the PVC owned by the Pod is also deleted.

The current StatefulSet controller implementation ensures that the manually deleted pods
are restored before the scale-down logic is run. This combined with the fact that the
owner references are set only before the scale-down will ensure that manual deletions do
not automatically delete the PVCs in question.

During scale-up, if a PVC has an OwnerRef that does not match the Pod, it indicates that
the PVC was referred to by the deleted Pod and is in the process of getting
deleted. The controller will skip the reconcile loop until PVC deletion finishes, avoiding
a race condition.

#### `whenDeleted` policy of `Delete`.

When `persistentVolumeClaimRetentionPolicy.whenDeleted` is set to `Delete`, when a
VolumeClaimTemplate PVC is created, an owner reference in PVC will be added to
point to the StatefulSet. When a scale-up or scale-down occurs, the PVC is
unchanged.  PVCs previously in use before scale-down will be used again when the
scale-up occurs.

In the existing StatefulSet reconcile loop, the associated VolumeClaimTemplate
PVCs will be checked to see if the ownerRef is correct according to the
`persistentVolumeClaimRetentionPolicy` and updated accordingly. This includes PVCs
that have been manually provisioned. It will be most consistent and easy
to reason about if all VolumeClaimTemplate PVCs are treated uniformly rather
than trying to guess at their provenance.

When the StatefulSet is deleted, these PVCs will also be deleted, but only after
the Pod gets deleted. Since the Pod StatefulSet ownership has
`blockOwnerDeletion` set to `true`, pods will get deleted before the StatefulSet
is deleted. The `blockOwnerDeletion` for PVCs will be set to `false` which
ensures that PVC deletion happens only after the StatefulSet is deleted. This is
necessary because of PVC protection which does not allow PVC deletion until all
pods referencing it are deleted.

The deletion policies may be combined in order to get the delete behavior both
on set deletion as well as scale-down.

#### Non-Cascading Deletion

When StatefulSet is deleted without cascading, eg `kubectl delete --cascade=false`, then
existing behavior is retained and no PVC will be deleted. Only the StatefulSet resource
will be affected.

#### Mutating `PersistentVolumeClaimRetentionPolicy`

Recall that as defined above, the PVCs associated with a StatefulSet are found
by the StatefulSet volumeClaimTemplate static naming scheme. The Pods associated
with the StatefulSet can be found by their controllerRef.

* **From a deletion policy to `Retain`**

When mutating any delete policy to retain, the PVC ownerRefs to the
StatefulSet are removed. If a scale-down is in progress, each remaining PVC
ownerRef to its pod is removed, by matching the index of the PVC to the Pod
index.

* **From `Retain` to a deletion policy**

When mutating from the `Retain` policy to a deletion policy, the StatefulSet
PVCs are updated with an ownerRef to the StatefulSet. If a scale-down is in
process, remaining PVCs are given an ownerRef to their Pod (by index, as above).

### Cluster role change for statefulset controller

In order to update the PVC ownerReference, the `buildControllerRoles` will be updated with
`patch` on PVC resource.

### Test Plan

[X] I/we understand the owners of the involved components may require updates to
existing tests to make this code solid enough prior to committing the changes necessary
to implement this enhancement.

#### Unit tests

- `k8s.io/kubernetes/pkg/controller/statefulset`: `2022-06-15`: `85.5%`
- `k8s.io/kubernetes/pkg/registry/apps/statefulset`: `2022-06-15`: `68.4%`
- `k8s.io/kubernetes/pkg/registry/apps/statefulset/storage`: `2022-06-15`: `64%`

##### Integration tests

- `test/integration/statefulset`: `2022-09-21`: These do not appear to be
  running in a job visible to the triage dashboard, see for example a search
  for the previously existing [TestStatefulSetStatusWithPodFail](https://storage.googleapis.com/k8s-triage/index.html?test=TestStatefulSetStatusWithPodFail).

Added `TestAutodeleteOwnerRefs` to `k8s.io/kubernetes/test/integration/statefulset`.

##### E2E tests

- `[gci-gce-statefulset](https://testgrid.k8s.io/google-gce#gci-gce-statefulset)`: `2022-09-21`: `0 Failures`
  - Note that as this KEP is behind the `StatefulSetAutoDeletePVC` feature gate,
    tests for this KEP are not being run.

Added `Feature:StatefulSetAutoDeletePVC` tests to `k8s.io/kubernetes/test/e2e/apps/`.

##### Upgrade/downgrade & feature enabled/disable tests

Should be added as an e2e tests, but we have not figured out if there is a
mechanism to run upgrade/downgrade tests.

    1. Create statefulset in previous version and upgrade to the version
       supporting this feature. The PVCs should remain intact.
    2. Downgrade to earlier version and check the PVCs with Retain
       remain intact and the others with set policies before upgrade
       gets deleted based on if the references were already set.

### Graduation Criteria

#### Alpha release
- (Done) Complete adding the items in the 'Changes required' section.
- (Done) Add unit, functional, upgrade and downgrade tests to automated k8s test.

#### Beta release
- (Done) Enable feature gate for e2e pipelines

#### GA release
- Validate with customer workloads

### Upgrade / Downgrade Strategy

This features adds a new field to the StatefulSet. The default value for the new field
maintains the existing behavior of StatefulSets.

On a downgrade, the `PersistentVolumeClaimRetentionPolicy` field will be hidden on
any StatefulSets. The behavior in this case will be identical to mutating they
policy field to `Retain`, as described above, including the edge cases
introduced if this is done during a scale-down or StatefulSet deletion.

### Version Skew Strategy
There are only kube-controller-manager changes involved (in addition to the
apiserver changes for dealing with the new StatefulSet field). Node components
are not involved so there is no version skew between nodes and the control plane.

## Production Readiness Review Questionnaire

### Feature Enablement and Rollback

##### How can this feature be enabled / disabled in a live cluster?
  - [x] Feature gate (also fill in values in `kep.yaml`)
    - Feature gate name: StatefulSetAutoDeletePVC
    - Components depending on the feature gate
      - kube-controller-manager, which orchestrates the volume deletion.
      - kube-apiserver, to manage the new policy field in the StatefulSet
        resource (eg dropDisabledFields).

##### Does enabling the feature change any default behavior?
  No. What happens during StatefulSet deletion differs from current behavior
  only when the user explicitly specifies the
  `PersistentVolumeClaimDeletePolicy`.  Hence no change in any user visible
  behavior change by default.

##### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
  Yes. Disabling the feature gate will cause the new field to be ignored. If the feature
  gate is re-enabled, the new behavior will start working.

  When the `PersistentVolumeClaimRetentionPolicy` has `WhenDeleted` set to
 `Delete`, then VolumeClaimTemplate PVCs ownerRefs must be removed.

  There are new corner cases here. For example, if a StatefulSet deletion is in
  process when the feature is disabled or enabled, the appropriate ownerRefs
  will not have been added and PVCs may not be deleted. The exact behavior will
  be discovered during feature testing. In any case the mitigation will be to
  manually delete any PVCs.

##### What happens if we reenable the feature if it was previously rolled back?
  In the simple case of reenabling the feature without concurrent StatefulSet
  deletion or scale-down, nothing needs to be done when the deletion policy has
  `whenScaled` set to `Delete`. When the policy has `whenDeleted` set to `Delete`, the
  VolumeClaimTemplate PVC ownerRefs must be set to the StatefulSet.

  As above, if there is a concurrent scale-down or StatefulSet deletion, more
  care needs to be taken. This will be detailed further during feature testing.

##### Are there any tests for feature enablement/disablement?
  Feature enablement and disablement tests will be added, including for
  StatefulSet behavior during transitions in conjunction with scale-down or
  deletion.

### Rollout, Upgrade and Rollback Planning

##### How can a rollout fail? Can it impact already running workloads?
  If there is a control plane update which disables the feature while a stateful
  set is in the process of being deleted or scaled down, it is undefined which
  PVCs will be deleted. Before the update, PVCs will be marked for deletion;
  until the updated controller has a chance to reconcile some PVCs may be
  garbage collected before the controller has a chance to remove any owner
  references. We do not think this is a true failure, as it should be clear to
  an operator that there is an essential race condition when a cluster update
  happens during a stateful set scale down or delete.

##### What specific metrics should inform a rollback?
  The operator can monitor `kube_persistent_volume_*` metrics from
  kube-state-metrics to watch for large numbers of undeleted
  PersistentVolumes. If consistent behavior is required, the operator can wait
  for those metrics to stablize.

##### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
  Yes. The race condition wasn't exposed, but we confirmed the PVCs were updated correctly.

##### Is the rollout accompanied by any deprecations and/or removals of features, APIs,
fields of API types, flags, etc.?
  Enabling the feature also enables the `PersistentVolumeClaimRetentionPolicy`
  api field.

### Monitoring Requirements

Metrics are provided by `kube-state-metrics` unless otherwise noted.

##### How can an operator determine if the feature is in use by workloads?
  `kube_statefulset_persistent_volume_claim_retention_policy` will have nonzero
  counts for the `delete` policy fields.

##### What are the SLIs (Service Level Indicators) an operator can use to determine
the health of the service?
  - Metric name: `kube_statefulset_status_replicas_current` should be near
    `kube_statefulset_stats_replicas_ready`.
    - [Optional] Aggregation method: `gauge`
    - Components exposing the metric: `kube-state-metrics`

##### What are the reasonable SLOs (Service Level Objectives) for the above SLIs?

  `kube_statefulset_stats_replicas_ready /
  kube_statefulset_stats_replicas_current` should be near 1.0, although as
  unhealthy replicas are often an application error rather than a problem with
  the stateful set controller, this will need to be tuned by an operator on a
  per-cluster basis.

##### Are there any missing metrics that would be useful to have to improve observability
of this feature?

  kube-state-metrics have filled a gap in the traditional lack of metrics from
  core Kubernetes controllers.

### Dependencies

##### Does this feature depend on any specific services running in the cluster?

  No, outside of depending on the scheduler, the garbage collector and volume
  management (provisioning, attaching, etc) as does almost anything in
  Kubernetes. This feature does not add any new dependencies that did not
  already exist with the stateful set controller.

### Scalability

##### Will enabling / using this feature result in any new API calls?

  Yes and no. This feature will result in additional resource deletion calls, which will
  scale like the number of pods in the stateful set (ie, one PVC per pod and possibly one
  PV per PVC depending on the reclaim policy). There will not be additional watches,
  because the existing pod watches will be used. There will be additional
  patches to set PVC ownerRefs, scaling like the number of pods in the StatefulSet.

  However, anyone who uses this feature would have made those resource deletions
  anyway: those PVs cost money. Aside from the additional patches for onwerRefs,
  there shouldn't be much overall increase beyond the second-order effect of
  this feature allowing more automation.

##### Will enabling / using this feature result in introducing new API types?
  No.

##### Will enabling / using this feature result in any new calls to the cloud provider?
  PVC deletion may cause PV deletion, depending on reclaim policy, which will result in
  cloud provider calls through the volume API. However, as noted above, these calls would
  have been happening anyway, manually.

##### Will enabling / using this feature result in increasing size or count of the existing API objects?
  - PVC, new ownerRef.
  - StatefulSet, new field

##### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
  No. (There are currently no StatefulSet SLOs?)

  Note that scale-up may be slower when volumes were deleted by scale-down. This
  is by design of the feature.

##### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
  No.

###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
  No.

### Troubleshooting

##### How does this feature react if the API server and/or etcd is unavailable?

PVC deletion will be paused. If the control plane went unavailable in the middle
of a stateful set being deleted or scaled down, there may be deleted Pods whose
PVCs have not yet been deleted. Deletion will continue normally after the
control plane returns.

##### What are other known failure modes?
  - PVCs from a stateful set not being deleted as expected.
    - Detection: This can be deteted by higher than expected counts of
      `kube_persistentvolumeclaim_status_phase{phase=Bound}`, lower than
      expected counts of `kube_persistentvolume_status_phase{phase=Released}`,
      and by an operator listing and examining PVCs.
    - Mitigations: We expect this to happen only if there are other,
      operator-installed, controllers that are also managing owner refs on
      PVCs. Any such PVCs can be deleted manually. The conflicting controllers
      will have to be manually discovered.
    - Diagnostics: Logs from kube-controller-manager and stateful set controller.
    - Testing: Tests are in place for confirming owner refs are added by the
      `StatefulSet` controller, but Kubernetes does not test against external
      custom controller.

##### What steps should be taken if SLOs are not being met to determine the problem?

Stateful set SLOs are new with this feature and are in process of being
evaluated. If they are not being met, the kube-controller-manager (where the
stateful set controller lives) should be examined and/or restarted.

[supported limits]: https://git.k8s.io/community//sig-scalability/configs-and-limits/thresholds.md
[existing SLIs/SLOs]: https://git.k8s.io/community/sig-scalability/slos/slos.md#kubernetes-slisslos

## Implementation History

  - 1.21, KEP created.
  - 1.23, alpha implementation.
  - 1.27, graduation to beta.

## Drawbacks
The StatefulSet field update is required.

## Alternatives
Users can delete the PVC manually. The friction associated with that is the motivation of
the KEP.

repository: kubernetes/enhancements

gha_language: Go

repo_name: kubernetes/enhancements


text:
# GitHubTelemetryParsor
Github Traffic API only has two weeks historic data. This tool helps to collect the data and put it into SQL database.

##Get Started
To use this tool, please follow the steps:

1. Prepare your SQL Server.
2. Execute the [table create command](https://github.com/Microsoft/GitHubTelemetryParsor/tree/master/TableCreation)
3. Open GithubTelemetryParse.sln in Visual Studio.
4. Define Parameter in app.config.
  * Github Account
  * Github Personal Access Token. (check [here](https://github.com/blog/1509-personal-api-tokens) if you don't have yet)
  * SQL ADO.NET connection string
  * Repos path like "Microsoft/GitHubTelemetryParsor"
5. Build the Solution and Run

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Unity-Build-Release for GitHub Actions
This action builds a unity release.
```
action "Build Release" {
    uses = "actions/unity-build-release",
    DOWNLOAD_URL = download url for unity editor linux release,
    BUILD_PATH = target folder in docker container,
    PROJECT_PATH = target folder in GITHUB_WORKSPACE
}
```
UNITY\_USER and UNITY\_PW should be specified via secret

repository: AffectiveCognitiveInstitute/inclumove

branch_name: refs/heads/main

repo_name: AffectiveCognitiveInstitute/inclumove


text:
---
layout: post
title: File Size Counters and Actual File Size for Linux
tags:
- thunar custom actions
- zenity
- filesize
category: posts
---
To learn how to use Thunar Custom Actions click [here](http://birchwell.github.io/posts/tutorial-convert-video-to-avi).

##Counter

This custom action will display the size of each selected file/folder in a pop-up window. The program Zenity must be installed for this action to work.

![File Size Counter - Thunar Custom Action](http://i.imgur.com/yvdoHyX.png)

* Name: Counter
* Description: Determine size of multiple files and folders.
* Command:

`du -chs --apparent-size %N | zenity --text-info`

Under `Appears if selection contains` make sure everything is checked.

##Report ACTUAL file size for Thunar

The program Zenity must be installed for this action to work.

Thunar has a strange weakness when it comes to reporting file sizes.

>>Thunar is reporting the MiB of the file as the number of KiB/1000, which is the method that hard drive manufacturers use to dupe us into believing we're getting a larger hard drive than we actually get.  Read more about the problem [here](http://pclosmag.com/html/Issues/201307/page01.html).

This works on files, but YMMV on folders. It's supposed to work on folders, but the results are screwy.

![File Size Counter - Thunar Custom Action](http://i.imgur.com/76KBJlX.png)

* Name: Actual File Size
* Description: Report the ACTUAL file size
* Command:

`/home/$USER/Scripts/file-size.sh %N`

Under `Appears if selection contains` make sure everything is checked.

###Bash Script

I keep my bash scripts in a folder called “Scripts” in my personal directory. To create the bash script copy the script below and paste it into a text editor. Name the script `file-size.sh` and save it to the scripts folder you created. Make the script executable by opening up a terminal and navigating to the folder in which the script is stored. Type `chmod +x file-size.sh` and press `Enter`. The script will now work when used with Thunar Custom Actions.

[Bash Script](http://gist.github.com/Birchwell/e1dcb5055cfea83b8f28)


text:
# Credits

## Development Lead

The developing team members are:

* Anand Shankar<EMAIL_ADDRESS>* Andres Pitta<EMAIL_ADDRESS>* Carlina Kim<EMAIL_ADDRESS>* Kenneth Foo<EMAIL_ADDRESS>
## Contributors

None yet. We encourage you to contribute to this package.

Contributors may use the [Contributing File](https://github.com/UBC-MDS/pysketball/blob/master/CONTRIBUTING.md) as a guide for their contibutions. In addition, any contributor must abide by the [Code of Conduct](https://github.com/UBC-MDS/pysketball/blob/master/CONDUCT.md)

*This file was adapted from the UBC-MDS [cookie cutter template](https://github.com/UBC-MDS/cookiecutter-ubc-mds.git)

repository: UBC-MDS/rsketball

gha_language: R

gha_license_id: MIT

repo_name: UBC-MDS/rsketball


text:
---
layout: post
title: "JSON API with rails-api and active_model_serializers"
date: 2014-03-02 10:44:41 +0100
comments: true
categories:
- Ruby on Rails
- JSON
- API
- rails-api
- active_model_serializers
---

This post is based on my presentation given at [Lodz Ruby Users Group](http://lrug.pl/). The slides are [here](http://adamniedzielski.github.io/presentations/api-serializers/) (in Polish).

## Rails and JSON

Dealing with JSON in Rails is pretty easy and straightforward. The support is built into the framework, request data is automatically available in ```params``` hash. Then we just have to say ```render :json``` and we are done.

This may be sufficient if JSON is one of the formats which we use. For instance, we can render both JSON and HTML in the same controller action. Or we may create an action intended for AJAX call which changes some model and returns JSON with ```status``` field.

On the other hand, we may use Ruby on Rails for building JSON API - app with the assumption that JSON is the only format we support. In such a case we know that the app won't render HTML. There is no View layer (or you can say that JSON is your View layer). We probably won't need cookies support and the code specific to handling browser requests.

<!-- more -->

## rails-api

Ruby on Rails has modular structure - you can opt out of the things which you don't want to use. It's described thoroughly in [this wonderful blog post](http://www.amberbit.com/blog/2014/2/14/putting-ruby-on-rails-on-a-diet/). But if we are talking about API-only Rails app [somebody](https://github.com/rails-api/rails-api#maintainers) already did it for us and published in the gem called **rails-api**.

#### Why should you care?

My personal reason is: "don't require things which you won't use". There might be bugs hiding there or security vulnerabilities connected with it. And of course there are other reasons:

* more lightweight application

I generated two fresh applications - one using ```rails-api new``` and the second using ```rails new```. The environment was consistent - Ruby 2.1.0, Rails 4.0.2. Then I started the server with ```rails s``` and measured RAM memory taken by server process. The results are following:

-> **37.4 MB vs. 43.8 MB for rails-api** <-

This is 15% less. Obviously when you start adding new gems the relative difference will be smaller.

* faster application

The same benchmarking environment as above. I created controller action which loads 100 ```User``` records from the database and renders them as JSON. I placed exactly the same code in rails-api application and regular rails application. Then I measured the server response time for a bunch of requests and took the avarage value. It looks like:

-> **31.0 ms vs. 35.2 ms for rails-api** <-

This is 12% faster.

* useful generator

The controller scaffold which comes with rails-api is really cool. It disables ```new``` and ```edit``` actions (they don't make sense because we do not display forms) and provides sensible default code inside other actions.

* easy installation and no maintenance costs

Last but not least, rails-api is super easy to install and learn. All you have to do to bootstrap new app is:

```bash
gem install rails-api
rails-api new my_app
```

What's more, you can re-enable some modules disabled by rails-api or just completely remove rails-api without any problem. rails-api is not a burden. It's worth to spend 10 minutes of your time learning it. [Check out the docs](https://github.com/rails-api/rails-api/blob/master/README.md)

## active_model_serializers

#### Update 26.05.2015

This description talks about version 0.8.x of active_model_serializers!

If you want to build JSON API it's good to have control over the generated JSON. And here we need the second gem - [active_model_serializers](https://github.com/rails-api/active_model_serializers).

Disclaimer: there are other gems meant to solve similar problem, for example [rabl](https://github.com/nesquena/rabl) and [Jbuilder](https://github.com/rails/jbuilder). I haven't used them in a project yet, so I can't make any comparisons. But active_model_serializers works for me.

Let's look at a sample serializer:

```ruby user_serializer.rb
class UserSerializer < ActiveModel::Serializer
  attributes :id, :first_name, :last_name, :email

  has_one :address
  has_many :packages
end
```

Serializers live in ```app/serializers``` directory. As you can guess ```UserSerializer``` is used to serialize ```User``` model. Using ```attributes``` we define what should be included in the generated JSON. You may think that this is repeating yourself (the fields are already defined in database schema), but in my opinion you rarely render all the fields, more often you want to hide some internals.

As you can see we embed associated records using familiar syntax: ```has_one``` and ```has_many```. Serializing ```Address``` and ```Package``` will be handled using ```AddressSerializer``` and ```PackageSerializer```, respectively.

#### No magic

```ruby user_serializer.rb
class UserSerializer < ActiveModel::Serializer

  [...]

  attributes :full_name, :email_address

  def full_name
    "#{object.first_name} #{object.last_name}"
  end

  def email_address
    object.email
  end

  [...]
end
```

Serializers are just classes which inherit from ```ActiveModel::Serializer```. You can define regular methods and the model being serialized is accessed by ```object``` method.

And how does the code inside ```UsersController``` look like? It's here:

```ruby users_controller.rb
[...]

  def index
    @users = User.includes(:address, :packages)

    render json: @users
  end

[...]
```

Pretty simple, isn't it? You just say: "I want JSON" and you have JSON rendered with proper serializer.

The generated JSON will look similar to this:

```json
{
  "users":
    [
      {
        "id": 1,
        "first_name": "Some String",
        "last_name": "Another String",
        [...]
        "address": { "street": "Yet another string" },
        "packages": [
          { "id": 2, "status": "delivered" },
          { "id": 5, "status": "lost" }
        ]
      }
    ]
}
```

#### More about associations

Let's imagine following use case: we want to get information about a package given its id. And we want it to contain information about the owner (user). Difficult? Not really!

```ruby package_serializer.rb
class PackageSerializer < ActiveModel::Serializer
  attributes :id, :status

  has_one :user
end
```

What's different here from model code? Package ```belongs_to``` user, but here it says ```has_one``` user. From the point of view of serializers ```belongs_to``` is exactly the same as ```has_one```, hence we have only ```has_one``` and ```has_many```.

Now let's go back to ```UsersController#index``` after our changes. We hit the action again and what do we get this time?

```bash
     Failure/Error: Unable to find matching line from backtrace
     SystemStackError:
       stack level too deep
```

That's an infinite loop: user contains package, package contains user, user contains package...

How can we avoid this?

#### Solution #1

```ruby user_serializer.rb
class UserSerializer < ActiveModel::Serializer
  [...]

  has_many :packages, :embed => :ids

  [...]
end
```

```json
{
  "users":
    [
      {
        "id": 1,
        [...]
        "package_ids": [2, 5]
      }
    ]
}
```

We can use ```:embed``` option and include only ids of the packages. This has a drawback: if a client of our API wants not only id of the package, but also its status then he will have to make a separate request for each package. Certainly this is a situation which we want to avoid.

#### Solution #2

```ruby user_serializer.rb
class UserSerializer < ActiveModel::Serializer
  [...]

  has_many :packages, :serializer => ShortPackageSerializer

  [...]
end
```

```ruby short_package_serializer.rb
class ShortPackageSerializer < ActiveModel::Serializer
  attributes :id, :status
end
```

We use ```:serializer``` option to specify different serializer than that inferred from naming conventions. We create ```ShortPackageSerializer```, which doesn't contain user embeded. What's more you can put ```ShortPackageSerializer``` and ```PackageSerializer``` in the inheritance hierarchy so you DRY.

In my opinion this solution is pretty clean. We have separate class for each representation and we are able to share some pieces of code by using inheritance. Of course, this may become too complex if the inheritance hierarchy grows very big. However if we limit ourselves to 2-3 serializers per model the code should stay clear and maintainable.

## Summary

Use rails-api if you are building API-only application. It's easy to learn and maintenance won't hit you later, because you can opt out without any problems.

Use active_model_serializers for better control over the generated JSON.

#### Sample application

You can find my sample application [here](https://github.com/adamniedzielski/narwhale). It's a university project, so don't expect it to be a complete solution for any problem. However, it contains examples for everything which I covered above (plus some extra things like specs for the API).

branch_name: refs/heads/source

extension: markdown

gha_language: HTML


text:
# VpnClientConfiguration

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**vpnClientAddressPool** | [***AddressSpace**](AddressSpace.md) |  | [optional] [default to nothing]
**vpnClientRootCertificates** | [**Vector{VpnClientRootCertificate}**](VpnClientRootCertificate.md) | VpnClientRootCertificate for virtual network gateway. | [optional] [default to nothing]
**vpnClientRevokedCertificates** | [**Vector{VpnClientRevokedCertificate}**](VpnClientRevokedCertificate.md) | VpnClientRevokedCertificate for Virtual network gateway. | [optional] [default to nothing]
**vpnClientProtocols** | **Vector{String}** | VpnClientProtocols for Virtual network gateway. | [optional] [default to nothing]
**vpnClientIpsecPolicies** | [**Vector{IpsecPolicy}**](IpsecPolicy.md) | VpnClientIpsecPolicies for virtual network gateway P2S client. | [optional] [default to nothing]
**radiusServerAddress** | **String** | The radius server address property of the VirtualNetworkGateway resource for vpn client connection. | [optional] [default to nothing]
**radiusServerSecret** | **String** | The radius secret property of the VirtualNetworkGateway resource for vpn client connection. | [optional] [default to nothing]
**radiusServers** | [**Vector{RadiusServer}**](RadiusServer.md) | The radiusServers property for multiple radius server configuration. | [optional] [default to nothing]
**aadTenant** | **String** | The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. | [optional] [default to nothing]
**aadAudience** | **String** | The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. | [optional] [default to nothing]
**aadIssuer** | **String** | The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. | [optional] [default to nothing]

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

gha_language: Julia

gha_license_id: NOASSERTION


text:
# Ustilago maydis (DC.) Corda, 1842 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Icon. fung. (Prague) 5: 3 (1842)

#### Original name
Uredo maydis DC., 1815

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
Go package Aiqiyi

Aiqiyi provide a struct for aiqiyi request and response.

The package file is automatic generated by official protobuf tool - protoc.

##########################
Ubuntu Platform

Run gen.sh with command line:
user@ubuntu:~$ bash gen.sh

Other Platform
Can try short command sh for bash or [x]sh
appadmins-Mac-mini-2:aiqiyi user$ sh gen.sh

##########################

Refernce

1 Similiar document to understand golang protobuf struct automatic generation mechanism.
  appcoachs.net/x/xiaodu/README.md

2 aiqiyi.proto
  - We get aiqiyi.proto according  merge bid_request.proto and bid_response.proto.
  - The union package name in .proto file is changed to aiqiyi.
  - Remove unneccessary lines content "extensions 100 to max;" in .proto file to avoid
    introduce bugs in aiqiyi.pb.go.

2017.02.17
Author: Paul Duan

repository: kerasking/garden

repo_name: kerasking/garden


text:
# Array inset shift
insert a value into the middle of an array, without any built-in functions
## Whiteboard Process
[Array-inset shift image link](https://i.imgur.com/zxQGBEI.png)
## Approach & Efficiency
once again, not using any built-in functions can be pretty hard, but I feel this one was easier than the last one.

[JavaScrip file link to github ➜](https://github.com/Suhaib-Ersan/401-data-structures-and-algorithms/blob/main/class-02-array-insert-shift/array-insert-shift.js)

[Go to table of contents](https://suhaib-ersan.github.io/401-data-structures-and-algorithms)

gha_language: JavaScript


text:
# Project Paranoid

## Overview

**Paranoid** project checks for well known weaknesses on cryptographic artifacts
such as public keys, digital signatures and general pseudorandom numbers.
This library contains implementations and optimizations of existing work found
in the literature. The existing work showed that the generation of these
artifacts was flawed in some cases. The following  are some examples of
publications the library is based on.

-   [Arjen K. Lenstra, James P. Hughes, Maxime Augier, Joppe W. Bos, Thorsten
    Kleinjung, and Christophe Wachter. (2012). **Ron was wrong, Whit is
    right**](https://eprint.iacr.org/2012/064);

-   [Nadia Heninger, Zakir Durumeric, Eric Wustrow, and J. Alex Halderman.
    (2012). **Mining Your Ps and Qs: Detection of Widespread Weak Keys in
    Network
    Devices**](https://www.usenix.org/conference/usenixsecurity12/technical-sessions/presentation/heninger);

-   [Daniel J. Bernstein, Yun-An Chang, Chen-Mou Cheng, Li-Ping Chou, Nadia
    Heninger, Tanja Lange, and Nicko van Someren. (2013). **Factoring RSA keys
    from certified smart cards: Coppersmith in the
    wild**](https://eprint.iacr.org/2013/599);

-   [Joachim Breitner and Nadia Heninger. (2019). **Biased Nonce Sense: Lattice
    Attacks against Weak ECDSA Signatures in
    Cryptocurrencies**](https://eprint.iacr.org/2019/023);

## Goal

The goal is to increase the confidence in cryptography use cases inside and
outside Google.

When dealing with asymmetric encryption, crypto artifacts usually are:

1.  Generated by one of our own tools (e.g., at Google we use for example
    [boringssl](https://github.com/google/boringssl) or
    [tink](https://github.com/google/tink)); or,
2.  Generated by third party tools that we have access to (so these tools can
    be, for example, checked for vulnerabilities using
    [wycheproof](https://github.com/google/wycheproof)); or,
3.  **Generated by third party tools and/or hardware or software black boxes
    that we do not have access to.**

With Paranoid, any cryptographic artifact can be tested, but its primary
motivation is to detect the usage of weak third party hardware or software black
boxes. Hence, Paranoid can be used even if we are not able to inspect the source
code (situation 3. listed above).

The project aims to detect known vulnerabilities as well as unknown ones. E.g.,
it tries to identify vulnerabilities caused by programming errors or the use of
weak proprietary random number generators. Detecting new vulnerabilities is of
course much more difficult than detecting known ones. Such detections may
require large sets of artifacts or find weak ones only with a low probability.

Therefore, we are very interested to receive feedback and learn about the
cryptographic library that generated weak cryptographic artifacts (See [call for
contributions](https://security.googleblog.com/2022/08/announcing-open-sourcing-of-paranoids.html)
). The project is constantly work in progress. After learning about weak
implementations the plan is to analyze and add detections targeting them.

## Getting Started

Documentation for the current implemented checks is located at [docs](docs). The
documentation will be populated with more content over time.

To learn how to use the checks, you can look at the [examples](examples)
folder or the unit tests (\*test.py files). The examples demonstrate testing
different crypto artifacts.

###  Installation

Clone the repository:

```$ git clone https://github.com/google/paranoid_crypto.git && cd paranoid_crypto```

**NOTE**: The commands below have been tested on Debian latest stable version
(bullseye). Make sure you will be using `python3.9` or newer.

Install dependencies:

```$ sudo apt update && sudo apt install python3 python3-pip python3-pybind11 python3-fpylll libgmp-dev protobuf-compiler```

Install paranoid_crypto python package:

```$ python3 -m pip install .```

To check whether the installation was successful, you can run the unit tests.
For example:

```
$ cd paranoid_crypto && python3 -m unittest discover -b -p "*test.py"
.................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 305 tests in 314.660s

OK
```

### Docker

Alternatively, if you want to run it in a container, you can use our provided
[Dockerfile](Dockerfile) as shown below.

**NOTE**: Make sure you have [docker](https://docs.docker.com/engine/install/)
installed.

After cloning the repository, build the docker image:

```$ docker build -t paranoid-img .```

Create and start the container:

```
$ docker run --name paranoid-container -it paranoid-img
paranoid-user@6191368b26b8:~$
```

To check whether the installation was successful, you can run the unit tests.
For example:

```
paranoid-user@6191368b26b8:~$ cd paranoid_crypto && python3 -m unittest discover -b -p "*test.py"
.................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 305 tests in 307.555s

OK
```

## Preliminary results

Similar to other published works, we have been analyzing the crypto artifacts
from [Certificate Transparency (CT)](https://certificate.transparency.dev),
which logs issued website certificates since 2013 with the goal of making them
transparent and verifiable. Its database contains more than 7 billion
certificates as of September 2022. For the Paranoid checks of EC public keys and
ECDSA signatures, so far, we have not found any weak artifacts in CT. For the
RSA public key checks with severities high or critical, we have the following
results:

|       **TestName**       | **Potentially Related CVEs** |    **Severity**   | **Number of Weak Artifacts** |
|:------------------------:|:----------------------------:|:-----------------:|:----------------------------:|
|   CheckOpensslDenylist   |         CVE-2008-0166        | SEVERITY_CRITICAL |             3989             |
|         CheckROCA        |        CVE-2017-15361        |   SEVERITY_HIGH   |             2875             |
|         CheckGCD         |               -              | SEVERITY_CRITICAL |             1860             |
|        CheckFermat       |        CVE-2022-26320        | SEVERITY_CRITICAL |              36              |
|  CheckContinuedFractions |               -              | SEVERITY_CRITICAL |              16              |
|     CheckBitPatterns     |               -              | SEVERITY_CRITICAL |               6              |
| CheckPermutedBitPatterns |               -              | SEVERITY_CRITICAL |               6              |
|   CheckKeypairDenylist   |        CVE-2021-41117        | SEVERITY_CRITICAL |               4              |
|      CheckPollardpm1     |               -              | SEVERITY_CRITICAL |               1              |

Some of these certificates were already expired or revoked. For the ones that
were still active (most of the CheckGCD ones), we immediately reported them to
the Certificate Authorities to be revoked.

## ABOUT

This library is developed and maintained by members of Google Security Team, but
this is not an officially supported Google product. If you want to contribute,
please read [CONTRIBUTING](CONTRIBUTING.md) and send us pull requests. You can
also report bugs or file feature requests.

If you use Paranoid in your research, you can cite it using the following
BibTeX:
```
@software{Barbosa_Bleichenbacher_Paranoid_Crypto_2022,
  author = {Barbosa, Pedro and Bleichenbacher, Daniel},
  license = {Apache-2.0},
  month = {8},
  title = {{Paranoid Crypto}},
  url = {https://github.com/google/paranoid_crypto},
  year = {2022}
}
```

gha_language: Python


text:
  Documentation
  •
  Examples
  •
  Tutorials
  •
  Support Us
  •
  Get Professional Help

AmplitudeJS is a lightweight JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required). AmplitudeJS is available under the [MIT License](https://raw.githubusercontent.com/521dimensions/amplitudejs/master/LICENSE).

## Demo

	Click the image above to go to the demo site or click here.

## Sponsors

AmplitudeJS is free to use under the MIT license, but the project is not sustainable without proper financial backing. If you rely on AmplitudeJS or would like to see this project grow, consider becoming a sponsor. Different levels have diferent perks.

 [Become a sponsor →](https://opencollective.com/amplitudejs)

## Features
* 🎨 100% customizable design of all player elements
* 🚀 Lightweight, 0 dependencies
* 📕 Thoroughly documented
* 🎧 Support for multiple playlists
* 🌊 Autogenerate waveforms and visualizations using the Web Audio API
* 🎤 Live streaming support
* 🎛 Public functions for unlimited control!
* 🤵 Professionally supported [Get professional help →](https://521dimensions.com/open-source/amplitudejs/docs/get-help/#professional-support)

## Don't just take our word for it
* [GitHub: Release Radar · January 2019](https://github.blog/2019-02-05-release-radar-january-2019/)
* [CSS Tricks: Front-End Tools: My Favorite Finds of 2017](https://css-tricks.com/front-end-tools-favorite-finds-2017/)
* [FossMint: AmplitudeJS - A Modern Open-Source HTML5 Audio Player](https://www.fossmint.com/amplitudejs-html5-audio-player-with-playlist/)

## Browser support

|
IE / Edge |
Firefox |
Chrome |

Safari |
Opera |
| --------- | --------- | --------- | --------- | --------- |
| IE11, Edge| 4.0+| 3.5+| 4.0+| 10.5+|

## Example Players

Looking for some cool examples to get started with? [View all of our example players →](https://521dimensions.com/open-source/amplitudejs/docs/examples/index.html)

## Installation
Installation is a breeze and very flexible on how you want to use it. [View the installation instructions →](https://521dimensions.com/open-source/amplitudejs/docs/installation/)

## Documentation & Usage
All of our documentation is located in the `/docs` folder, but we made an even easier and more beautiful way to fully experience AmplitudeJS. [View our documentation site →](https://521dimensions.com/open-source/amplitudejs/docs)

## Getting Help
Feeling stuck? No worries! We have entire community built around helping eachother out. [Get help →](https://521dimensions.com/open-source/amplitudejs/docs/help-and-support/)

## Roadmap
We have all of our proposed features organized on our [roadmap](https://github.com/521dimensions/amplitudejs/projects/11). If you are interested in sponsoring a specific feature, just comment on that feature and we will get in touch with you soon!

repository: JEGardner/amplitudejs

repo_name: JEGardner/amplitudejs


text:
This is a Phaser HTML5 framework plugin to integrate both Google Adx and A4G video pre-roll ads into your HTML5 games.

Why we've created it and the target audience:
* We love games, especially the HTML5 flavour.
* We have created this plugin to help our existing and future customers monetise their Phaser games.
* All of our HTML5 publishers, who tried video pre-roll, generated higher revenues.
* Why AdX and not Adsense? Adx is paid by CPM and should generate better profits.

A4G Demo usage
================

The game from this github repository shows how a video pre-roll ad can be integrated into HTML5 framework Phaser game.
See a working demo showing a video pre-roll and inter-game ad each 60 seconds: http://xmmorpg.com/phaser-a4g/example/

Integration steps:
* First include `a4g-ad-plugin.js` into your codebase.
* Then create the A4gPlugin:

```
game.a4gPlugin = game.plugins.add(A4gPlugin.configure({
        zone: YOUR_ZONE_ID
    }));
```
* Whenever you want to show an ad within your game just call `showAd()` function.
Typically game developers call this function on the beginning of the game and between the levels.

```
game.a4gPlugin.onAdComplete.add(function () {
        console.log('Ad has been completed');
    });

game.a4gPlugin.showAd();

```

In order to integrate this plugin you will need `YOUR_ZONE_ID`. Unless you are an existing customer, please sign-up as a publisher / website at: http://www.a4g.com/#get-contacted and add a message saying that you are signing up for a Phaser HTML5 game.

Note: Adx has rigorous requirements to join. We will help you with the set-up process to make it as smooth as possible.

NPM
=====================

You can get the latest NPM from here: https://www.npmjs.com/package/@ad4game/phaser-a4g
```
npm install @ad4game/phaser-a4g --save-dev
```

A4g Phaser Plugin API
=====================

* `A4gPlugin.configure(config)` creates preconfigured A4gPhaser plugin. It takes 1 parameter, configuration.
Configuration is a regular JavaScript object, which can take following settings:
  * `zone` zone id from A4g (required)
  * `adTypes` array of ad types that can be displayed. Available values are `['video', 'skippablevideo', 'standardvideo', 'bumpervideo', 'text', 'image']`, default value is `['video']` which is equivalent to [`standardvideo', 'bumpervideo', 'skippablevideo`], see required params / ad_type for more info: https://support.google.com/adsense/answer/3112148
  * `skipOffset` number of seconds when ad can be skipped, default value is `10`
  * `fallbackZone` zone id which could be used in case the video cannot be loaded, by default not set. In case the Adx ad will not be loaded we will load a replacement ad (usually with a lower CPM). This could be useful if Adx fills a very small percentage of requests.
  * `pauseGame` boolean indicates if game should be paused while ad is shown, default value is true
  * `unpauseGameDelay` number of milliseconds to wait for unpausing game after ad is hidden (will be used only if `pauseGame` set to true), default value is 500
* `A4gPlugin.prototype.showAd()` shows an ad
* `A4gPlugin.prototype.onAdShown` `Phaser.Signal` would be triggered when ad shown
* `A4gPlugin.prototype.onAdComplete` `Phaser.Signal` would be triggered when ad showing is completed
* You can fully control the styling of the div showing the ad. Our publishers often display games in an iframe, which autoscales to 100%.

References:
* http://phaser.io/
* https://github.com/photonstorm/phaser
* http://phaser.io/news/2017/05/a4g-plugin


text:
# Zeta Ret Zetadmin Debug Form

Provides XMLHttpRequest Forms directly into Zeta Ret Zetadmin API:
- Debug Request
- Debug View
- Debug Response
- Auto/Custom Fields for each request based on command
- HTML Tag Prototyping by Zeta Elements and Registry using MutationObserver and Object maps per tag name

repository: ZetaRet/debugform

repo_name: ZetaRet/debugform


text:
# Example Submission

This visualization is from the movie Alien (1979), directed by Ridley Scott.

![terrain viz from Alien](images/alien_terrain.jpg "Alien Terrain")

This visualization appears on screen as the ship carrying our protagonists
approaches a planetoid; the terrain is unknown, and the computer displays it as
it senses during approach.

The terrain is displayed in a stratified manner; the lines are connected
horizontally (giving the potentially misleading impression that the horizontal
resolution is greater than vertical) and each “layer” appears to be opaque to
the segments behind it.  Most standard visualization tools could generate an
image very similar to this by simply overplotting lines (and staggering them
according to the perspective of the viewpoint), but blocking out the terrain
behind a given line is more complex and difficult.

The data here has likely been generated by taking scan points and connecting
them; while it’s possible that these are irregular in x and y, it looks as
though they are regular in both.

![terrain viz by hand](images/terrain_by_hand.jpg "My drawing")

I recreated this visualization by hand, and in doing so I changed the data
somewhat.  I discovered that it’s considerably harder to generate this by hand
than I expected!  I tried to draw out the lines, but the implied perspective
made them appear strange and distorted.

While doing this, I discovered that according to [Tisovˇcík
2012](https://is.muni.cz/th/359691/fi_b/Thesis.pdf) this terrain was generated
on the fly, rather than being stored ahead of time.  It was also the first
terrain used in a movie, although it is contemporaneous with the famous
"Unknown Pleasures" album cover that features a similar visualization of a
pulsar.

gha_language: Jupyter Notebook


text:
# RTFL
Read The (Freely Hosted) License

# Stop Your Cargo-Culting Bullshit Having the _LICENSE_ at the top of every single source file.

Why you might ask?  Here are a few reasons:

## It makes you look old
Basically every modern language has accepted a repository centered view of licensing with a single
top level file (**[repo_root]/LICENSE**) which integrates with build-system, IDE, code-hosting, indexing, and search.

## There is no legal benefit:
A _license_ is not a _copyright_.  A _license_ is a document describing the terms under which a piece of
software **may** be used, whereas a _copyright_ is an **AUTOMATIC** [international right](https://en.wikipedia.org/wiki/Berne_Convention) granted to all
content creators which *forbids* the unlicensed use/duplication by others.

It is the responsibility of the duplicator of copyright work to ensure that their use is permitted by
the copyright holder.

## It kills people:

If every time an reader loads up a file they must first take a second to scroll past
redundant front-matter, and they do this (conservatively) 5 times a day, and only on
work days, by the end of their career thy will have spent an entire day of their life
ignoring this garbage.

This means that for the
[21 million engineers](https://evansdata.com/reports/viewRelease.php?reportID=9) today,
we are spending over **5.5 human lifetimes EVERY YEAR.**
These are the collective lives of people like you that we will never get back.
Which reminds me...

## It is a chore:

Do you know the copyright date on your files? Copyright is protected for 50 years after
the content creators death.  Inclusion of *copyright date and authorship* is the best
way to make sure these rights are protected. Are you excited about updating this in every
single file in your whole repository?  You sure shouldn't be because there is literally a
best practice acronym to describe why this sucks...

## DRY
Unnecessary duplication leads to version drift between copies, poor maintainability,
and [host](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) of other issues.
Without a mechanism to check for consistency these **will** end up wrong,
this weakens protection, wastes space, and has no...

## Integrity
Without a single source of truth your protections are weaker.
Which of several competing licenses apply is less clear and overall weakens your protections.

# So what should I do?
This [rtfl.io](http://rtfl.io) is here to help.

repository: meawoppl/RTFL

repo_name: meawoppl/RTFL


text:
# MySQL

## Overview

The MySQL source supports both Full Refresh and Incremental syncs. You can choose if this connector will copy only the new or updated data, or all rows in the tables and columns you set up for replication, every time a sync is run.

### Resulting schema

The MySQL source does not alter the schema present in your database. Depending on the destination connected to this source, however, the schema may be altered. See the destination's documentation for more details.

### Data type mapping

MySQL data types are mapped to the following data types when synchronizing data:

| MySQL Type | Resulting Type | Notes |
| :--- | :--- | :--- |
| `array` | array |  |
| `binary` | string |  |
| `date` | string |  |
| `datetime` | string |  |
| `enum` | string |  |
| `numeric` | string | includes integer, etc |
| `string` | string | includes integer, etc |

If you do not see a type in this list, assume that it is coerced into a string. We are happy to take feedback on preferred mappings.

**Note:** arrays for all the above types as well as custom types are supported, although they may be de-nested depending on the destination. Byte arrays are currently unsupported.

### Features

| Feature | Supported |
| :--- | :--- |
| Full Refresh Sync | Yes |
| Incremental - Append Sync | Yes |
| Replicate Incremental Deletes | Coming soon |
| Logical Replication \(WAL\) | Coming soon |
| SSL Support | Yes |
| SSH Tunnel Connection | Coming soon |

## Getting started

### Requirements

1. MySQL Server `8.0`, `5.7`, or `5.6`.
2. Create a dedicated read-only Airbyte user with access to all tables needed for replication

### Setup guide

#### 1. Make sure your database is accessible from the machine running Airbyte

This is dependent on your networking setup. The easiest way to verify if Airbyte is able to connect to your MySQL instance is via the check connection tool in the UI.

#### 2. Create a dedicated read-only user with access to the relevant tables \(Recommended but optional\)

This step is optional but highly recommended to allow for better permission control and auditing. Alternatively, you can use Airbyte with an existing user in your database.

To create a dedicated database user, run the following commands against your database:

```sql
CREATE USER 'airbyte'@'%' IDENTIFIED BY 'your_password_here';
```

Then give it access to the relevant schema:

```sql
GRANT SELECT ON <database name>.* TO 'airbyte'@'%';
```

You can limit this grant down to specific tables instead of the whole database. Note that to replicate data from multiple MySQL schemas, you can re-run the command above to grant access to all the relevant schemas, but you'll need to set up multiple sources connecting to the same db on multiple schemas.

Your database user should now be ready for use with Airbyte.

repository: MinjaMiladinovic/airbyte

gha_language: Java

repo_name: MinjaMiladinovic/airbyte


text:
# SunspotWithActiveuuid

Extends sunspot to be compatible with activeuuid. Activeuuid gem uses UUID objects
as primary keys for models, what this gem does is making sure that sunspot is aware of it.

## Installation

Add this line to your application's Gemfile:

    gem 'sunspot_with_activeuuid'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sunspot_with_activeuuid

## 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:
Library `(lispkit enum)` provides an implementation of enumerated values and sets of enumerated values based on the API defined by R6RS.

Enumerated values are represented by ordinary symbols, while finite sets of enumerated values form a separate type, known as _enumeration set_. The enumeration sets are further partitioned into sets that share the same universe and enumeration type. These universes and enumeration types are created by the `make-enumeration` procedure. Each call to that procedure creates a new enumeration type.

In the descriptions of the following procedures, _enum-set_ ranges over the enumeration sets, which are defined as the subsets of the universes that can be defined using `make-enumeration`.

***

**(make-enumeration _symbol-list_)**     [procedure]

Argument _symbol-list_ must be a list of symbols. The `make-enumeration` procedure creates a new enumeration type whose universe consists of those symbols (in canonical order of their first appearance in the list) and returns that universe as an enumeration set whose universe is itself and whose enumeration type is the newly created enumeration type.

**(enum-set-universe _enum-set_)**     [procedure]

Returns the set of all symbols that comprise the universe of its argument _enum-set_, as an enumeration set.

**(enum-set-indexer _enum-set_)**     [procedure]

Returns a unary procedure that, given a symbol that is in the universe of _enum-set_, returns its 0-origin index within the canonical ordering of the symbols in the universe; given a value not in the universe, the unary procedure returns `#f`.

```
(let* ((e (make-enumeration '(red green blue)))
       (i (enum-set-indexer e)))
  (list (i 'red) (i 'green) (i 'blue) (i 'yellow)))
 ⇒ (0 1 2 #f)
```

The `enum-set-indexer` procedure could be defined as follows using the `memq` procedure:

```
(define (enum-set-indexer set)
  (let* ((symbols (enum-set->list (enum-set-universe set)))
         (cardinality (length symbols)))
    (lambda (x)
      (cond ((memq x symbols) =>
              (lambda (probe) (- cardinality (length probe))))
            (else #f)))))
```

**(enum-set-constructor _enum-set_)**     [procedure]

Returns a unary procedure that, given a list of symbols that belong to the universe of _enum-set_, returns a subset of that universe that contains exactly the symbols in the list. The values in the list must all belong to the universe.

**(enum-set->list _enum-set_)**     [procedure]

Returns a list of the symbols that belong to its argument, in the canonical order of the universe of _enum-set_.

```
(let* ((e (make-enumeration '(red green blue)))
       (c (enum-set-constructor e)))
  (enum-set->list (c '(blue red))))
⇒ (red blue)
```

**(enum-set-member? _symbol enum-set_)**     [procedure]
**(enum-set-subset? _enum-set1 enum-set2_)**     [procedure]
**(enum-set=? _enum-set1 enum-set2_)**     [procedure]

The `enum-set-member?` procedure returns `#t` if its first argument is an element of its second argument, `#f` otherwise.

The `enum-set-subset?` procedure returns `#t` if the universe of _enum-set1_ is a subset of the universe of _enum-set2_ (considered as sets of symbols) and every element of _enum-set1_ is a member of _enum-set2_. It returns `#f` otherwise.

The `enum-set=?` procedure returns `#t` if _enum-set1_ is a subset of _enum-set2_ and vice versa, as determined by the `enum-set-subset?` procedure. This implies that the universes of the two sets are equal as sets of symbols, but does not imply that they are equal as enumeration types. Otherwise, `#f` is returned.

```
(let* ((e (make-enumeration '(red green blue)))
       (c (enum-set-constructor e)))
  (list (enum-set-member? 'blue (c '(red blue)))
        (enum-set-member? 'green (c '(red blue)))
        (enum-set-subset? (c '(red blue)) e)
        (enum-set-subset? (c '(red blue)) (c '(blue red)))
        (enum-set-subset? (c '(red blue)) (c '(red)))
        (enum-set=? (c '(red blue)) (c '(blue red)))))
⇒ (#t #f #t #t #f #t)
```

**(enum-set-union _enum-set1 enum-set2_)**     [procedure]
**(enum-set-intersection _enum-set1 enum-set2_)**     [procedure]
**(enum-set-difference _enum-set1 enum-set2_)**     [procedure]

Arguments _enum-set1_ and _enum-set2_ must be enumeration sets that have the same enumeration type.

The `enum-set-union` procedure returns the union of _enum-set1_ and _enum-set2_. The `enum-set-intersection` procedure returns the intersection of _enum-set1_ and _enum-set2_. The `enum-set-difference` procedure returns the difference of _enum-set1_ and _enum-set2_.

```
(let* ((e (make-enumeration '(red green blue)))
       (c (enum-set-constructor e)))
  (list (enum-set->list (enum-set-union (c '(blue)) (c '(red))))
        (enum-set->list
          (enum-set-intersection (c '(red green)) (c '(red blue))))
        (enum-set->list
         (enum-set-difference (c '(red green)) (c '(red blue))))))
⇒ ((red blue) (red) (green))
```

**(enum-set-complement _enum-set_)**     [procedure]

Returns _enum-set_'s complement with respect to its universe.

```
(let* ((e (make-enumeration '(red green blue)))
       (c (enum-set-constructor e)))
  (enum-set->list (enum-set-complement (c '(red)))))
⇒ (green blue)
```

**(enum-set-projection _enum-set1 enum-set2_)**     [procedure]

Projects _enum-set1_ into the universe of _enum-set2_, dropping any elements of _enum-set1_ that do not belong to the universe of _enum-set2_. If _enum-set1_ is a subset of the universe of its second, no elements are dropped, and the injection is returned.

```
(let ((e1 (make-enumeration '(red green blue black)))
      (e2 (make-enumeration '(red black white))))
  (enum-set->list (enum-set-projection e1 e2))))
⇒ (red black)
```

**(define-enumeration _type-name (symbol ...) constructor_)**     [syntax]

The `define-enumeration` form defines an enumeration type and provides two macros for constructing its members and sets of its members. A `define-enumeration` form is a definition and can appear anywhere any other definition can appear.

_type-name_ is an identifier that is bound as a syntactic keyword; _symbol ..._ are the symbols that comprise the universe of the enumeration (in order).

`(`_type-name_ _symbol_`)` checks whether the name of _symbol_ is in the universe associated with _type-name_. If it is, `(`_type-name_ _symbol_`)` is equivalent to _symbol_. It is a syntax violation if it is not.

_constructor_ is an identifier that is bound to a syntactic form that, given any finite sequence of the symbols in the universe, possibly with duplicates, expands into an expression that evaluates to the enumeration set of those symbols.

`(`_constructor_ _symbol ..._`)` checks whether every <symbol> ... is in the universe associated with _type-name_. It is a syntax violation if one or more is not. Otherwise `(`_constructor_ _symbol> ..._`)` is equivalent to `((enum-set-constructor (`_constructor-syntax_`)) '(`_symbol ..._`))`.

Here is a complete example:

```
(define-enumeration color (black white purple maroon) color-set)
(color black)                   ⇒ black
(color purpel)                  ⇒ error: symbol not in enumeration universe
(enum-set->list (color-set))    ⇒ ()
(enum-set->list
  (color-set maroon white))     ⇒ (white maroon)
```

***

Some of this documentation is derived from the [R6RS specification of enumerations](http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-14.html#node_chap_13) by Michael Sperber, Kent Dybvig, Matthew Flatt, Anton van Straaten, Richard Kelsey, William Clinger, and Jonathan Rees.

repository: kwccoin/swift-lisppad-ios

filename: (lispkit enum).md

repo_name: kwccoin/swift-lisppad-ios


text:
# linear-regression

linear-regression is an introductory project that performs linear regression using gradient descent for corporate profit in a given city population.

## Screenshot
![image](https://user-images.githubusercontent.com/41022783/53430100-dbc06f00-39bb-11e9-8344-60a010f3bf1b.png)

## Contributing
Pull requests are welcome. Otherwise the project is just a demonstration.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: KevinKronk/linear-regression

repo_name: KevinKronk/linear-regression


text:
# stm32f103c8t6_button
An eclipse project for a STM32f103c8t6 arm system.
This project builds on the blink, uart1 and interrupt1 to add 3 buttons
it reads the button state (PA0 PA1 and PC15) and toggles an LED (PB7, PB8 and
PB9)

it aso sets up two timers to blink pins PB5 and PB6
it is built on the blink and uart1 programs so it will also
initialise the uart1 pins (PB9 and PB10) on an stm32f103c8t6 development board
and send a message in a continuous loop.
you can use this to help debug your programs
It also blinks pc13 so you know all is working
this project is built on the PC13 blink program.
 It is the default program when creating a basic "hello world" for
 the stm32f103.

You can download the whole project and import it into eclipse.


text:
LaspVfx
-------

![gif](https://i.imgur.com/KIwkpcI.gif)
![gif](https://i.imgur.com/Nrb1XGw.gif)

**LaspVfx** is a Unity package providing property binders for connecting [LASP]
(audio input plugin) and [Visual Effect Graph].

[LASP]: https://github.com/keijiro/Lasp
[Visual Effect Graph]: https://unity.com/visual-effect-graph

System Requirements
-------------------

- Unity 2019.4 or later

How To Install
--------------

This package uses the [scoped registry] feature to resolve package
dependencies. Please add the following lines to the manifest file
(`Packages/manifest.json`).

[scoped registry]: https://docs.unity3d.com/Manual/upm-scoped.html

.NET Standard 2.0 (Unity 2021.1 or earlier)

To the `scopedRegistries` section:

```
{
  "name": "Unity NuGet",
  "url": "https://unitynuget-registry.azurewebsites.net",
  "scopes": [ "org.nuget" ]
},
{
  "name": "Keijiro",
  "url": "https://registry.npmjs.com",
  "scopes": [ "jp.keijiro" ]
}
```

To the `dependencies` section:

```
"org.nuget.system.memory": "4.5.3",
"jp.keijiro.laspvfx": "1.0.2"
```

After the changes, the manifest file should look like:

```
{
  "scopedRegistries": [
    {
      "name": "Unity NuGet",
      "url": "https://unitynuget-registry.azurewebsites.net",
      "scopes": [ "org.nuget" ]
    },
    {
      "name": "Keijiro",
      "url": "https://registry.npmjs.com",
      "scopes": [ "jp.keijiro" ]
    }
  ],
  "dependencies": {
    "org.nuget.system.memory": "4.5.3",
    "jp.keijiro.laspvfx": "1.0.2",
    ...
```

.NET Standard 2.1 (Unity 2021.2 or later)

To the `scopedRegistries` section:

```
{
  "name": "Keijiro",
  "url": "https://registry.npmjs.com",
  "scopes": [ "jp.keijiro" ]
}
```

To the `dependencies` section:

```
"jp.keijiro.laspvfx": "1.0.2"
```

After the changes, the manifest file should look like:

```
{
  "scopedRegistries": [
    {
      "name": "Keijiro",
      "url": "https://registry.npmjs.com",
      "scopes": [ "jp.keijiro" ]
    }
  ],
  "dependencies": {
    "jp.keijiro.laspvfx": "1.0.2",
    ...
```

license: Unlicense

repository: keijiro/LaspVfx

repo_name: keijiro/LaspVfx


text:
---
layout: post
title: "15% off Labour at Crown Classic Cars through July 2013"
permalink: /archives/2013/03/15_off_labour_at_crown_classic_cars_through_july_2.html
commentfile: 2013-03-07-15_off_labour_at_crown_classic_cars_through_july_2
category: around_town
date: 2013-03-07 19:28:25
image: "/assets/images/2013/ccc_postcard_thumb.jpg"
excerpt: |
    As a small local business we rely on the support of local people and as a long standing family business, based in St Margarets, Crown Classic Cars are offering you a 15% discount on all labour costs[1] for all your motoring needs (quote STMAG15 when booking).

    We pride ourselves on the quality of our work and offer a comprehensive range of services, from MOTs, full service, diagnostics, mechanical repairs & bodywork. Whether it's a bulb change or a full service, we're happy to help. We're a small family business but we're big on service.

---

As a small local business we rely on the support of local people and as a long standing family business, based in St Margarets, Crown Classic Cars are offering you a 15% discount on all labour costs[1] for all your motoring needs (quote STMAG15 when booking).

We pride ourselves on the quality of our work and offer a comprehensive range of services, from MOTs, full service, diagnostics, mechanical repairs & bodywork. Whether it's a bulb change or a full service, we're happy to help. We're a small family business but we're big on service.

You will find us at:

Unit 16D Crown Yard
Crown Road
St Mararets
TW1 3EE

#### Contact details

-   O20 8891 6101
-<EMAIL_ADDRESS>-   [www.crownclassiccars.co.uk](http://www.crownclassiccars.co.uk)

[1] T&C - 15% discount applies to all labour costs. Offer runs until 31 July 2013

repository: pmahnke/stmgrts

repo_name: pmahnke/stmgrts


text:
# Chlorociboria bulgarioides (Rabenh.) C.S. Ramamurthi, Korf & L.R. Batra, 1958 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 49(6): 860 (1958)

#### Original name
null

### Remarks
null

path: /life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Rutstroemiaceae/Rutstroemia/Rutstroemia bulgarioides/ Syn. Chlorociboria bulgarioides/README.md


text:
# Releases

Action to create, edit or delete [GitHub Releases](https://developer.github.com/v3/repos/releases/).

> NOTE: this is a very rudimentary first release with no changelog or asset uploads.

## Inputs

### `repo_token`

**Required** The GITHUB_TOKEN.

### `task`

**Required** The task to execute: `create`, `edit` or `delete`.

### `tag_name`

**Required** The name of the tag.

### `target`

Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA.

### `name`

The name of the release.

### `body`

Text describing the contents of the tag.

### `draft`

`true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`.

### `prerelease`

`true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`.

## Outputs

### `upload_url`

The `upload_url` key returned from creating the release.

## Example usage

```yaml
- uses: bas/releases@v1
    id: release
    with:
      repo_token: ${{ secrets.GITHUB_TOKEN }}
      tag_name: 'v1.0'
      task: 'create'
- name: "Check upload URL"
  run: echo "Release created with ${{ steps.release.outputs.upload_url }}"

```

repository: bas/releases

repo_name: bas/releases


text:
# Resources

## Books
- [Code: The Hidden Language of Computer Hardware and Software](http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319/ref=zg_bs_3839_16)
- [Automate the Boring Stuff with Python](https://automatetheboringstuff.com)
- [Learn Python the Hard Way](http://learnpythonthehardway.org/book/)

## Online
- [google.com](https://google.com)
- [stackoverflow.com](https://stackoverflow.com)

## Reed Wilson
- Koding Messages
- [reedcwilson<EMAIL_ADDRESS>

## Exercises
- [Python Exercises](http://www.ling.gu.se/~lager/python_exercises.html)
- [Math Exercises](https://projecteuler.net/archives)

## Source Control
- [git](http://www.sitepoint.com/git-for-beginners/)
- [GitHub](https://guides.github.com/activities/hello-world/)
- [Bitbucket](https://confluence.atlassian.com/display/BITBUCKET/Getting+started+with+Bitbucket)

## Python
- [Python Download](https://www.python.org/downloads/) (we will use version 2.7 of Python)
- [Python Documentation](https://docs.python.org/2.7/)
- [IDLE Documentation](https://docs.python.org/2/library/idle.html)
- [Style Guide](https://www.python.org/dev/peps/pep-0008/)

## Text Editors
- [Sublime Text](http://www.sublimetext.com/)
- [Visual Studio Code](https://www.visualstudio.com/en-us/products/code-vs.aspx)
- [Atom](https://atom.io/)
- [Vim](http://www.vim.org/download.php) (more difficult)
- [Emacs](http://www.gnu.org/software/emacs/) (more difficult)

repository: reedcwilson/programming-fundamentals

repo_name: reedcwilson/programming-fundamentals


text:
# dynodao
[![Build Status](https://img.shields.io/github/workflow/status/dynodao/dynodao/CI)](https://github.com/dynodao/dynodao/actions/workflows/maven.yml)
[![codecov](https://codecov.io/gh/dynodao/dynodao/branch/master/graph/badge.svg)](https://codecov.io/gh/dynodao/dynodao)
```
taras@me:~$ dynodao
 ________________________________________
/ An annotation processor for generating \
| fluent, type-safe DynamoDB             |
\ interactions.                          /
 ----------------------------------------
\                             .       .
 \                           / `.   .' "
  \                  .---.  <    > <    >  .---.
   \                 |    \  \ - ~ ~ - /  /    |
         _____          ..-~             ~-..-~
        |     |   \~~~\.'                    `./~~~/
       ---------   \__/                        \__/
      .'   Working with the DynamoDb Java SDK can be tedious. The addition of DynamoDBMapper removes much of the tedium by using magic to serialize and deserialize classes, but [working with expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.QueryScanExample.html) is still awkward, and all that magic (read: reflection) incurs a runtime cost.

Dynodao takes a lot of inspiration from DynamoDBMapper. Compared to it, dynodao offers:

* **Fast execution** by using plain methods instead of reflective access
* **Compile-time type safety** wherever possible
  * The generated classes are specific to a *schema* which only contain operations allowed on the defined attributes and types
  * If an object cannot be automatically mapped to an `AttributeValue`, you get a compilation error
* **Easily debuggable code** as there is no magic at runtime
* **Real lazy pagination** as `PaginatedList` end up [storing all results](https://github.com/puppetlabs/aws-sdk-for-java/blob/master/src/main/java/com/amazonaws/services/dynamodb/datamodeling/PaginatedList.java#L121) from a read operation in memory

To generate all of the classes, you must define a *schema* class. This is just an annotated POJO (aka java-bean) which corresponds to the data you'd store in Dynamo. This class must adhere to the [java-beans](https://en.wikipedia.org/wiki/JavaBeans) specification, ie needs a default constructor, and getters and setters.

```java
@DynoDaoSchema(tableName = "things")
class MySchema {
    @DynoDaoHashKey
    private String hashKey;

    @DynoDaoRangeKey
    private String rangeKey;

    // default ctor, getters, setters omitted...
}
```

The processor generates several classes for simplifying the interactions with a DynamoDB table which stores items of type `MySchema`. Depending on the schema, many classes may be generated, but you don't really need to know about all of them (ctrl+space is your friend!). The main class you need to know about is the *staged builder*, which serves as your entry point to performing operations using dynodao.

To make a query you new up the staged builder, specify the index to use and then the keys. Pass that object to `DynoDao#get` which will make the appropriate read operation for you. This results a class with a lazy stream which automatically performs the pagination for you, keeping only one page in memory at a time.

```java
DynoDao dynoDao = new DynoDao(amazonDynamoDb);
Stream<MySchema> queryResult = dynoDao.get(new MySchemaStagedDynamoBuilder()
        .usingIndexName()
        .withHashKey("hashKey")
        .withRangeKey("rangeKey"));
```

repository: twentylemon/dynodao

repo_name: twentylemon/dynodao


text:
![header](/artwork/header.png)

# Klinker Apps Support Dashboard

These are the sites and services that I watch throughout the day. If you are a solo developer, you know the struggle of trying to keep up with support. For me, this tool has been indispensable as my work as continued to gain traction. To have an app I can open, that will instantly give access to all of the info I need has been an incredible timesaver. It displays:

* **Email** - an obvious support tool for anyone
* **Slack** - I have created different bots to notify me of reviews, purchases, daily summaries, GitHub interactions, etc
* **Pulse** - 3 pages: reviews, Firebase analytics, and the admin dashboard for the web app
* **Talon** - 2 pages: reviews and Firebase analytics
* **Purchases** - 2 pages: Play Store orders and Google Pay
* **GitHub Notifications**
* **Twitter** - a search for "@KlinkerApps @lukeklinker @TalonAndroid"
* **Google+ Notifications**
* **Cloud Consoles** - 3 pages: Heroku, AWS, and Redis
* **Jenkins**

At it's core, this app just aggregates webpages and makes them easier to access and combine. For example, while the email tab show a fullscreen Gmail view, the Pulse tab opens 3 webpages at once, to display them in a grid.

## Running the App

To build and run the apps locally:

```
// download electron
npm i -g electron

// prepare the installation
$ yarn

// run the app
$ yarn start
```

To package the apps for each platform:

```
$ yarn
$ yarn run build-mac
$ yarn run build-linux
$ yarn run build-windows
```

### Notes on Building for Mac

With MacOS Catalina (`10.14.5`), Apple requires DMG files to be notarized by the distributer. The files that I distribute are all signed and notarized by me.

If you are looking to develop the app yourself, you can debug and run the app through `yarn start` without issue. However, if you want to make a signed executable (`yarn build-mac`), you will need to set up your Apple ID and password for the notarization process.

To do this, you will first need a valid Apple developer account. You can sign up at https://developer.apple.com. You will need to use Xcode to [export your new developer signing information](https://help.apple.com/xcode/mac/current/#/dev154b28f09) and add it to your keychain.

You will then need to generate an app-specific password for that Apple ID. This is not the same as the password that you use to sign in to your developer account. You can create this app-specific password, here: https://appleid.apple.com

After completing those two steps, create a `.env` file in the root of this project. It should look something like:

```
<EMAIL_ADDRESS>APPLEIDPASS=xxxx-tttt-vvvv-aaaa
```

## Customizing the App

The pages I have set up probably won't be the same as what you need, since they are specific to my needs. These pages are easy to customize. They just run off of a naming convention. For example, to add a "Play Store" page:

1. Add an icon called `play-store.png` to the `/resources/images/` folder.
2. Add the HTML layout to a `play-store.html` file in the `/pages/` folder. I recommend just copying a layout from one of the currently available options. Or, you could make your own. The layout would typically define the `webviews`.
3. Add `play-store` to the `navLinks` array, in the `loader.js` file. It will automatically be added to whatever position you have defined.

The naming will need to be consistent across these three locations.

## Chrome App Version

This is also a compatible Chrome app. To load it through Chrome, rather than Electron, open `chrome://extensions`, select `Load Unpacked`, then just navigate to this project folder. Chrome will load it based on the `manifest.json` file.

This is actually the way I do it most of the time, to avoid having to maintain Electron. With Chrome, you get all of the new Chrome optimization automatically, when Chrome updates.

## License

    Copyright 2018 Luke Klinker

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

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

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


text:
# XYUUID

![Alt text](logo.png)

[![MIT License](https://img.shields.io/badge/license-MIT-brightgreen)](https://github.com/guojunliu/XYUUID/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/version-1.0.0-blue)](https://github.com/guojunliu/XYUUID)
[![GitHub Release](https://img.shields.io/badge/release-v1.0.0-orange)](https://github.com/guojunliu/XYUUID/releases/tag/1.0.0)
[![Cocopods](https://img.shields.io/cocoapods/v/XYUUID.svg?style=flat)](https://cocoapods.org/pods/XYUUID)
[![Github All Releases](https://img.shields.io/badge/downloads-41KB-yellowgreen)](https://github.com/guojunliu/XYUUID/files/5116427/XYUUID.zip)
[![Github Platform](https://img.shields.io/badge/platform-iOS-red)]()

English | [简体中文](README-cn.md)

### Installation

##### CocoaPods:
- `pod'XYUUID'`

##### Manual integration:
- Copy the `XYUUID` folder to your project

### Background

- Starting from iOS 10, IDFA may be restricted by users from ad tracking, resulting in the inability to obtain IDFA normally, thus making it impossible to use IDFA as a unique device identifier

### Advantages of XYUUID

- Simple API
- Use the latest iOS 14 API to get IDFA
- Universally unique identifiers with different persistence levels

### Advantages of uuidForDevice

- onger timeliness
- Long storage
- Lower conflict rate
- Lower drift rate

### API

Get UUIDs of different persistence levels

```
/// Random UUID, this value will be refreshed every time
+ (NSString *)uuid;

/// Install UUID, this value will be refreshed every time you reinstall
+ (NSString *)uuidForInstall;

/// Open the application UUID, this value will be refreshed every time the application is opened
+ (NSString *)uuidForAppOpen;

/// IDFA, open and close authorization, this value will be refreshed
+ (NSString *)uuidForIDFA;

/// IDFV
+ (NSString *)uuidForIDFV;

/// Device information UUID, generated according to device information, can remain unchanged for a period of time
+ (NSString *)uuidForDeviceInfo;

/// Keychain UUID, uninstall application remains unchanged
+ (NSString *)uuidForKeychain;

/// Device UUID, the unique identifier of the device
+ (NSString *)uuidForDevice;

```

### Persistence level

| UUID              	 | App relaunch | Reset Advertising Identifier | App reinstall | System reboot | System upgrade | System reset |
|-----------------------|:----------:|:------------:|:----------------------------:|:-------------:|:-------------:|:--------------:|
| `uuid `                |❌|❌|❌|❌|❌|❌|
| `uuidForInstall `      |✅|✅|❌|✅|✅|❌|
| `uuidForAppOpen `      |❌|✅|❌|❌|❌|❌|
| `uuidForIDFA `    	  |✅|❌|✅|✅|✅|❌|
| `uuidForIDFV `       	  |✅|✅|❌|✅|✅|❌|
| `uuidForDeviceInfo `   |✅|✅|✅|❌|❌|❌|
| `uuidForKeychain `     |✅|✅|✅|✅|✅|❌|
| `uuidForDevice `       |✅|✅|✅|✅|✅|❌|