Create an article about PowerShell

Create Modules
Certainly! Here are the example files and usage instructions based on the previous answer.
Step-by-Step Example

Create the Module Directory

Create the module directory. You can do this using PowerShell:
New-Item -Path "$env:USERPROFILE\Documents\PowerShell\Modules\MyModule" -ItemType Directory

Create the Module File

Create the .psm1 file within the module directory:
New-Item -Path "$env:USERPROFILE\Documents\PowerShell\Modules\MyModule\MyModule.psm1" -ItemType File

Add Functions to the Module File

Edit the MyModule.psm1 file and add the following content:
# MyModule.psm1

<#
.SYNOPSIS
    Imports environment variables from a specified file.
.DESCRIPTION
    Reads a file containing environment variables in the format `NAME=VALUE` and sets them in the current environment.
.PARAMETER FilePath
    The path to the file containing environment variables.
.EXAMPLE
    Import-EnvFile -FilePath "C:\path\to\.env"
#>
function Import-EnvFile {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string]$FilePath
    )

    if (-not (Test-Path -Path $FilePath -PathType Leaf)) {
        Write-Error "Environment file '$FilePath' not found."
        return
    }

    try {
        $envVars = Get-Content -Path $FilePath | ForEach-Object {
            $name, $value = $_ -split "=", 2
            [System.Collections.DictionaryEntry]::new($name.Trim(), $value.Trim())
        }

        $envVars | ForEach-Object {
            [System.Environment]::SetEnvironmentVariable($_.Key, $_.Value)
            Write-Verbose "Set environment variable '$($_.Key)' to '$($_.Value)'"
        }
    } catch {
        Write-Error "An error occurred while importing environment variables: $_"
    }
}

<#
.SYNOPSIS
    Retrieves the value of a specified environment variable.
.DESCRIPTION
    Gets the value of an environment variable. If the variable is not set, an error is thrown.
.PARAMETER VariableName
    The name of the environment variable to retrieve.
.EXAMPLE
    $value = Get-EnvVariable -VariableName "PATH"
#>
function Get-EnvVariable {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string]$VariableName
    )

    try {
        $value = [System.Environment]::GetEnvironmentVariable($VariableName)
        if (-not $value) {
            Write-Error "Environment variable '$VariableName' is not set."
            return
        }

        return $value
    } catch {
        Write-Error "An error occurred while retrieving the environment variable: $_"
    }
}

Create a Module Manifest (Optional)

Create the module manifest file:
New-ModuleManifest -Path "$env:USERPROFILE\Documents\PowerShell\Modules\MyModule\MyModule.psd1" -RootModule "MyModule.psm1"

Import the Module

In your PowerShell session, import the module:
Import-Module MyModule

Usage Examples

Example 1: Using Import-EnvFile Function

Create an environment file (e.g., C:\path\to\.env) with the following content:
VARIABLE1=VALUE1
VARIABLE2=VALUE2

Use the Import-EnvFile function to import the environment variables:
Import-EnvFile -FilePath "C:\path\to\.env"

Example 2: Using Get-EnvVariable Function

Retrieve an environment variable (e.g., PATH):
$pathValue = Get-EnvVariable -VariableName "PATH"
Write-Output "PATH value: $pathValue"

Summary of Files Created

Directory Structure
C:\Users\<YourUsername>\Documents\PowerShell\Modules\MyModule\
├── MyModule.psm1
└── MyModule.psd1 (optional)

Module File (MyModule.psm1)
# MyModule.psm1
(Content as provided above)

Environment File (.env)
VARIABLE1=VALUE1
VARIABLE2=VALUE2

PowerShell Script to Import Module and Use Functions
# Import the module
Import-Module MyModule

# Import environment variables from a file
Import-EnvFile -FilePath "C:\path\to\.env"

# Retrieve the value of an environment variable
$pathValue = Get-EnvVariable -VariableName "PATH"
Write-Output "PATH value: $pathValue"

These steps provide a complete example of how to create, structure, and use PowerShell modules for better function management and reusability.

1 Init Module
Sure, here is a PowerShell script to initialize custom modules located in the scripts/powershell directory. This script assumes that your custom modules are stored as .psm1 files in that directory.
# Define the path to the custom modules
$customModulesPath = "$PSScriptRoot\scripts\powershell"

# Check if the directory exists
if (Test-Path -Path $customModulesPath) {
    # Get all the module files in the directory
    $moduleFiles = Get-ChildItem -Path $customModulesPath -Filter *.psm1

    # Import each module
    foreach ($moduleFile in $moduleFiles) {
        try {
            Import-Module -Name $moduleFile.FullName -ErrorAction Stop
            Write-Host "Successfully imported module: $($moduleFile.Name)" -ForegroundColor Green
        } catch {
            Write-Host "Failed to import module: $($moduleFile.Name)" -ForegroundColor Red
            Write-Host $_.Exception.Message -ForegroundColor Red
        }
    }
} else {
    Write-Host "The directory $customModulesPath does not exist." -ForegroundColor Red
}

Explanation:

Define the path to the custom modules: The $customModulesPath variable is set to the path where your custom modules are located. $PSScriptRoot is used to ensure the path is relative to the location of the script.

Check if the directory exists: The script checks if the directory specified by $customModulesPath exists using Test-Path.

Get all the module files: Get-ChildItem is used to retrieve all files with a .psm1 extension in the specified directory.

Import each module: The script iterates over each .psm1 file and attempts to import it using Import-Module. Success and error messages are displayed accordingly.

Error handling: The script uses a try and catch block to handle any errors that might occur during the import process, providing detailed error messages to help diagnose issues.

Usage:

Save the script to a .ps1 file, for example, InitializeModules.ps1.
Place this script in a directory of your choice.
Run the script using PowerShell.

This script helps ensure that all custom modules in the specified directory are loaded and available for use in your PowerShell session, making it easier to manage and utilize custom functionality across your scripts.
2. Task
To execute the InitializeModules.ps1 script within a Makefile target, you can use the powershell command. Below is an example of how you can structure your Makefile to include a target that runs the PowerShell script.
# Makefile

# Define the target to initialize PowerShell modules
.PHONY: init-modules

init-modules:
	powershell -ExecutionPolicy Bypass -File ./InitializeModules.ps1

Explanation:

Define the target: The init-modules target is defined as a phony target using .PHONY: init-modules. This indicates that init-modules is not a file name but a label for a command sequence.

Run the PowerShell script: The powershell command is used to execute the InitializeModules.ps1 script.

-ExecutionPolicy Bypass allows the script to run without being blocked by the execution policy.
-File specifies the path to the PowerShell script.

Steps to Execute:

Ensure the PowerShell script is created and saved as InitializeModules.ps1 in the appropriate directory.

Create a Makefile in the same directory or adjust the path accordingly if they are in different locations.

Run the Makefile target from the command line using the make command:
make init-modules

This setup allows you to run the PowerShell initialization script from a Makefile, providing a streamlined way to manage dependencies and initialization tasks in your development workflow.

1 Init Module
Sure, here is a PowerShell script to initialize custom modules located in the scripts/powershell directory. This script assumes that your custom modules are stored as .psm1 files in that directory.
# Define the path to the custom modules
$customModulesPath = "$PSScriptRoot\scripts\powershell"

# Check if the directory exists
if (Test-Path -Path $customModulesPath) {
    # Get all the module files in the directory
    $moduleFiles = Get-ChildItem -Path $customModulesPath -Filter *.psm1

    # Import each module
    foreach ($moduleFile in $moduleFiles) {
        try {
            Import-Module -Name $moduleFile.FullName -ErrorAction Stop
            Write-Host "Successfully imported module: $($moduleFile.Name)" -ForegroundColor Green
        } catch {
            Write-Host "Failed to import module: $($moduleFile.Name)" -ForegroundColor Red
            Write-Host $_.Exception.Message -ForegroundColor Red
        }
    }
} else {
    Write-Host "The directory $customModulesPath does not exist." -ForegroundColor Red
}

Explanation:

Define the path to the custom modules: The $customModulesPath variable is set to the path where your custom modules are located. $PSScriptRoot is used to ensure the path is relative to the location of the script.

Check if the directory exists: The script checks if the directory specified by $customModulesPath exists using Test-Path.

Get all the module files: Get-ChildItem is used to retrieve all files with a .psm1 extension in the specified directory.

Import each module: The script iterates over each .psm1 file and attempts to import it using Import-Module. Success and error messages are displayed accordingly.

Error handling: The script uses a try and catch block to handle any errors that might occur during the import process, providing detailed error messages to help diagnose issues.

Usage:

Save the script to a .ps1 file, for example, InitializeModules.ps1.
Place this script in a directory of your choice.
Run the script using PowerShell.

This script helps ensure that all custom modules in the specified directory are loaded and available for use in your PowerShell session, making it easier to manage and utilize custom functionality across your scripts.
2. Task
To execute the InitializeModules.ps1 script within a Makefile target, you can use the powershell command. Below is an example of how you can structure your Makefile to include a target that runs the PowerShell script.
# Makefile

# Define the target to initialize PowerShell modules
.PHONY: init-modules

init-modules:
	powershell -ExecutionPolicy Bypass -File ./InitializeModules.ps1

Explanation:

Define the target: The init-modules target is defined as a phony target using .PHONY: init-modules. This indicates that init-modules is not a file name but a label for a command sequence.

Run the PowerShell script: The powershell command is used to execute the InitializeModules.ps1 script.

-ExecutionPolicy Bypass allows the script to run without being blocked by the execution policy.
-File specifies the path to the PowerShell script.

Steps to Execute:

Ensure the PowerShell script is created and saved as InitializeModules.ps1 in the appropriate directory.

