text:
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/)

## [Unreleased]
### Added

### Removed

### Changed

## [v1.10.1](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.10...v1.10.1) - 2021-03-29
### Changed
- renamed `secure code warriors` mapping to `secure code warrior`

## [v1.10](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.9...v1.10) - 2021-03-18
### Added
- insufficient_security_configurability.verification_of_contact_method_not_required
- insufficient_security_configurability.weak_two_fa_implementation.two_fa_code_is_not_updated_after_new_code_is_requested
- insufficient_security_configurability.weak_two_fa_implementation.old_two_fa_code_is_not_invalidated_after_new_code_is_generated
- broken_authentication_and_session_management.weak_login_function.over_http
- server_security_misconfiguration.oauth_misconfiguration.account_squatting
- Third-party mapping to [Secure Code Warrior](https://www.securecodewarrior.com/) trainings
- automotive_security_misconfiguration.can.injection_battery_management_system
- automotive_security_misconfiguration.can.injection_steering_control
- automotive_security_misconfiguration.can.injection_pyrotechnical_device_deployment_tool
- automotive_security_misconfiguration.can.injection_headlights
- automotive_security_misconfiguration.can.injection_sensors
- automotive_security_misconfiguration.can.injection_vehicle_anti_theft_systems
- automotive_security_misconfiguration.can.injection_powertrain
- automotive_security_misconfiguration.can.injection_basic_safety_message
- automotive_security_misconfiguration.battery_management_system
- automotive_security_misconfiguration.battery_management_system.firmware_dump
- automotive_security_misconfiguration.battery_management_system.fraudulent_interface
- automotive_security_misconfiguration.gnss_gps
- automotive_security_misconfiguration.gnss_gps.spoofing
- automotive_security_misconfiguration.immobilizer
- automotive_security_misconfiguration.immobilizer.engine_start
- automotive_security_misconfiguration.abs
- automotive_security_misconfiguration.abs.unintended_acceleration_brake
- automotive_security_misconfiguration.rsu
- automotive_security_misconfiguration.rsu.sybil_attack
- automotive_security_misconfiguration.infotainment_radio_head_unit
- automotive_security_misconfiguration.infotainment_radio_head_unit.pii_leakage
- automotive_security_misconfiguration.infotainment_radio_head_unit.ota_firmware_manipulation
- automotive_security_misconfiguration.infotainment_radio_head_unit.code_execution_can_bus_pivot
- automotive_security_misconfiguration.infotainment_radio_head_unit.code_execution_no_can_bus_pivot
- automotive_security_misconfiguration.infotainment_radio_head_unit.unauthorized_access_to_services
- automotive_security_misconfiguration.infotainment_radio_head_unit.source_code_dump
- automotive_security_misconfiguration.infotainment_radio_head_unit.dos_brick
- automotive_security_misconfiguration.infotainment_radio_head_unit.default_credentials

### Removed
- insufficient_security_configurability.lack_of_verification_email
- broken_authentication_and_session_management.weak_login_function.https_not_available_or_http_by_default
- broken_authentication_and_session_management.weak_login_function.http_and_https_available
- broken_authentication_and_session_management.weak_login_function.lan_only
- cross_site_request_forgery_csrf.flash_based.high_impact
- cross_site_request_forgery_csrf.flash_based.low_impact
- automotive_security_misconfiguration.infotainment
- automotive_security_misconfiguration.infotainment.pii_leakage
- automotive_security_misconfiguration.infotainment.code_execution_can_bus_pivot
- automotive_security_misconfiguration.infotainment.code_execution_no_can_bus_pivot
- automotive_security_misconfiguration.infotainment.unauthorized_access_to_services
- automotive_security_misconfiguration.infotainment.source_code_dump
- automotive_security_misconfiguration.infotainment.dos_brick
- automotive_security_misconfiguration.infotainment.default_credentials

### Changed
 - server_security_misconfiguration.lack_of_security_headers.cache_control_for_a_non_sensitive_page updated remediation advice
 - server_security_misconfiguration.lack_of_security_headers.cache_control_for_a_sensitive_page updated remediation advice
 - cross_site_scripting_xss.flash_based priority changed from P4 to P5
 - cross_site_request_forgery_csrf.flash_based priority changed from null to P5 (due to children removal)
 - using_components_with_known_vulnerabilities.rosetta_flash priority changed from P4 to P5

## [v1.9](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.8...v1.9) - 2020-05-22
### Added
- sensitive_data_exposure.disclosure_of_secrets.for_publicly_accessible_asset
- sensitive_data_exposure.disclosure_of_secrets.for_internal_asset
- sensitive_data_exposure.disclosure_of_secrets.pay_per_use_abuse
- sensitive_data_exposure.disclosure_of_secrets.intentionally_public_sample_or_invalid
- sensitive_data_exposure.disclosure_of_secrets.data_traffic_spam
- sensitive_data_exposure.disclosure_of_secrets.non_corporate_user
- server_side_injection.ssti.basic
- server_side_injection.ssti.custom
- sensitive_data_exposure.via_localstorage_sessionstorage.sensitive_token
- sensitive_data_exposure.via_localstorage_sessionstorage.non_sensitive_token
- mobile_security_misconfiguration.auto_backup_allowed_by_default
- server_security_misconfiguration.no_rate_limiting_on_form.change_password
- server_side_injection.content_spoofing.impersonation_via_broken_link_hijacking
- cross_site_request_forgery_csrf.flash_based.high_impact
- cross_site_request_forgery_csrf.flash_based.low_impact
- insufficient_security_configurability.password_policy_bypass

### Removed
- sensitive_data_exposure.critically_sensitive_data.password_disclosure
- sensitive_data_exposure.critically_sensitive_data.private_api_keys
- sensitive_data_exposure.critically_sensitive_data

## [v1.8](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.7.1...v1.8) - 2019-09-25
### Added
- server_security_misconfiguration.race_condition
- server_security_misconfiguration.cache_poisoning
- indicators_of_compromise
- broken_authentication_and_session_management.failure_to_invalidate_session.on_two_fa_activation_change

### Removed
- mobile_security_misconfiguration.clipboard_enabled.on_sensitive_content
- mobile_security_misconfiguration.clipboard_enabled.on_non_sensitive_content

### Changed
- server_security_misconfiguration.mail_server_misconfiguration.email_spoofing_on_non_email_domain name changed from "Email Spoofing on non-email domain" to "Email Spoofing on Non-Email Domain"
- mobile_security_misconfiguration.clipboard_enabled priority changed from null to P5 (due to children removal)

##  [v1.7.1](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.7...v1.7.1) - 2019-04-15
### Added
- Remediation Advice and CVSS mappings for automotive_security_misconfiguration

##  [v1.7](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.6...v1.7) - 2019-03-13
### Added
- sensitive_data_exposure.weak_password_reset_implementation.token_leakage_via_host_header_poisoning
- server_security_misconfiguration.mail_server_misconfiguration.email_spoofing_on_non_email_domain
- broken_access_control.username_enumeration.non_brute_force
- insufficient_security_configurability.weak_two_fa_implementation.two_fa_secret_cannot_be_rotated
- insufficient_security_configurability.weak_two_fa_implementation.two_fa_secret_remains_obtainable_after_two_fa_is_enabled
- insufficient_security_configurability.weak_two_fa_implementation
- sensitive_data_exposure.token_leakage_via_referer.trusted_third_party
- sensitive_data_exposure.token_leakage_via_referer.untrusted_third_party
- cross_site_scripting_xss.ie_only.ie_eleven
- cross_site_scripting_xss.ie_only.older_version_ie_eleven
- automotive_security_misconfiguration
- automotive_security_misconfiguration.infotainment
- automotive_security_misconfiguration.infotainment.pii_leakage
- automotive_security_misconfiguration.infotainment.code_execution_can_bus_pivot
- automotive_security_misconfiguration.infotainment.code_execution_no_can_bus_pivot
- automotive_security_misconfiguration.infotainment.unauthorized_access_to_services
- automotive_security_misconfiguration.infotainment.source_code_dump
- automotive_security_misconfiguration.infotainment.dos_brick
- automotive_security_misconfiguration.infotainment.default_credentials
- automotive_security_misconfiguration.rf_hub
- automotive_security_misconfiguration.rf_hub.key_fob_cloning
- automotive_security_misconfiguration.rf_hub.can_injection_interaction
- automotive_security_misconfiguration.rf_hub.data_leakage_pull_encryption_mechanism
- automotive_security_misconfiguration.rf_hub.unauthorized_access_turn_on
- automotive_security_misconfiguration.rf_hub.roll_jam
- automotive_security_misconfiguration.rf_hub.replay
- automotive_security_misconfiguration.rf_hub.relay
- automotive_security_misconfiguration.can
- automotive_security_misconfiguration.can.injection_disallowed_messages
- automotive_security_misconfiguration.can.injection_dos
- server_side_injection.content_spoofing.email_hyperlink_injection_based_on_email_provider

### Removed
- broken_access_control.username_enumeration.data_leak
- insufficient_security_configurability.weak_2fa_implementation
- sensitive_data_exposure.token_leakage_via_referer.trusted_3rd_party
- sensitive_data_exposure.token_leakage_via_referer.untrusted_3rd_party
- cross_site_scripting_xss.ie_only.ie11
- cross_site_scripting_xss.ie_only.older_version_ie11

### Changed
- server_security_misconfiguration.username_enumeration name changed from "Username Enumeration" to "Username/Email Enumeration"
- broken_access_control.username_enumeration name changed from "Username Enumeration" to "Username/Email Enumeration"
- updated Remediation Advice reference URLs for OWASP

## [v1.6](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.5...v1.6) - 2018-09-13
### Added
- broken_access_control.server_side_request_forgery_ssrf.internal_high_impact
- broken_access_control.server_side_request_forgery_ssrf.internal_scan_and_or_medium_impact
- server_security_misconfiguration.mail_server_misconfiguration.no_spoofing_protection_on_email_domain
- server_security_misconfiguration.mail_server_misconfiguration.email_spoofing_to_inbox_due_to_missing_or_misconfigured_dmarc_on_email_domain
- server_security_misconfiguration.mail_server_misconfiguration.email_spoofing_to_spam_folder
- server_security_misconfiguration.mail_server_misconfiguration.missing_or_misconfigured_spf_and_or_dkim

### Removed
- broken_access_control.server_side_request_forgery_ssrf.internal
- server_security_misconfiguration.mail_server_misconfiguration.email_spoofing_on_email_domain
- server_security_misconfiguration.mail_server_misconfiguration.missing_spf_on_non_email_domain
- server_security_misconfiguration.mail_server_misconfiguration.spf_uses_a_soft_fail
- server_security_misconfiguration.mail_server_misconfiguration.spf_includes_10_lookups
- server_security_misconfiguration.mail_server_misconfiguration.missing_dmarc

## [v1.5](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.4...v1.5) - 2018-09-13
### Added
- unvalidated_redirects_and_forwards.open_redirect.flash_based
- cross_site_scripting_xss.flash_based
- server_side_injection.content_spoofing.flash_based_external_authentication_injection
- broken_authentication_and_session_management.session_fixation.remote_attack_vector
- broken_authentication_and_session_management.session_fixation.local_attack_vector
- broken_authentication_and_session_management.cleartext_transmission_of_session_token
- broken_access_control.server_side_request_forgery_ssrf.dns_query_only
- mobile_security_misconfiguration.clipboard_enabled
- mobile_security_misconfiguration.clipboard_enabled.on_sensitive_content
- mobile_security_misconfiguration.clipboard_enabled.on_non_sensitive_content
- server_security_misconfiguration.waf_bypass.direct_server_access
- broken_authentication_and_session_management.two_fa_bypass
- server_security_misconfiguration.no_rate_limiting_on_form.sms_triggering
- server_security_misconfiguration.mail_server_misconfiguration.email_spoofing_on_email_domain
- server_security_misconfiguration.insecure_ssl.certificate_error
- cross_site_scripting_xss.stored.privileged_user_to_privilege_elevation
- cross_site_scripting_xss.stored.privileged_user_to_no_privilege_elevation
- server_security_misconfiguration.clickjacking.form_input
- server_security_misconfiguration.misconfigured_dns.basic_subdomain_takeover
- server_security_misconfiguration.misconfigured_dns.high_impact_subdomain_takeover
- server_security_misconfiguration.captcha
- server_security_misconfiguration.captcha.missing
- cross_site_request_forgery_csrf.csrf_token_not_unique_per_request

### Removed
- server_security_misconfiguration.mail_server_misconfiguration.missing_spf_on_email_domain
- server_security_misconfiguration.mail_server_misconfiguration.email_spoofable_via_third_party_api_misconfiguration
- cross_site_scripting_xss.stored.admin_to_anyone
- server_security_misconfiguration.misconfigured_dns.subdomain_takeover
- server_security_misconfiguration.captcha_bypass

### Changed
- broken_authentication_and_session_management.failure_to_invalidate_session.on_password_change updated remediation advice
- CWE mapping default changed from `[CWE-2000]` to `null`
- Updated python version to 3.6
- cross_site_scripting_xss.stored.non_admin_to_anyone name changed from "Non-Admin to Anyone" to "Non-Privileged User to Anyone"
- server_security_misconfiguration.clickjacking.sensitive_action name changed from "Sensitive Action" to "Sensitive Click-Based Action"
- server_security_misconfiguration.captcha_bypass.implementation_vulnerability moved via subcategory change to server_security_misconfiguration.captcha.implementation_vulnerability
- server_security_misconfiguration.captcha_bypass.brute_force moved via subcategory change to server_security_misconfiguration.captcha.brute_force

## [v1.4](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.3.1...v1.4) - 2018-04-13
### Added
- insufficient_security_configurability.weak_password_reset_implementation.token_is_not_invalidated_after_login
- server_side_injection.content_spoofing.rtlo
- mapping of VRT to CWE
- server_security_misconfiguration.dbms_misconfiguration.excessively_privileged_user_dba
- cross_site_scripting_xss.stored.url_based
- server_security_misconfiguration.oauth_misconfiguration.insecure_redirect_uri
- server_security_misconfiguration.oauth_misconfiguration.account_takeover
- client_side_injection.binary_planting.non_default_folder_privilege_escalation
- broken_authentication_and_session_management.weak_login_function.not_operational
- broken_authentication_and_session_management.weak_login_function.other_plaintext_protocol_no_secure_alternative
- broken_authentication_and_session_management.weak_login_function.lan_only
- broken_authentication_and_session_management.weak_login_function.http_and_https_available
- broken_authentication_and_session_management.weak_login_function.https_not_available_or_http_by_default
- cross_site_scripting_xss.ie_only.ie11
- cross_site_scripting_xss.ie_only.older_version_ie11
- broken_authentication_and_session_management.failure_to_invalidate_session.on_logout_server_side_only
- sensitive_data_exposure.sensitive_token_in_url.user_facing
- sensitive_data_exposure.sensitive_token_in_url.in_the_background
- sensitive_data_exposure.sensitive_token_in_url.on_password_reset
- mapping of VRT to Remediation Advice

### Removed
- server_side_injection.sql_injection.error_based
- server_side_injection.sql_injection.blind
- broken_authentication_and_session_management.weak_login_function.over_http
- cross_site_scripting_xss.ie_only.older_version_ie_10_11
- cross_site_scripting_xss.ie_only.older_version_ie10
- broken_authentication_and_session_management.failure_to_invalidate_session.on_password_reset
- network_security_misconfiguration.telnet_enabled.credentials_required
- server_security_misconfiguration.using_default_credentials.production_server
- server_security_misconfiguration.using_default_credentials.staging_development_server

### Changed
- Use unittest for vrt validations
- broken_authentication_and_session_management.failure_to_invalidate_session.all_sessions name changed from "All Sessions" to "Concurrent Sessions On Logout"
- server_security_misconfiguration.oauth_misconfiguration.missing_state_parameter name changed from "Missing State Parameter" to "Missing/Broken State Parameter"
- server_security_misconfiguration.oauth_misconfiguration.missing_state_parameter priority changed from P4 to null
- server_security_misconfiguration.no_rate_limiting_on_form.login priority changed from P3 to P4
- client_side_injection.binary_planting.privilege_escalation name changed from "Privilege Escalation" to "Default Folder Privilege Escalation" priority changed from P4 to P3
- server_security_misconfiguration.lack_of_password_confirmation.change_email_address priority changed from P4 to P5
- server_security_misconfiguration.lack_of_password_confirmation.change_password priority changed from P4 to P5
- server_security_misconfiguration.unsafe_file_upload.no_antivirus priority changed from P4 to P5
- server_security_misconfiguration.unsafe_file_upload.no_size_limit priority changed from P4 to P5
- broken_authentication_and_session_management.failure_to_invalidate_session.on_logout name changed from "On Logout" to "On Logout (Client and Server-Side)"
- broken_authentication_and_session_management.failure_to_invalidate_session.on_password_change name changed from "On Password Change" to "On Password Reset and/or Change"
- network_security_misconfiguration.telnet_enabled priority changed from null to P5 (due to children removal)
- server_security_misconfiguration.using_default_credentials priority changed from null to P1 (due to children removal)

## [v1.3.1](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.3...v1.3.1) - 2017-10-31
### Changed
- references to the invalid insufficient_security_configurability.weak_password_policy.no_password_policy updated to insufficient_security_configurability.no_password_policy

## [v1.3.0](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.2...v1.3) - 2017-09-22
### Added
- insecure_data_transport.cleartext_transmission_of_sensitive_data
- broken_access_control
- broken_access_control.idor
- mobile_security_misconfiguration.tapjacking
- server_security_misconfiguration.misconfigured_dns.missing_caa_record
- mapping of VRT to CVSS V3
- server_security_misconfiguration.bitsquatting

### Removed
- missing_function_level_access_control
- insecure_direct_object_references_idor

### Changed
- missing_function_level_access_control.server_side_request_forgery_ssrf moved via category change to broken_access_control.server_side_request_forgery_ssrf
- missing_function_level_access_control.server_side_request_forgery_ssrf.internal moved via category change to broken_access_control.server_side_request_forgery_ssrf.internal
- missing_function_level_access_control.server_side_request_forgery_ssrf.external moved via category change to broken_access_control.server_side_request_forgery_ssrf.external
- missing_function_level_access_control.username_enumeration moved via category change to broken_access_control.username_enumeration
- missing_function_level_access_control.username_enumeration.data_leak moved via category change to broken_access_control.username_enumeration.data_leak
- missing_function_level_access_control.exposed_sensitive_android_intent moved via category change to broken_access_control.exposed_sensitive_android_intent
- missing_function_level_access_control.exposed_sensitive_ios_url_scheme moved via category change to broken_access_control.exposed_sensitive_ios_url_scheme
- cross_site_request_forgery_csrf.application_wide name changed from Applicaton-Wide to Application-Wide

## [v1.2.0](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.1...v1.2) - 2017-08-04
### Added
- sensitive_data_exposure.visible_detailed_error_page.descriptive_stack_trace
- sensitive_data_exposure.visible_detailed_error_page.detailed_server_configuration
- unvalidated_redirects_and_forwards.open_redirect.get_based
- sensitive_data_exposure.internal_ip_disclosure
- sensitive_data_exposure.visible_detailed_error_page.full_path_disclosure
- server_security_misconfiguration.cookie_scoped_to_parent_domain
- client_side_injection.binary_planting
- client_side_injection.binary_planting.privilege_escalation
- client_side_injection.binary_planting.no_privilege_escalation
- sensitive_data_exposure.token_leakage_via_referer.trusted_3rd_party
- sensitive_data_exposure.token_leakage_via_referer.untrusted_3rd_party
- server_security_misconfiguration.fingerprinting_banner_disclosure
- server_security_misconfiguration.lack_of_password_confirmation.manage_two_fa
- sensitive_data_exposure.json_hijacking
- cross_site_request_forgery_csrf.action_specific.logout
- broken_authentication_and_session_management.privilege_escalation
- insecure_data_transport.executable_download
- insecure_data_transport.executable_download.no_secure_integrity_check
- insecure_data_transport.executable_download.secure_integrity_check
- server_security_misconfiguration.rfd
- sensitive_data_exposure.xssi
- server_security_misconfiguration.misconfigured_dns.zone_transfer
- insufficient_security_configurability.no_password_policy (changelog text corrected in v1.4.0 #100)
- insecure_data_storage.server_side_credentials_storage
- insecure_data_storage.server_side_credentials_storage.plaintext

### Removed
- unvalidated_redirects_and_forwards.open_redirect.get_based_all_users
- unvalidated_redirects_and_forwards.open_redirect.get_based_authenticated
- unvalidated_redirects_and_forwards.open_redirect.get_based_unauthenticated
- sensitive_data_exposure.token_leakage_via_referer.over_https
- sensitive_data_exposure.mixed_content.sensitive_data_disclosure
- sensitive_data_exposure.mixed_content.requires_being_a_man_in_the_middle
- broken_authentication_and_session_management.session_token_in_url
- broken_authentication_and_session_management.session_token_in_url.over_http
- broken_authentication_and_session_management.session_token_in_url.over_https
- broken_authentication_and_session_management.authentication_bypass.vertical
- broken_authentication_and_session_management.authentication_bypass.horizontal
- insecure_data_storage.credentials_stored_unencrypted
- insecure_data_storage.credentials_stored_unencrypted.on_external_storage
- insecure_data_storage.credentials_stored_unencrypted.on_internal_storage
- insecure_data_storage.insecure_data_storage
- insecure_data_storage.insecure_data_storage.password
- insufficient_security_configurability.weak_password_policy.complexity_both_length_and_char_type_not_enforced
- insufficient_security_configurability.weak_password_policy.complexity_length_not_enforced
- insufficient_security_configurability.weak_password_policy.complexity_char_type_not_enforced
- insufficient_security_configurability.weak_password_policy.allows_reuse_of_old_passwords
- insufficient_security_configurability.weak_password_policy.allows_password_to_be_same_as_email_username

### Changed
- sensitive_data_exposure.visible_detailed_error_page name changed from 'Visible Detailed Error Page' to 'Visible Detailed Error/Debug Page'
- server_security_misconfiguration.mail_server_misconfiguration.missing_dmarc name changed from 'Missing DMARC' to 'Missing DKIM/DMARC'
- insecure_data_transport.ssl_certificate_pinning moved via category change to mobile_security_misconfiguration.ssl_certificate_pinning
- insecure_data_transport.ssl_certificate_pinning.absent moved via category change to mobile_security_misconfiguration.ssl_certificate_pinning.absent
- insecure_data_transport.ssl_certificate_pinning.defeatable moved via category change to mobile_security_misconfiguration.ssl_certificate_pinning.defeatable
- sensitive_data_exposure.mixed_content name changed from 'Mixed Content' to 'Mixed Content (HTTPS Sourcing HTTP)'
- sensitive_data_exposure.mixed_content priority changed from null to P5 (due to children removal)
- broken_authentication_and_session_management.authentication_bypass priority changed from null to P1 (due to children removal)
- insufficient_security_configurability.weak_password_policy priority changed from null to P5 (due to children removal)

## [v1.1.0](https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/v1.0...v1.1) - 2017-04-13
### Added
- directory_listing_enabled
- directory_listing_enabled.sensitive_data_exposure
- directory_listing_enabled.non_sensitive_data_exposure
- server_security_misconfiguration.path_traversal
- cross_site_scripting_xss.reflected.self
- cross_site_scripting_xss.reflected.non_self
- cross_site_request_forgery_csrf.application_wide
- cross_site_request_forgery_csrf.application_specific
- cross_site_request_forgery_csrf.authenticated_action
- cross_site_request_forgery_csrf.unauthenticated_action

### Removed
- poor_physical_security
- social_engineering

### Changed
- cross_site_scripting_xss.cookie_based priority changed from P4 to P5

## [1.0.0] - 2017-03-06

repository: bugcrowd/vulnerability-rating-taxonomy

gha_language: Python

repo_name: bugcrowd/vulnerability-rating-taxonomy


text:
# ms-registry
A registry service in Nodejs for storing information regarding micro-services and the dependencies between them.

## Running the application
> npm install
> npm run build
> npm start

## Running the application in dev-mode
> npm run dev

## Installation
> npm i lib -S

## ES-Lint
> npm run lint

## Babel
> npm run build

This command removes dist/ folder and builds it from the contents in src/ folder

## Mocha & Chai (Testing)
> npm run test

## Coverage Report
> npm run coverage

## Benchmark
> npm run benchmark

## Contributions
This is open-source, which makes it obvious for any PRs, but I would request you to add necessary test-cases for the same

license: MIT

repository: AkashBabu/ms-registry

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: AkashBabu/ms-registry


text:
---
title: Istio 1.12 Upgrade Notes
description: Important changes to consider when upgrading to Istio 1.12.0.
publishdate: 2021-11-18
weight: 20
---

When you upgrade from Istio 1.10.0 or 1.11.0 to Istio 1.12.0, you need to consider the changes on this page.
These notes detail the changes which purposefully break backwards compatibility with Istio 1.10.0 and 1.11.0.
The notes also mention changes which preserve backwards compatibility while introducing new behavior.
Changes are only included if the new behavior would be unexpected to a user of Istio 1.12.0.

## TCP probes now working as expected

When using TCP probes with older versions of Istio, the check was always successful. TCP probes simply check the port will accept a connection, and because all traffic is first redirected to the Istio sidecar, the sidecar will always accept the connection.
In Istio 1.12, this issue is resolved by using the [same mechanism used for HTTP probes](/docs/ops/configuration/mesh/app-health-check/).
As a result, TCP probes in 1.12+ will start to properly check the health of the configured port. If your probes previously would have failed, they may now start failing unexpectedly.
This change can be disabled temporarily by setting the `REWRITE_TCP_PROBES=false` environment variable in the Istiod deployment. The entire probe rewrite feature (HTTP and TCP) can also [be disabled](/docs/ops/configuration/mesh/app-health-check/#liveness-and-readiness-probes-using-the-http-request-approach).

## Default revision must be switched when performing a revision-based upgrade

When installing a new Istio control plane revision the previous resource validator will remain unchanged to prevent
unintended effects on the existing, stable revision. Once prepared to migrate over to the new control plane revision,
cluster operators should switch the default revision. This can be done through `istioctl tag set default --revision <new revision>`,
or if using a Helm-based flow, `helm upgrade istio-base manifests/charts/base -n istio-system --set defaultRevision=<new revision>`.

gha_language: HTML


text:
# About

This project took a baseline installation of a Linux distribution on a virtual machine and prepared it to host web applications, to include installing updates, securing it from a number of attack vectors and installing/configuring web and database servers.

The application can be seen live in the following URL: https://catalog.growthandtraction.com/

![](https://i.ibb.co/VpXVPPq/Screen-Shot-2019-06-09-at-12-11-27-PM.png)

## Table of Contents

- [Selecting a server host](#selecting-a-server-host)
- [Setting up the server](#setting-up-the-server)
- [Deploying the catalog app](#deploying-the-catalog-app)
- [Domain name](#setting-up-a-subdomain)
- [Configuring SSL](#configuring-ssl)
- [Adjusting OAuth from Google](#adjusting-oauth-from-google)
- [Third party resources](#third-party-resources)

## Selecting a server host

Tried Amazon Lightsail but it didn't seem as intuitive as I would have expected. So, I preferred to use Digital Ocean which I was already familiar with.

## Setting up the server

The following is a summary of the configuration steps made to the server:

1. Updated available package lists
2. Upgraded installed packages
3. Removed unneeded packages
4. Installed finger
5. Create a new user called `grader`
6. Used `usermod` command to add the `grader` user to the sudo group
7. Creaded .ssh folder and authorized_keys file for the user `grader`
8. Changed .ssh folder permissions to 700 and authorized_keys file to 644 and `grader` user as the owner
9. Created a SSH key pairs for `grader`
10. Copied SSH public keys to the server using `ssh-copy-id`
11. Disabled password-based authentication to the server to enforce key-based SSH authentication
12. Disabled remote login of the root user
13. Changed the default SSH port
14. Denied default SSH port 22
15. Restarted SSH
16. Created a server firewall to only allow incoming connections for SSH, WWW, HTTP (port 80), HTTPS (443) and NTP (port 123). Also allowed outgoing as default.

## Deploying the Catalog App

Next, I needed to get the catalog app up and running on the Ubuntu server. For this, I followed these steps:

1. Installed apache
2. Installed python 3.7 and pip3
3. Installed Flask and mod_wsgi.
4. Created a Flask application following the steps on this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps). This includes creating a __init__.py file, a virtual host config file `FlaskApp.conf` in the folder /etc/apache2/sites-available and enabling the virtual host, and also creating a `flaskapp.wsgi` file.
5. Restarted Apache
5. Git cloned the catalog app from my [repository](https://github.com/feconroses/item_catalog)
6. Installed needed modules and packages for the catalog app (httplib2, requests, sqlalchemy, oauth2client, and httplib2)
6. Renamed application.py as __init__.py
7. Deleted previous catalog.db file (which was cloned from the repo)
8. Installed and configured PostgreSQL. Logged in as default user postregs, connnected to the system using `psql`, created a postgres user `catalog` with password. Give the user permissions to create a database. Then, created a database named `catalog` with the owner `catalog`. Connected to the database catalog using `\c catalog` and revoked all rights `REVOKE ALL ON SCHEMA public FROM public;`. Also, granted only access to the catalog role `GRANT ALL ON SCHEMA public TO catalog;`. Finally exited PostresSQL.
9. Created a new PostgreSQL database schema using `python3 database_setup.py`
10. Installed psycopg2.
11. Changed the line starting with "engine" to `engine = create_engine('postgresql://catalog:DB-PASSWORD@localhost/catalog')`
12. Changed the relative URLs from the __init__.py to absolute (e.g. from `client_secrets.json` to `/var/www/FlaskApp/FlaskApp/client_secrets.json`)
13. Added a `.` to the relative URLs from the import packages in __init__.py (e.g. changed `from database_setup import Base, Category, CategoryItem, User` to `from .database_setup import Base, Category, CategoryItem, User`)
14. Restarted apache.

## Setting up a subdomain

Already had the domain https://growthandtraction.com, so I decided to use a subdomain catalog.growthandtraction for serving this catalog app. Created a A record and pointed it to the server in Digital Ocean.

## Configuring SSL

Now, I needed to configure SSL so users can access to the https://catalog.growthandtraction.com subdomain using HTTPS.

1. First, I created a self-signed SSL certificate and configured the `default-ssl.conf`
following the steps in this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04).
2. Then, I activated the SSL virtual host using `sudo a2ensite default-ssl.conf` and restarted Apache to load the new virtual host file using `sudo service apache2 restart`
3. Finally, to avoid getting a warning that the browser cannot verify the identity of my server because it has not been signed by one of the certificate authorities that it trusts, I got a third-party certificate using `Let's Encrypt` (used this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04) as a reference).

## Adjusting OAuth from Google

Finally, I needed to re-configure the OAuth from Google so it works for the new sub-domain. So, I adjusted the **Authorized JavaScript origins** in Google Console APIs so the Google OAuth can support the http://catalog.growthandtraction.com and https://catalog.growthandtraction.com. Also, added http://catalog.growthandtraction.com/login, https://catalog.growthandtraction.com/login, http://catalog.growthandtraction.com/gconnect, and https://catalog.growthandtraction.com/gconnect as **Authorized redirect URIs**. Then, I replaced the old client_secrets.json file in the server with the new client_secrets.json file.

## Third party resources

Used the following tutorials for completing this project:

* [How to deploy a Flask application on an Ubuntu VPS](https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps)
* [SSL on apache tutorial](https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04)
* [Let's Encrypt tutorial](https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04)

repository: feconroses/Linux-Server-Configuration

repo_name: feconroses/Linux-Server-Configuration


text:
# Getting Started

## Composer
Download composer in order to download the required dependencies.

Composer can be found at http://getcomposer.org/download/ OR you can download it using curl

```bash
curl -s https://getcomposer.org/installer | php
```

Then use composer to start a new surebert web project with the framework modules required.
```bash
composer create-project surebert/webapp-basic -s dev $YOUR_APPLICATION_NAME
```

# Serving your project
Once they are installed you can begin working on your project.  You will need to serve your applications /public
directory.  This can be done via apache on nginx in production but you can simply user php 5.4 new built in server for testing.  To do so cd into the /public directory and type

```bash
cd /PATH/TO/YOUR/PROJECT/public
php -S <IP_ADDRESS>:9000
```

Immediately you will see you projects /private/view/home/index.view file served.

If serving with apache add the site to your httpd.conf or httpd-vhosts.conf file
```text
<VirtualHost *:80>
    ServerName YOUR.DOMAIN
    DocumentRoot /PATH/TO/$YOUR_APPLICATION_NAME/public
    CustomLog /PATH/TO/$YOUR_APPLICATION_NAME_access.log combined
    ErrorLog  /PATH/TO/$YOUR_APPLICATION_NAME_error.log
    RewriteEngine On
    RewriteBase /
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule .* index.php [L]
</VirtualHost>
```

For more information see the wiki on gitlab https://gitlab.com/paulvisco/surebert-framework/wikis/home

repository: surebert/surebert-framework

gha_language: PHP

gha_license_id: MIT

repo_name: surebert/surebert-framework


text:
# terraform-aws-route53-resolver-rule
[![](https://github.com/rhythmictech/terraform-aws-route53-resolver-rule/workflows/check/badge.svg)](https://github.com/rhythmictech/terraform-aws-route53-resolver-rule/actions)

Create and manage a [Route 53 Resolver Resolver Rule](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-rules-managing.html).

## Usage

```
# Create a rule and assign it to a given VPC
module "route53-rule-ad-corp" {
  source            = "git::https://github.com/rhythmictech/terraform-aws-route53-resolver-rule?ref=v0.0.2"
  associated_vpcs   = ["vpc-1234567"]
  forward_domain    = "ad.mycompany.com."
  forward_ips       = ["<IP_ADDRESS>", "<IP_ADDRESS>"]
  resolver_endpoint = module.route53-outbound.endpoint_id
}

# Create a rule without VPC assignment(and share it via RAM)
module "route53-rule-ad-corp" {
  source            = "git::https://github.com/rhythmictech/terraform-aws-route53-resolver-rule?ref=v0.0.2"
  forward_domain    = "ad.mycompany.com."
  forward_ips       = ["<IP_ADDRESS>", "<IP_ADDRESS>"]
  resolver_endpoint = module.route53-outbound.endpoint_id
}

```

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| associated\_vpcs | List of VPC IDs to associate rule to | `list(string)` | null | no |
| dns\_port | DNS port to forward DNS requests to | `number` | `53` | no |
| forward\_domain | Domain name to forward requests for | `string` | n/a | yes |
| forward\_ips | List of IPs to forward DNS requests to | `list(string)` | n/a | yes |
| resolver\_endpoint | Resolver Endpoint ID | `string` | n/a | yes |
| resource\_share\_accounts | List of account IDs to share this resolver rule with | `list(string)` | `[]` | no |
| tags | Map of tags to apply to supported resources | `map(string)` | `{}` | no |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Related Projects
* [Route 53 Resolver Endpoint module](https://github.com/rhythmictech/terraform-aws-route53-endpoint)

gha_language: HCL


text:
---
layout: project
type: project
image: images/mupre.png
title: Multiartha Online Report System
permalink: projects/multiarthaors
# All dates must be YYYY-MM-DD format!
date: 2015-12-15
labels:
  - Java
  - MySQL

summary: Developed a Simple Online Report System for Maintenance Reporting using Java and MySql Database.
---

Helped in integrating routine maintenance report from multiple ATM booths managed by the company across Indonesia
and Providing maintenance portofolio to increase company’s credibility and clients’ reliability.

In this project I gained experience with full-stack web application design and associated technologies, including [MongoDB](http://mongodb.com) for database storage, the [Twitter Bootstrap](http://getbootstrap.com/) CSS Framework for the user interface, and Javascript for both client and server-side programming.

Source: theVacay/vacay


text:
---
id: 08a917a9-31f1-434d-bc7f-71dce2b63a27
title: Seeds
desc: ''
updated:<PHONE_NUMBER>105
created:<PHONE_NUMBER>105
parent: 348fc5c7-e1ba-4fa2-ab6d-a3c94628fa11
children: []
stub: false
fname: dendron.dev.api.seeds
hpath: dendron.dev.api.seeds
---
# Seeds

From dendron.topic.seeds

Go to text →

> Note: Seeds are highly experimental and under active development. Content here is subject to change.

![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/seeds.png)

Seeds represent existing knowledge out in the world. A seed could be a wikipedia article, a github repo, or an arbitrary website.

You can use a **Dendron Seed** to ingest data from existing sources and import them into your vault. Data ingestion is also referred to as **planting**.

Note that seeds differ from [pods](66727a39-d0a7-449b-a10d-f6c438185d7f) in that they help you ingest content from external sources from content that you might have no control over. Pods help you import/export your content between various platforms.

You can see an example of a published seeded vault [here](https://aws.dendron.so/).

# DendronSeed

Base class to extend from when creating a new seed. Documentation is still under construction. In the meanwhile, you can use [the code](https://github.com/dendronhq/dendron/blob/master/packages/seeds-core/src/base.ts#L39) as a guide when creating a new seed.

You can see an example of a seed implementation [here](https://github.com/dendronhq/seeds.aws/blob/master/packages/awsgeek-seed/src/index.ts#L63:L63)

repository: tsnieman/dendron-template

repo_name: tsnieman/dendron-template


text:
---
title: "Data Center and Systems Migration"
date: 2018-11-18T12:33:46+10:00
featured: true
weight: 1
---

UnifiedFederal brings extensive experience in data center operations for federal agencies to design comprehensive virtualization roadmaps. We leverage world-class best practices for planning migrations and transforming datacenter environments.

## Proven Technologies for  Proven Results

UnifiedFederal uses proven technologies including VMware for server virtualization solutions. Our infrastructure migration to OMB approved and FedRAMP certified cloud computing environments are designed to optimize system performance.

Our engineers bring over ten years of experience in data center operations for federal agencies, and our custom solutions are created for your specific and unique needs. We design and implement a cloud strategy by assessing your existing services, applications and infrastructure to develop a comprehensive solution to fit your cloud computing requirements.

UnifiedFederal offers solutions to optimize your system performance, improve user productivity and reduce overall IT costs for federal agencies and government organizations.


text:
# Episode 05 - Uprising of the Jokers

> Thanks for being with me in the 5th episode. That was fun! Thank you very much guys for the engagement, even if it was very late for you. Blazor for the Win :) Thanks for your ongoing support.

Watch the teaser on [Youtube](https://youtu.be/q0IR-mOuSWQ).

## Content

With each episode, the game will grow. In today's, episode we focus on a better game mechanic. The goal is to make it obvious that our quiz is fun and not totally serious.

To achieve this goal, we need to change the game mechanic. First, we change the counting practice from the correct answer to points. Each question can have a different value.  If a player chooses the right option, the points are added towards their balance. However, a wrong answer means the opposite. They are subtracted from their credit. To make it more interesting, the player can have a series. With each correctly answered question, their bonus is increased.

The second element are jokers. They intend to help the player; however, they came at a particular cost. The total reliable wisdom joker, for instance, will select the correct answer, but only with a certain probability. So, the chosen answer could be wrong.

From a development perspective, we will alter our ```GameSession``` and ```Player``` class to implement the logic. We started by counting points in addition to correct answers. The next step is to implement the bonus and count the points accordingly. This doesn't need new inputs or changes to the UI.  The jokers, however, need more input and visuals. So at these steps, there will changes to the ```GameSessionPage``` as well.

## Get started by cloning the rep

> You could start with the episode, but before you need to have set up your development machine. You can find [here](https://github.com/just-the-benno/BlazQ/tree/main/episode1) instructions per system (setup-windows.md etc).

The recommended way is cloning the repository.

```
git clone https://github.com/just-the-benno/BlazQ.git
```

And navigate to the directory ```episode5/BlazQ.Episode5/BlazQ.Episode5```. Open this directory with VS code, and you are prepared.
z
It is the content of episode 04 with a little bit of clean-up code. Besides, to speed up the design process, there are some changes in the ```app.css`` with additional classes.

## Learning outcome

Again, tiny steps and the evolution of existing classes lead us to the goal.  Without much change to the existing structure, we have been able to create a new feature. Sure, we needed to add more code to our classes, but we still have the same participants - classes and their way of communication.

Besides, that is something I hope for. You should get a feeling and understanding of how might software development is. We have been able to change and adapt our game constantly. Change has been easy, and if each reached level, we could add more changes in the same amount of time. You should be curious about what else you could do.

## Feedback form

BlazQ is feedback-driven. The feedback provided by you helps me to improve the learning experience for everyone. I highly encourage you to take the time to fill out the form. The results and what changed based on them will be discussed in the next session.

[Feedback form](https://forms.gle/Sz3mSGEw9CzsXd537)

If you didn't enjoy the experience, think about the why and feel free to send me your feedback directly or fill out the feedback form.

## Media

+ [Slides](media/slides-episode-05.pdf)
+ [Recorded session on YouTube](https://youtu.be/kwmf4v1heGE)

repository: just-the-benno/BlazQ

branch_name: refs/heads/main

repo_name: just-the-benno/BlazQ


text:
JulietMenu - Drop Down Menu
=======

[FULL DOCS](https://compasspointmedia.github.io/julietmenu)

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/compasspointmedia/julietmenu/master/LICENSE) [![Packagist](https://img.shields.io/packagist/dt/compasspointmedia/julietmenu.svg?style=flat-square)](https://packagist.org/packages/compasspointmedia/julietmenu) [![Packagist](https://img.shields.io/packagist/v/compasspointmedia/julietmenu.svg?style=flat-square)](https://packagist.org/packages/compasspointmedia/julietmenu) [![GitHub release](https://img.shields.io/github/release/compasspointmedia/julietmenu.svg?style=flat-square)](https://packagist.org/packages/compasspointmedia/julietmenu)

***Socialize:***

[![Twitter Follow](https://img.shields.io/twitter/follow/compasspointmedia.svg?style=social&label=Follow&style=flat-square)](https://twitter.com/compasspointmedia) [![Twitter](https://img.shields.io/twitter/url/https/github.com/compasspointmedia/julietmenu.svg?style=social&style=flat-square)](https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D)

**JulietMenu** is a Database driven, Dynamic Drop Down Menu Package for ***Laravel 5+*** . JulietMenu is Currently under development so it would be very greatful of you to co-operate with it. But as it's an opensource project you are free to contribute.

We are working on it constantly to make things right and get things on the right track. Bear with us just for some time. :)

> *FEEL FREE TO CONTRIBUTE TO THIS PROJECT BY  **FORKING, CREATING A PULL REQUEST, CREATING AN ISSUE, ETC.**. I'll be glad to answer them.*

# Full Documentation
The full documentation on **Usage**, **Installation**, **Configuration** can be found here: [compasspointmedia.github.io/julietmenu](https://compasspointmedia.github.com/julietmenu)

Things to do:

repository: CompassPointMedia/julietmenu

repo_name: CompassPointMedia/julietmenu


text:
# Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

## Types of Contributions

### Report Bugs

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

### Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.

### Implement Features

Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.

### Write Documentation

You can never have enough documentation! Please feel free to contribute to any
part of the documentation, such as the official docs, docstrings, or even
on the web in blog posts, articles, and such.

### Submit Feedback

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
  are welcome :)

## Get Started!

Ready to contribute? Here's how to set up `nemed` for local development.

1. Download a copy of `nemed` locally.
2. Install `poetry`
    - `poetry` is changing the way dependencies are managed, so as of July 2022, install `v1.2.0b2` (we will transition to `v1.2.0` once it is released)
    - The command below applies to UNIX systems. For Windows, refer to the [`poetry` docs](https://python-poetry.org/docs/master/#installation)

        ```console
        $ curl -sSL https://install.python-poetry.org | python3 - --version 1.2.0b2
        ```
4. Install `nemed` using `poetry`:
    - Developers should install additional `poetry` groups for development:
      - `docs` for documentation dependencies
      - `lint` for linters. `nemed` uses `flake8` and `mypy` for type annotations
      - `test` for testing utilities
      - (optional) `debug` for debugging tools

    ```console
    $ poetry install --with=docs,lint,test
    ```

3. Use `git` (or similar) to create a branch for local development and make your changes:

    ```console
    $ git checkout -b name-of-your-bugfix-or-feature
    ```

4. When you're done making changes, check that your changes conform to any code formatting requirements and pass any tests.

5. Commit your changes and open a pull request.

## Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include additional tests if appropriate.
2. If the pull request adds functionality, the docs should be updated.
3. The pull request should work for all currently supported operating systems and versions of Python.

## Code of Conduct

Please note that the `nemed` project is released with a
[Code of Conduct](CONDUCT.md). By contributing to this project you agree to abide by its terms.

repository: UNSW-CEEM/NEMED

repo_name: UNSW-CEEM/NEMED


text:
# Docker Storage

# Table of Contents

- [**Manage data in Docker**](#manage-data-in-docker-link)
  - [Choose the right type of mount](#choose-the-right-type-of-mount-link)
  - [Good use cases](#good-use-cases)
- [**Volumes**](#volumes-link)
- [**Bind Mounts**](#bind-mounts-link)
- [**tmpfs Mounts**](#tmpfs-mounts-link)
- [**Troubleshoot volume errors**](#troubleshoot-volume-errors-link)
- [**Store data within containers**](#store-data-within-containers-link)
- [**Docker storage drivers**](#docker-storage-drivers-link)
  - [Use the AUFS storage driver](#use-the-aufs-storage-driver-link)
  - [Use the BTRFS storage driver](#use-the-btrfs-storage-driver-link)
  - [Use the Device Mapper storage driver](#use-the-device-mapper-storage-driver-link)
  - [Use the OverlayFS storage driver](#use-the-overlayfs-storage-driver-link)
  - [Use the ZFS storage driver](#use-the-zfs-storage-driver-link)
  - [Use the VFS storage driver](#use-the-vfs-storage-driver-link)

# Manage data in Docker [link](https://docs.docker.com/storage/)

It is possible to store data within the writable layer of a container, but there are some downsides:

* The data doesn’t persist when that container is no longer running,
  and it can be difficult to get the data out of the container if another process needs it.
* A container’s writable layer is tightly coupled to the host machine where the container is running.
  You can’t easily move the data somewhere else.
* Writing into a container’s writable layer requires a storage driver to manage the filesystem.
  The storage driver provides a union filesystem, using the Linux kernel.
  This extra abstraction reduces performance as compared to using data volumes, which write directly to the host filesystem.

[_Back to TOC_](#table-of-contents)

## Choose the right type of mount [link](https://docs.docker.com/storage/#choose-the-right-type-of-mount)

* **Volumes** are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux).
  > Non-Docker processes should not modify this part of the filesystem. Volumes are the best way to persist data in Docker.
* **Bind mounts** may be stored anywhere on the host system. They may even be important system files or directories.
  > Non-Docker processes on the Docker host or a Docker container can modify them at any time.
* **tmpfs mounts** are stored in the host system’s memory only, and are never written to the host system’s filesystem.

![types-of-mounts](https://raw.githubusercontent.com/quanpan302/phd/master/docker/assets/img/docker-storage/types-of-mounts.png)

[_Back to TOC_](#table-of-contents)

## Good use cases

[_Back to TOC_](#table-of-contents)

### volumes

Volumes are the preferred way to **persist data in Docker containers and services**.
Some use cases for volumes include:

* **Sharing data among multiple running containers.**
  If you don’t explicitly create it, a volume is created the first time it is mounted into a container.
  When that container stops or is removed, the volume still exists.
  Multiple containers can mount the same volume simultaneously, either read-write or read-only.
  Volumes are only removed when you explicitly remove them.
* When the Docker host is not guaranteed to have a given directory or file structure.
  **Volumes help you decouple the configuration of the Docker host from the container runtime.**
* When you want to **store your container’s data on a remote host or a cloud provider, rather than locally**.
* When you need to **back up, restore, or migrate data from one Docker host to another**, volumes are a better choice.
  You can stop containers using the volume, then back up the volume’s directory (such as `/var/lib/docker/volumes/<volume-name>`).

[_Back to TOC_](#table-of-contents)

### bind mounts

In general, you should **use volumes where possible**.
Bind mounts are appropriate for the following types of use case:

* **Sharing configuration files from the host machine to containers.**
  This is how Docker provides DNS resolution to containers by default, by mounting `/etc/resolv.conf` from the host machine into each container.
* **Sharing source code or build artifacts between a development environment on the Docker host and a container.**
  For instance, you may mount a Maven target/ directory into a container,
  and each time you build the Maven project on the Docker host,
  the container gets access to the rebuilt artifacts.

    > If you use Docker for development this way, your production Dockerfile would copy the production-ready artifacts directly into the image, rather than relying on a bind mount.

* When the file or directory structure of the Docker host is guaranteed to be **consistent** with the bind mounts the containers require.

[_Back to TOC_](#table-of-contents)

### tmpfs mounts

`tmpfs` mounts are best used for cases when you do not want the data to persist either on the host machine or within the container.
This may be for security reasons or to protect the performance of the container when your application needs to write a large volume of non-persistent state data.

[_Back to TOC_](#table-of-contents)

### Tips for using bind mounts or volumes

* **If you mount an empty volume** into a directory in the container in which files or directories exist,
  these files or directories are propagated (copied) into the volume.
* Similarly, **if you start a container and specify a volume which does not already exist**,
  an empty volume is created for you.
  This is a good way to pre-populate data that another container needs.
* **If you mount a bind mount or non-empty volume** into a directory in the container in which some files or directories exist,
  these files or directories are obscured by the mount,
  just as if you saved files into `/mnt` on a Linux host and then mounted a **USB drive** into `/mnt`.

    The contents of `/mnt` would be obscured by the contents of the USB drive until the USB drive were unmounted.
    The obscured files are not removed or altered, but are not accessible while the bind mount or volume is mounted.

[_Back to TOC_](#table-of-contents)

# Volumes [link](https://docs.docker.com/storage/volumes/)

[_Back to TOC_](#table-of-contents)

# Bind Mounts [link](https://docs.docker.com/storage/bind-mounts/)

[_Back to TOC_](#table-of-contents)

# tmpfs Mounts [link](https://docs.docker.com/storage/tmpfs/)

[_Back to TOC_](#table-of-contents)

# Troubleshoot volume errors [link](https://docs.docker.com/storage/troubleshooting_volume_errors/)

[_Back to TOC_](#table-of-contents)

# Store data within containers [link](https://docs.docker.com/storage/storagedriver/)

[_Back to TOC_](#table-of-contents)

## Docker storage drivers [link](https://docs.docker.com/storage/storagedriver/select-storage-driver/)

[_Back to TOC_](#table-of-contents)

## Use the AUFS storage driver [link](https://docs.docker.com/storage/storagedriver/aufs-driver/)

[_Back to TOC_](#table-of-contents)

## Use the BTRFS storage driver [link](https://docs.docker.com/storage/storagedriver/btrfs-driver/)

[_Back to TOC_](#table-of-contents)

## Use the Device Mapper storage driver [link](https://docs.docker.com/storage/storagedriver/device-mapper-driver/)

[_Back to TOC_](#table-of-contents)

## Use the OverlayFS storage driver [link](https://docs.docker.com/storage/storagedriver/overlayfs-driver/)

[_Back to TOC_](#table-of-contents)

## Use the ZFS storage driver [link](https://docs.docker.com/storage/storagedriver/zfs-driver/)

[_Back to TOC_](#table-of-contents)

## Use the VFS storage driver [link](https://docs.docker.com/storage/storagedriver/vfs-driver/)

[_Back to TOC_](#table-of-contents)

repository: liujiamingustc/phd

repo_name: liujiamingustc/phd


text:
# sankey-layout

[![Build Status](https://travis-ci.org/ricklupton/sankey-layout.svg?branch=master)](https://travis-ci.org/ricklupton/sankey-layout)

Sankey diagram layout algorithm written in Javascript, intended for use with d3.
See [d3-sankey-diagram](https://github.com/ricklupton/d3-sankey-diagram) if you
just want to draw Sankey diagrams; this package contains the layout algorithms
but no visualisation.

If you use the Jupyter notebook, try
[ipysankeywidget](https://github.com/ricklupton/ipysankeywidget).

repository: ricklupton/sankey-layout

repo_name: ricklupton/sankey-layout


text:
# User Guide {: .doctitle}
Configuration and usage of ThemeScheduler.

---

## General Use
Set your rules in `User/ThemeScheduler.sublime-settings` (it will automatically be created).  Then set `#!js "enabled": True`.

### Optional Dependencies
- Applying filters requires [ThemeTweaker plugin](https://github.com/facelessuser/ThemeTweaker).
- Alternative notifications require the [SubNotify plugin](https://github.com/facelessuser/SubNotify).

## Examples
### Changing Themes

```js
    "themes":
    [
        {
            "theme": "Packages/User/Color Scheme/sometheme.tmTheme",
            "time": "21:30"
        },
        {
            "theme": "Packages/User/Color Scheme/someothertheme.tmTheme",
            "time": "8:30"
        }
    ]
```

[Package Control](https://packagecontrol.io/) will usually install theme packages as zip files with the `.sublime-package` extension in `Installed Packages` instead of the `Packages` folder, but you treat them as if they are stored in the `Packages` folder unzipped. Sublime handles the abstraction. For example, we will assume a package tmTheme file is installed in the root of a zipped package at `Installed Packages/Github Color Theme.subime-pakcage`:

```js
    "themes":
    [
        {
            "theme": "Packages/One Dark Color Scheme/One Dark.tmTheme",
            "time": "21:30"
        },
        {
            "theme": "Packages/Github Color Theme/GitHub.tmTheme",
            "time": "8:30"
        }
    ]
```

If a tmTheme is is installed in a sub-folder(s) within the zip, you would specify those the sub-folder(s) as well:

```js
    "themes":
    [
        {
            "theme": "Packages/Github Color Theme/sub-folder/GitHub.tmTheme",
            "time": "8:30"
        }
    ]
```

### Using filters
See ThemeTweaker's [custom filter documentationn](http://facelessuser.github.io/ThemeTweaker/usage/#custom-filter) for more info on configuring filter options.  The `filters` argument is constructed the same way.

```js
    "themes":
    [
        {
            "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
            "filters": "brightness(.98)@bg",
            "time": "10:00"
        },
        {
            "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
            "filters": "brightness(.97)@bg;glow(.1)",
            "time": "11:00"
        }
    ]
```

### Displaying Messages at Theme Change
Messages will be done through the Sublime API via a popup dialog or status bar.  If you are using the [SubNotify plugin](https://github.com/facelessuser/SubNotify) with the `use_sub_notify` option enabled in the settings file, messages will be displayed through SubNotify.

```js
    "themes":
    [
        {
            // Lunch
            "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
            "filters": "brightness(.96)@bg;glow(.1)",
            "time": "12:00",
            "msg": "Lunch time!"
        }
    ]
```

### Setting the UI Theme
When changing a theme, Sublime may look funny because it does not refresh all of the UI.  You can try resizing the window, moving the element (like a tab) or restart Sublime.  ThemeScheduler has no control over this, so if the results are unsatisfactory, or you find yourself restarting Sublime to clear the glitches, then this feature may not be one that you want to use.  If in the future, Sublime handles theme refresh better on theme changes, this feature may become even more useful.

```js
{
    // Lunch
    "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
    "filters": "brightness(.96)@bg;glow(.1)",
    "time": "12:00",
    "msg": "Lunch time!",
    "ui_theme": "Aprosopo<EMAIL_ADDRESS>    "time": "21:00"
},
```

### Run a Sublime ApplicationCommand
ThemeScheduler allows setting a specific command with arguments.  ThemeScheduler currently, only allows `Application` commands to be run on change.  You can work around this by simply writing an application command that wraps around view or windows commands if you absolutely have to run them.

```js
{
    // Lunch
    "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
    "filters": "brightness(.96)@bg;glow(.1)",
    "time": "12:00",
    "msg": "Lunch time!",
    "command": {
        "command": "set_aprosopo_theme", "args":
        {
            "theme": "light",
            "color": "blue"
        }
    },
    "time": "21:00"
},
```

## Settings
Theme Scheduler has only a small handful of settings outside the theme change rules.

### enabled
This is a boolean that controls whether ThemeScheduler is active.

```js
"enabled": true
```

### use_sub_notify
To use [SubNotify plugin](https://github.com/facelessuser/SubNotify) for notification messages, just enable SubNotify usage with this setting (assuming SubNotify has been installed).

```js
"use_sub_notify": true,
```

### themes
This is an array of all your ThemeScheduler rules.

```js

"themes": [
    {
        // Lunch
        "theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
        "filters": "brightness(.96)@bg;glow(.1)",
        "time": "12:00",
        "msg": "Lunch time!",
        "ui_theme": "Aprosopo<EMAIL_ADDRESS>        "time": "21:00"
    }
]
```

repository: Argimko/ThemeScheduler

repo_name: Argimko/ThemeScheduler


text:
# Aggregation Queries

### AVG

AVG() is an aggregate function that returns the average value for a numeric column.

```sql
SELECT AVG(column_name)
FROM table_name;
```

### COUNT

COUNT() is a function that takes the name of a column as an argument and counts the number of rows where the column is not NULL.

```sql
SELECT COUNT(column_name)
FROM table_name;

-- To count all rows
SELECT COUNT(*) FROM table_name;
```

### DIFFERENCE

```sql
SELECT MAX(POPULATION) - MIN(POPULATION)
FROM CITY;
```

### MAX

MAX() is a function that takes the name of a column as an argument and returns the largest value in that column.

```sql
SELECT MAX(column_name)
FROM table_name;
```

### MIN

MIN() is a function that takes the name of a column as an argument and returns the smallest value in that column.

```sql
SELECT MIN(column_name)
FROM table_name;
```

### ROUND

ROUND() is a function that takes a column name and an integer as an argument. It rounds the values in the column to the number of decimal places specified by the integer.

```sql
SELECT ROUND(column_name, integer)
FROM table_name;
```

### SUM

SUM() is a function that takes the name of a column as an argument and returns the sum of all the values in that column.

```sql
SELECT SUM(column_name)
FROM table_name;
```

### GROUP BY

GROUP BY is a clause in SQL that is only used with aggregate functions. It is used in collaboration with the SELECT statement to arrange identical data into groups.

The GROUP BY statement comes after any WHERE statements, but before ORDER BY or LIMIT

```sql
SELECT COUNT(*)
FROM table_name
GROUP BY column_name;

SELECT ROUND(imdb_rating), COUNT(name) FROM movies GROUP BY 1 ORDER BY 1;
-- Here, the 1 refers to the first column in our SELECT statement, ROUND(imdb_rating)

-- group by all
SELECT car_model, count(DISTINCT city) AS count FROM dealer GROUP BY ALL;
```

#### GROUP BY ALL

A shorthand notation to add all `SELECT`-list expressions not containing aggregate functions as `group_expression`s. If no such expression exist `GROUP BY ALL` is equivalent to omitting the `GROUP BY` clause which results in a global aggregation.

[GROUP BY clause | Databricks on AWS](https://docs.databricks.com/sql/language-manual/sql-ref-syntax-qry-select-groupby.html)

#### Guidelines

- All the dependent columns or columns used in GROUP BY function must form the basis of grouping, hence must be included in GROUP BY clause also
- GROUP BY clause does not support the use of column alias, but the actual names
- GROUP BY clause can only be used with aggregate functions like SUM, AVG, COUNT, MAX, and MIN
- Aggregate functions cannot be used in a GROUP BY clause
  - Use Inner query for solving this
  - Example -

```sql
SELECT
 cp.CoinId,
 cp.createdAt AS max_createdAt,
 COUNT(*) AS count_duplicates
FROM
 coin cp
 INNER JOIN (
  SELECT
   CoinId,
   MAX(createdAt) AS max_createdAt
  FROM
   coin
  GROUP BY
   CoinId
 ) cp_max
 ON cp.CoinId = cp_max.CoinId AND cp.createdAt = cp_max.max_createdAt
GROUP BY
 cp.CoinId,
 cp.createdAt
HAVING
 COUNT(*) > 1;
```

[Using Group functions](https://www.tutorialspoint.com/sql_certificate/using_the_group_functions.htm)

### Examples

```sql
SELECT
    CONCAT(HOUR(create_date),
            ':00-',
            HOUR(create_date) + 1,
            ':00') AS Hours,
    COUNT(*) AS `usage`
FROM
    communication_log
WHERE
    channel = 'sms'
        AND create_date BETWEEN '2021-08-25 00:00:00' AND NOW()
GROUP BY HOUR(create_date);

SELECT create_date, count(*)
FROM communication_log
WHERE
    channel = 'sms'
        AND create_date BETWEEN '2021-08-25 00:00:00' AND NOW()
GROUP BY hour( create_date ) , day( create_date );

SELECT YEAR(create_date),
    MONTH(create_date),
    count(id)
FROM st_customer_detail
GROUP BY YEAR(create_date),
        MONTH(create_date)
ORDER BY YEAR(create_date) DESC, MONTH(create_date) DESC;

SELECT
    template_id, COUNT(*) AS template_count
FROM
    (SELECT
        customer_id, template_id, COUNT(*) AS count
    FROM
        communication_log
    WHERE
        channel = 'sms' AND is_success = 1
            AND create_date BETWEEN NOW() - INTERVAL 16 HOUR AND NOW()
    GROUP BY customer_id , template_id) inner_query
WHERE
    count > 2
GROUP BY template_id
ORDER BY template_count DESC;

-- Department wise bifurcation
select a.channel, a.department, a.name, count(*) from (
SELECT ct.department, ct.channel, ct.name
FROM communication_log cl
LEFT JOIN communication_templates ct ON cl.template_id = ct.name
WHERE cl.id BETWEEN 422020686 AND 435852382
    AND is_success = '1'
GROUP BY cl.id
) a group by a.channel, a.department, a.name;

-- average temperature by hour and month
-- output hours in rows and months in columns
-- transform row as column using CASE
SELECT
    DAY(exam_date),
    AVG(marks),
    round(AVG(CASE WHEN MONTH(exam_date) = 1 THEN marks ELSE 0 END),2) jan,
    round(AVG(CASE WHEN MONTH(exam_date) = 2 THEN marks ELSE 0 END),2) feb,
    round(AVG(CASE WHEN MONTH(exam_date) = 3 THEN marks ELSE 0 END),2) mar,
    round(AVG(CASE WHEN MONTH(exam_date) = 4 THEN marks ELSE 0 END),2) apr,
    round(AVG(CASE WHEN MONTH(exam_date) = 5 THEN marks ELSE 0 END),2) may,
    round(AVG(CASE WHEN MONTH(exam_date) = 6 THEN marks ELSE 0 END),2) june,
    round(AVG(CASE WHEN MONTH(exam_date) = 7 THEN marks ELSE 0 END),2) july,
    round(AVG(CASE WHEN MONTH(exam_date) = 8 THEN marks ELSE 0 END),2) aug,
    round(AVG(CASE WHEN MONTH(exam_date) = 9 THEN marks ELSE 0 END),2) sep,
    round(AVG(CASE WHEN MONTH(exam_date) = 10 THEN marks ELSE 0 END),2) oct,
    round(AVG(CASE WHEN MONTH(exam_date) = 11 THEN marks ELSE 0 END),2) nov,
    round(AVG(CASE WHEN MONTH(exam_date) = 12 THEN marks ELSE 0 END),2) december
FROM
    demo_table
GROUP BY MONTH(exam_date) , DAY(exam_date);

-- count vowels in names in a table
select d_name, sum(
    if (d_name like '%a%', 1, 0)
    + if( d_name like '%e%', 1, 0)
    + if( d_name like '%i%', 1, 0)
    + if( d_name like '%o%', 1, 0)
    + if( d_name like '%u%', 1, 0)
) as vowel_count from (select distinct name as d_name
from demo_table) a group by a.d_name;
```

### max_by, min_by

Returns the value of an `expr1` associated with the maximum value of `expr2` in a group.

This function can also be invoked as a [window function](https://docs.databricks.com/sql/language-manual/sql-ref-window-functions.html) using the `OVER` clause.

This function is non-deterministic if `expr2` is not unique within the group.

```sql
-- max_by
SELECT max_by(x, y) FROM VALUES (('a', 10)), (('b', 50)), (('c', 20)) AS tab(x, y);
>>> b

-- min_by
SELECT min_by(x, y) FROM VALUES (('a', 10)), (('b', 50)), (('c', 20)) AS tab(x, y);
>>> a
```

[max\_by aggregate function | Databricks on AWS](https://docs.databricks.com/sql/language-manual/functions/max_by.html)

[min\_by aggregate function | Databricks on AWS](https://docs.databricks.com/sql/language-manual/functions/min_by.html)

## Databricks aggregate functions

|Function|Description|
|---|---|
|[any(expr)](https://docs.databricks.com/sql/language-manual/functions/any.html)|Returns true if at least one value of `expr` in the group is true.|
|[any_value(expr[,ignoreNull])](https://docs.databricks.com/sql/language-manual/functions/any_value.html)|Returns any random value of `expr` for a group of rows.|
|[approx_count_distinct(expr[,relativeSD])](https://docs.databricks.com/sql/language-manual/functions/approx_count_distinct.html)|Returns the estimated number of distinct values in `expr` within the group.|
|[approx_percentile(expr,percentage[,accuracy])](https://docs.databricks.com/sql/language-manual/functions/approx_percentile.html)|Returns the approximate percentile of the `expr` within the group.|
|[approx_top_k(expr[,k[,maxItemsTracked]])](https://docs.databricks.com/sql/language-manual/functions/approx_top_k.html)|Returns the top `k` most frequently occurring item values in an `expr` along with their approximate counts.|
|[array_agg(expr)](https://docs.databricks.com/sql/language-manual/functions/array_agg.html)|Returns an array consisting of all values in `expr` within the group.|
|[avg(expr)](https://docs.databricks.com/sql/language-manual/functions/avg.html)|Returns the mean calculated from values of a group.|
|[bit_and(expr)](https://docs.databricks.com/sql/language-manual/functions/bit_and.html)|Returns the bitwise `AND` of all input values in the group.|
|[bit_or(expr)](https://docs.databricks.com/sql/language-manual/functions/bit_or.html)|Returns the bitwise `OR` of all input values in the group.|
|[bit_xor(expr)](https://docs.databricks.com/sql/language-manual/functions/bit_xor.html)|Returns the bitwise `XOR` of all input values in the group.|
|[bool_and(expr)](https://docs.databricks.com/sql/language-manual/functions/bool_and.html)|Returns true if all values in `expr` are true within the group.|
|[bool_or(expr)](https://docs.databricks.com/sql/language-manual/functions/bool_or.html)|Returns true if at least one value in `expr` is true within the group.|
|[collect_list(expr)](https://docs.databricks.com/sql/language-manual/functions/collect_list.html)|Returns an array consisting of all values in `expr` within the group.|
|[collect_set(expr)](https://docs.databricks.com/sql/language-manual/functions/collect_set.html)|Returns an array consisting of all unique values in `expr` within the group.|
|[corr(expr1,expr2)](https://docs.databricks.com/sql/language-manual/functions/corr.html)|Returns Pearson coefficient of correlation between a group of number pairs.|
|[`count(*)`](https://docs.databricks.com/sql/language-manual/functions/count.html)|Returns the total number of retrieved rows in a group, including rows containing null.|
|[`count(expr[, …]`)](https://docs.databricks.com/sql/language-manual/functions/count.html)|Returns the number of rows in a group for which the supplied expressions are all non-null.|
|[count_if(expr)](https://docs.databricks.com/sql/language-manual/functions/count_if.html)|Returns the number of true values for the group in `expr`.|
|[count_min_sketch(expr, epsilon, confidence, seed)](https://docs.databricks.com/sql/language-manual/functions/count_min_sketch.html)|Returns a count-min sketch of all values in the group in `expr` with the `epsilon`, `confidence` and `seed`.|
|[covar_pop(expr1,expr2)](https://docs.databricks.com/sql/language-manual/functions/covar_pop.html)|Returns the population covariance of number pairs in a group.|
|[covar_samp(expr1,expr2)](https://docs.databricks.com/sql/language-manual/functions/covar_samp.html)|Returns the sample covariance of number pairs in a group.|
|[every(expr)](https://docs.databricks.com/sql/language-manual/functions/every.html)|Returns true if all values of `expr` in the group are true.|
|[first(expr[,ignoreNull])](https://docs.databricks.com/sql/language-manual/functions/first.html)|Returns the first value of `expr` for a group of rows.|
|[first_value(expr[,ignoreNull])](https://docs.databricks.com/sql/language-manual/functions/first_value.html)|Returns the first value of `expr` for a group of rows.|
|[hll_sketch_agg(expr[,lgConfigK])](https://docs.databricks.com/sql/language-manual/functions/hll_sketch_agg.html)|Returns a HyperLogLog sketch used to approximate a distinct values count.|
|[hll_union_agg(expr[,allowDifferentLgConfigK])](https://docs.databricks.com/sql/language-manual/functions/hll_union_agg.html)|Aggregates HyperLogLog sketches for a group of rows.|
|[kurtosis(expr)](https://docs.databricks.com/sql/language-manual/functions/kurtosis.html)|Returns the kurtosis value calculated from values of a group.|
|[last(expr[,ignoreNull])](https://docs.databricks.com/sql/language-manual/functions/last.html)|Returns the last value of `expr` for the group of rows.|
|[last_value(expr[,ignoreNull])](https://docs.databricks.com/sql/language-manual/functions/last_value.html)|Returns the last value of `expr` for the group of rows.|
|[max(expr)](https://docs.databricks.com/sql/language-manual/functions/max.html)|Returns the maximum value of `expr` in a group.|
|[max_by(expr1,expr2)](https://docs.databricks.com/sql/language-manual/functions/max_by.html)|Returns the value of an `expr1` associated with the maximum value of `expr2` in a group.|
|[mean(expr)](https://docs.databricks.com/sql/language-manual/functions/mean.html)|Returns the mean calculated from values of a group.|
|[median(expr)](https://docs.databricks.com/sql/language-manual/functions/median.html)|Returns the median calculated from values of a group.|
|[min(expr)](https://docs.databricks.com/sql/language-manual/functions/min.html)|Returns the minimum value of `expr` in a group.|
|[min_by(expr1, expr2)](https://docs.databricks.com/sql/language-manual/functions/min_by.html)|Returns the value of an `expr1` associated with the minimum value of `expr2` in a group.|
|[mode(expr)](https://docs.databricks.com/sql/language-manual/functions/mode.html)|Returns the most frequent, not `NULL`, value of `expr` in a group.|
|[percentile(expr, percentage [,frequency])](https://docs.databricks.com/sql/language-manual/functions/percentile.html)|Returns the exact percentile value of `expr` at the specified `percentage`.|
|[percentile_approx(expr,percentage[,accuracy])](https://docs.databricks.com/sql/language-manual/functions/percentile_approx.html)|Returns the approximate percentile of the `expr` within the group.|
|[percentile_cont(pct) WITHIN GROUP (ORDER BY key)](https://docs.databricks.com/sql/language-manual/functions/percentile_cont.html)|Returns the interpolated percentile of the `key` within the group.|
|[percentile_disc(pct) WITHIN GROUP (ORDER BY key)](https://docs.databricks.com/sql/language-manual/functions/percentile_disc.html)|Returns the discrete percentile of the `key` within the group.|
|[regr_avgx(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_avgx.html)|Returns the mean of `xExpr` calculated from values of a group where `xExpr` and `yExpr` are NOT NULL.|
|[regr_avgy(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_avgy.html)|Returns the mean of `yExpr` calculated from values of a group where `xExpr` and `yExpr` are NOT NULL.|
|[regr_count(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_count.html)|Returns the number of non-null value pairs `yExpr`, `xExpr` in the group.|
|[regr_intercept(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_intercept.html)|Returns the intercept of the uni-variate linear regression line in a group where `xExpr` and `yExpr` are NOT NULL.|
|[regr_r2(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_r2.html)|Returns the coefficient of determination from values of a group where `xExpr` and `yExpr` are NOT NULL.|
|[regr_slope(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_slope.html)|Returns the slope of the linear regression line of non-null value pairs `yExpr`, `xExpr` in the group.|
|[regr_sxx(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_sxx.html)|Returns the sum of squares of the `xExpr` values of a group where `xExpr` and `yExpr` are NOT NULL.|
|[regr_sxy(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_sxy.html)|Returns the sum of products of `yExpr` and `xExpr` calculated from values of a group where `xExpr` and `yExpr` are NOT NULL.|
|[regr_syy(yExpr, xExpr)](https://docs.databricks.com/sql/language-manual/functions/regr_syy.html)|Returns the sum of squares of the `yExpr` values of a group where `xExpr` and `yExpr` are NOT NULL.|
|[skewness(expr)](https://docs.databricks.com/sql/language-manual/functions/skewness.html)|Returns the skewness value calculated from values of a group.|
|[some(expr)](https://docs.databricks.com/sql/language-manual/functions/some.html)|Returns true if at least one value of `expr` in a group is `true`.|
|[std(expr)](https://docs.databricks.com/sql/language-manual/functions/std.html)|Returns the sample standard deviation calculated from the values within the group.|
|[stddev(expr)](https://docs.databricks.com/sql/language-manual/functions/stddev.html)|Returns the sample standard deviation calculated from the values within the group.|
|[stddev_pop(expr)](https://docs.databricks.com/sql/language-manual/functions/stddev_pop.html)|Returns the population standard deviation calculated from values of a group.|
|[stddev_samp(expr)](https://docs.databricks.com/sql/language-manual/functions/stddev_samp.html)|Returns the sample standard deviation calculated from values of a group.|
|[sum(expr)](https://docs.databricks.com/sql/language-manual/functions/sum.html)|Returns the sum calculated from values of a group.|
|[try_avg(expr)](https://docs.databricks.com/sql/language-manual/functions/try_avg.html)|Returns the mean calculated from values of a group, NULL if there is an overflow.|
|[try_sum(expr)](https://docs.databricks.com/sql/language-manual/functions/try_sum.html)|Returns the sum calculated from values of a group, NULL if there is an overflow.|
|[var_pop(expr)](https://docs.databricks.com/sql/language-manual/functions/var_pop.html)|Returns the population variance calculated from values of a group.|
|[var_samp(expr)](https://docs.databricks.com/sql/language-manual/functions/var_samp.html)|Returns the sample variance calculated from values of a group.|
|[variance(expr)](https://docs.databricks.com/sql/language-manual/functions/variance.html)|Returns the sample variance calculated from values of a group.|

### COUNT_IF

```sql
SELECT
COUNT_IF(col1 = 'abc' AND col2 IN ('abc', 'xyz')) AS cUser
FROM table_name
WHERE status = 'ACTIVE'
```

## Links

[Window Functions](languages/sql/dql-data-query-language/window-functions.md)

gha_language: JavaScript


text:
# A tiny graph database

Goal: A simple and relatively efficient graph data store that can
handle billions of vertexes on single machine.  In particular, we
wanted a local copy of [Freebase](https://www.freebase.com/).

This project is called "Tinygraph" because the codebase is
tiny.  It just doesn't do much, but it's pretty efficient and easy to
use.

Status: Experimental.  Definitely not over-engineered.

What it can do:

1. Store triples (actually "quads") indexed for (prefixes of)
   subject-property-object, object-property-subject, and
   property-subject-object access.
2. Find edges based on those indexes.
3.
4. Give you a barely functional Javascript-from-HTTP API based on that
   Go API.

That's about it.  The core code is fewer than 1,000 lines of Go.

What it can't do:

1. Query planning.  You just traverse paths.  (But it'll be easy to expose RocksDB's `GetApproximateSizes`.)
2. Fancy [graph algorithms](http://en.wikipedia.org/wiki/Category:Graph_algorithms).
3. Provide much safety.

For comparison, see:

1. [Cayley](https://github.com/google/cayley)
2. [Accumulo](https://accumulo.apache.org/)
3. [Neo4j](http://neo4j.com/)

and many other [graph databases](http://en.wikipedia.org/wiki/Graph_database).

How it works:

1. Uses [RocksDB](http://rocksdb.org/).  Could use any key-value store
   that provides prefix ordering.
2. Does not intern strings.  Instead, uses RocksDB's Snappy
   compression in an simple attempt to mitigate the cost of duplicates
   (while avoiding read+update during each write).
3. Uses the nifty
   [`robertkrimen/otto`](https://github.com/robertkrimen/otto)
   Javascript implementation in Go.

Getting started:

Get [Go](https://golang.org/).

Then try to get [RocksDB](http://rocksdb.org/) built:

```Shell
gcc -v # 4.7+
sudo apt-get install -y libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev
git clone https://github.com/facebook/rocksdb.git
cd rocksdb
make shared_lib
# Suit yourself re installation.
sudo cp librocksdb.so /usr/lib
(cd /usr/include && sudo ln -s ~/rocksdb/include/rocksdb rocksdb)
```

Then

```Shell
go get && go build
```

Quick example:

It's easy to load [WordNet RDF](http://wordnet-rdf.princeton.edu/).
Here's an example of loading a useful subset of WordNet quickly.

```Shell
wget http://wordnet-rdf.princeton.edu/wn31.nt.gz
zcat wn31.nt.gz | grep 'hyponym\|hypernym\|meronym\|holonym\|#label' | gzip > somewn.nt.gz
rm -rf wordnet.db
./tinygraph -config config.wordnet -lang eng -load somewn.nt.gz -serve
```

Then:

```Shell
cat <<EOF > holo.js
function holonyms(term) {
  var label = G.Bs("http://www.w3.org/2000/01/rdf-schema#label");
  var holo = G.Bs("http://wordnet-rdf.princeton.edu/ontology#part_holonym");
  var paths = G.In(label).Out(holo).Out(label).Walk(G.Graph(), G.Vertex(term)).Collect();
  var uniq = {};
  var acc = [];
  for (var i=0; i<paths.length; i++) {
	  var h = paths[i][2].Strings()[2];
	  if (!uniq[h]) {
          uniq[h] = true;
		  acc.push(h);
	  }
  }
  return acc;
}
EOF
curl --data-urlencode<EMAIL_ADDRESS>http://localhost:8080/js
# Use that stored procedure.
curl --data-urlencode 'js=holonyms("Africa")' http://localhost:8080/js
```

You'll hopefully see

```Javascript
[
    "Barbary",
    "Nubia",
    "Mahgrib",
    "African nation",
    "East Africa",
    "South West Africa",
    "Republic of Angola",
    "Republic of Burundi",
    "Republic of Cameroon",
    "Central African Republic",
    "Tchad",
    "Republic of the Congo",
    "Zaire",
	...
]
```

Check out [`examples/`](examples) for more.  Also see `freebase.sh`.

ToDo:

1. More logging.
2. More test cases.
3. More docs (especially configuration).
4. Buffered Stepper channels.
5. Expose RocksDB `GetApproximateSizes`.
6. Deal with concurrent requests and Javascript.
7. Concurrency using mutexes and such.

repository: jsmorph/tinygraph

repo_name: jsmorph/tinygraph


text:
# [Carts examples](https://developer.epages.com/apps/api-reference/resource-carts.html)

This example assumes you have configured the `shop` correctly.

All this calls returns an **Epages::Cart** instance.
**Epages::Cart** is an object that represents an ePages shop cart.

## [Cart post call](https://developer.epages.com/apps/api-reference/post-shops-shopid-carts.html)

This call creates a cart for the shop and returns a Epages::Shop instance.
Default options:
 * currency: 'EUR'
 * taxType: 'GROSS'
 * locale: 'en_GB'
 * lineItems: []

```
default_cart = shop.create_cart
us_cart = shop.create_cart(currency: 'USD', locale: 'en_US')
```

## [Cart by id](https://developer.epages.com/apps/api-reference/get-shops-shopid-carts-cartid.html)

This call retrieve a specific cart using its ID or **Epages::Cart** instance. Returns a Epages::Shop instance
```
cart = shop.cart("561E0DA0-91C0-4D12-79C6-D5809AB3231B")
```

##[Order a Cart](https://developer.epages.com/apps/api-reference/post-shops-shopid-carts-cartid-order.html)

This call orders a cart and returns the order generated by the cart. To be accepted the cart must have the billing address attribute.
```
address = Epages::Address.new({firstName: 'Domingo', lastName: 'Cividanes', street: 'Fake Street', zipCode: 20_253, city: 'HH', country: 'GE', emailAddress<EMAIL_ADDRESS>products = shop.products.take(3) # contains the products to be ordered

cart = shop.create_cart(line_items: products.map(&:to_line_item))
cart = shop.update_cart_billing_address(cart, address)
order = shop.order_cart(cart)
```

## [Add line_item to cart](https://developer.epages.com/apps/api-reference/post-shops-shopid-carts-cartid-line-items.html)

This call add a line_item to the cart, and returns the instance of the Epages::Cart updated with the product.
The default quantity of the product is 1. To change it, add a third parameter.
This method has the alias **add_product_to_cart** to ease the syntax of the code.
```
updated_cart = shop.cart_line_item(old_cart, product)
updated_cart = shop.add_product_to_cart(updated_cart, another_product, 3)
```

## [Update a line_item](https://developer.epages.com/apps/api-reference/put-shops-shopid-carts-cartid-line-items-lineitemid.html)

This call modifies a specified product line_item in a cart indicated by the line_item id or a Epages::LineItem instance. Returns the updated Epages::Cart instance.
```
cart = shop.update_cart_line_item(old_cart, lineitem, quantity: 3)
```

## [Delete a line_item](https://developer.epages.com/apps/api-reference/delete-shops-shopid-carts-cartid-line-items-lineitemid.html)

This call deletes a specified product line_item in a cart indicated by the line_item id or a Epages::LineItem instance. Returns the updated Epages::Cart instance.
```
cart = shop.delete_cart_line_item(old_cart, lineitem)
```

## [Update Billing Address](https://developer.epages.com/apps/api-reference/put-shops-shopid-carts-cartid-billing-address.html) and [Update Shipping Address](https://developer.epages.com/apps/api-reference/put-shops-shopid-carts-cartid-shipping-address.html)

This call updates addresses of the cart with the Epages::Address instance indicated. Returns the updated Epages::Cart instance.
```
address_data = {firstName: 'Domingo', lastName: 'Cividanes', street: 'Fake Street', zipCode: 20_253, city: 'HH', country: 'GE', emailAddress<EMAIL_ADDRESS>address = Epages::Address.new(address_data)
cart = shop.update_cart_billing_address(old_cart, address)
cart = shop.update_cart_shipping_address(cart, address)
```

## [Delete Billing Address](https://developer.epages.com/apps/api-reference/delete-shops-shopid-carts-cartid-billing-address.html) and [Delete Shipping Address](https://developer.epages.com/apps/api-reference/delete-shops-shopid-carts-cartid-shipping-address.html)

This call deletes addresses of the car adn returns the updated Epages::Cart instance.
```
cart = shop.delete_cart_billing_address(old_cart)
cart = shop.delete_cart_shipping_address(cart)
```

repository: askolsam/kaaos-epages-rest-ruby

repo_name: askolsam/kaaos-epages-rest-ruby


text:
# Introduction

## What is Lotus?

Lotus is a Ruby MVC web framework comprised of many micro-libraries. It has a
simple, stable API, a minimal DSL, and prioritises the use of plain objects over
magical, over-complicated classes with too much responsibility.

The natural repercussion of using simple objects with clear responsibilities
is more boilerplate code. Lotus provides ways to mitigate
this extra legwork while keeping the underlying implementation the same.

## Why Choose Lotus?

Here are three compelling reasons to choose Lotus:

### Lotus is Lightweight

Lotus's code is relatively short. It only concerns itself with the things
that all web applications—regardless of implementation—need.

Lotus ships with several optional modules that can be included if required.
Other libraries that extend functionality can also be included easily.

### Lotus is Architecturally Sound

If you've ever felt like you're stretching against the 'Rails way', or found
it difficult to write tests for your Sinatra routes, you'll appreciate Lotus.

Lotus keeps controller actions class-based, making them easier to test in isolation.

Lotus also encourages you to write your application logic in use case or
workflow objects, and views are separated from templates so the logic inside
of them can be well-contained and tested in isolation.

### Lotus is Threadsafe

Making use of green threads is a great way to boost the performance of your
application. It shouldn't be hard to write thread-safe code, and Lotus (when
using the entire framework, or using only parts of it) is runtime threadsafe.

**This document is a stub. You can help by expanding it, reviewing its content,
or by verifying its correctness. Please file any issues in the
[Github Issue Tracker](https://github.com/lotus/docs/issues).**

repository: LeoTeam/docs

repo_name: LeoTeam/docs


text:
# jeu-memory

A simple memory game with multiple themes written in Java.

## Usage

To run the program:
```bash
java -jar jeu-memory.jar
```

## License
[MIT](https://raw.githubusercontent.com/Nakwendaa/jeu-memory/master/LICENSE)

repository: Nakwendaa/jeu-memory

repo_name: Nakwendaa/jeu-memory


text:
---
id: api_version
title: Get API Version information
sidebar_position: 8
---

This method can be used to retrieve api version information

## Input

```
GET /v1/version
```

### Request headers

```
Accept: application/json
```

## Response

Headers: `Status: 200 OK`

## Response Body

Json Response

```json
{
    "release": "1.0.5",
    "commit": "f9f2e8c5f02lbcc94fe76b0d3cfa5d20d9365444",
    "build_time": "2019-11-01T12:51:04Z",
    "golang": "go1.11.5",
    "compiler": "gc",
    "os": "linux",
    "architecture": "amd64"
}
```

repository: ARGOeu/argo-messaging

gha_language: Go

repo_name: ARGOeu/argo-messaging


text:
  ☕ javascript, assemble.

  Project   |
  Technology   |
  License

## 💻 Project

The RocketShoes is an application that simulates an e-commerce to buy tennis shoes.

## :rocket: Technology

This project was developed with the following technologies:

- [Node.js](https://nodejs.org/en/)
- [React](https://reactjs.org)

## :information_source: How to use

To clone and run this application, you will need [Git](https://git-scm.com), [Node.js][nodejs] e [Yarn][yarn] installed on your computer.

Through command line:

```bash
# Clone this repositori
$ https://github.com/DanielNeris/bootcamp-gostack-07.git
# Go to backend
$ cd backend
# Install dependences
$ yarn install
# Start the servidor
$ yarn dev
```

[nodejs]: https://nodejs.org/
[yarn]: https://yarnpkg.com/
[vc]: https://code.visualstudio.com/

## :memo: License

This project is under the MIT license. See the [LICENSE](LICENSE.md) for more details.

---

Made with ♥ by Daniel


text:
Example on how to add or update a Chart:

```
helm repo add falcosecurity https://falcosecurity.github.io/charts
helm repo up
helm fetch falcosecurity/falco --version 1.5.2 --untar
```

# Note

The Starboard Operator currently uses a subchart containing a PSP to allow the Trivy scanners to run and the RBAC to use it. Keep it until it is supported upstream.

repository: DutchEllie/compliantkubernetes-apps

repo_name: DutchEllie/compliantkubernetes-apps


text:
#### This repo contains:
__env.list__ : a file that is to be included while building docker containers. This file provides Database credentials, Eureka Server host to containers. e.g.,

```shell script
sudo docker run -d -p 8080:8080 --env-file ./env.list --network="host" <docker-image-name>
```

repository: pritamprasd/e-commerce

gha_language: Java

repo_name: pritamprasd/e-commerce


text:
# > Mouse

The `Mouse` library lets us query the mouse.
The mouse adds the following global variables for querying the mouse buttons.

- `MOUSE_BUTTON_LEFT`
- `MOUSE_BUTTON_MIDDLE`
- `MOUSE_BUTTON_RIGHT`

##X

The current X position of the mouse.

`float Mouse.X()`

```lua
local x = Mouse:X()
```

##Y

The current Y position of the mouse.

`float Mouse.Y()`

```lua
local y = Mouse:Y()
```

##Position

The X, Y position of the mouse returned as a `Vector`. The z coordinate is 0.

`Vector Mouse.Position()`

##PrevPosition

The position of the mouse on the previous frame.

`Vector Mouse.PrevPosition()`

##Difference

The difference between the `PrevPosition` and the `Position` as a vector.

`Vector Mouse.Difference()`

##JustPressed

If a mouse button has just been pressed down.

`bool Mouse.JustPressed(int mouseButton)`

Parameter |  Type | Description | Optional
--------- | ------- | ---- | ----
mouseButton | int | The mouse button to test either left, middle or right. | ✘

```lua
if Mouse.JustPressed(MOUSE_BUTTON_LEFT) then
    print("Left mouse button pressed.")
end
```

##JustReleased

If a mouse button has just been pressed and then released.

`bool Mouse.JustReleased(int mouseButton)`

Parameter |  Type | Description | Optional
--------- | ------- | ---- | ----
mouseButton | int | The mouse button to test either left, middle or right. | ✘

```lua
if Mouse.JustReleased(MOUSE_BUTTON_LEFT) then
    print("Left mouse button released.")
end
```

##Held

Is the current mouse button being held.

`bool Mouse.Held(int mouseButton)`

Parameter |  Type | Description | Optional
--------- | ------- | ---- | ----
mouseButton | int | The mouse button to test either left, middle or right. | ✘

```lua
-- Draws "Hello World" next to the mouse position.
gRenderer = Renderer.Create()
if Mouse.Held(MOUSE_BUTTON_LEFT) then
    local pos = Mouse.Position()
    gRenderer:DrawText2d(pos:X(), pos:Y(), "Hello World")
end
```

repository: balaam/slate

repo_name: balaam/slate


text:
# search-context

Show where a query matches a document.

# example

``` js
var context = require('search-context')
var fs = require('fs')
var README = fs.readFileSync(__dirname + '/README.md', 'utf-8')

function hi (string) {
  return '***'+string.toUpperCase()+'***'
}

console.log(
  context(README, ['query', 'document', 'search'], 80, hi)
)

```

`hi` is an optional function that marks the matched string.
By default it applies bold ansi escape to display in the terminal.

## output

`search-context` finds the tightest occurance of the terms in the query.
If the terms are far apart, the context around each term is displayed
with ... joining them.

## License

MIT

repository: dominictarr/search-context

repo_name: dominictarr/search-context


text:
# eslint-config-touchlay

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

StandardJS with ES6 features, babel, JSX, [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react), [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) and [dangling commas for multiline statements](https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8).

## Install

```
npm install --save-dev eslint-config-touchlay
```

## Use

Add to your `.eslintrc`:

```js
{
  "extends": "touchlay"
}
```

You can additionally set environments, pick some!

```js
{
  "extends": "touchlay",
  "env": {
    "browser": true,
    "meteor": true,
    "mongo": true,
    "node": true,
  }
}
```

### Atom

In the editor [Atom](https://atom.io/), you can install a linter as follows:

```
apm install linter-eslint
```

Restart Atom afterwards to prevent issues.

![https://i.imgur.com/dzgzv11.png](https://i.imgur.com/dzgzv11.png)
![https://i.imgur.com/K2g1OQc.png](https://i.imgur.com/K2g1OQc.png)