per client application authorization support issue

Hi,
This is indeed a question/query rather than an issue so please treat accordingly:)
We are trying to use spring cloud config server as main config server of our application infrastructure. We have numerous applications that pull configuration from the server.
As far as we understand , the security concern of spring cloud config is handled by spring security foundation. (We are able to use basic auth credentials and etc.)
However, we could not figure out if "per client application authorization" can be achieved or not.
To be more precise, as long as a client has valid credentials to access the config server, assuming that it knows application, profile and label info for any other app, it can obtain the resources (config info) of the other app by querying the config server as follows:
http://{host}:{port}/{application}/{profile}/{label}/resource
I know that this issue can be avoided by using separate config servers for each application but we do not want that.
Is there any mechanism we can use to achieve the above mentioned "per client application authorization" ?
Or should we consider application, profile and label params as credentials that should be secured in the same was as spring security credentials in the client side?
Regards

If each app had their own user name and password you could use Spring Security to configure which app can access which paths.

If each app had their own user name and password you could use Spring Security to configure which app can access which paths.

Hi @ryanjbaxter
Thanks for your response. If I understand correctly, you are mentioning the role based security config of spring security (hasRole, hasAuthority ) ?
This should work in theory, but it would introduce a moving part in config server for every new application added , i.e. we will need to alter security config of config server for every new application and most probably we will not want that.
Does this means that such a concern is not handled by spring cloud config and delegated to spring security?
Regards

Hi @ryanjbaxter
Thanks for your response. If I understand correctly, you are mentioning the role based security config of spring security (hasRole, hasAuthority ) ?
This should work in theory, but it would introduce a moving part in config server for every new application added , i.e. we will need to alter security config of config server for every new application and most probably we will not want that.
Does this means that such a concern is not handled by spring cloud config and delegated to spring security?
Regards

Does this mean that such a concern is not handled by spring cloud config and delegated to spring security?

Yeah the config server does not handle any kind of security itself.

This should work in theory, but it would introduce a moving part in config server for every new application added , i.e. we will need to alter security config of config server for every new application and most probably we will not want that.

There is probably a pattern you could come up with where the application name matches the path and only then allow access so the configuration is not crazy.  Although you still have to deal with adding the credentials for each application, but I suppose that could be externalized as well.
I am by no means a Spring Security expert, so there is probably a better solution than what I am coming up with here.

Does this mean that such a concern is not handled by spring cloud config and delegated to spring security?

Yeah the config server does not handle any kind of security itself.

This should work in theory, but it would introduce a moving part in config server for every new application added , i.e. we will need to alter security config of config server for every new application and most probably we will not want that.

There is probably a pattern you could come up with where the application name matches the path and only then allow access so the configuration is not crazy.  Although you still have to deal with adding the credentials for each application, but I suppose that could be externalized as well.
I am by no means a Spring Security expert, so there is probably a better solution than what I am coming up with here.

Hİ @ryanjbaxter
Thanks for the info.
Closing the issue
Best regards

Hİ @ryanjbaxter
Thanks for the info.
Closing the issue
Best regards


Nlog - NLog.NLogRuntimeException - Asynchronous exception has occurred

This error happens from the URL deployed in IIS (ASP.NET MVC). After few hits we are receiving exception from Nlog. Can you please advise the fix for this.
NLog.Internal.txt
Nlog Version - 4.6.2   .NET version - 4.5.2
Nlog Config  -
<?xml version="1.0" encoding="utf-8"?>
<nlog throwexceptions="true" xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<variable name="directory" value="D:/Logs/" /> <!--This denotes the directory where the log files will be created-->
    <targets>
	    <target name="file" xsi:type="File" fileName="${directory}/${event-properties:item=ProductName}/${event-properties:item=FileName}"
      layout="[${longdate}][${level:uppercase=true}][${message}]" />
    </targets>
    <rules>
	   <logger name="*" minlevel="Debug"  writeTo="file" enabled="true" />
    </rules>
</nlog>

Error -
Error with flush. Exception: NLog.NLogRuntimeException: Asynchronous exception has occurred. ---> System.TimeoutException: Timeout.
--- End of inner exception stack trace ---
at NLog.Common.AsyncHelpers.RunSynchronously(AsynchronousAction action)
at NLog.LogFactory.Flush(TimeSpan timeout)

Very confusing that your attached NLog.Internal.txt nicely shows that you are using this NLog-target:
https://www.nuget.org/packages/NLog.Targets.Syslog/
But the NLog.config you have attached to the issue is different. It makes it difficult to help you when you give wrong information.
There is a bug in NLog.Targets.Syslog that has been fixed with: https://github.com/luigiberrettini/NLog.Targets.Syslog/pull/201
Sadly enough no release has been made yet. Think you should close this issue and instead create a new issue at:
https://github.com/luigiberrettini/NLog.Targets.Syslog
Unless you can reproduce the issue without using NLog.Targets.Syslog ?


Don't include trace spans for skipped or canceled steps in jobs

At present, this action publishes a trace span for all steps in each job that it covers, whether or not the steps actually ran. For steps in a job that get skipped, we should not publish trace spans representing them, as there was no actual work that occurred.
We can detect which steps were skipped by checking the "outcome" field of the "steps" context. If the value is "cancelled" or "skipped," then the step never ran. We should only include trace spans for steps whose outcome is "success" or "failure."
It looks like we could add this guard condition to the traceWorkflowRunStep function.

This seems like a reasonable enhancement. That location looks good to add the check. Happy to review a PR and get a release cut with this change.

I wrote a patch to implement this change, but I am uncertain of how best to test it. Would you like me to post it if I'm not sure yet whether it works as intended?

Please see #33 for this improvement.


Fix merge conflict with 23.12 [skip ci]

Resolves the merge conflict reported in #10287.  There are no code changes since the changes trying to be merged were a backport of changes from 24.02 originally.
NOTE: This needs to be merged with a merge commit, not squashed!

build


fails to run under python 3.8

When I try to use pygccxml under python 3.8 on Manjaro I get the following error:
...
    declarations = parser.read_files(files, compilation_mode)
  File "/usr/lib/python3.8/site-packages/pygccxml/parser/project_reader.py", line 264, in read_files
    return self.__parse_file_by_file(files)
  File "/usr/lib/python3.8/site-packages/pygccxml/parser/project_reader.py", line 319, in __parse_file_by_file
    start_time = time.clock()
AttributeError: module 'time' has no attribute 'clock'

The clock method was removed in Python 3.8 as it was deprecated since python 3.3. Therefore, this issues arises.

We are also hitting this issue using Python 3.8. It looks like this issue is resolved in the develop branch when do you expect to merge into master and make a new release?

I can confirm that develop branch currently works for the ns-3 project and Python 3.8 (tested on Ubuntu 20.04).

I am working on updating the build pipelines https://github.com/gccxml/pygccxml/pull/112.
Once this is done I will do a final review and try to tag a new release.

Is there a status on this?

When is a new version coming out?

Soon. I am currently reviewing the last issues. This one is fixed on develop so I'll close it.


Support for Debug Probe

I thought I should check with you before I try and do this myself :)
In terms of creating VSCode projects, I note that there are a couple options missing when generating launch.json