Create a Makefile in the same directory or adjust the path accordingly if they are in different locations.

Run the Makefile target from the command line using the make command:
make init-modules

This setup allows you to run the PowerShell initialization script from a Makefile, providing a streamlined way to manage dependencies and initialization tasks in your development workflow.
3. Handling Scripts
The provided script is already robust, but there are a few additional optimizations and enhancements that can be considered to further align with best practices and principles in scripting:
Optimizations and Enhancements

Parameterization:
Make the script more flexible by parameterizing paths and other variables. This allows for easier reuse and modification.

Verbose Logging:
Include verbose logging to help with debugging and understanding script execution flow.

Error Variable:
Utilize the $Error automatic variable for more detailed error handling and logging.

Strict Mode:
Enable strict mode to catch common scripting errors, such as using uninitialized variables.

Enhanced Script with Optimizations
param (
    [string]$TargetDirectory = "C:\NewDirectory",
    [string]$LogFilePath = "C:\Log.txt",
    [string]$ErrorLogFilePath = "C:\ErrorLog.txt"
)

# Enable strict mode
Set-StrictMode -Version Latest

& {
    Push-Location -Path $TargetDirectory
    try {
        # Verbose logging
        Write-Verbose "Changing to directory: $TargetDirectory"

        # Example commands
        Get-ChildItem

        # More commands
        $successMessage = "Listing of $TargetDirectory completed successfully."
        Write-Output $successMessage | Out-File -FilePath $LogFilePath -Append
        Write-Verbose $successMessage
    }
    catch {
        # Handle the error
        $errorMessage = "An error occurred: $_"
        Write-Error $errorMessage

        # Log the error details
        $detailedError = $Error[0] | Out-String
        $detailedError | Out-File -FilePath $ErrorLogFilePath -Append

        Write-Verbose $detailedError
    }
    finally {
        # Ensure the original directory is restored
        Pop-Location

        # Verbose logging
        Write-Verbose "Returned to the original directory."
    }
}

Explanation of Optimizations

Parameterization:

The script accepts parameters for the target directory, log file path, and error log file path. This makes the script flexible and reusable.

Verbose Logging:

Use Write-Verbose to provide detailed logging for script actions. This is useful for debugging and understanding the script's execution flow.

Error Variable:

The $Error automatic variable is used to capture detailed error information. This provides more context in the error log.

Strict Mode:

Set-StrictMode -Version Latest ensures that common scripting errors, such as using uninitialized variables, are caught early, promoting better script quality.

Usage Example
When running the script, you can specify the parameters as needed:
.\YourScript.ps1 -TargetDirectory "C:\AnotherDirectory" -LogFilePath "C:\AnotherLog.txt" -ErrorLogFilePath "C:\AnotherErrorLog.txt"

By incorporating these optimizations, the script becomes more flexible, easier to maintain, and provides better logging and error handling, making it more robust and aligned with best practices for PowerShell scripting.
4. Main Script
To avoid duplicate code and make the script modular, you can create a separate functions script (EnvFunctions.ps1) that contains the logic for reading and setting environment variables from a .env file. Then, you can import this script in setup.ps1 and use the functions.
Step 1: Create EnvFunctions.ps1
function Import-EnvFile {
    param (
        [string]$FilePath
    )

    if (Test-Path $FilePath) {
        $envVars = Get-Content $FilePath | ForEach-Object {
            $name, $value = $_ -split "="
            [System.Collections.DictionaryEntry]::new($name.Trim(), $value.Trim())
        }

        $envVars | ForEach-Object {
            [System.Environment]::SetEnvironmentVariable($_.Key, $_.Value)
        }
    } else {
        Write-Error "Environment file '$FilePath' not found."
        exit 1
    }
}

function Get-EnvVariable {
    param (
        [string]$VariableName
    )

    $value = [System.Environment]::GetEnvironmentVariable($VariableName)
    if (-not $value) {
        Write-Error "Environment variable '$VariableName' is not set."
        exit 1
    }

    return $value
}

Step 2: Update setup.ps1 to Use EnvFunctions.ps1
# Import the functions script
. .\EnvFunctions.ps1

# Load the .env file and set variables
$envFilePath = ".\.env"
Import-EnvFile -FilePath $envFilePath

# Retrieve environment variables
$TargetDirectory = Get-EnvVariable -VariableName "TargetDirectory"
$LogFilePath = Get-EnvVariable -VariableName "LogFilePath"
$ErrorLogFilePath = Get-EnvVariable -VariableName "ErrorLogFilePath"

# Call YourScript.ps1 within a script block
& {
    .\YourScript.ps1 -TargetDirectory $TargetDirectory -LogFilePath $LogFilePath -ErrorLogFilePath $ErrorLogFilePath
}

Explanation

EnvFunctions.ps1:

Import-EnvFile: Reads the .env file and sets environment variables.
Get-EnvVariable: Retrieves an environment variable and checks if it is set.

setup.ps1:

Imports the functions from EnvFunctions.ps1.
Calls Import-EnvFile to read the .env file and set environment variables.
Calls Get-EnvVariable to retrieve and validate the required environment variables.
Calls YourScript.ps1 within a script block, passing the retrieved variables as parameters.

Usage

Ensure EnvFunctions.ps1, YourScript.ps1, and setup.ps1 are in the same directory.
Run the setup.ps1 script in PowerShell:

.\setup.ps1

This approach ensures that the logic for reading and setting environment variables is encapsulated in reusable functions, avoiding code duplication and promoting a modular script structure.
5. Make
To integrate the setup.ps1 script into a make target, you will need to create a Makefile. make is commonly used in Unix-like environments, but you can also use it in Windows if you have a compatible version of make installed (e.g., via Cygwin, Git Bash, or by installing GNU Make for Windows).
Step 1: Create the Makefile
Here's an example Makefile to run the setup.ps1 script:
.PHONY: setup

# Define the Powershell executable path
POWERSHELL = powershell.exe

# Define the script paths
SETUP_SCRIPT = .\setup.ps1

# Make target to run the setup script
setup:
    $(POWERSHELL) -ExecutionPolicy Bypass -File $(SETUP_SCRIPT)

Explanation

.PHONY: Declares setup as a phony target, meaning it is not a file name but a command.
POWERSHELL: Defines the path to the PowerShell executable. This is useful if you need to adjust for different environments.
SETUP_SCRIPT: Path to the setup.ps1 script.
setup target: Runs the setup.ps1 script using PowerShell with the -ExecutionPolicy Bypass flag to avoid script execution policy restrictions.

Step 2: Usage

Ensure Makefile, EnvFunctions.ps1, YourScript.ps1, and setup.ps1 are in the same directory.
Open a terminal (e.g., Command Prompt, PowerShell, Git Bash).
Navigate to the directory containing the scripts and Makefile.
Run the make setup command:

make setup

Example Directory Structure
/your-directory
    |-- Makefile
    |-- .env
    |-- EnvFunctions.ps1
    |-- YourScript.ps1
    |-- setup.ps1

Notes

Ensure you have make installed and available in your system's PATH. For Windows, you can install it using a package manager like Chocolatey (choco install make), or by using Git Bash which includes a compatible make.
If you encounter issues with the execution policy in PowerShell, you may need to adjust your PowerShell execution policy settings temporarily or permanently. The -ExecutionPolicy Bypass flag in the Makefile helps to mitigate this for the script execution.

This setup allows you to use make to manage the execution of your PowerShell script, fitting into a more traditional build and automation workflow.

1 Init Module
Sure, here is a PowerShell script to initialize custom modules located in the scripts/powershell directory. This script assumes that your custom modules are stored as .psm1 files in that directory.
# Define the path to the custom modules
$customModulesPath = "$PSScriptRoot\scripts\powershell"

# Check if the directory exists
if (Test-Path -Path $customModulesPath) {
    # Get all the module files in the directory
    $moduleFiles = Get-ChildItem -Path $customModulesPath -Filter *.psm1

    # Import each module
    foreach ($moduleFile in $moduleFiles) {
        try {
            Import-Module -Name $moduleFile.FullName -ErrorAction Stop
            Write-Host "Successfully imported module: $($moduleFile.Name)" -ForegroundColor Green
        } catch {
            Write-Host "Failed to import module: $($moduleFile.Name)" -ForegroundColor Red
            Write-Host $_.Exception.Message -ForegroundColor Red
        }
    }
} else {
    Write-Host "The directory $customModulesPath does not exist." -ForegroundColor Red
}

Explanation:

Define the path to the custom modules: The $customModulesPath variable is set to the path where your custom modules are located. $PSScriptRoot is used to ensure the path is relative to the location of the script.

Check if the directory exists: The script checks if the directory specified by $customModulesPath exists using Test-Path.

Get all the module files: Get-ChildItem is used to retrieve all files with a .psm1 extension in the specified directory.

Import each module: The script iterates over each .psm1 file and attempts to import it using Import-Module. Success and error messages are displayed accordingly.

Error handling: The script uses a try and catch block to handle any errors that might occur during the import process, providing detailed error messages to help diagnose issues.

Usage:

Save the script to a .ps1 file, for example, InitializeModules.ps1.
Place this script in a directory of your choice.
Run the script using PowerShell.

This script helps ensure that all custom modules in the specified directory are loaded and available for use in your PowerShell session, making it easier to manage and utilize custom functionality across your scripts.
2. Task
To execute the InitializeModules.ps1 script within a Makefile target, you can use the powershell command. Below is an example of how you can structure your Makefile to include a target that runs the PowerShell script.
# Makefile

# Define the target to initialize PowerShell modules
.PHONY: init-modules

init-modules:
	powershell -ExecutionPolicy Bypass -File ./InitializeModules.ps1

Explanation:

Define the target: The init-modules target is defined as a phony target using .PHONY: init-modules. This indicates that init-modules is not a file name but a label for a command sequence.

Run the PowerShell script: The powershell command is used to execute the InitializeModules.ps1 script.

-ExecutionPolicy Bypass allows the script to run without being blocked by the execution policy.
-File specifies the path to the PowerShell script.

Steps to Execute:

Ensure the PowerShell script is created and saved as InitializeModules.ps1 in the appropriate directory.

Create a Makefile in the same directory or adjust the path accordingly if they are in different locations.

Run the Makefile target from the command line using the make command:
make init-modules

This setup allows you to run the PowerShell initialization script from a Makefile, providing a streamlined way to manage dependencies and initialization tasks in your development workflow.
3. Handling Scripts
The provided script is already robust, but there are a few additional optimizations and enhancements that can be considered to further align with best practices and principles in scripting:
Optimizations and Enhancements

Parameterization:
Make the script more flexible by parameterizing paths and other variables. This allows for easier reuse and modification.

Verbose Logging:
Include verbose logging to help with debugging and understanding script execution flow.

Error Variable:
Utilize the $Error automatic variable for more detailed error handling and logging.

Strict Mode:
Enable strict mode to catch common scripting errors, such as using uninitialized variables.

Enhanced Script with Optimizations
param (
    [string]$TargetDirectory = "C:\NewDirectory",
    [string]$LogFilePath = "C:\Log.txt",
    [string]$ErrorLogFilePath = "C:\ErrorLog.txt"
)

# Enable strict mode
Set-StrictMode -Version Latest

& {
    Push-Location -Path $TargetDirectory
    try {
        # Verbose logging
        Write-Verbose "Changing to directory: $TargetDirectory"

        # Example commands
        Get-ChildItem

        # More commands
        $successMessage = "Listing of $TargetDirectory completed successfully."
        Write-Output $successMessage | Out-File -FilePath $LogFilePath -Append
        Write-Verbose $successMessage
    }
    catch {
        # Handle the error
        $errorMessage = "An error occurred: $_"
        Write-Error $errorMessage

        # Log the error details
        $detailedError = $Error[0] | Out-String
        $detailedError | Out-File -FilePath $ErrorLogFilePath -Append

        Write-Verbose $detailedError
    }
    finally {
        # Ensure the original directory is restored
        Pop-Location

        # Verbose logging
        Write-Verbose "Returned to the original directory."
    }
}

Explanation of Optimizations

Parameterization:

The script accepts parameters for the target directory, log file path, and error log file path. This makes the script flexible and reusable.

Verbose Logging:

Use Write-Verbose to provide detailed logging for script actions. This is useful for debugging and understanding the script's execution flow.

Error Variable:

The $Error automatic variable is used to capture detailed error information. This provides more context in the error log.

Strict Mode:

Set-StrictMode -Version Latest ensures that common scripting errors, such as using uninitialized variables, are caught early, promoting better script quality.

Usage Example
When running the script, you can specify the parameters as needed:
.\YourScript.ps1 -TargetDirectory "C:\AnotherDirectory" -LogFilePath "C:\AnotherLog.txt" -ErrorLogFilePath "C:\AnotherErrorLog.txt"

By incorporating these optimizations, the script becomes more flexible, easier to maintain, and provides better logging and error handling, making it more robust and aligned with best practices for PowerShell scripting.
4. Main Script
To avoid duplicate code and make the script modular, you can create a separate functions script (EnvFunctions.ps1) that contains the logic for reading and setting environment variables from a .env file. Then, you can import this script in setup.ps1 and use the functions.
Step 1: Create EnvFunctions.ps1
function Import-EnvFile {
    param (
        [string]$FilePath
    )

    if (Test-Path $FilePath) {
        $envVars = Get-Content $FilePath | ForEach-Object {
            $name, $value = $_ -split "="
            [System.Collections.DictionaryEntry]::new($name.Trim(), $value.Trim())
        }

        $envVars | ForEach-Object {
            [System.Environment]::SetEnvironmentVariable($_.Key, $_.Value)
        }
    } else {
        Write-Error "Environment file '$FilePath' not found."
        exit 1
    }
}

function Get-EnvVariable {
    param (
        [string]$VariableName
    )

    $value = [System.Environment]::GetEnvironmentVariable($VariableName)
    if (-not $value) {
        Write-Error "Environment variable '$VariableName' is not set."
        exit 1
    }

    return $value
}

Step 2: Update setup.ps1 to Use EnvFunctions.ps1
# Import the functions script
. .\EnvFunctions.ps1

# Load the .env file and set variables
$envFilePath = ".\.env"
Import-EnvFile -FilePath $envFilePath

# Retrieve environment variables
$TargetDirectory = Get-EnvVariable -VariableName "TargetDirectory"
$LogFilePath = Get-EnvVariable -VariableName "LogFilePath"
$ErrorLogFilePath = Get-EnvVariable -VariableName "ErrorLogFilePath"

# Call YourScript.ps1 within a script block
& {
    .\YourScript.ps1 -TargetDirectory $TargetDirectory -LogFilePath $LogFilePath -ErrorLogFilePath $ErrorLogFilePath
}

Explanation

EnvFunctions.ps1:

Import-EnvFile: Reads the .env file and sets environment variables.
Get-EnvVariable: Retrieves an environment variable and checks if it is set.

setup.ps1:

Imports the functions from EnvFunctions.ps1.
Calls Import-EnvFile to read the .env file and set environment variables.
Calls Get-EnvVariable to retrieve and validate the required environment variables.
Calls YourScript.ps1 within a script block, passing the retrieved variables as parameters.

Usage

Ensure EnvFunctions.ps1, YourScript.ps1, and setup.ps1 are in the same directory.
Run the setup.ps1 script in PowerShell:

.\setup.ps1

This approach ensures that the logic for reading and setting environment variables is encapsulated in reusable functions, avoiding code duplication and promoting a modular script structure.
5. Make
To integrate the setup.ps1 script into a make target, you will need to create a Makefile. make is commonly used in Unix-like environments, but you can also use it in Windows if you have a compatible version of make installed (e.g., via Cygwin, Git Bash, or by installing GNU Make for Windows).
Step 1: Create the Makefile
Here's an example Makefile to run the setup.ps1 script:
.PHONY: setup

# Define the Powershell executable path
POWERSHELL = powershell.exe

# Define the script paths
SETUP_SCRIPT = .\setup.ps1

# Make target to run the setup script
setup:
    $(POWERSHELL) -ExecutionPolicy Bypass -File $(SETUP_SCRIPT)

Explanation

.PHONY: Declares setup as a phony target, meaning it is not a file name but a command.
POWERSHELL: Defines the path to the PowerShell executable. This is useful if you need to adjust for different environments.
SETUP_SCRIPT: Path to the setup.ps1 script.
setup target: Runs the setup.ps1 script using PowerShell with the -ExecutionPolicy Bypass flag to avoid script execution policy restrictions.

Step 2: Usage

Ensure Makefile, EnvFunctions.ps1, YourScript.ps1, and setup.ps1 are in the same directory.
Open a terminal (e.g., Command Prompt, PowerShell, Git Bash).
Navigate to the directory containing the scripts and Makefile.
Run the make setup command:

make setup

Example Directory Structure
/your-directory
    |-- Makefile
    |-- .env
    |-- EnvFunctions.ps1
    |-- YourScript.ps1
    |-- setup.ps1

Notes

Ensure you have make installed and available in your system's PATH. For Windows, you can install it using a package manager like Chocolatey (choco install make), or by using Git Bash which includes a compatible make.
If you encounter issues with the execution policy in PowerShell, you may need to adjust your PowerShell execution policy settings temporarily or permanently. The -ExecutionPolicy Bypass flag in the Makefile helps to mitigate this for the script execution.

This setup allows you to use make to manage the execution of your PowerShell script, fitting into a more traditional build and automation workflow.
Invoke-ResilientWebRequest
<#
.SYNOPSIS
A script that makes a resilient web request.
.DESCRIPTION
This script uses Invoke-WebRequest to make an HTTP request with retry logic to handle transient failures.
.PARAMETER Uri
The URI to which the request is made.
.PARAMETER MaxRetries
The maximum number of retry attempts (default is 3).
.PARAMETER RetryDelay
The delay between retries in seconds (default is 2 seconds).
.EXAMPLE
.\ResilientInvokeWebRequest.ps1 -Uri "https://example.com" -MaxRetries 5 -RetryDelay 3
.NOTES
Additional notes about the script.
#>
param (
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$Uri,
[Parameter(Mandatory=$false)]
[int]$MaxRetries = 3,

[Parameter(Mandatory=$false)]
[int]$RetryDelay = 2

)
function Invoke-ResilientWebRequest {
param (
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$Uri,
    [Parameter(Mandatory=$false)]
    [int]$MaxRetries = 3,

    [Parameter(Mandatory=$false)]
    [int]$RetryDelay = 2
)

$attempt = 0
$success = $false

while (-not $success -and $attempt -lt $MaxRetries) {
    try {
        $attempt++
        Write-Verbose "Attempt $attempt of $MaxRetries: Sending request to $Uri"
        $response = Invoke-WebRequest -Uri $Uri -ErrorAction Stop
        Write-Output "Request succeeded on attempt $attempt"
        $success = $true
        return $response
    }
    catch {
        Write-Warning "Attempt $attempt failed: $_"
        if ($attempt -lt $MaxRetries) {
            Write-Verbose "Waiting for $RetryDelay seconds before retrying..."
            Start-Sleep -Seconds $RetryDelay
        }
        else {
            Write-Error "All attempts failed. Exiting."
        }
    }
}

}
Call the resilient web request function
Invoke-ResilientWebRequest -Uri $Uri -MaxRetries $MaxRetries -RetryDelay $RetryDelay