Remote (whereby an openocd instance is already running and listening on port 3333)
Debug Probe ( https://www.raspberrypi.com/products/debug-probe/ )

If would be really helpful if these were supported in this (rather useful) tool.
I've got working examples for both, but it's not as simple as a simple string substitution. My thinking would be to change the approach, and have some templates that are simply copied (as they do here https://github.com/raspberrypi/pico-examples/tree/master/ide/vscode ) into the generated project folder.
I'm considering writing the changes myself and generating a PR, but only if that sounds like an approach that might be acceptable?
Cheers,
Nick Outram, University of Plymouth, UK

Note - for now - I've make a PR to support the debug probe https://github.com/raspberrypi/pico-project-generator/pull/76 as this is a simple addition to the launch.json file.
The above still stands however if remote is to be added.

PR is now merged. Leaving this open for the remote bit.


Document how resp is affected by raising HTTPError/HTTPStatus

As pointed out by @onecrayon on Gitter, at the time of writing, it is not very clear what happens with data attributes/headers/cookies already set on resp in the case an instance of HTTPError or HTTPStatus is raised.
The correct answer for the 3.x series is that resp.data, .text, .media, etc are reset, but headers and cookies persist unless they are overwritten by headers passed into HTTPError.
Another undocumented surprise is that passing Set-Cookie in headers will bubble up an unhandled falcon.errors.HeaderNotSupported to the app server.
See also: #1752.

TBD: do we need any code changes here, or is clearly documenting the current behaviour good enough?

Clear documentation would be sufficient for my needs, personally, but mainly because I still want to send cookies along with redirects. I could also see an argument for the redirects using a completely new response, though, because it’s two lines to explicitly send a redirect while maintaining the response otherwise (set the status, set the header).

If we were to implement #1752 also for http status/error it would be feasible to add an attribute to them called override_request that means "discard everything in request and use things only from this object".
The default would be False to keep the current behaviour


simplify and speed up TABLEDATA processing

Simplify some of the code that parses the TD elements. I don't understand the details of what was going on before, but it was very slow.  Following this commit, parsing TABLEDATA is about five times faster and all the unit tests still pass.
However, I might be missing something about the previous implementation, so there might be some good reason not to apply this commit.

Right, it is faster now.


logstash input sqlserver ouput kafka failed

I want to get the sqlserver data into kafka.
But I got an error when I start logstash with config file.
Thanks a lot~~

Version:logstash-6.2.4
Operating System: windows server 2012 R2
Config File (if you have sensitive info, please remove it):
input{
jdbc{
jdbc_driver_library => "D:\sqljdbc_6.4\chs\mssql-jdbc-6.4.0.jre7.jar"
jdbc_driver_class =>"com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://ip:port;databasename=xxxxx"
jdbc_user => "XXXX"
jdbc_password => "XXXX"
statement => "SELECT TOP 1000 [AutoID]
,[CatalogID]
,[ItemID]
,[Type]
,[Name]
,[Description]
,[Attributes]
,[CustomColumn0]
,[CustomColumn1]
,[CustomColumn2]
,[CustomColumn3]
,[Owner]
,[LastModifier]
,[ModificationTime]
,[XML]
,[Revision]
FROM XXXXXX"
}
}
#filter {

#}
output {
stdout { codec => rubydebug }
kafka {
bootstrap_servers => "xxxx:9092"
topic_id => "sqlserver-to-es"
codec => "json"
compression_type => "snappy"
acks => "1"
retries => "5"
}
}

log:
[2018-06-13T14:49:27,693][WARN ][logstash.shutdownwatcher ] {"inflight_count"=>63, "stalling_thread_info"=>{"other"=>[{"thread_id"=>30, "name"=>nil, "current_call"=>"[...]/vendor/bundle/jruby/2.3.0/gems/logstash-output-kafka-7.0.10/lib/logstash/outputs/kafka.rb:253:in block in retrying_send'"}, {"thread_id"=>31, "name"=>nil, "current_call"=>"[...]/vendor/bundle/jruby/2.3.0/gems/logstash-output-kafka-7.0.10/lib/logstash/outputs/kafka.rb:253:in block in retrying_send'"}, {"thread_id"=>32, "name"=>nil, "current_call"=>"[...]/vendor/bundle/jruby/2.3.0/gems/logstash-output-kafka-7.0.10/lib/logstash/outputs/kafka.rb:253:in block in retrying_send'"}, {"thread_id"=>33, "name"=>nil, "current_call"=>"[...]/vendor/bundle/jruby/2.3.0/gems/logstash-output-kafka-7.0.10/lib/logstash/outputs/kafka.rb:253:in block in retrying_send'"}]}}

I apologize for the inconvenience, but this is a usage question, and should be asked at https://discuss.elastic.co.
GitHub is for coding issues and error reporting.


UofT-DSI | Deep Learning - Labs 1-6

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

Completing 6 labs in each commit / file.

What did you learn from the changes you have made?
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
How were these changes tested?
A reference to a related issue in your repository (if applicable)
Checklist

[x] I can confirm that my changes are working as intended

Labs 1-6 complete


feat: Initial working terraform module

Initial working Terraform module, plus

autogenerated README
CI inc pre-commit

Why is the example called hello_world_local? What is local about it?

local pipeline definition, as opposed to pipeline definition hosted in GCS


Bug: Missing Communication Link Reference in individual_risk_categories Despite Proper Definition in technical_assets

Issue Summary: I'm experiencing an issue where Threagile fails to recognize a communication link defined in technical_assets within the individual_risk_categories. Specifically, the communication link process-to-db is reported as missing in the risk category internal-fault-risk, even though it is correctly defined in the technical_assets.
Error message:
2024/10/22 00:24:58 missing referenced communication link at individual risk 'internal-fault-risk': process-to-db
threagile.yaml
threagile_version: "1.0"
title: "Test Threagile Model"
date: "2024-10-21"
author:
  name: "Jane Doe"
  homepage: "https://janedoe.example.com"
business_criticality: "critical"
tags_available:
  - "finance"
  - "user-data"
  - "compliance"
  - "confidential"
  - "backend"
  - "api"
  - "database"
  - "persistent-storage"
  - "internal"
  - "runtime"
  - "web"
data_assets:
  data-asset-db:
    id: "data-asset-db"
    description: "Primary database containing user financial data."
    usage: "business"
    tags:
      - "finance"
    origin: "internal"
    owner: "Database Team"
    quantity: "many"
    confidentiality: "confidential"
    integrity: "critical"
    availability: "critical"
    justification_cia_rating: "Essential for financial transactions and user trust."

technical_assets:
  process-server:
    id: "process-server"
    description: "Handles business logic and processes user transactions."
    type: "process"
    usage: "business"
    used_as_client_by_human: false
    out_of_scope: false
    size: "application"
    technology: "web-application"
    tags:
      - "backend"
      - "api"
    internet: false
    machine: "virtual"
    encryption: "data-with-symmetric-shared-key"
    owner: "DevOps Team"
    confidentiality: "confidential"
    integrity: "critical"
    availability: "important"
    multi_tenant: false
    redundant: true
    custom_developed_parts: true
    data_assets_processed:
      - "data-asset-db"
    data_assets_stored:
      - "data-asset-db"
    data_formats_accepted:
      - "json"
      - "xml"
    communication_links:
      process-to-db:
        target: "database-server"
        description: "Connects the process server to the main database."
        protocol: "jdbc"
        authentication: "credentials"
        authorization: "technical-user"
        vpn: true
        ip_filtered: true
        readonly: false
        usage: "business"
        data_assets_sent:
          - "data-asset-db"
        data_assets_received:
          - "data-asset-db"

  database-server:
    id: "database-server"
    description: "Stores and manages all financial user data."
    type: "datastore"
    usage: "business"
    used_as_client_by_human: false
    out_of_scope: false
    size: "system"
    technology: "database"
    tags:
      - "database"
      - "persistent-storage"
    internet: false
    machine: "virtual"
    encryption: "data-with-symmetric-shared-key"
    owner: "Database Team"
    confidentiality: "confidential"
    integrity: "critical"
    availability: "critical"
    multi_tenant: false
    redundant: true
    custom_developed_parts: false
    data_assets_processed:
      - "data-asset-db"
    data_assets_stored:
      - "data-asset-db"
    data_formats_accepted:
      - "json"
      - "xml"
    communication_links: {}  # No outgoing communication links from the database server

shared_runtimes:
  shared-runtime-web:
    id: "shared-runtime-web"
    description: "Shared runtime environment for web applications."
    tags:
      - "runtime"
      - "web"
    technical_assets_running:
      - "process-server"

individual_risk_categories:
 internal-fault-risk:
    id: "internal-fault-risk"
    description: "Risk associated with the communication between process server and database server."
    impact: "High impact on data integrity and availability."
    asvs: "ASVS Level 2"
    cheat_sheet: "Use secure communication protocols and strong authentication mechanisms."
    action: "Implement encryption and robust authentication for all database connections."
    mitigation: "Use encrypted JDBC connections with strong credentials and regularly rotate them."
    check: "Regularly audit database access logs and monitor for unusual activities."
    function: "development"
    stride: "information-disclosure"
    detection_logic: "Monitor and alert on abnormal access patterns and failed login attempts."
    risk_assessment: "High likelihood of data breach due to sensitive financial data."
    false_positives: "Low"
    model_failure_possible_reason: false
    cwe: 200
    risks_identified:
      data_exposure:
        severity: "high"
        exploitation_likelihood: "likely"
        exploitation_impact: "high"
        data_breach_probability: "probable"
        data_breach_technical_assets:
          - "database-server"
        most_relevant_data_asset: "data-asset-db"
        most_relevant_technical_asset: "database-server"
        most_relevant_communication_link: "process-to-db"
        most_relevant_trust_boundary: "internal-network"
        most_relevant_shared_runtime: "shared-runtime-web"
trust_boundaries:
  internal-network:
    id: "internal-network"
    description: "Internal network trust boundary."
    type: "network-on-prem"
    tags:
      - "internal"
    technical_assets_inside:
      - "process-server"
      - "database-server"
    trust_boundaries_nested: []
risk_tracking:
  internal-fault-risk:
    status: "in-progress"
    justification: "Addressing the encryption and authentication vulnerabilities."
    ticket: "TICKET-1234"
    date: "2024-10-20"
    checked_by: "Security Team Lead"

Expected Behavior: Threagile should recognize the process-to-db communication link defined within technical_assets and associate it correctly with the internal-fraud-risk in individual_risk_categories without any missing reference errors.
Actual Behavior: Despite the correct definition of process-to-db in technical_assets and proper referencing in individual_risk_categories, Threagile reports that the communication link is missing.

I am using the this docker version:
podman run --rm -it threagile/threagile --version
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)

|_   | |_  _ __ ___  __ _  __ () | ___
| | | '_ | '/ _ /  |/ _ | | |/ _
| | | | | | | |  __/ (| | (| | | |  __/
|| || ||_|  _|_,|_, |||_|
|/
Threagile - Agile Threat Modeling
Documentation: https://threagile.io
Docker Images: https://hub.docker.com/r/threagile/threagile
Sourcecode: https://github.com/threagile
License: Open-Source (MIT License)
Version: 1.0.0<PHONE_NUMBER>3903)

I also tried to run it from the source code, but the risk defined in the "individual risk category" is missing from the reports.  see https://github.com/Threagile/threagile/discussions/103.

Yeah, individual risks are reworked to use something like this  https://github.com/Threagile/threagile/blob/master/pkg/risks/scripts/accidental-secret-leak.yaml
@joreiche may share a bit more about it

Oh, thanks for the info.  As I am using individual risk categories (irc) heavily, just want to clarify that you mean irc would be a rework like the one in https://github.com/Threagile/threagile/blob/master/pkg/risks/scripts/accidental-secret-leak.yaml?    If so, I need to temporarily separate those parts in another manual report until your work is done.
It would be better to announce this and turn off the individual risk category functionalities if that is the case. We are serious users of Threagile, and that would impact what we should invest time in. :p
Is there anything I can contribute?  I can ping @joreiche

and thx for making Threagile better!  Good job!

@DavidCheuk In version 1.0, the native-code custom risk modules have been reworked to enable cross-platform support. I apologize that there isn't any documentation for this yet. We haven't officially released 1.0 yet, one of the main reasons being the lack of documentation of the changes as well as insufficient testing of this functionality. I will try to give you the important bits here but please be aware that this is gathered ad-hoc and likely incomplete.
Please, see cmd/risk_demo/main.go for a working example of what your custom risk modules should look like. The main differences to the previous implementation (off the top of my head) are:

custom risk modules are now regular executables, not shared libraries
they need to read input data in JSON format (e.g. the model) via os.Stdin
they need to write model.CustomRiskCategory in JSON format to os.Stdout when called with command line flag -get-info
they need to write a slice of types.Risk items in JSON format to os.Stdout when called with command line flag -generate-risks
they should write any runtime error messages to os.Stderr (so Threagile can capture and log them)

To Yevhen's point, there is also a script engine to allow writing risk modules. I expect to hook up this functionality into the custom risk modules as well but I don't think this has been done yet. Only the built-in risk modules are currently being loaded and executed using the script engine.

Eventually, native-code scripts (and RAA calculations) will be deprecated in favor of only supporting scripts in the future. We will definitely keep in mind your use case and the fact that you have a number of custom modules that would need to be converted. When we start deprecating support for native-code modules, I'll be happy to help you convert your modules to scripts.

@DavidCheuk In version 1.0, the native-code custom risk modules have been reworked to enable cross-platform support. I apologize that there isn't any documentation for this yet. We haven't officially released 1.0 yet, one of the main reasons being the lack of documentation of the changes as well as insufficient testing of this functionality. I will try to give you the important bits here but please be aware that this is gathered ad-hoc and likely incomplete.
Please, see cmd/risk_demo/main.go for a working example of what your custom risk modules should look like. The main differences to the previous implementation (off the top of my head) are:
custom risk modules are now regular executables, not shared libraries
they need to read input data in YAML format (e.g. the model) via os.Stdin
they need to write model.CustomRiskCategory in YAML format to os.Stdout when called with command line flag -get-info
they need to write a slice of types.Risk items in YAML format to os.Stdout when called with command line flag -generate-risks
they should write any runtime error messages to os.Stderr (so Threagile can capture and log them)
I reviewed the example in cmd/risk_demo/main.go and noticed that it is actually not correctly implemented (it uses JSON instead of YAML, and it text-formats its output data instead of directly writing it to os.Stdout) at the moment. I will fix it and test it to make sure it works correctly. I will let you know when it is ready.
To Yevhen's point, there is also a script engine to allow writing risk modules. I expect to hook up this functionality into the custom risk modules as well but I don't think this has been done yet. Only the built-in risk modules are currently being loaded and executed using the script engine.
Eventually, native-code scripts (and RAA calculations) will be deprecated in favor of only supporting scripts in the future. We will definitely keep in mind your use case and the fact that you have a number of custom modules that would need to be converted. When we start deprecating support for native-code modules, I'll be happy to help you convert your modules to scripts.

@DavidCheuk I pushed the fixed risk demo module to branch script-explanations. Since that branch is very far behind master it will take me a while rebasing that branch and merging my changes to master. Please stay tuned :)

The demo risk rule is now merged to master.


Publish latest version to NPM

npm version of this package is too old (2.1.4)
could you please create and publish the latest version to npm repo (including index.js) ?

i'm sorry @ja9adeesh, i just noticed this ticket;
i've just published the up to date version for both ng-flow and flow.js
\cc @AidasK


Update README

Update the readme to support the location of the example files now.

I love your project. It has helped me a lot. I'm happy to help with this issue.

Thanks for the nice words and the the heads up! 😊
Fixed it in 87efa40!

I'm happy to help with this issue.

There is something else I could use some help @marahim20! Maybe check out the PR to publish it as a package (https://github.com/typst/packages/pull/466) and leave a comment there about your thoughts! =)

Ok. I'll check it out.


AttributeError in custom layer for a weight defined in build() method when using JAX backend in Keras 3.0

I am reimplementing a TensorFlow implementation of a Conv2D layer with variational dropout in Keras Core. When I use this custom layer in a model with either the TF or the PyTorch backends, the network trains just fine. However, I get a AttributeError: 'VariationalConv2d' object has no attribute 'theta' error when I try to use the JAX backend.
In the custom layer, the theta attribute is defined using the add_weight function in the layer's build() method:
def build(self, input_shape):
    self.theta = self.add_weight(name="kernel", shape=self.kernel_size, initializer=self.kernel_initializer, trainable=True, regularizer=self.kernel_regularizer)

in my testing, I use (5, 5, 1, 6) as self.kernel_size, 'glorot_normal' as self.kernel_initializer, and None as self.kernel_regularizer.
In addition to the standard methods, this property is also defined within the layer:
@property
    def log_alpha(self):
        """Compute log alpha, which is the log of the variance of the weight matrix."""
        theta = ops.where(ops.isnan(self.theta), ops.zeros_like(self.theta), self.theta)
        log_sigma2 = ops.where(ops.isnan(self.log_sigma2), ops.zeros_like(self.log_sigma2), self.log_sigma2)
        log_alpha = ops.clip(log_sigma2 - ops.log(ops.square(theta) + 1e-10), -20.0, 4.0)
        return ops.where(ops.isnan(log_alpha), self.threshold * ops.ones_like(log_alpha), log_alpha)

The above property gets called by the following regularization property, whose result is added onto the result of the loss function:
@property
    def regularization(self):
        """Compute the regularization term for the weight matrix."""
        k1, k2, k3 = 0.63576, 1.8732, 1.48695
        C = -k1
        mdkl = k1 * ops.sigmoid(k2 + k3 * self.log_alpha) - 0.5 * ops.log(1 + (ops.exp(-self.log_alpha))) + C
        return -ops.sum(mdkl)

According to the traceback of the AttributeError exception, the call causing the exception is the line theta = ops.where(ops.isnan(self.theta), ops.zeros_like(self.theta), self.theta) within log_alpha.
For clarity, I will add the full layer definition and the train_step and training loop definitions in a comment.

Full layer definition:
class VariationalConv2d(Layer):
    def __init__(self, kernel_size, stride, padding='SAME', threshold=3.0, activation=None, data_format='channels_last', kernel_initializer='glorot_normal', bias_initializer='zeros', kernel_regularizer=None):
        super(VariationalConv2d, self).__init__()
        assert len(kernel_size) == 4    #kernel_size: [filter_height, filter_width, in_channels, out_channels]
        self.kernel_size = kernel_size
        self.stride = stride
        self.padding = padding
        self.threshold = threshold
        self.activation = activations.get(activation)
        self.data_format = data_format

        self.kernel_initializer = initializers.get(kernel_initializer)
        self.bias_initializer = initializers.get(bias_initializer)

        self.kernel_regularizer = regularizers.get(kernel_regularizer)

    def build(self, input_shape):
        self.theta = self.add_weight(name="kernel", shape=self.kernel_size,
                                     initializer=self.kernel_initializer, trainable=True, regularizer=self.kernel_regularizer)

        self.log_sigma2 = self.add_weight(name="log_sigma2", shape=self.kernel_size,
                                 initializer=initializers.Constant(-10.0), trainable=True)

    def sparsity(self):
        """Compute sparsity of the weight matrix, based on the number of non-zero elements."""
        total_param = ops.prod(ops.shape(self.boolean_mask))
        remaining_param = ops.count_nonzero(ops.cast(self.boolean_mask, dtype="uint8"))

        return remaining_param, total_param

    @property
    def log_alpha(self):
        """Compute log alpha, which is the log of the variance of the weight matrix."""
        theta = ops.where(ops.isnan(self.theta), ops.zeros_like(self.theta), self.theta)
        log_sigma2 = ops.where(ops.isnan(self.log_sigma2), ops.zeros_like(self.log_sigma2), self.log_sigma2)
        log_alpha = ops.clip(log_sigma2 - ops.log(ops.square(theta) + 1e-10), -20.0, 4.0)
        return ops.where(ops.isnan(log_alpha), self.threshold * ops.ones_like(log_alpha), log_alpha)

    @property
    def boolean_mask(self):
        return self.log_alpha <= self.threshold

    @property
    def sparse_theta(self):
        theta = ops.where(ops.isnan(self.theta), ops.zeros_like(self.theta), self.theta)
        return ops.where(self.boolean_mask, theta, ops.zeros_like(theta))

    @property
    def regularization(self):
        """Compute the regularization term for the weight matrix."""
        k1, k2, k3 = 0.63576, 1.8732, 1.48695
        C = -k1
        mdkl = k1 * ops.sigmoid(k2 + k3 * self.log_alpha) - 0.5 * ops.log(1 + (ops.exp(-self.log_alpha))) + C

        return -ops.sum(mdkl)

    def call(self, input, **kwargs):
        """Forward pass of the layer - differentiates between sparse (on evaluation time) and dense (on training time) input."""
        theta = ops.where(ops.isnan(self.theta), ops.zeros_like(self.theta), self.theta)

        if not kwargs['sparse_input']:
            sigma = ops.sqrt(ops.exp(self.log_alpha) * theta * theta)
            self.weight = theta + random.normal(ops.shape(theta), 0.0, 1.0) * sigma
            output = ops.conv(input, self.weight, self.stride, self.padding, self.data_format)

            if self.activation is not None:
                output = self.activation(output)

        else:
            output = ops.conv(input, self.sparse_theta, self.stride, self.padding, self.data_format)
            if self.activation is not None:
                output = self.activation(output)

        return output

    def get_config(self):
        config = super().get_config()
        config.update(
            {
                "kernel_size": self.kernel_size,
                "strides": self.strides,
                "padding": self.padding,
                "data_format": self.data_format,
                "activation": activations.serialize(self.activation),
                "kernel_initializer": initializers.serialize(
                    self.kernel_initializer
                ),
                "bias_initializer": initializers.serialize(
                    self.bias_initializer
                ),
                "kernel_regularizer": regularizers.serialize(
                    self.kernel_regularizer
                ),
                "threshold": self.threshold,
            }
        )
        return config

JAX training loop:
        def compute_loss(t, preds, reg):
            return criterion(t, preds) + reg

        def compute_loss2(label, pred):
            return criterion(label, pred)

        def compute_loss_and_updates(trainable_variables, non_trainable_variables, metric_variables, x, t, epoch,
                                     training=False):
            reg = rw_schedule(epoch) * model.regularization()

            preds, non_trainable_variables = model.stateless_call(trainable_variables, non_trainable_variables, x,
                                                                  train=training, sparse_input=False)

            loss = compute_loss(t, preds, reg)
            metric_variables = train_acc.stateless_update_state(metric_variables, t, preds)
            return loss, (non_trainable_variables, metric_variables)

        grad_fn = jax.value_and_grad(compute_loss_and_updates, has_aux=True)

        @partial(jax.jit, static_argnames=['epoch'])
        def train_step(state, data, epoch):
            (
                trainable_variables,
                non_trainable_variables,
                optimizer_variables,
                metric_variables,
            ) = state
            x, t = data

            (loss, (non_trainable_variables, metric_variables)), grads = grad_fn(trainable_variables,
                                                                                non_trainable_variables,
                                                                                metric_variables,
                                                                                x, t, epoch, True)

            trainable_variables, optimizer_variables = optimizer.stateless_apply(optimizer_variables, grads,
                                                                                trainable_variables)

            # Return updated state
            return loss, (
                trainable_variables,
                non_trainable_variables,
                optimizer_variables,
                metric_variables,
            )

        @jax.jit
        def eval_step(state, data):
            trainable_variables, non_trainable_variables, metric_variables = state
            x, t = data

            preds, non_trainable_variables = model.stateless_call(trainable_variables, non_trainable_variables,
                                                                  x, train=False, sparse_input=True)

            loss = compute_loss2(t, preds)

            metric_variables = test_acc.stateless_update_state(metric_variables, t, preds)

            return loss, (
                trainable_variables,
                non_trainable_variables,
                metric_variables,
            )

        # Initialization
        optimizer.build(model.trainable_variables)
        trainable_variables = model.trainable_variables
        non_trainable_variables = model.non_trainable_variables
        optimizer_variables = optimizer.variables
        metric_variables = train_acc.variables
        state = (
            trainable_variables,
            non_trainable_variables,
            optimizer_variables,
            metric_variables,
        )

        for epoch in range(epochs):
            x_train, y_train = shuffle(x_train, y_train, random_state=42)

            for batch in range(n_batches):
                start = batch * batch_size
                end = start + batch_size
                x_batch, y_batch = x_train[start:end], y_train[start:end]
                loss, state = train_step(state,
                                         (ops.convert_to_tensor(x_batch, dtype="float32"),
                                          ops.convert_to_tensor(y_batch, dtype="float32")),
                                         epoch)

            loss, state = eval_step(state,
                                    (ops.convert_to_tensor(x_test, dtype="float32"),
                                     ops.convert_to_tensor(y_test, dtype="float32")))
            for variable, value in zip(train_acc.variables, metric_variables):
                variable.assign(value)

            print(f'Epoch: {epoch + 1}, Valid Cost: {float(loss):.3f}, Valid Acc: {test_acc.result():.3f}')
            print("Sparsity: ", ops.convert_to_numpy(model.count_sparsity()))

Model definition:
def rw_schedule(epoch):
    """Defines the schedule for the weight regularization term."""
    if epoch <= 1:
        return 0
    else:
        return 0.0001 * (epoch - 1)

class VariationalLeNet(Model):
    def __init__(self, n_class=10):
        super().__init__()
        self.n_class = n_class

        self.conv1 = VariationalConv2d((5, 5, 1, 6), stride=1, padding='VALID')
        self.pooling1 = MaxPooling2D(padding='SAME')
        self.conv2 = VariationalConv2d((5, 5, 6, 16), stride=1, padding='VALID')
        self.pooling2 = MaxPooling2D(padding='SAME')

        self.flat = Flatten()
        self.fc1 = VariationalDense(120)
        self.fc2 = VariationalDense(84)
        self.fc3 = VariationalDense(10)

        self.hidden_layers = [self.conv1, self.conv2, self.fc1, self.fc2, self.fc3]

    def call(self, input, **kwargs):
        x = self.conv1(input, sparse_input=kwargs['sparse_input'])
        x = ops.relu(x)
        x = self.pooling1(x)
        x = self.conv2(x, sparse_input=kwargs['sparse_input'])
        x = ops.relu(x)
        x = self.pooling2(x)
        x = self.flat(x)
        x = self.fc1(x, sparse_input=kwargs['sparse_input'])
        x = ops.relu(x)
        x = self.fc2(x, sparse_input=kwargs['sparse_input'])
        x = ops.relu(x)
        x = self.fc3(x, sparse_input=kwargs['sparse_input'])
        return ops.softmax(x)

    def regularization(self):
        """Computes the total regularization term that has been applied on all the layers."""
        total_reg = 0
        for layer in self.hidden_layers:
            total_reg += layer.regularization

        return total_reg

    def count_sparsity(self):
        """Computes the sparsity of the weight matrices in all the layers."""
        total_remain, total_param = 0, 0
        for layer in self.hidden_layers:
            a, b = layer.sparsity()
            total_remain += a
            total_param += b

        return 1 - (total_remain / total_param)

@Faptimus420  Would you mind creating a colab for reproducing the error?
So that we can look further into it.
Thanks!

@haifeng-jin Sure, here it is https://colab.research.google.com/drive/1Oo2RZ00T3dbOCCRa68kL6hfk7dqu4LVc

I looked into this a bit.
JAX is much stricter than other backends about creating state in advance of using the model (due to its stateless nature -- it cannot create state on the fly like the other backends). In particular, you cannot call an unbuilt model in a JAX jit scope. The state must have been created beforehand.
So the first thing is that you need to build the model before using it. You can do so e.g. before calling optimizer.build(). Just add model.build(input_shape), e.g. model.build(x_train.shape[0:1]).
When you do this you will see an error about your custom layers having unbuilt state and needing to build their sublayers. This is because calling build() on the model will create the sublayers but won't build their variables. So you will need to add a build() method on your VariationalLeNet class that builds the sublayers. It could look like this:
    def build(self, input_shape):
        for layer in self.hidden_layers:
            layer.build(input_shape)
            input_shape = layer.compute_output_shape(input_shape)

In order to implement it, you will further need to add def compute_output_shape(self, input_shape) on your two custom layers, VariationalConv2d and VariationalDense.
So in summary, you should add:

VariationalDense.compute_output_shape
VariationalConv2d.compute_output_shape
VariationalLeNet.build

And then you should call model.build(input_shape) before using the model (outside the jit scope).

Oh and quick note -- if you do not want to bother with compute_output_shape should can build the model via something like:
def build(self, input_shape):
   # eager build
   x = keras.ops.zeros(input_shape)
   self(x)

In your case it would be a tad more complex because your model takes more than one call argument.


Font Awesome

Hi,
Font awesome icon loads fines in the local server, but whenever I deploy it on aws amplify it attempts to load from www.example.org folder instead of the domain name, even though the domain is correctly specified in the config file.
i've tried modifying the sass file for the font awesome loading but have not had any luck getting it to work so far,
It loads perfectly fine on the local server, but inky when deployed it attempts to laod from www.example.org
Any help is appreciated, thanks!

HI! I would guess it's something to do with your deploy process, as there's no "www.example.org" anywhere in the theme. Even the exampleSite config.toml is "example.com", but as you said, your config should be correct.
I can help troubleshoot given more details on your deploy process. Are there separate configuration settings for Amplify that may be interfering?

Hi,
Yeah it seems to be a deployment issue. Fiddled around more and it's a CORS not enabled problem.
Thanks for your help!


Two or more identityClass models

Is there way to use two or more identityClass for sign-in? I have three very different models (User, Manager, Member) and can I use all of these models as identityClass?

can you provide more information on this? I am facing the same issue.

@usualdesigner help me please!, how you resolved finally this problem? what's better option?
Thanks in advance

As suggested, you should have a class user and then three classes one for each kind of user, related to user class with a user_Id field, for example

@daskon please use forum for questions


Task: Implement GH workflow for automated pre-commit hook update

What is the task about?
Following the example of https://github.com/repository-service-tuf/repository-service-tuf-cli/blob/main/.github/workflows/update-pre-commit-hooks.yml, add a GitHub workflow that automates the updating of the pre-commit hooks in the .pre-commit-config.yaml file.
Parent feature
No response
References

https://docs.github.com/en/actions/using-workflows
https://github.com/repository-service-tuf/repository-service-tuf-cli/blob/main/.github/workflows/update-pre-commit-hooks.yml
https://github.com/repository-service-tuf/repository-service-tuf-cli/pull/383

Code of Conduct

[X] I agree to follow this project's Code of Conduct

I cannot add the labels, but some appropriate ones would be: "hacktoberfest", "help wanted", "good first issue"


Infer: eradicate and try-catch

It seems that infer: eradicate treats catch-blocks as never executed, at least in some cases. Below is an example class that "infer -a eradicate" claims has no issues. If the assignment "path = null" is moved after the catch-block (or into the try-block) then the assignment "filePath = path"  is (correctly) flagged as an error. Is this a bug in infer or an issue with models?
public class ExceptionTest {
	String filePath = "";
	public OutputStream returnStream(){
		File file = null;
		OutputStream stream = null;
		String path = null;
		try{
			file = File.createTempFile("tmp", "tmp");
			stream = new FileOutputStream(file);
			path = file.getAbsolutePath();
		}catch(IOException e) {
			path = null;
		}
		filePath = path;
		return stream;
	}
}

Thanks for the report. It seems to be a library modelling issue, as calling a locally defined method declared as throwing IOException causes the expected error to be reported.
Stay tuned.

Currently Infer does not analyze the jar of the standard library to get information on declared exceptions.
Turning to wishlist.

Thank you for your reply, and good to know this is on the wishlist. As a workaround, I tried to add a model of the method with the correct throws clause. However, it seems that adding a model that throws exceptions doesn't help in this case.  Is this also not supported yet?

Eradicate uses a different modeling mechanism than the core Infer analysis, with tables for annotations instead of actual code, as the implementation of called methods is not used by Eradicate's analysis.
It would be easy to add tables for exceptions as well, as a temporary solution while the full solution is being developed.


Convert cmake targets to plain libraries to fix linker error

When ${PROJECT_NAME}_LIBRARIES contains an imported cmake target, this command will blindly add it to the Makefile with a -l option in front. This PR uses a catkin function to extract the library path from imported cmake targets before passing it to the command.

Thanks for the fix.


Send document for signing example

Is there an example that shows how to send a document for signing?

If anyone comes across this situation I figured it out. What you have to do is add the document object to the envelope_definition. Also there is no TemplateId to set as the API will reject your request.

We now have a complete set of examples. See the repository eg-03-php-auth-code-grant


Delay Node: Error with Rate Limit and msg.reset

In V2.01 with a delay node set as Rate Limit and a msg.reset message the delay node will throw the following error: TypeError: Cannot read property 'hasOwnProperty' of undefined
Flow to reproduce:
[{"id":"49c5f93c6e9995b4","type":"inject","z":"8ae02d5f.40148","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":920,"y":1140,"wires":[["2e22d894ed0e714c"]]},{"id":"2e22d894ed0e714c","type":"change","z":"8ae02d5f.40148","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":1140,"wires":[["644d0a36bf3c0011"]]},{"id":"644d0a36bf3c0011","type":"delay","z":"8ae02d5f.40148","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":1250,"y":1140,"wires":[[]]}]

@deonp thanks for reporting. Found the issue straight away.
BTW - please use the 'Report a bug' template in the future as it helps ensure all relevant information is provided.

Thanks @knolleary for the quick fix.
I looked for 10 minutes and didn't notice the repeated call.
Yes, missed the template I think due to signing into GitHub on a different PC after clicking Raise an Issue.


how to set active_low to 1?

I want to set active_low to 1 but I don't know how. manually change to 1 in /sys/class/gpio/active_low to 1 but always back to 0.
please help.

this is my config:
        "accessory": "GPIODevice",
        "name": "Kitchen Speaker",
        "type": "Outlet",
        "inverted": "false",
        "initState": "1",
        "pin": 20

but when reboot and Homebridge start the relay turn on. I want relay off when raspberry pi boots.
please help

active_low showing 0
direction showing out
edge showing none
uevent is empty
value showing 0

this is my config:
        "accessory": "GPIODevice",
        "name": "Kitchen Speaker",
        "type": "Outlet",
        "inverted": "false",
        "initState": "1",
        "pin": 20

but when reboot and Homebridge start the relay turn on. I want relay off when raspberry pi boots.
please help

I need help with this too


Preserve original formatting when serializing

Hi Anton! 👋🙂
In my current use case, I have a user-edited toml file where I sometimes want to update a specific value programmatically. In this scenario, I would want to update the file without losing any comments or custom white space added by the user (except when directly affected by the change).
In the the most general form, TomlValue.from(path).write(path) would be a "no-op". If the TomlValue is modified between reading and writing as little formatting should change as possible. As a more special case, I could imagine a special operation which writes a new value to a single specified key without decoding the full document. But that may not be in line with the current API.
I understand that this may be a fundamental change and simply out of scope, but it doesn't hurt to ask, right? 😁

I think this would be doable for 90% of cases without too much work. The last 10% would be significantly harder. Consider the following examples:
[foo]
bar = 123

foo = {bar = 123}

foo.bar = 123

All of these map to {"foo": {"bar": 123}} in JSON notation. While the two first cases are easy enough to handle - just annotate foo with the type of dictionary it corresponds to - the third one is a problem. Handling cases like this would require replacing the current simple pretty-printing algorithm with some slow and convoluted hackery, and the annotations to support it would be pretty invasive to boot.
Would a best effort solution, which does the right thing as long as you only use the first two forms but converts the third form into the first during a roundtrip, still be useful?

In my case, I have an end-user editable configuration file which may include custom formatting and comments. The file is read in full and decoded to data classes on startup. In some cases I want to persist changes to the configuration. Typicaly, I have one or a few specific value(s) that I want to change programmatically. The rest of the file should not be changed (i.e. preserving custom white space and comments).
The value (X) I want to change may be at different levels, such as:
a = "X"

[a]
b.c = "X"

[a]
b = [ "X", "y", "z" ]

[a]
b = [ { c = "X", d = "y" }, { e = "z" } ]

As hinted at earlier, if it is simpler, for my use case it would be fine to say something like:
tomlMapper.encodeInline(tomlFilePath, "a.b.c", newValue)

In this case, the full file would not be decoded. Instead, it would be parsed only enough to identify the "bounds" of the existing value for that key in the file, and then replace that part of the file with the new value.


Fixed flaky test testDateHandling in TimestampsParquetReaderTest.java with JSONAssert

Description

Fixed flaky test testDateHandling in TimestampsParquetReaderTest.java with JSONAssert
Location: extensions-core/parquet-extensions
Filename: TimestampsParquetReaderTest.java
Test: testDateHandling
Steps to Reproduce:

Install the packagemvn install -pl extensions-core/parquet-extensions -am -DskipTests

Run the test in regular runsmvn -pl extensions-core/parquet-extensions test -Dtest=org.apache.druid.data.input.parquet.TimestampsParquetReaderTest#testDateHandling

The test failed by running the test with Non-Dex tool.mvn -pl extensions-core/parquet-extensions edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dcheckstyle.skip -Dtest=org.apache.druid.data.input.parquet.TimestampsParquetReaderTest#testDateHandling

Reason of flakiness:
The data reading methods used createReader() in the test does not retrieve data in a consistent order, which can possibly lead to different JSON representations of the same data during test runs.
Changes:

Imported JSONAssert and JSONException packages, and changed from using standard assertion method Assert to using JSONAssert.
Add org.json and org.skyscreamer dependencies to pom.xml file in /parquet-extensions.

Release note

Fixed: TimestampsParquetReaderTest.testDateHandling test no longer fail when running with the NonDex tool.

This PR has:

[x] been self-reviewed.
[ ] added documentation for new or modified features or behaviors.
[x] a release note entry in the PR description.
[ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
[ ] added or updated version, license, or notice information in licenses.yaml
[ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
[ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
[ ] added integration tests.
[ ] been tested in a test Druid cluster.

have you seen a failed job in github actions?

have you seen a failed job in github actions?

I have fixed the issue by modifying the fix. Thanks!

Closing in favor of https://github.com/apache/druid/pull/15418


stg_ga4__event_page_view: fails not_null check for 'location'

We've been running dbt with dbt-ga4 on version 1.0.0 in production for a while now, but recently (March 23rd) one of the tests started failing.
We've opted for updating to the latest version of dbt-ga4, but see the same test failure on the latest (3.1.0) version.
The test output (after a dbt run with full refresh):
(env)  ± dbt test -s ga4
12:20:29  Running with dbt=1.3.1
12:20:31  Found 578 models, 7474 tests, 216 snapshots, 52 analyses, 760 macros, 1 operation, 9 seed files, 582 sources, 291 exposures, 0 metrics
12:20:32
12:20:36  Concurrency: 99 threads (target='dev')
12:20:36
12:20:36  1 of 16 START test not_null_stg_ga4__event_page_view_page_location ............. [RUN]
12:20:36  2 of 16 START test not_null_stg_ga4__sessions_traffic_sources_session_source ... [RUN]
12:20:36  3 of 16 START test not_null_stg_ga4__user_id_mapping_user_pseudo_id ............ [RUN]
12:20:36  4 of 16 START test unique_dim_ga4__sessions_session_key ........................ [RUN]
12:20:36  5 of 16 START test unique_dim_ga4__user_pseudo_ids_user_pseudo_id .............. [RUN]
12:20:36  6 of 16 START test unique_fct_ga4__sessions_daily_session_partition_key ........ [RUN]
12:20:36  7 of 16 START test unique_fct_ga4__sessions_session_key ........................ [RUN]
12:20:36  8 of 16 START test unique_fct_ga4__user_ids_user_id_or_user_pseudo_id .......... [RUN]
12:20:36  9 of 16 START test unique_fct_ga4__user_pseudo_ids_user_pseudo_id .............. [RUN]
12:20:36  10 of 16 START test unique_stg_ga4__events_event_key ........................... [RUN]
12:20:36  11 of 16 START test unique_stg_ga4__session_conversions_daily_session_partition_key  [RUN]
12:20:36  12 of 16 START test unique_stg_ga4__sessions_traffic_sources_session_key ....... [RUN]
12:20:36  13 of 16 START test unique_stg_ga4__user_id_mapping_user_pseudo_id ............. [RUN]
12:20:36  14 of 16 START test unique_stg_ga4__user_properties_user_pseudo_id ............. [RUN]
12:20:36  15 of 16 START test unique_stg_ga4__user_pseudo_id_first_last_events_user_pseudo_id  [RUN]
12:20:36  16 of 16 START test unique_stg_ga4__user_pseudo_id_first_last_pageviews_user_pseudo_id  [RUN]
12:20:37  3 of 16 PASS not_null_stg_ga4__user_id_mapping_user_pseudo_id .................. [PASS in 1.15s]
12:20:37  1 of 16 FAIL 41 not_null_stg_ga4__event_page_view_page_location ................ [FAIL 41 in 1.16s]
12:20:38  15 of 16 PASS unique_stg_ga4__user_pseudo_id_first_last_events_user_pseudo_id .. [PASS in 2.46s]
12:20:39  11 of 16 PASS unique_stg_ga4__session_conversions_daily_session_partition_key .. [PASS in 2.97s]
12:20:39  16 of 16 PASS unique_stg_ga4__user_pseudo_id_first_last_pageviews_user_pseudo_id  [PASS in 2.98s]
12:20:39  8 of 16 PASS unique_fct_ga4__user_ids_user_id_or_user_pseudo_id ................ [PASS in 3.18s]
12:20:39  14 of 16 PASS unique_stg_ga4__user_properties_user_pseudo_id ................... [PASS in 3.44s]
12:20:39  9 of 16 PASS unique_fct_ga4__user_pseudo_ids_user_pseudo_id .................... [PASS in 3.47s]
12:20:39  5 of 16 PASS unique_dim_ga4__user_pseudo_ids_user_pseudo_id .................... [PASS in 3.53s]
12:20:39  6 of 16 PASS unique_fct_ga4__sessions_daily_session_partition_key .............. [PASS in 3.56s]
12:20:40  13 of 16 PASS unique_stg_ga4__user_id_mapping_user_pseudo_id ................... [PASS in 4.40s]
12:20:40  4 of 16 PASS unique_dim_ga4__sessions_session_key .............................. [PASS in 4.59s]
12:20:43  7 of 16 PASS unique_fct_ga4__sessions_session_key .............................. [PASS in 6.64s]
12:20:54  2 of 16 PASS not_null_stg_ga4__sessions_traffic_sources_session_source ......... [PASS in 17.97s]
12:20:59  12 of 16 PASS unique_stg_ga4__sessions_traffic_sources_session_key ............. [PASS in 22.64s]
12:20:59  10 of 16 PASS unique_stg_ga4__events_event_key ................................. [PASS in 23.35s]
12:20:59
12:20:59  Finished running 16 tests, 1 hook in 0 hours 0 minutes and 27.70 seconds (27.70s).
12:21:00
12:21:00  Completed with 1 error and 0 warnings:
12:21:00
12:21:00  Failure in test not_null_stg_ga4__event_page_view_page_location (models/staging/events/stg_ga4__event_page_view.yml)
12:21:00    Got 41 results, configured to fail if != 0
12:21:00
12:21:00    compiled Code at target/compiled/ga4/models/staging/events/stg_ga4__event_page_view.yml/not_null_stg_ga4__event_page_view_page_location.sql
12:21:00
12:21:00  Done. PASS=15 WARN=0 ERROR=1 SKIP=0 TOTAL=16

I've looked for ways that we can override the tests coming in from dependencies installed via dbt deps, but so far haven't found a way to do that, resulting in our dbt test suite being in a red state for the last couple of days.
Not sure if something changed at Google's end, so that NULLs are now allowed for this particular field, but it looks like it.
Any ideas about the cause and/or a solution that we could implement at our end?

That's interesting. Are you accepting app events? Maybe that could be it? We can remove the not null check on page_location if Google sends null values for valid reasons. But if it helps point to an implementation error, I wouldn't want to remove it. Can you double-check your implementation?

Another option may be for us to move the test configurations to the dbt_project.yml file which, I believe, would allow them to be overwritten: https://docs.getdbt.com/reference/test-configs

I had this come up on two client sites last week. For both we overrode the model and replaced page_location with ifnull(page_location, 'implementation_error_null_page_location'). For both sites, the error was traced back to implementation issues rather than package issues, hence the error message.
This lets tests pass but also increases visibility on the implementation issues.

@johanvdlaak, get the code for stg_ga4__event_page_view.sql from the package and copy it to a model with the same name in your project's models folder (it's best to put it in a staging folder, other folders are optional but keeping your models organized is never a bad idea).
You sill need to add an except statement to the select * portion of that model. Depending on the version of the package that you are running, there may be already an except statement, in which case you will add 'page_location' to that except statement or you will need to add an except statement with the page location.
If there's no except statement:
select * except(page_location)

If page_engagement_key is already in an except statement:
select * except (page_engagement_key, page_location)

Then add a line re-setting page_location (line 3 works fine):
ifnull(page_location, 'implementation_error_null_page_location') as page_location,

@dgitis Thanks for your help.
Applying the patch using the same filename, I was at first running into the following dbt error:
09:37:50  Running with dbt=1.3.1
09:37:51  Encountered an error:
Compilation Error
  dbt found two models with the name "stg_ga4__event_page_view".

  Since these resources have the same name, dbt will be unable to find the correct resource
  when looking for ref("stg_ga4__event_page_view").

  To fix this, change the name of one of these resources:
  - model.ga4.stg_ga4__event_page_view (models/staging/events/stg_ga4__event_page_view.sql)
  - model.gynzy.stg_ga4__event_page_view (models/staging/gynzy-extern/ga4_overrides/stg_ga4__event_page_view.sql)

Which I finally was able to resolve by disabling the original version of that model in the dbt_project.yml file (for others running into this same issue):
...

  ga4:
    ...
    staging:
      ...
      events:
        stg_ga4__event_page_view:
          +enabled: false # 2023-04-05: disable since we patched this file because of NULL errors
...

Closing the ticket as it's resolved by patching it at our end.

To me it would make a lot of sense if this were to be a warning instead of an error. Especially since the problem seems to be popping up for more than just a few cases.

Yeah pretty sure Google changed something.  We started getting null values around the same time, with no changes to our GA4 setup.
What kind of implementation issues can cause the page view event to be missing the location?

Agree with setting this as a warning. I started seeing this on a very simple installation so I believe the functionality has somehow changed on Google's side. I'll implement this now and link the PR.


Extract runReporter to capture output under tests

Description of the Change
As refactoring dot reporter tests, capturing output for all reporter tests moves to test/reporters/helpers.js(createMockReporter). And it has tee to show reporter's output in running tests.
Alternate Designs
N/A
Benefits

Greatly simplifies setup/teardown related to capturing screen output, reducing possibility of error.
Reporter tests are more maintainable and easier to follow.
Reporter test screen output is no longer echo'd by default, pruning individual test output minutiae.

Possible Drawbacks
New contributors will be lulled into thinking writing new tests for Mocha is pretty trivial.  LOL
Applicable issues
semver-patch

Coverage increased (+0.09%) to 90.429% when pulling 3de06a3d7c6230968fbd8e812f78e3e08d589d66 on outsideris:extract-runreporter into ceff283e5f33061afef87d5a3d886a76ddcfe438 on mochajs:master.

Idea was to default to not echo, but make it simple to get output from single test. No need to specify this in the closure.

I still leave showOutput in the closure. Currently, only progress reporter tests use "Reporter configuration settings".  So, other tests should call runReporter as runReporter({epilogue: function() {}}, runner, null, showOutput);. Specifying options as null is too verbose for me. IMO, it's enough to handle output in suite level by passing tee into createRunReporterFunction, because we can run a single test.

Idea was to default to not echo, but make it simple to get output from single test. No need to specify this in the closure.

I still leave showOutput in the closure. Currently, only progress reporter tests use "Reporter configuration settings". So, other tests should call runReporter as runReporter({epilogue: function() {}}, runner, null, showOutput);. Specifying options as null is too verbose for me. IMO, it's enough to handle output in suite level by passing tee into createRunReporterFunction, because we can run a single test.

No. Put tee back in runReporter where it belongs. No need of it in closure since we don't echo by default anyway. We could have a constant var ECHO = true;, rather than bother with showOutput (which is closer to new usage anyway).
options are coming to all reporters, just not there yet.

Besides, you could temporarily use a partialRight to default those arguments if you wanted to echo output for the entire suite.

Fixed.

I'll write new issue for discovered cloning problem with reporter tests.
Keep your checkmark fix here if you like, or reapply it after this gets merged with new issue.
But it would be nice to resolve the last two issues, and get this merged before Mocha-6.0.
Have other changes going on in these same files.

Done! Sorry for late work. I also choose the latter case.
And I removed a commit to fix Symbol problem.


Speaker Poster Needed - CNCF Gandhinagar Meetup

Goal:
Speaker Poster Needed for CNCF Gandhinagar Meetup
Info:
Speaker1
Name: Dishant Makwana
Topic: a beginner's guide to kubernetes

Speaker2
Name: Mehul Patel
Topic: 4 Actionable Tips to Kickstart Your Open-Source Project

Style Information:
Please use the standard format.
Deadline:
Need it by Tuesday 05th Sept'23.

Thanks everyone! Closing this one!


installing visual studio code on macOs catalina

first install homebrew then.....
$ brew update
$ brew cask install visual-studio-code
$ '/usr/local/bin/code'

This is not an issue, but if you do have an issue with Catalina please see https://github.com/microsoft/vscode/issues/74782.

Thank you, Problem solved


to do list is ugly when checked

the background of the to do list items shows gray when the item is checked

Closed!


shortlinks for non-existing pages from Loqi don't work

It looks like we don't have a page for "X" yet. Would you like to create it? https://indieweb.org/s/... links don't work.

shoot, I spent so long making sure the existing ones worked, forgot to test new ones! bad file permissions on the new folder, but it's fixed now. (anything created since last week won't work)


refactor: update social card design

What type of PR is this? (check all applicable)

[ ] 🍕 Feature
[ ] 🐛 Bug Fix
[ ] 📝 Documentation Update
[x] 🎨 Style
[ ] 🧑💻 Code Refactor
[ ] 🔥 Performance Improvements
[ ] ✅ Test
[ ] 🤖 Build
[ ] 🔁 CI
[ ] 📦 Chore (Release)
[ ] ⏩ Revert

Description
This PR updates the social card design

Related Tickets & Documents
closes #44

Mobile & Desktop Screenshots/Recordings
Insights Page

Users

Highlights

Added tests?

[x] 👍 yes
[ ] 🙅 no, because they aren't needed
[ ] 🙋 no, because I need help

Added to documentation?

[ ] 📜 README.md
[ ] 📓 docs.opensauced.pizza
[ ] 🍕 dev.to/opensauced
[ ] 📕 storybook
[x] 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?

I'm thinking we might want to add the copy or previews text

I think it'd look better if we used bold titles instead of semi-bold, and grey for the subtitles (see screenshot), just to ensure a clear content hierarchy, but honestly it's a small detail and it still looks good the way it is right now.

a quick question @bdougie, are we replacing the username with the highlights copy or adding the copy below the username on the highlights card?

a quick question @bdougie, are we replacing the username with the highlights copy or adding the copy below the username on the highlights card?

Replace the user name.

Updated copy

cc: @bdougie @brandonroberts


VSFTPD - Virtual Users

First of all thanks for bringing EasyEngine to us!
Followed and used the project for quite some time now, and love the way it's going and the direction the development has taken.
The only thing I hate, is that EasyEngine dos not give us a way to give a user FTP Access, we only got the www-data SFTP login, I got a couple of costumers that need FTP access, and I dont want to hand out the www-data user, since they can do to mutch harm.
So I started my journey how could I make a solution that worked with EasyEngine, and that allowed me to create FTP accounts for specific websites, with out giving them access to all other websites on the server.
After some searching on Virtual Users FTP, I tried out a couple of tutorials and it worked! BUT! They used text files, and raw passwords, not very safe to be honest, so when I got a new server I played arround with VSFTPD/MySQL and PAM, to create a more secure container for the password, and to be honest it's just a better way then creating text files to get the same result.
The guides found for VSFTPD/MySQL/PAM and Virtual Users, did not work out that well, because they forgot to mention, that Ubuntu got meny problems with VSFTPD true apt-get, after a lot of searching I finally found a good forum thread on UbuntuForums.
First we need to get a working version of VSFTPD! http://ehcpforce.tk/faq/index.php?sid=2579&lang=en&action=artikel&cat=1&id=3&artlang=en this link contains info for Ubuntu 12.04 and above, and is different for every Version of Ubuntu.
After you installed VSFTPD follow the following guide.
apt-get install libpam-mysql libpam-ldap
LDAP server Uniform Resource Identifier: <--  ENTER
Distinguished name of the search base: <-- ENTER
LDAP version to use: <-- 3
Make local root Database admin: <-- Yes
Does the LDAP database require login?  <-- No
LDAP account for root: <-- ENTER
LDAP root account password: <-- ldaprootpw (change to your password)
If you get more questions select the option that it surgests
==> Create The MySQL Database For vsftpd
mysql -u root -p
==> Create the Database, and user, remember to set your own password instead of fpdpass
CREATE DATABASE vsftpd;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON vsftpd.* TO 'vsftpd'@'localhost' IDENTIFIED BY 'ftpdpass';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON vsftpd.* TO<EMAIL_ADDRESS>IDENTIFIED BY 'ftpdpass';
FLUSH PRIVILEGES;
USE vsftpd;
==> Create the Tables in vsftpd Database
USE vsftpd;
CREATE TABLE accounts (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
username VARCHAR( 30 ) NOT NULL ,
pass VARCHAR( 50 ) NOT NULL ,
UNIQUE (
username
)
) ENGINE = MYISAM ;
quit;
==> Only use this line if you got issues with the setup, I only tested with this line, since I had some issues, that I later found out was Ubuntus version of VSFTPD
useradd --home /home/vsftpd --gid nogroup -m --shell /bin/false vsftpd
==> Config file stuff
cp /etc/vsftpd.conf /etc/vsftpd.conf_orig
cat /dev/null > /etc/vsftpd.conf
nano /etc/vsftpd.conf
==> Insert following to the config file
listen=YES
anonymous_enable=NO
local_enable=YES
virtual_use_local_privs=YES
write_enable=YES
local_umask=022
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
guest_enable=YES
ftp_username=www-data
chown_username=www-data
guest_username=www-data
user_sub_token=$USER
local_root=/var/www/$USER
chroot_local_user=YES
hide_ids=YES
check_shell=NO
user_config_dir=/var/www/users
allow_writeable_chroot=YES
==> Create user_config_dir
mkdir /var/www/users
==> Lets create the PAM config files for vsftpd
cp /etc/pam.d/vsftpd /etc/pam.d/vsftpd_orig
cat /dev/null > /etc/pam.d/vsftpd
nano /etc/pam.d/vsftpd
==> Insert the following, remember to change ftpdpass in to the password you set for the mysql vsftpd user earlyer
auth required pam_mysql.so user=vsftpd passwd=ftpdpass host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2
account required pam_mysql.so user=vsftpd passwd=ftpdpass host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2
==> Restart VSFTPD
/etc/init.d/vsftpd restart
==> Create the first virtual user, remember the username needs to match a folder in /var/www ex. Domain.com
mysql -u root -p
USE vsftpd;
==> Remember to change domain.com and password to what you want
INSERT INTO accounts (username, pass) VALUES('testuser', PASSWORD('secret'));
quit;
–--------------------------------
You should now be good to go, and have a working ftp user that can only access /var/www/domain.com
If you want a user to have a different root, or create a “master” account, you can do this by creating a file in /var/www/users
Example – the file you create inside /var/www/users needs to match the username, lets say I created a username thats masteruser in the mysql table
nano /var/www/users/masteruser
==>> Insert the following change the directory to /var/www or something inside /var/www
Example 1
local_root=/var/www
Example 2
local_root=/var/www/domain.com

Hope we can get some sort of adoptation in to EasyEngine, since this would fit it perfectly! Easy Simple, and Works like intended!
Created it as a tutorial in the EasyEngine Forum
http://community.rtcamp.com/t/vsftpd-mysql-virtual-users-tutorial/4228

Minor note if you install libpam-mysql and then update to MariaDB you need to install libpam-mysql once more.

@benzon ,
We always recomend to use SFTP instead of vsftpd.
You can refer https://rtcamp.com/easyengine/docs/chroot-sftp-easyengine/ article to create Sftp for separate uers.

It's much easier to contact these guys on this web site http://buy.fineproxy.org/eng/ /They've helped very quickly.  Support 24/7. Сheap proxy

@gau1991
I tried to follow your tutorial to setup Chroot SFtp but encountered the following issue.
Newly created user ee-user has permission to read/write in this directory:
/home/ee-user/example.com
But after you mount webroot in SFtp home directory with the following command:
mount --bind /var/www/example.com/htdocs /home/ee-user/example.com/htdocs
All files and htdocs directory has www-data:www-data permission, so ee-user can't really edit/update any files in htdocs.
Am I missing something here? I followed your tutorial a couple of times, same result.
Any help or ideas?

@jimtyrro
On tutorial we first add ee-user to the www-data group
root@example.com:~# useradd -G www-data -ms /bin/false ee-user

Also when ee-user create any files its save with www-data permision due to [SGID Permission] (https://miteshshah.github.io/linux/basics/advanced-topics-in-users-groups-and-permissions/#for-directory)
chmod g+s /var/www/example.com/htdocs/
chmod 775 /var/www/example.com/htdocs

Hi Mitesh,
Thank you for answering, but it still doesn't work. I tried it twice. Still when I FTP into /var/www/example.com/htdocs , htdocs and all files inside it have www-data:www-data permission and whenever I tried to edit any file although ee-user is in www-data group I'm getting permission denied error.
What should I check? Why is my results are different then yours? Any ideas?

You mentioned create file, but I didn't try that, I only tried editing existing files and received "permission denied" error.

@jimtyrro Refer this how to setup sftp video https://asciinema.org/a/8fo1mtmyohch1w1y17alap59a
Once its setup I'd open filezilla and login with ee-user and upload a screenshot
Refer: https://asciinema.org/a/6p18yike4g8ohgwm9638ix2ew

Hi Mitesh,
Sorry to bother you again, I did follow your instructions and whenever I try to upload something I receive "Permission denied" error. I tried two different FTP client apps just in case, CyberDuck and Yummy FTP (on Mac), same result. See screenshots below.
What could be wrong here?

@jimtyrro can you tell me which user did you tried ?
ee-user or www-data ?

I tried ee-user. I can only upload and delete files in htdocs root folder but cannot edit them, and whenever I try to upload files or edit them in any other folder inside htdocs, e.g. wp-content, etc I get permission denied error.

In the tutorial you have these two commands:
chmod g+s /var/www/example.com/htdocs/
chmod 775 /var/www/example.com/htdocs
first is ending with a slash and the second one doesn't , does it have any impact on permissions?


Add positional_encodings_ layer to Dlib

This pull request introduces a new layer, positional_encodings_, to the Dlib library.
The positional_encodings_ layer adds "positional encodings" to the input tensor, which is particularly useful for models processing sequential data, such as transformers. The positional encodings are computed using sine and cosine functions of different frequencies, as described in the paper "Attention is All You Need" by Vaswani et al. This enhancement aims to provide positional information to the model, improving its ability to understand the order and position of elements in a sequence.
The implementation includes methods for setup, forward propagation, and backward propagation, along with serialization support.

@Cydral This is all great. Really cool. Can I ask though, why do you use dlib instead of Pytorch for neural nets? Slowly adding transformer support to dlib is a lot of work due to the absence of autograd. Its recursive template API makes it very slow to compile. In torch, adding a SOTA layer can be just a few lines of code. For example, sinusoidal positional embeddings is like 15 lines. You can then train in pytorch, then export, or even compile to something you can run in C/C++. So I'm not sure what's the benefit of adding transformer support to dlib when there are arguably better solutions for DNNs in C++. Also, the author has the burden of maintaining this code. I'm not trying to overly criticise but this is requiring a lot of work for potentially little gain. I'm wondering if these additions belong in a "dlib_contrib" repository.

@Cydral This is all great. Really cool. Can I ask though, why do you use dlib instead of Pytorch for neural nets? Slowly adding transformer support to dlib is a lot of work due to the absence of autograd. Its recursive template API makes it very slow to compile. In torch, adding a SOTA layer can be just a few lines of code. For example, sinusoidal positional embeddings is like 15 lines. You can then train in pytorch, then export, or even compile to something you can run in C/C++. So I'm not sure what's the benefit of adding transformer support to dlib when there are arguably better solutions for DNNs in C++. Also, the author has the burden of maintaining this code. I'm not trying to overly criticise but this is requiring a lot of work for potentially little gain. I'm wondering if these additions belong in a "dlib_contrib" repository.

It's obviously an interesting question and yes, I can confirm that it's also a huge job to add such layers to Dlib, but the idea here isn't necessarily to build a neural network that's exactly the same as what you'll find in other libraries. For example, I'm studying in parallel the impact of convolution layers to replace certain ‘linear’ type layers that you'll actually find in PyTorch.
Of course, the absence of an autograd function also means that we have to design derivatives specifically for the gradient, but it's also a way of getting a better handle on what we're doing. So far I've managed to achieve some interesting results (we'd been trying for a while to introduce a mechanism for predicting the ‘next’ sequence in Dlib using a feed forward principle).
In particular, I've managed to get the network to memorise sequences of text (a mechanism akin to ‘rote’ learning), which I think is already a good start, and even if I decide not to go to the end of this "exercise", the new layers I've added could also be used for specific processing on images too.
In this respect, I think we have a lot of great things to do with Dlib. This isn't the first time I've read about developers moving on to PyTorch, but if nobody tries to develop Dlib any more, then let's shut down development of this library... even though it's still very efficient for many tasks. Adding new functions does not, in principle, oblige the developer to maintain it all. It's also the role of the community around this library to help fix any functional problems it sees (as I sometimes do for certain parts contributed by other contributors).

Yes, I want to encourage you to keep up with this great work! I can't wait to try training transformer-based networks in dlib :)
And of course, I will try my best to help to maintain this stuff :D

I'm continuing and making progress... I've just finished reworking gemm() to take into account the matricial dimension of 4D tensors.

Yeah it's all good.  I am a huge fan of pytorch, but there are also things about it I would do differently.  Frankly, if I wasn't extremely busy working at a pre-money startup and trying to ensure we are successful long term (which I feel pretty good about our future), I would be working way more on dlib and making more open source ML stuff in particular.
There is also way more going on in dlib than the deep learning stuff.  The deep learning tooling is honestly the least interesting part of dlib for me.  There are some pretty sweeping changes I would make to the deep learning stuff and will at some point.  Anyway, that's all to say, it doesn't matter how many people use the deep learning parts of dlib.  There are tons of other things in it that lots of people use on a huge number of projects too.
And the dnn tooling is very low dependency and easy to compile, which is really it's selling point.  And people use that still and that's fine.
That's all to say, this PR is cool.  So knock yourself out :)

You should be able to merge the master branch into this one and get the tril_ layer here too, so the tests pass. Something seems off, where you have the tests of that layer, but not the implementation...

Something went wrong when I retrieved the latest versions after the integration of the tril_ layer... I just deleted the accesses to tril_ in the positional_encodings branch, in the dnn.ccp file. I hope that when the merge is done, nothing will disappear in the master branch.

@davis, There were indeed new conflicts following the integration of the last class that you dealt with. It looks good now, but could you please go through the integration in chronological order and thus consider frist this new class instead. If it's OK and integrated, I'll make the following changes to avoid going back and forth and I'll keep you informed. Thank you in advance for your help and support.

Ah you have a merge error or something.  Check the PR contents, it's missing all your code changes :(

Sorry for all these troubles, I've never had so many problems with merges on GitHub... I've just merged with the main branch and in my session I can see all the classes added recently (transpose, embeddings, tril, ..., and positional_encodings). Could you please have another look from your side? I can't see what code is missing now.

Sorry for all these troubles, I've never had so many problems with merges on GitHub... I've just merged with the main branch and in my session I can see all the classes added recently (transpose, embeddings, tril, ..., and positional_encodings). Could you please have another look from your side? I can't see what code is missing now.

No worries.  Check it again though.  Like look at https://github.com/davisking/dlib/pull/3019/files, it's still missing the changes :shrug:

It's OK now. The implementation in <layers.h> was in fact present but came from a previous merge (which explains why the tests and precompilation worked already)...


BUG: Memory leak in scipy.odr when using user-supplied Jacobian

from scipy.odr import ODR, Data, unilinear
x = list(range(100))
for i in range(100000):
    odr = ODR(Data(x, x), unilinear)
    odr.set_job(deriv=3)
    fit = odr.run()

When set_job(deriv=3) or set_job(deriv=2) is set, memory usage will grow continuously. When that line is removed, or a value of 0 or 1 is used, memory usage does not grow
SciPy/NumPy/Python version information
1.8.0 1.21.5 sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)

Thanks for reporting the issue, @nevubm.  I can reproduce the problem with the main development branch.


Parenthesis in path result in document formatting not working.

This issue has been moved from a ticket on Developer Community.

Create a new Blazor Server Project.
Open Counter.razor
Type in 5 nested divs after the button
Change the indentation to be wrong, if it isn't already
Type Ctrl-K Ctrl-D

Text is not formatted, indentation is not corrected, and not changed.

Original Comments
Feedback Bot on 3/13/2022, 07:54 PM:
Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

Original Solutions
(no solutions)

Can reproduce this by creating a project in a path that has ( in the name. For instance the path of my project was: C:\Users\nimullen\John(Doe\source\BlazorApp1


Emphasized do not use Application Cache

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

File
Status
Preview URL
Details

microsoft-edge/devtools-guide-chromium/storage/applicationcache.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 09ef176:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

microsoft-edge/devtools-guide-chromium/storage/applicationcache.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 c9d4e0f:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

microsoft-edge/devtools-guide-chromium/storage/applicationcache.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


Description Field in Test.yaml Causes Assertions to Pass Incorrectly

When defining assertions in a separate yaml file, the description key is useful as, without it, the input and assert fields do not seem to appear in the output of the eval command. However, including the description field causes assertions to pass when they should fail. For example, I have the following config:
description: "Test PromptFoo Setup"
prompts:
  - |-
    Respond to me with JSON in the the following format
    {
      "message": "Hello"
    }
providers: [openai:gpt-3.5-turbo-0125]
tests: test.yaml

And a test.yaml file defined like so:
- description: "Returns json"
  vars:
    input: "Hello!"

    assert:
      - type: is-json
        value: "true"

when I run yarn promptfoo eval -c ./<path_to_config>/promptfooconfig.yaml --no-cache I see no errors (expected)

however, if I change the assertion to expect in-valid json (value: "false") I still see no errors (not expected).

By removing the description key, the assertions behave as expected, but the output is less desirable. This test.yaml
- vars:
  input: "Hello!"

  assert:
    - type: is-json
      value: "false"

produces the following, expected output:

Is the expectation that the description key should be supported?
Big fan of this tool and any insight you could provide would be most appreciated!
currently running v.0.55.0, as a project dependency (not a global dependency)

Hi @SimonPringleWallace,
Looks like your indentation is off in both test.yaml examples.
In this one, you need to unindent assert.  It should not be under vars (that is why assert shows up as a var in the CLI table output)
- description: "Returns json"
  vars:
    input: "Hello!"

    assert:
      - type: is-json
        value: "true"

In this one, input needs to be indented:
- vars:
  input: "Hello!"

  assert:
    - type: is-json
      value: "false"
``

Well that is a bit embarrassing. Thanks for the correction there @typpo, works like a charm 🚀

No worries, it happens!
On Fri, May 10, 2024 at 7:19 AM SimonPringleWallace <
@.***> wrote:

Well that is a bit embarrassing. Thanks for the correction there @typpo
https://github.com/typpo, works like a charm 🚀
—
Reply to this email directly, view it on GitHub
https://github.com/promptfoo/promptfoo/issues/767#issuecomment-2104695491,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AACLYJXM6JHTZL37LDMRWVDZBTJQZAVCNFSM6AAAAABHPCZILCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUGY4TKNBZGE
.
You are receiving this because you were mentioned.Message ID:
@.***>


v1.listDockerImages provides error response RESOURCE_PROJECT_INVALID

What you're trying to do

The equivalent of the following gcloud CLI command (which works):
gcloud artifacts docker images list us-east1-dkrimgs.pkg.dev/dev-infrastructure/images-v1 --format=json --include-tags

using the v1.listDockerImages() method.  I'd also like to have it include the 'tags' (not sure how exactly to get that flag passed down, if needed, as docs and examples that I've seen are not too helpful here).

What code you've already tried

import { v1 } from '@google-cloud/artifact-registry';

(async () => {

const client = new v1.ArtifactRegistryClient();
const stub = await client.initialize();

console.log('stub:');
console.dir(stub); // What looks like good results are visible as result of this

const projectId = await client.getProjectId();
console.log('projectId:', projectId); // good result is seen here (got it from the environment settings / client .json file, I guess)

const resp = await client.listDockerImages({
parent: 'us-east1-dkrimgs.pkg.dev/dev-infrastructure/images-v1'
});

// does not get here
})();

Any error messages you're getting

error: Error: 3 INVALID_ARGUMENT: Invalid resource field value in the request.
    at Object.callErrorFromStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/client.js:189:52)
    at Object.onReceiveStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:365:141)
    at Object.onReceiveStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
    at /app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/call-stream.js:187:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 3,
  details: 'Invalid resource field value in the request.',
  metadata: Metadata {
    internalRepr: Map(3) {
      'grpc-server-stats-bin' => [Array],
      'google.rpc.errorinfo-bin' => [Array],
      'grpc-status-details-bin' => [Array]
    },
    options: {}
  },
  statusDetails: [
    ErrorInfo {
      metadata: [Object],
      reason: 'RESOURCE_PROJECT_INVALID',
      domain: 'googleapis.com'
    }
  ],
  reason: 'RESOURCE_PROJECT_INVALID',
  domain: 'googleapis.com',
  errorInfoMetadata: {
    method: 'google.devtools.artifactregistry.v1.ArtifactRegistry.ListDockerImages',
    service: 'artifactregistry.googleapis.com'
  }
}