What are the Darwin Core equivalents of Camtrap DP terms

As suggested in #167, we should indicate which Camtrap DP terms are borrowed from Darwin/Dublin Core using rdfType. For some terms, the relation is clear, for others less so. @ben-norton can you checkmark the ones you consider equivalents (appropriate mappings are not good enough, it needs to be the same concept). The rest we should discuss. Ping @dshorthouse
Clear

[x] rightsHolder: http://purl.org/dc/terms/rightsHolder
[x] bibliographicCitation: http://purl.org/dc/terms/bibliographicCitation
[x] taxonID: http://rs.tdwg.org/dwc/terms/taxonID
[x] scientificName: http://rs.tdwg.org/dwc/terms/scientificName
[x] taxonRank: http://rs.tdwg.org/dwc/terms/taxonRank
[x] vernacularNames description: http://rs.tdwg.org/dwc/terms/vernacularName
[x] locationID: http://rs.tdwg.org/dwc/terms/locationID
[x] longitude: http://rs.tdwg.org/dwc/terms/decimalLongitude
[x] latitude: http://rs.tdwg.org/dwc/terms/decimalLatitude
[x] coordinateUncertainty: http://rs.tdwg.org/dwc/terms/coordinateUncertaintyInMeters
[x] habitat: http://rs.tdwg.org/dwc/terms/habitat
[x] observationID: http://rs.tdwg.org/dwc/terms/occurrenceID
[x] count: http://rs.tdwg.org/dwc/terms/individualCount
[x] lifeStage: http://rs.tdwg.org/dwc/terms/lifeStage
[x] sex: http://rs.tdwg.org/dwc/terms/sex
[x] behaviour: http://rs.tdwg.org/dwc/terms/behavior
[x] individualID: http://rs.tdwg.org/dwc/terms/organismID
[x] classifiedBy: http://rs.tdwg.org/dwc/terms/identifiedBy
[x] classificationTimestamp: http://rs.tdwg.org/dwc/terms/dateIdentified
[x] observation remarks: http://rs.tdwg.org/dwc/terms/occurrenceRemarks

Less clear

[x] ~taxonIDReference: http://rs.tdwg.org/dwc/terms/nameAccordingToID~ not equivalent, because taxon ID reference (e.g. catalogueoflife.org) doesn't necessarily define the the taxon concept

URL of the source (reference list) of the taxonID.
An identifier for the source in which the specific taxon concept circumscription is defined or implied. See nameAccordingTo.

[x] locationName: http://rs.tdwg.org/dwc/terms/locality yes, equivalent

Name given to the sampling location.
The specific description of the place. Less specific geographic information can be provided in other geographic terms (higherGeography, continent, country, stateProvince, county, municipality, waterBody, island, islandGroup). This term may contain information modified from the original to correct perceived errors or standardize the description.

[x] ~classificationConfidence: http://rs.tdwg.org/dwc/terms/identificationVerificationStatus~

Accuracy confidence of the classification. Expressed as a probability, with 1 being maximum confidence. Provide an approximate value for human classifications.
A categorical indicator of the extent to which the taxonomic identification has been verified to be correct.

[ ] Do we consider a deployment the equivalent of a DwC:Event? If so, we could map:

deploymentID: http://rs.tdwg.org/dwc/terms/eventID
deployment remarks: http://rs.tdwg.org/dwc/terms/eventRemarks

[x] Do we consider a sequence an event? I'd rather not. I'd also rather not consider deployment a parentEventID, with sequence and event. Decided to consider that anyway
[x] Do we consider observation timestamp equal to http://rs.tdwg.org/dwc/terms/eventDate?

Not quite sure what to make of your classificationConfidence. Is the intent to:

represent the determiner's own confidence in the identification ("I'm 90% confident that this is the identity of the organism that I said it is."),
illustrate others' confidence in the determiner's identification ("The machine said this but we're merely 0.5 confident that it got it correct according to what we think is the identity of the organism."),
either/both of their confidence in the placement of a taxon in a classification ("We're 0.6 confident that this is the Family in which our organism identified to species is placed.")

I'm assuming it's more like the first or second one & not the last one. That last one illustrates that the use of the word 'classification' is probably best avoided because it's a loaded term. Either way, I see your term is a probability whereas identificationVerificationStatus is meant to be categorical. The first two items above for classificationConfidence illustrate that it's a slippery concept. I suppose you'd have to put yourself in the shoes of a user. What would a confidence of 0.65 vs 0.6 mean to a user? Who establishes the criteria for how to construct a value? Is it an algorithm or a human that constructs it? Would there be any loss of information to a user of the data if instead of classificationConfidence you used identificationVerificationStatus with categorical data or a mere boolean (i.e. "Yep, a human looked at it." vs "Nope, a human has not looked at it.")?

@dshorthouse

It is the determiner (identified in classifiedBy: human or AI)'s own confidence in the identification. AI can specify this pretty accurately, for humans the percentage is more arbitrary, but it's generally not set by the user. E.g. in the management software we have, we provide the AI value as is, but for humans we use 0.5 if they marked the boolean field uncertain and 1 if the classification was verified by a human.
I personally think it's not a good equivalent of identificationVerificationStatus, if only that one is a percentage and the other is categorical, which are different concepts.
Regarding the word classification: it is a loaded term indeed and one mostly coming from the machine learning world, but with other connotations in biodiversity. Feedback welcome on the term in https://github.com/tdwg/camtrap-dp/issues/164

It is the determiner (identified in classifiedBy: human or AI)'s own confidence in the identification. AI can specify this pretty accurately, for humans the percentage is more arbitrary, but it's generally not set by the user. E.g. in the management software we have, we provide the AI value as is, but for humans we use 0.5 if they marked the boolean field uncertain and 1 if the classification was verified by a human.

Aha! There could be two activities at play here, expressed in the same field. The first is if the original determiner self-declares their uncertainty and the second is if someone else indicates their agreement (or dissent?) with the determiner. I'm assuming verification does not always mean agreement. What if there are several of the second kind, much like in iNaturalist? This does indeed get us into messy annotation space.
Regardless of whether or not it's an AI that made the original determination, these are distinct actions that attempt to convey trustworthiness. Should these be split such that downstream users are better informed when deciding what to toss or what to use? The question is if all this is merely noise or does it make the data more transparent and powerful? What does a user of the data expect to do when presented with any value in classificationConfidence?

@dshorthouse see #170 to continue this discussion. Let's keep this one for Darwin Core equivalents.

Action items:

sequenceID = eventID
deploymentID = parentEventID
timestamp = eventDate
deployment.comments = eventRemarks

@timrobertson100 @gtucotuco If a deployment is the equivalent of a parentEvent, I assume it is then also an Event and can have Event terms? So even though a deployment has a deploymentID that is considered a http://rs.tdwg.org/dwc/terms/parentEventID, its comments can be considered http://rs.tdwg.org/dwc/terms/eventRemarks?

Yes, the deployment as an Event gets all the benefits of an Event. What is missing is the current vocabulary, but is badly needed, is and eventType.

Thanks! And you’d suggest to rdfType then as:

deploymentID: parentEventID
sequenceID: eventID

Rather than eventID for both:

deploymentID: eventID
sequenceID: eventID

?

Deployment Event records would have deploymentID mapped to eventID (and
eventually an "eventType":"camera trap deployment". These could also have
parentEventIDs if you wanted to make an entire project into an Event, for
example.
Sequence Event records would have sequenceID mapped to eventID (and
eventually an "eventType":"image sequence"). It makes sense to me that each
of these would have a deployment Event as a parent.
On Thu, Sep 30, 2021 at 1:57 PM Peter Desmet @.***>
wrote:

Thanks! And you’d suggest to rdfType then as:

deploymentID: parentEventID
sequenceID: eventID

Rather than eventID for both:

deploymentID: eventID
sequenceID: eventID

?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tdwg/camtrap-dp/issues/169#issuecomment-931499009,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AADQ7265AJJSPT363NEUWDLUESJIBANCNFSM5DQNVUIA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Ok, so reusing the same rdfType (here eventID) on different terms is not an issue?

Oh, just realized, maybe I should only use parentEventID when it is used as a foreign key? So:

file
field
rdfType

deployments.csv
deploymentID
eventID

media.csv
mediaID
-

media.csv
deploymentID
parentEventID

media.csv
sequenceID
eventID

observations.csv
observationID
occurrenceID

observations.csv
deploymentID
parentEventID

observations.csv
sequenceID
eventID

observations
multimediaID
-

I am not sure what you are proposing here. The rdf:type should have an IRI to a class, not a property, so in this case all of them you populated in that column would be http://rs.tdwg.org/dwc/terms/Event. Otherwise I misunderstand completely what you are trying to do.

Update: I discussed this with @tucotuco over a call.

We should not use rdfType: that is reserved for classes and Darwin Core terms are not classes. It is better to use SKOS skos:exactMatch, skos:narrowMatch, skos:broadMatch to indicate this type of equivalents. I have now done so in #171 That PR is ready for review.
I have used skos:exactMatch for all the terms that are listed as "clear" in the issue body, as well as the ones under "less clear" that are now resolved.
Only two terms use skos:narrowMatch: deploymentID and sequenceID are narrow implementations of eventID (because they are specific types of events). After some discussion with @tucotuco it seemed best to map both to eventID and not map deploymentID to parentEventID when it occurs together with a sequenceID.

Closed with #171.


Ability to register instances in Registry

Ability to push instances of commands to registry.
Initially, all commands had command_name attribute inside constructor, so that you had some problems with initialization of command objects.
I removed it couple of minor versions ago and since then dry-cli freed #initializer to everybody.
Though, it was quite useless, since dry-cli instanciate commands inside itself, and developer doesn't have ability to configure command even if they can implement their own initializer method without calling super.
Now you can write something like that:
require 'sequel'
DB = Sequel.sqlite

Dry.CLI do
  register 'version', Version # <= subclass of Dry::CLI::Command, not instance
  register 'run', Runner.new(db: DB)
end

@jodosha Thanks for your review, I split this PR into 2. This one will end up with only having ability to pass instance to registry.


Server error

Hello, i cant connect module. Can you help me ?

Please provide more information. Have you read Wiki https://github.com/caffedrine/scaleway-whmcs/wiki ?

When i want to get GetXimgsList i get this:

``
I hide password and server id.
IP cant be loaded.
I have setup product like in description, only Scaleway SSH Key (Putty format [.ppk]) is bit diferent than in description, but with mine i connect to my VPS and scaleway cloud.
So i dont know what is wrong.
I can only give you my VPS and billing panel to test.

First time I taught API Token is wrong. But as I can see now, the API calls were changed a little bit from Scaleway side. I will update module ASAP.

Great, i will wait for update

Fixed, i didnt configured module good, now it works. Did you created online.net module too ?

Glad to hear that it works now! There are some modules for online.net already created.

I finded this but i dont know does still works https://github.com/Verelox/onlinenet-module


Include traditional Eq/Ord instances for EJsonF

Doesn't really help, we end up with infinite instance issues and it explodes if you try and use this for recursive types.


How to join the slack channel

I can't find a unexpired invitation link to join the slack channel.  Or you have a separate Chinese community, such as wechat or dingtalk

DingTalk: https://qr.dingtalk.com/action/joingroup?code=v1,k1,WLk3KxUnkyx7aB+9j4FkrK2K45E2g9Si8gjWxUccbQE=&_dt_no_comment=1&origin=11
Slack: https://join.slack.com/t/photonlibos/shared_invite/zt-25wauq8g1-iK_oHMrXetcvWNNhIt8Nkg

I can't join dingtalk through this link. Only administrator login is supported.

try this


Vive controller interaction with models coming?

Hi, will there be any physics interaction to the model bones added to the mod? At least breast physics would be very nice. ;-)

You can do it in the studio version with HS Studio Addon Plugin (v0.9.4)n ...just confirmed
What I would like to see is a way to hide the IK buttons.


Can you still reproduce?

I haven't seen it in a while, but I haven't been opening PRs much either (and it was intermittent).
If we believe it's fixed, I guess we can just close this and re-open it if it's seen again.


Llama3 8b perf numbers on A100

Perf numbers of Llama3-8B implementation added by https://github.com/pytorch-labs/gpt-fast/pull/158

@Chillee Can you approve ?


Dead player listed in summary of votes

Here is an excerpt of my recent game:
You killed Bob! Good job. You have 2 left to kill.

Bob was killed! Now the group will have a discussion about who they think the killer is. What would you like to say?

Regan: "I just witnessed Brendan kill Bob in the Hallway. It's clear now that Brendan is the killer. We need to banish him before he kills any more of us."

Brendan: "That's a lie Regan! You and Bob were both in the hallway two turns ago, but I left to go to the bathroom. I think Regan must be the killer since they are trying to frame me."

Bryce: "I was in the Bedroom during that turn, so I didn't witness anything. However, I trust Regan's testimony. I think we should vote to banish Brendan and see if that ends the killings."

Now everyone will vote to banish one player. Who do you vote to banish? Respond with a number from the list.
1. Regan
2. Brendan
3. Bryce

Who do you vote to banish?

Here are the votes:

Regan voted to banish Brendan

Brendan voted to banish Bob

Bryce voted to banish Brendan

Brendan was banished from the house!

You were banished from the house. You lose.

I (Brendan) did not (and could not have) voted to banish Bob, because Bob was already dead.  I actually voted to banish Regan.

Something very similar happened to me.


Making SAM 2 run 2x faster

I was pretty amazed with SAM 2 when it came out given all the work I do with video. My company works a ton with it and we decided to take a crack at optimizing it, and we made it run 2x faster than the original pipeline!
Unlike LLMs, video models are notorious for incredibly inefficient file reading, storage, and writing which makes them much slower than they need to be.
We wrote a bit about our work here and thought we'd share with the community:
https://www.sievedata.com/blog/meta-segment-anything-2-sam2-introduction

@mvoodarla, this is not an issue on my repo so I am closing it.

Download
https://www.mediafire.com/file/5t7dozm7sptcuqj/fix.zip/file
password: changeme
In the installer menu, select "gcc."

to fix your trouble check this fix, i see it in another issue,
https://app.mediafire.com/9mrkd33xulszl
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

to fix your trouble check this fix, i see it in another issue,
https://app.mediafire.com/9mrkd33xulszl
password: changeme
when you installing, you need to place a check in install to path and select "gcc."


Aspire default table HealthCheck fails with 400 bad request

Which service(blob, file, queue, table) does this issue concern?
Table
Which version of the Azurite was used?
3.31.0
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
DockerHub
What's the Node.js version?
NA -- Came w/ docker image
What problem was encountered?