All seems good until the .listDockerImages() is invoked.
From what I can see, I'm providing the 'parent' value in the request object, with exactly the same value there as what the gcloud CLI accepts without issue.
Node version is: 16.14.2
@google-cloud/artifact-registry module version: 1.3.0 (latest)
Assistance is appreciated!

@Peter-Sparksuite thanks for the issue.
I'm not too sure about the tags specifically, but I'm curious as to whether this might work:
For the parent argument, can you change the value to the following?

projects/dev-infrastructure/locations/us-east1/repositories/images-v1

Context:
gcloud uses the format documented here, whereas I suspect the client libraries use the format used by the REST API


docs: update information about schematics

I clarified some information to the best of my knowledge and restructured the doc a bit for better readability.

thanks for the review!


Question - Way to install webrecorder without dockers

Maybe someone managed and would like to share some script to install this application without using dockers.
It would be better, more secure and also more practical when someone is already using nginx, postfix, redis servers.
I was trying to make it happen but don't have nerves for it...

We definitely want to support a 'standalone' version that runs without Docker, but we haven't had time yet.

Thanks, I'll wait for some update then.

Hello there! I saw few changes in this area, any update?


Add MonoGame Windows NuGet package

This should remove the requirement of having to have MonoGame
installed locally to build on Windows.

Alright, thanks.


4 books + new section.

Description
I added 4 books and one new section.
One ReactJS book, One HTML/CSS book, and 2 Other books.

@all-contributors please add @dapoadedire for code


KnapsackProblemByOm.java

KnapSack Problem is basically calculating the maximum profit gained in a given constraint.

KnapSack Problem is basically calculating the maximum profit gained in a given constraint.

@Omji-Kesharwani Please add approach.