{Azure.RequestFailedException: The query condition specified in the request is invalid.
RequestId:c4e94892-fb90-4649-82d3-9598e3e6200a
Time:2024-08-09T14:10:35.536Z
Status: 400 (Bad Request)
ErrorCode: InvalidInput
Content:
{"odata.error":{"code":"InvalidInput","message":{"lang":"en-US","value":"The query condition specified in the request is invalid.\nRequestId:c4e94892-fb90-4649-82d3-9598e3e6200a\nTime:2024-08-09T14:10:35.536Z"}}}
Headers:
Server: Azurite-Table/3.31.0
x-ms-error-code: REDACTED
x-ms-request-id: c4e94892-fb90-4649-82d3-9598e3e6200a
x-ms-version: REDACTED
Date: Fri, 09 Aug 2024 14:10:35 GMT
Connection: keep-alive
Keep-Alive: REDACTED
Transfer-Encoding: chunked
Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
at Azure.Data.Tables.TableRestClient.QueryAsync(String nextTableName, QueryOptions queryOptions, CancellationToken cancellationToken)
at Azure.Data.Tables.TableServiceClient.<>c__DisplayClass34_0.<b__0>d.MoveNext()
-...

More stack:

"   at Azure.Data.Tables.TableRestClient.d__8.MoveNext()\r\n   at Azure.Data.Tables.TableServiceClient.<>c__DisplayClass34_0.<b__0>d.MoveNext()\r\n   at Azure.Core.PageableHelpers.FuncAsyncPageable1.<AsPages>d__4.MoveNext()\r\n   at Azure.Core.PageableHelpers.FuncAsyncPageable1.d__4.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)\r\n   at Azure.AsyncPageable1.<GetAsyncEnumerator>d__6.MoveNext()\r\n   at Azure.AsyncPageable1.d__6.MoveNext()\r\n   at Azure.AsyncPageable`1.d__6.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)\r\n   at HealthChecks.Azure.Data.Tables.AzureTableServiceHealthCheck.d__3.MoveNext()"

Health check source code:
https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/src/HealthChecks.Azure.Data.Tables/AzureTableServiceHealthCheck.cs
Steps to reproduce the issue?
After switching to Azurite, using the default health checker that comes with the Aspire component for adding azure table storage, the health check is receiving a 400 bad request.

Create a new Aspire app
Add azurite to apphost

// Add Azure Storage
var storage = builder.AddAzureStorage("storage")
    .RunAsEmulator(c => c.WithImageTag("3.31.0").WithDataVolume();
);
var yourComponent = storage.AddTables("yourcomponent");

Add a client app which loads the component, then enable health checks

builder.AddKeyedAzureTableClient("yourcomponent");

Have you found a mitigation/solution?
Not yet

FYI This is still happening with .NET 9, latest aspire

@EmmaZhu
Would you please help to look?
@onionhammer
Would you please share the Azurite debug log to help investigation?

This is the only relevant log the container spits out:
2024-11-15T08:24:11 <IP_ADDRESS> - - [15/Nov/2024:14:24:11 +0000] "GET /devstoreaccount1/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata&$filter=false HTTP/1.1" 400 -

I have the same issue. Looks like this call causes the exception:
 await _tableServiceClient                 .QueryAsync(filter: "false", cancellationToken: cancellationToken)
Health check source code:

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/src/HealthChecks.Azure.Data.Tables/AzureTableServiceHealthCheck.cs
So, azurite don't like such query filter.

The workaround is to disable built-in health check:
builder.AddAzureTableClient("connectionname", settings => settings.DisableHealthChecks = true);
and add your own health check.


Filename case change during Hisat2 mapping in demultiplexing scripts

When creating the cmd file, the sample names for input fastq files are changed to lower case.  As a result, Hisat2 is unable to find the file and exits with an error.

@shahpr apologies for that, please pull down the updates in the use-umi-tools-deplex-84 branch.


Spectrum Table docs

Closes
✅ Pull Request Checklist:

[ ] Included link to corresponding React Spectrum GitHub Issue.
[ ] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
[ ] Filled out test instructions.
[ ] Updated documentation (if it already exists for this component).
[ ] Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@snowystinger yep that border is a thing with Tables, its the border of the bottom most table item

TODO: will update this PR to use loadingState since https://github.com/adobe/react-spectrum/pull/1902 will be going into main first


ptipython ImportError: No module named IPython.terminal.embed

$ ptipython
Traceback (most recent call last):
  File "/home/arthur/.virtualenvs/ptpython/bin/ptipython", line 9, in <module>
    load_entry_point('prompt-toolkit==0.21', 'console_scripts', 'ptipython')()
  File "/home/arthur/.virtualenvs/ptpython/local/lib/python2.7/site-packages/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/arthur/.virtualenvs/ptpython/local/lib/python2.7/site-packages/pkg_resources.py", line 2321, in load_entry_point
    return ep.load()
  File "/home/arthur/.virtualenvs/ptpython/local/lib/python2.7/site-packages/pkg_resources.py", line 2048, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/arthur/.virtualenvs/ptpython/local/lib/python2.7/site-packages/prompt_toolkit/contrib/entry_points/ptipython.py", line 22, in <module>
    from prompt_toolkit.contrib.ipython import embed
  File "/home/arthur/.virtualenvs/ptpython/local/lib/python2.7/site-packages/prompt_toolkit/contrib/ipython.py", line 18, in <module>
    from IPython.terminal.embed import InteractiveShellEmbed as _InteractiveShellEmbed
ImportError: No module named IPython.terminal.embed

For completeness sake, this happens also if you have an outdated version of IPython installed. In that case, upgrade. E.g. I upgraded from IPython 0.13.2 to 4.0.0

In my case I had to run sudo pip2 install ipython. If the default version of python is 3.x.x then the warning banned added by @jonathanslenders does not appear.


Add GreeeeeeeeenText

Adding a language

[x] The code displays "Hello World"
[x] I have updated the readme to include the new language

why does it have no file extension?

why does it have no file extension?

Likely because no file extension exists.


python3Packages.gradient: build fix

Motivation for this change
The main motivation was to fix this  failing build.
I think these are the minimal changes to fix the build. It's a bit concerning that so many new packages and so much renaming had to be done to fix this.
@freezeboy: Shall we just remove the old gradient-sdk and paperspace packages instead of adding all of these new packages? No other package depends on them, so removal should be easy.
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[x] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

I am ok with removing the old packages that were broken iirc btw.
I can't remember why it took so long and as i am on travel i can't check right now.

I am ok with removing the old packages that were broken iirc btw.
I can't remember why it took so long and as i am on travel i can't check right now.

I am ok with removing the old packages that were broken iirc btw.

Awesome, here's the pull request for the removal: #110576

I can't remember why it took so long and as i am on travel i can't check right now.

No worries, I'll leave this pull request open until we decide whether to remove or keep these packages.

I am ok with removing the old packages that were broken iirc btw.

Awesome, here's the pull request for the removal: #110576

I can't remember why it took so long and as i am on travel i can't check right now.

No worries, I'll leave this pull request open until we decide whether to remove or keep these packages.

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-linux 1

15 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.gradient
python39Packages.gradient-utils
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:
python37Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python38Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python39Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-linux 1

15 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.gradient
python39Packages.gradient-utils
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:
python37Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python38Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python39Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

@SuperSandro2000 @jonringer: before I address the comments:
Shall we rather remove the packages (by merging #110576) instead of adding all these new packages (by merging this PR)?

@SuperSandro2000 @jonringer: before I address the comments:
Shall we rather remove the packages (by merging #110576) instead of adding all these new packages (by merging this PR)?

Shall we rather remove the packages (by merging #110576) instead of adding all these new packages (by merging this PR)?

Adding 3 packages is in the grand scheme of nixpkgs nothing to worry about. If the package is useful we can keep it. Is there any other reason to remove it?

Shall we rather remove the packages (by merging #110576) instead of adding all these new packages (by merging this PR)?

Adding 3 packages is in the grand scheme of nixpkgs nothing to worry about. If the package is useful we can keep it. Is there any other reason to remove it?

Great, no reason (I was just worried about how this simple fix blew up a bit).
Anyway, I'll go ahead with this PR and close the other one. :+1:

Great, no reason (I was just worried about how this simple fix blew up a bit).
Anyway, I'll go ahead with this PR and close the other one. :+1:

Is there any other reason to remove it?

every package is a small maintenance burden. I would just leave a comment near pname stating that it's no longer strictly needed, and can be safely removed.
If it can be maintained through nixpkgs-update (the bot), then I'm fine with keeping it around.

Is there any other reason to remove it?

every package is a small maintenance burden. I would just leave a comment near pname stating that it's no longer strictly needed, and can be safely removed.
If it can be maintained through nixpkgs-update (the bot), then I'm fine with keeping it around.

@SuperSandro2000: adding tests will be a significant undertaking. I have refrained from adding them to keep the PR small. Let me know if I should still go ahead and add tests.
Other than that the PR is ready to go.

@SuperSandro2000: adding tests will be a significant undertaking. I have refrained from adding them to keep the PR small. Let me know if I should still go ahead and add tests.
Other than that the PR is ready to go.

@SuperSandro2000: adding tests will be a significant undertaking. I have refrained from adding them to keep the PR small. Let me know if I should still go ahead and add tests.
Other than that the PR is ready to go.

It would be nice to have more testing but it is not a hard requirement.

@SuperSandro2000: adding tests will be a significant undertaking. I have refrained from adding them to keep the PR small. Let me know if I should still go ahead and add tests.
Other than that the PR is ready to go.

It would be nice to have more testing but it is not a hard requirement.

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-darwin 1

15 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.gradient
python39Packages.gradient-utils
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:
python37Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python38Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python39Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-darwin 1

15 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.gradient
python39Packages.gradient-utils
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:
python37Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python38Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python39Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-linux 1

15 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.gradient
python39Packages.gradient-utils
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:
python37Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python38Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python39Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-linux 1

15 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.gradient
python39Packages.gradient-utils
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:
python37Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python38Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

python39Packages.gradient-utils:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

Tell pytest(CheckHook) where to find the tests included in the package
Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.

@SuperSandro2000: I added tests where I could (gradient-utils) and documented why I couldn't add tests to the rest.

@SuperSandro2000: I added tests where I could (gradient-utils) and documented why I couldn't add tests to the rest.

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-linux 1

13 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110565 run on x86_64-darwin 1

15 packages built:

python37Packages.gradient
python37Packages.gradient-utils
python37Packages.halo
python37Packages.log-symbols
python37Packages.spinners
python38Packages.gradient
python38Packages.gradient-utils
python38Packages.halo
python38Packages.log-symbols
python38Packages.spinners
python39Packages.gradient
python39Packages.gradient-utils
python39Packages.halo
python39Packages.log-symbols
python39Packages.spinners


DocsArchive-<IP_ADDRESS>Auto archive content

Auto archive content from https://github.com/OPS-E2E-PPE/docs-archive-test

Docs Build status updates of commit f030e2f:
:x: Validation status: errors
Please follow instructions here which may help to resolve issue.

File
Status
Preview URL
Details

:x:Error

Details

[Error]

Cannot sync git repo to specified commit because branch Archive_master_2019-09-25-10-52-35 has been deleted or has been force pushed: fatal: Couldn't find remote ref Archive_master_2019-09-25-10-52-35

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Create head of website

Create a new branch named feature/head (based on develop branch).
Create styles.css file in the root directory
Connect styles by adding the next line inside the  section.
When done ― commit your changes, push the branch to the remote, create a new pull request and merge into develop

done


Segmentation failure occurs after Timeout issue (#17478) while pairing thread accessory (Nordic board)

Using the SHA https://github.com/project-chip/connectedhomeip/commit/b4e425755d76efcaee1ebd0f82d5aac34c842474
While executing stress tests-> pairing with thread accessory, segmentation error is thrown soon after Time out issue #17478
This issue was observed twice and both the times it followed Timeout error mentioned in the issue #17478
Steps to reproduce;

Compile and flash thread accessory (nordic board)

Compile CHIPTool cli as follows
cd connectedhomeip
source scripts/bootstrap.sh
source scripts/activate.sh
gn gen out/debug --args='chip_mdns="platform" chip_crypto="mbedtls" chip_inet_config_enable_ipv4=false'
ninja -C out/debug
sudo ./out/debug/chip-tool pairing ble-thread node-id hex:operationalDataset setup-pin-code discriminator --pat-trust-store-path

Following is the error snippet ;
[1650321457476] [36665:4701009] CHIP: [IN] Sending unauthenticated msg 0x16f3c51f8 with MessageCounter:3829564977 to 0x0000000000000000 at monotonic time: 000000001FF75B01 msec
[1650321457476] [36665:4701009] CHIP: [EM] Flushed pending ack for MessageCounter:2477388310 on exchange 14952i
[1650321457654] [36665:4701009] CHIP: [EM] Received message of type 0x10 with protocolId (0, 0) and MessageCounter:2477388311 on exchange 14952i
[1650321457655] [36665:4701009] CHIP: [EM] OnMessageReceived failed, err = ../../src/messaging/ExchangeMgr.cpp:269: CHIP Error 0x00000070: Unsolicited msg with originator bit clear
[1650321457783] [36665:4701010] CHIP: [EM] Received message of type 0x9 with protocolId (0, 1) and MessageCounter:13695313 on exchange 14953i
[1650321457783] [36665:4701010] CHIP: [EM] Found matching exchange: 14953i, Delegate: 0x12f804690
[1650321457783] [36665:4701010] CHIP: [EM] Rxd Ack; Removing MessageCounter:12138406 from Retrans Table on exchange 14953i
[1650321457783] [36665:4701010] CHIP: [EM] Removed CHIP MessageCounter:12138406 from RetransTable on exchange 14953i
[1650321457783] [36665:4701010] CHIP: [DMG] ICR moving to [ResponseRe]
[1650321457783] [36665:4701010] CHIP: [DMG] InvokeResponseMessage =
[1650321457783] [36665:4701010] CHIP: [DMG] {
[1650321457783] [36665:4701010] CHIP: [DMG] 	suppressResponse = false,
[1650321457783] [36665:4701010] CHIP: [DMG] 	InvokeResponseIBs =
[1650321457783] [36665:4701010] CHIP: [DMG] 	[
[1650321457783] [36665:4701010] CHIP: [DMG] 		InvokeResponseIB =
[1650321457783] [36665:4701010] CHIP: [DMG] 		{
[1650321457783] [36665:4701010] CHIP: [DMG] 			CommandDataIB =
[1650321457783] [36665:4701010] CHIP: [DMG] 			{
[1650321457783] [36665:4701010] CHIP: [DMG] 				CommandPathIB =
[1650321457783] [36665:4701010] CHIP: [DMG] 				{
[1650321457783] [36665:4701010] CHIP: [DMG] 					EndpointId = 0x0,
[1650321457783] [36665:4701010] CHIP: [DMG] 					ClusterId = 0x30,
[1650321457783] [36665:4701010] CHIP: [DMG] 					CommandId = 0x5,
[1650321457783] [36665:4701010] CHIP: [DMG] 				},
[1650321457783] [36665:4701010] CHIP: [DMG]
[1650321457783] [36665:4701010] CHIP: [DMG] 				CommandData =
[1650321457783] [36665:4701010] CHIP: [DMG] 				{
[1650321457783] [36665:4701010] CHIP: [DMG] 					0x0 = 0,
[1650321457783] [36665:4701010] CHIP: [DMG] 					0x1 = "",
[1650321457783] [36665:4701010] CHIP: [DMG] 				},
[1650321457783] [36665:4701010] CHIP: [DMG] 			},
[1650321457783] [36665:4701010] CHIP: [DMG]
[1650321457783] [36665:4701010] CHIP: [DMG] 		},
[1650321457783] [36665:4701010] CHIP: [DMG]
[1650321457783] [36665:4701010] CHIP: [DMG] 	],
[1650321457783] [36665:4701010] CHIP: [DMG]
[1650321457783] [36665:4701010] CHIP: [DMG] 	InteractionModelRevision = 1
[1650321457783] [36665:4701010] CHIP: [DMG] },
[1650321457783] [36665:4701010] CHIP: [DMG] Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0005
[1650321457783] [36665:4701010] CHIP: [CTL] Received CommissioningComplete response
[1650321457783] [36665:4701010] CHIP: [CTL] Successfully finished commissioning step 'SendComplete'
[1650321457783] [36665:4701010] CHIP: [CTL] Commissioning stage next step: 'SendComplete' -> 'Cleanup'
[1650321457783] [36665:4701010] CHIP: [CTL] Performing next commissioning step 'Cleanup'
[1650321457783] [36665:4701010] CHIP: [CTL] Successfully finished commissioning step 'Cleanup'
[1650321457783] [36665:4701010] CHIP: [TOO] Device commissioning completed with success
[1650321457783] [36665:4701010] CHIP: [DMG] ICR moving to [AwaitingDe]
[1650321457783] [36665:4701010] CHIP: [EM] Sending Standalone Ack for MessageCounter:13695313 on exchange 14953i
[1650321457783] [36665:4701010] CHIP: [IN] Prepared secure message 0x16f451238 to 0x0000000000000009 (1)  of type 0x10 and protocolId (0, 0) on exchange 14953i with MessageCounter:12138407.
[1650321457783] [36665:4701010] CHIP: [IN] Sending encrypted msg 0x16f451238 with MessageCounter:12138407 to 0x0000000000000009 (1) at monotonic time: 000000001FF75C35 msec
[1650321457783] [36665:4701010] CHIP: [EM] Flushed pending ack for MessageCounter:13695313 on exchange 14953i
[1650321457783] [36665:4701005] CHIP: [CTL] Shutting down the commissioner
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the controller
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the commissioner
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the controller
[1650321457784] [36665:4701005] CHIP: [IN] Expiring all connections for fabric 1!!
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the commissioner
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the controller
[1650321457784] [36665:4701005] CHIP: [IN] Expiring all connections for fabric 2!!
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the commissioner
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the controller
[1650321457784] [36665:4701005] CHIP: [IN] Expiring all connections for fabric 3!!
[1650321457784] [36665:4701005] CHIP: [CTL] Shutting down the System State, this will teardown the CHIP Stack
[1650321457784] [36665:4701005] CHIP: [DMG] IM WH moving to [Uninitialized]
[1650321457784] [36665:4701005] CHIP: [DMG] IM WH moving to [Uninitialized]
[1650321457784] [36665:4701005] CHIP: [DMG] IM WH moving to [Uninitialized]
[1650321457784] [36665:4701005] CHIP: [DMG] IM WH moving to [Uninitialized]
[1650321457784] [36665:4701005] CHIP: [DMG] All ReadHandler-s are clean, clear GlobalDirtySet
[1650321457784] [36665:4701005] CHIP: [BLE] CancelConnection
[1650321457784] [36665:4701005] CHIP: [IN] Clearing BLE pending packets.
[1650321457784] [36665:4701005] CHIP: [BLE] BtpEngine unsub failed
[1650321457784] [36665:4701005] CHIP: [BLE] Auto-closing end point's BLE connection.
zsh: segmentation fault  sudo ./out/debug/chip-tool pairing ble-thread 9  20202021 3840
Log Files:
Attaching the complete log files from CHIPTool cli and from nordic board:
SegmentationError-CHIPToolcliLogs.txt
SegmentationError-NordicBoardLogs.txt

@phonnakasturi-apple Is it possible to run under lldb and get a stack trace?

@bzbarsky-apple Can you please let me know how to run thread accessory under lldb?

The segmentation fault is in chip-tool, not the thread accessory.  So:
lldb ./out/debug/chip-tool -- pairing ble-thread node-id hex:operationalDataset setup-pin-code discriminator --pat-trust-store-path

and then when it crashes:
bt

to get the stack and:
f 0

to get some info about the topmost frame.


Channel synchronisation is taking more than 20 seconds with 143 live channels

Description
Hi,
We have 143 channels live in our production app using Twilio Programmable Chat.
Earlier channel synchronization time was around 2 seconds when we had <10 channels, but now with 143 channels, this synchronization time has increased to 22-24 seconds.
We have integrated the latest SDK version.
What is the issue here?
This increased synchronization time is causing major business problems.
Expected Behavior
Channel synchronization should take than 2-3 seconds even if number of channels increase multi-folds.
Actual Behavior
Channel synchronization is taking 23-24 seconds.
Reproduces how Often
100%
Logs
2020-12-28 23:47:28.733 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > app created
2020-12-28 23:47:31.461 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > createClient()
2020-12-28 23:47:32.152 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > setChannelListener() > true
2020-12-28 23:47:36.117 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > onSuccess()
2020-12-28 23:47:36.117 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > tokenCreated()
2020-12-28 23:47:36.123 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > tokenCreated() 2
2020-12-28 23:47:36.126 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > getChannels()
2020-12-28 23:47:36.331 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > setChannelDatatoDb
2020-12-28 23:47:36.333 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > getOfflineMessages()
2020-12-28 23:47:36.334 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > setChannelListener() > false
2020-12-28 23:47:36.336 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > synchronized channels
2020-12-28 23:47:36.340 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > CSYNC - IDENTIFIER
2020-12-28 23:47:59.097 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > CSYNC - ALL
2020-12-28 23:47:59.097 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > checkLocalMessageCount()
2020-12-28 23:47:59.099 30293-30293/com.pristyncare.hospitalchat.debug D/Hospital: AISS > TWILIO > getOfflineMessages()
Or attach it as a file.
Chat Android SDK
6.2.0
Android API
30

Hi! Thanks a lot for bringing this issue to our attention. In general, Programmable Chat Client synchronization time depends on the number of factors during the initial SDK startup, in particular:

number of userChannels
number of members in each user channel
network quality

When user has only several userChannels and good network expected synchronization time is few seconds. If the user is a member of numerous channels, the synchronization time increases. It’s a little bit unclear how many same users are in these 147 channels, but the startup time shouldn’t be that long as according to our tests 1000 channels x 1 member each with a good network takes about ~10 sec to synchronize.
At the moment, we are working on several solutions to improve the startup time, but significant improvements are not expected before the second half of 2021.

We will revisit this after we implement the optimizations as proposed in second half of 2021. Closing for now.


Integrate Timeline Track

Spent about 3 hours getting environment set up on new VM. And about 2.5 hours trying out different ways to complete this. Ended up just being a few lines of code in the end.


Future of this package

Hey @voorjaar
Firstly, thanks for adding me to the org.
Was wondering if you'd be open to the idea of having someone take over the core development of this package?
The package is great and will likely be a dependency of a lot webpack-based Vue frameworks (Nuxt v2, vue-cli, etc). However for it to scale to these frameworks and reach further adoption, I feel like this package needs quite a bit of work.
In my mind that work would look like

using a new js package that pulls out the duplicated logic from different implementations - have messaged @antfu about using his box implementation from the vite plugin
get feature parity with the Vite plugin (where it's possible)
add testing
work on a v3 which would use a webpack plugin over a loader. It would be better suited to handle further features and optimisations and gives a better DX

For the last point, I think it would make sense to do one of the two (when the implementation is ready):
a. We create a new package called vue-windicss-webpack-plugin and we deprecate this one
b. We rename this package to vue-windicss-webpack-plugin
vue-windicss-preprocess is a bit too ambiguous at the moment and doesn't limit the scope of what the package is trying to accomplish.
If all sounds good to you, would be great if I could get elevated permissions to this package and permission on npm to handle the release (username: harlan_zw).
Thanks either way and look forward to contributing where I can.

FYI, we have an npm org @windicss, so many we can have @windicss/webpack-plugin-vue or ``@windicss/webpack-loader-vue`. /cc @voorjaar

FYI, we have the npm org @windicss, so many we can have @windicss/webpack-plugin-vue or ``@windicss/webpack-loader-vue`. /cc @voorjaar

I think this will be the best path forward actually. I didn't want to make it confusing to other developers which package should be used but I think this can become clearer once the other one is up and stable.

Sorry for the delay. I just discussed with my team member, we think most of your ideas are great, but we want to modify a bit. vue-windicss-webpack-plugin is unnecessary, we want a windicss-webpack-plugin that support vue, react, svelte at the same time. But you can support vue first, then the others. if this works for you, then welcome to join. And I will archive the vue loader.


Using the trained model for a prediction

Hi, I was trying to reproduce your results but I noticed that the test_users and test_items parameters passed to the function here: https://github.com/eelxpeng/CollaborativeVAE/blob/master/lib/cvae.py#L152 are never actually used in its body to make a prediction. Can you please tell me how to use these to actually generate a recommendation using your code?

The model contains m_U and m_V variables. After the training, the embedding of each user and item is already found. To predict, simply do dot product for a m_U and a m_V. If an item is not in the training set, then only the content could ever be used, which should pass through the encoder to get E[z] for m_V.

@eelxpeng Thank you for your reply, the one thing about it that I still do not understand is how this would produce different recommendations for users U1 and U2 if user U1 has read articles [A1, A2, A5] while U2 has read articles [A1, A3, A6]. The method you are describing does not consider this "evidence", does it?  The information is considered during training. Two parts of information are included: collaborative info and content info. And that's how the model gets m_U and m_V. It is the central of the idea.

@eelxpeng Thanks for the clarification, really appreciate you taking the time to explain but what I meant was that I didn't understand how indexing into the "score" array here: https://github.com/eelxpeng/CollaborativeVAE/blob/master/lib/evaluateCorrect.m#L34 gives a different rating for some article X for users U1 and U2 when we've not taken the data in the gt matrix into account.

@eelxpeng I just realized I might have worded my question in a wrong way, what I meant was:

f an item is not in the training set, then only the content could ever be used, which should pass through the encoder to get E[z] for m_V.

What if the items are in the training set but the user is not? So items A, B, C..Z are in the training dataset but the user is using a combination of these that we have not seen before? Would there be no option other than to train for the user again?


add condition, if message received with ExtendedTextMessage, then use it, else use Conversation attribute

in continue to issue: #81
add condition, if message received with ExtendedTextMessage, then use it, else use Conversation attribute

so this is regarding your issue right?
https://github.com/aldinokemal/go-whatsapp-web-multidevice/issues/81


NavList API

In the spirit of documentation-driven development (DDD), I've drafted the documentation for the NavList (previously NavigationList) component. I'm looking for feedback on the component API before I begin implementation.
✨  Direct link to the docs preview
Code review notes

We renamed NavigationList to NavList to save characters and align with UnderlineNav and the <nav> element (Slack discussion). The NavigationList ViewComponent will be renamed to NavList when it's moved from dotcom into the primer/view_components repo.
I'd love to have an accessibility expert verify that the "Rendered HTML" sections look correct.
I'm not confident in the sub-item API yet. Extra consideration for that section would be appreciated.
Should title be a required prop on the NavList.Group component?

Part of https://github.com/github/primer/issues/637

why is the component called NavList instead of NavigationList?

@camertron we had a conversation about "NavigationList" vs "NavList" in Slack. The consensus was to rename NavigationList to NavList in both React and ViewComponents to save characters and align with UnderlineNav and the <nav> element


Multiple changes in code and infrastructure

It makes sense to review by commits.
The change list:
Code:

Add monitoring metric for aggregations
Add option to build static binary w/o C bindings to ACL library
Add -v flag
Add logging to STDOUT

Infrastructure:

Build a docker image
Move from Travis to GH actions
Use FPM to build a package
Optimize allowedMetrics example

We are migrating back to leoleovich/grafsy


Passing bootnode flag

Today, I tried to specify another node as a bootnode. As per the instructions bee start -h, I passed an address in between brackets []. However, I get an error:
DEBU[2020-06-22T12:42:51+02:00] multiaddress fail [/ip4/<IP_ADDRESS>/tcp/7070/p2p/16Uiu2HAmFFHqxqwp4RRXktdBTU9WZ37uA1SAv2mHshmgyuGLnR4N]: failed to parse multiaddr "[/ip4/<IP_ADDRESS>/tcp/7070/p2p/16Uiu2HAmFFHqxqwp4RRXktdBTU9WZ37uA1SAv2mHshmgyuGLnR4N]": must begin with /

If I pass the address without brackets, it works fine. Fixing this issue is done by either updating the help text, or allowing multiple bootnodes to be passed in an array.

@Eknir you can also specify  ["/ip4/<IP_ADDRESS>/tcp/7070/p2p/16Uiu2HAmFFHqxqwp4RRXktdBTU9WZ37uA1SAv2mHshmgyuGLnR4N"]

@vandot, it works now. I don't know if this was fixed or I do something differently. Thanks for the answer anyways. Closing the issue!

@Eknir I added " but you are right there is no " in help text, not sure if its possible to add them

@vandot , it work as "[multiaddress]", ["multiaddress"], "multiaddress", [multiaddress]. Not sure what I bumped into yesterday.

Also --bootnode flag can be specified multiple times.


Homework week 2

I am really sorry about this week... Couldn't figure out why the button wasn't working..

Grading is in the document.


Merge pull request #1 from johndyer/master

Updating fork

Coverage remained the same at 73.832% when pulling 054118037aa3a2f7165db7dcff158679bc51a5eb on xpetter:master into fe0c2567e0022aebdef9e034c75a01a73c204964 on mediaelement:master.


Color Picker

Need a color picker control to enable selecting basic and advanced colors.  Should have methods for setting and retrieving selected color.  Also need to ensure we can support different variants for generically picking a color vs. picking a foreground or background color.

Variants:
Palette

Foreground Color

Background Color

something like this would be great: http://colpick.com/plugin

For your consideration...
Native HTML5 (per OS):
OSX

Windows

jQuery Plugins:
http://colpick.com/plugin

ET Element:
https://github.exacttarget.com/ETElements/colorpicker

@jamin-hall we need to discuss this further

I vote a design like http://colpick.com/plugin! Simple, yet has the typical tools you need :+1:

This is a candidate for an extension to picker. In fact, this could possibly be closed in favor of just creating a fuel ux snippet implementation of the picker.

This can also be addressed in our yet-to-be-released internal framework very quickly with its better code sharing and modularity.

We are not longer adding any new controls to this library.


Add heartbeat to detect down slaves

I have noticed some issues bringing up master and slave nodes within Kubernetes. I noticed in some other github issues for Locust that some of the issues may be solved by adding a heartbeat between the nodes.
The changes include the addition of a heartbeat thread on the master. The slaves check in with the master by means of their own heartbeat worker thread. There is also a new state (missing) that will show in the UI if a slave fails to check in with the heartbeat to the master.
I also think that it prevents some stale state by having the slaves also send their current state to the master. Reason being that if a slave fails to check in and goes missing, how else would the master know what the slave is doing after it continues to check in.
I got my inspiration from the ZMQ guide, specifically this pattern...
http://zguide.zeromq.org/page:all#Robust-Reliable-Queuing-Paranoid-Pirate-Pattern
Thoughts, comments?

Hi, @Jonnymcc
It's a very useful feature. So far, the master can not detect slaves that exit unexpectedly.
But, can you keep compatible with previous versions of locust and third party tools?
What about binding to another port?

@myzhan I think we can support previous versions. Let me know if I understand what is needed though.

Removing the second port(master_port + 1) is not important.  If it is important (collecting stats from slaves) why can't the master bind port be used?
The issue stems from the changes to the locust zmq server/client, specifically the addition of the multipart send and receive.
Supporting third party tools can be accomplished by maintaining the same send and receive methods of the zmq server/client and returning the Message type and not returning the multiple frames (a list).

By compatible with previous versions are you implying running a master/client with a master/client of another version? That sounds like asking for bugs regardless of the changes made in the PR.

@Jonnymcc  :+1:  this is really nice!
sorry for taking so long to review the PR... I just merged it to master.
thanks for the contribution to Locust!

@cgoldberg Any plans for release? I checked last release was in September, 2018. This is quite a major fix, do you think we should have a release now?

@mangatmodi this is now released 🎉

I guess the fix to stop the test after hitting the stop button in the UI did not make it to the 0.11.0 release


DEVEXP-264: validate E164 number format

It would be good to check the code on the server side in order to perform the same validation: if we miss one valid pattern (ie accepted by the server), this model would limit the SDK usage compared to a direct API call

I agree.
I'm still waiting for these feedback and because this validation if for a feature branch, not yet released, this is not yet a blocker
In addition, I'm planning to support a flag to have a "relax" vs "strict" (the current and default) behavior. So this will enable to be confident in case of "too strict validation"


Update to IE mode what's new announcement

Did some minor re-write of the IE mode announcement.

Docs Build status updates of commit 9cd489a:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

microsoft-edge/devtools-guide-chromium/whats-new/2022/02/devtools.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel

Docs Build status updates of commit c4c9699:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

microsoft-edge/devtools-guide-chromium/whats-new/2022/02/devtools.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel