ManagedIdentityCredential authentication unavailable, no managed identity endpoint found for aio ManagedIdentity

Package Name: azure-storage-blob==12.8.1
Package Version: 12.8.1
Operating System: 18.04.1-Ubuntu
Python Version: 3.9

Describe the bug
Error " azure.identity._exceptions.CredentialUnavailableError: ManagedIdentityCredential authentication unavailable, no managed identity endpoint found." occured when query request increased but it works well when QPS is low. The logic is the request is to download blob. When this error occurred, request latency will increase a lot.
To Reproduce
Steps to reproduce the behavior:

use flask to host a request. in the request, we have a  aio blob service client and we download blobs. The blob service client is initialized when the server is hosted.
do stress test to the API

Expected behavior
A clear and concise description of what you expected to happen.
Should not raise such error as the MI can works time before and after the error.
Screenshots
If applicable, add screenshots to help explain your problem.
Here is my trace stack.
`
Traceback (most recent call last):
File "/venv/lib/python3.9/site-packages/azure/storage/blob/aio/_download_async.py", line 293, in _initial_request
location_mode, response = await self._clients.blob.download(
File "/venv/lib/python3.9/site-packages/azure/storage/blob/_generated/aio/operations/_blob_operations.py", line 174, in download
pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs)
File "/venv/lib/python3.9/site-packages/azure/core/pipeline/_base_async.py", line 215, in run
return await first_node.send(pipeline_request)
File "/venv/lib/python3.9/site-packages/azure/core/pipeline/_base_async.py", line 83, in send
response = await self.next.send(request) # type: ignore
File "/venv/lib/python3.9/site-packages/azure/core/pipeline/_base_async.py", line 83, in send
response = await self.next.send(request) # type: ignore
File "/venv/lib/python3.9/site-packages/azure/core/pipeline/_base_async.py", line 83, in send
response = await self.next.send(request) # type: ignore
[Previous line repeated 3 more times]
File "/venv/lib/python3.9/site-packages/azure/core/pipeline/policies/_authentication_async.py", line 73, in send
await await_result(self.on_request, request)
File "/venv/lib/python3.9/site-packages/azure/core/pipeline/_tools_async.py", line 36, in await_result
return await result # type: ignore
File "/venv/lib/python3.9/site-packages/azure/core/pipeline/policies/_authentication_async.py", line 51, in on_request
self._token = await self._credential.get_token(*self._scopes)
File "/venv/lib/python3.9/site-packages/azure/identity/aio/_internal/decorators.py", line 17, in wrapper
token = await fn(*args, **kwargs)
File "/venv/lib/python3.9/site-packages/azure/identity/aio/_credentials/managed_identity.py", line 93, in get_token
return await self._credential.get_token(*scopes, **kwargs)
File "/venv/lib/python3.9/site-packages/azure/identity/aio/_internal/get_token_mixin.py", line 62, in get_token
token = await self._request_token(*scopes)
File "/venv/lib/python3.9/site-packages/azure/identity/aio/_credentials/imds.py", line 57, in _request_token
raise CredentialUnavailableError(message=message)
azure.identity._exceptions.CredentialUnavailableError: ManagedIdentityCredential authentication unavailable, no managed identity endpoint found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/venv/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/venv/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/app/src/rca/dataset_manager/entrypoints/flask_app.py", line 220, in list_data_sets
datasets, has_next_link = services.list_data_sets(
File "/usr/app/src/rca/dataset_manager/service_layer/services.py", line 419, in list_data_sets
contents = blob_repo.get_metas(uuids)
File "/usr/app/src/rca/dataset_manager/adapters/data_set_blob_repo.py", line 65, in get_metas
return self.blob_async.get_jsons(paths)
File "/usr/app/src/rca/common/azure/blob_service_client.py", line 196, in get_jsons
res = self.loop.run_until_complete(self.__get_json_tasks(paths))
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/usr/app/src/rca/common/azure/blob_service_client.py", line 277, in __get_json_tasks
res = await asyncio.gather(*tasks)
File "/usr/app/src/rca/common/azure/blob_service_client.py", line 253, in __get_json_async
downloaded, etag = await self.__get_async(path)
File "/usr/app/src/rca/common/azure/blob_service_client.py", line 238, in __get_async
downloader = await blob_client.download_blob()
File "/venv/lib/python3.9/site-packages/azure/core/tracing/decorator_async.py", line 74, in wrapper_use_tracer
return await func(*args, **kwargs)
File "/venv/lib/python3.9/site-packages/azure/storage/blob/aio/_blob_client_async.py", line 464, in download_blob
await downloader._setup() # pylint: disable=protected-access
File "/venv/lib/python3.9/site-packages/azure/storage/blob/aio/_download_async.py", line 250, in _setup
self._response = await self._initial_request()
File "/venv/lib/python3.9/site-packages/azure/storage/blob/aio/_download_async.py", line 318, in _initial_request
if self._start_range is None and error.response.status_code == 416:
AttributeError: 'NoneType' object has no attribute 'status_code'
`
Such logic works well when QPS is low.
Additional context
Add any other context about the problem here.

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Azure.Identity:0.5393793,Storage:0.30737743,Azure.Core:0.05351754'

Thank you for the quick response @xiangyan99 ,  I have only one blobServiceClient instance for the whole service and it is only initialized once. But for the blobClient, every time I download some blob, it is a new instance.  I used the blob client to download blob. So for your question, I think my answer is yes, I reused the blob service client, but the error is thrown

any update on this?

@suxi-ms Thanks for the updates.
@tasherif-msft could you help to check what's your token caching policy for storage?

any update on this question?

Kindly ping， if you need more information about my code, feel free to reach me

@jalauzon-msft @vincenttran-msft could you help to take a look?


Want to add the ability to translate local files directly

Want to add the ability to translate local files directly !
For example, there is a file english.txt locally, and I hope that the contents of this file can be translated directly through sgpt.

Is thie method not enough?
cat english.txt | sgpt "Translated into spanish. Results only." > spanish.txt

OK, thank you very much!!!
Is there a good translation prompt  ?

OK, thank you very much!!!
Is there a good translation prompt ?
such as:
sgpt "Hello chatgpt, you were created to do all kinds of translation work.Please help to do the designated language translation work, mainly English or other languages, complete and correct translation into Chinese.If you need to store any data, assume it will be stored in the conversation.APPLY MARKDOWN formatting when possible.If there are English names in the article, keep their original names and do not translate them. For example, 'elon musk' does not need to be translated! Keep 'elon musk'. Results only！"

I think the suggestion provided by @MokaCubrew is sufficient in this case, given that closing this issue.


Add Verve Credit Card for validation

Add Verve Credit Card for validation

Coverage remained the same at 100.0% when pulling a1c668867f43b9d78803d57f3718f31cbc947f21 on olaoluwa-98:addVerveCard into af3bab9af09dd159fbd23815ab08b1092d7fa963 on inacho:master.

I have fixed this fail


Entity Framework 6 DbConfiguration causes ReflectionTypeLoadException at startup on Mono

Wow, that title is a mouthful.
DbConfiguration is the class used for code-based configuration in Entity Framework 6. Simply having an implementation of DbConfiguration in an ASP.NET 5 site causes "ReflectionTypeLoadException: The classes in the module cannot be loaded." to be thrown at startup on Mono. It works fine on .NET Framework 4.5 and 4.6 though.
Mono version: 4.0.2
Command: dnx --appbase /var/www/dan.cx/net5test/MonoEFTest/approot/src/MonoEFTest Microsoft.Framework.ApplicationHost kestrel
Stack trace:
System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
  at System.Reflection.Assembly+<>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
  at System.Collections.Generic.List`1[System.Reflection.TypeInfo]..ctor (IEnumerable`1 collection) [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.ToList[TypeInfo] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Startup.StartupLoader.FindStartupType (System.String startupAssemblyName, IList`1 diagnosticMessages) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureStartup () [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureApplicationServices () [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start () [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
  at Kestrel.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in <filename unknown>:0

project.json:
{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "EntityFramework": "6.1.3",
    "Kestrel": "1.0.0-beta6",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
    "MySql.Data.Entity": "6.9.7",
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
    "Microsoft.Framework.Logging.Console": "1.0.0-beta6"
  },

  "frameworks": {
    "dnx451": {}
  }
}

Startup.cs:
public class Startup
{
	public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
	{
		loggerFactory.MinimumLevel = LogLevel.Information;
		loggerFactory.AddConsole();

		app.UseErrorPage();

		app.Use(async (context, next) =>
		{
			await context.Response.WriteAsync("IT WORKS YO");
		});
	}
}

MyDbConfiguration.cs:
public class MyDbConfiguration : DbConfiguration
{
}

I put a try catch block around the call to assembly.DefinedTypes.ToList() in StartupLoader.cs and checked the LoaderExceptions property of the ReflectionTypeLoadException. This was the exception:
System.TypeLoadException: Could not load type 'System.Data.Entity.DbConfiguration' from assembly 'EntityFramework, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

How do I debug this? The correct version of EntityFramework is present at approot/packages/EntityFramework/6.1.3/lib/net45/EntityFramework.dll, and I confirmed through a disassembler that the DbConfiguration type is present in the assembly.
ASP.NET should probably guard against this and show more useful error messages (eg. the contents of the LoaderExceptions property)

My problem was due to Mono having an old version of Entity Framework in the GAC :(
ASP.NET should still guard against this though. People shouldn't have to hack StartupLoader.cs just to figure out which type is failing to load. The exception printed right now when this happens isn't very useful.

Related https://github.com/aspnet/dnx/issues/1739


added token CHUM on polygon

This is main governance token of chumhum protocol.

How can I pay the processing fee?


ImportError: cannot import name 'main'

Attempting to add users to an internal account when I received an error:
"Failed to import the required Python library (openshift) on cldlgn05.unx.sas.com's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
I realized there had been a new project released yesterday, so I cloned the new project and while executing:
ansible-galaxy collection install -r requirements.yaml -f
ansible-galaxy role install -r requirements.yaml -f
Received the following error:
File "/usr/local/bin/ansible-playbook", line 5, in
from ansible.cli.playbook import main
ImportError: cannot import name 'main' from 'ansible.cli.playbook' (/r/ge.unx.sas.com/vol/vol410/u41/jawilk/.local/lib/python3.10/site-packages/ansible/cli/playbook.py)

I did also perform the pip3 install --user -r requirements.txt command before the ansible-galaxy commands.

Contents of ansible-galaxy file:
#!/usr/bin/python3
-- coding: utf-8 --
import re
import sys
from ansible.cli.galaxy import main
if name == 'main':
sys.argv[0] = re.sub(r'(-script.pyw|.exe)?$', '', sys.argv[0])
sys.exit(main())

If you have both python 2 and python 3 on your system you have to make sure that python 3 is the default version for both the python and pip executables.

Python 3.10 is the default for both pip and python executables, yet I am still getting the same error.

Seems like an ansible issue. I'd say find another system and try fresh with python3 pip3 and ansible in a clean state.

Marking as stale/inactive. If there are additional questions, please open a new Github issue.


Toggle to publish to fixed port

Environment: Docker for Mac
I was wondering if a flag can be added to fix the port exposed on the host instead of selecting randomly (--publish-all). For example, a flag that simply uses the service's port in this section of code. My understanding is that it is currently random in the situation where multiple LoadBalancer services exist on the same port?
This would be useful in my case as I'm using a single ingress (istio) on a single kind server node that is schedulable and would like a deterministic way to call it from the host. If this sounds like a good idea, this sounds like an easy PR I can whip up.

This would be useful in my case as I'm using a single ingress (istio) on a single kind server node that is schedulable and would like a deterministic way to call it from the host. If this sounds like a good idea, this sounds like an easy PR I can whip up.

NAME               TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
lb-service-local   LoadBalancer   <IP_ADDRESS>   <IP_ADDRESS>   80:31215/TCP   57s

It is already deterministic, you connect to the externalIP and Port , in the example above <IP_ADDRESS>:80

I'll need to read the code a bit more, but is the IP deterministic as well? As in can you fetch it without asking for it from the k8s api server?

have you tried the examples?

Oh probably should have done that. I went straight in to using it. I guess it is possible and I can close this.

Ran some more tests and found it to be consistent. In case anyone else stumbles on this thread:

The external ip is guaranteed to be in the "kind" network or whatever is passed into KIND_EXPERIMENTAL_DOCKER_NETWORK subnet
In the case if only one kind cluster is in the network, the ip is consistent (.1 is host gateway, .2 is node1, ..., then the next available ip gets selected for the container that does the proxying between external ip and the load balancer)

Though for my case, it is probably better to just kubectl get the external ip and write it to a file to be consumed by other dependencies.


Set pyparsing >= 3.0.7 requirement

Currently, the moto requirement is >= 3.0.0, however, at this line:
https://github.com/spulec/moto/blob/5d84eec79e213c0f71cc3bd7bd94ef55e1d474e4/moto/glue/utils.py#L278
it uses the function delimited_list with kwarg min=1.
This keyword only appears starting 3.0.7 in pyparsing, causing an exception if you have a lower pyparsing version installed.
Link to pyparsing file:
3.0.6
https://github.com/pyparsing/pyparsing/blob/pyparsing_3.0.6/pyparsing/helpers.py
3.0.7
https://github.com/pyparsing/pyparsing/blob/pyparsing_3.0.7/pyparsing/helpers.py

Codecov Report

Merging #5149 (3eb8e44) into master (5d84eec) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #5149   +/-   ##
=======================================
  Coverage   95.89%   95.89%
=======================================
  Files         680      680
  Lines       67425    67425
=======================================
  Hits        64655    64655
  Misses       2770     2770

Flag
Coverage Δ

servertests
36.86% <ø> (ø)

unittests
95.83% <ø> (-0.01%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d84eec...3eb8e44. Read the comment docs.


Use a more concise mkdir -p when the situation permits.

I posted one comment; otherwise this looks good (though it's weird Travis didn't finish).

OK, addressed.

Merged, thanks @rht!


Is 'application' default software component classification? Possible doc update

https://github.com/CycloneDX/specification/blob/aa6dea146b6a8af531e5ba1e9cf96ea983fa9205/schema/bom-1.1.xsd#L188-L194
https://github.com/CycloneDX/specification/blob/aa6dea146b6a8af531e5ba1e9cf96ea983fa9205/schema/bom-1.1.xsd#L307-L316
I wonder if the documentation string should instead be something like

Specifies the type of component. If a software component cannot be classified as an application, file, framework, or operating system, the component should be classified as an application.

or

Specifies the type of component. For software components, classify as application if no more specific appropriate classification is available or cannot be determined for the component.

Thanks for catching the doc issue. I used the clarifying text you provided as it captures the spirit of what the intended meaning was.


[Feature]: Set Table Heading Options to the bottom of table

Is there an existing issue for this?

[X] I have searched the existing issues

Summary
Currently Table control only shows the Heading Options at the top of the table.
In stead there should be options to show Heading Options At Top, At Bottom, Both (Top and Bottom).
In the same way here there should also be provision for showing a drop down so that user can select as to how many records he/she wants to see at a time on the page.
Users selection of number of records to see on the page will also alter other pagination information.
Add an input box where user can type a page number to navigate directly to that page.
Why should this be worked on?
It will increase the usability of Table control.

Here is a sample of what it may look like. This screenshot will also give better ideas in implementing this feature.


Integration Test - Release - 2019/02/13 18:50:26

Auto create for integration test. AnotherAuthorUpdatedArticleFlow

@adunndevster : Thanks for your contribution! The author, @v-caxian, has been notified to review your proposed change.


Provide a disciminated union of all available Node types

TypeScript Version:  2.1.5
Recently in tslint development there was the idea to create a discriminated union of all ts.Nodes available in the AST. That would make it easier to switch on Node.kind and avoid the need of type assertions. It would also simplify some of TypeScript's own code like forEachChild in parser.ts.
Before we start to create and maintain such a union ourselves, the question is if typescript can provide anything for this use case? Given there are already unions for things like BlockLike, CallLikeExpression, etc., would it be possible to have more of them, maybe even auto generated?
Unfortunately that would ultimately result in the demand for more unions for Expression, Statement, ...
Code
ts.forEachChild(someNode, visitNode);
function visitNode(node: ts.Node) {
  switch (node.kind) {
    case ts.SyntaxKind.Identifier:
      doStuff((node as ts.Identifier).text);
    case ts.SyntaxKind.PropertyAssignment:
      if ((node as ts.PropertyAssignment).initializer.kind === ts.SyntaxKind.Identifier)
        doStuff(((node as ts.PropertyAssignment).initializer as ts.Identifier).text);
     // ... to be continued
  }
}

Expected behavior:
ts.forEachChild(someNode, visitNode);
function visitNode(node: ts.AllNodes) { // discriminated union of all subtypes of ts.Node
  switch (node.kind) {
    case ts.SyntaxKind.Identifier:
      doStuff(node.text); // type can be inferred
    case ts.SyntaxKind.PropertyAssignment:
      if (node.initializer.kind === ts.SyntaxKind.Identifier) // node is inferred as ts.PropertyAssignment
        doStuff(node.initializer.text); // node.initializer could be inferred to be ts.Identifier, would require another union for all subtypes of ts.Expression
  }
}

//cc  @nchen63

Thanks for making this issue. I meant to and kept forgetting. When I'm writing lint rules, dealing with type assertions is always the most annoying part of the process. If discriminated unions won't work somehow, I'd also gladly take type guard functions for each type of node that can hopefully be generated. Babel does something similar - see https://github.com/babel/babel/tree/master/packages/babel-types and ctrl-f the page for 't.is'

In tslint-react we have a generic type guard for this, but it is just a little verbose:
export function nodeIsKind<T extends ts.Node>(node: ts.Node, kind: ts.SyntaxKind): node is T {
    return node.kind === kind;
}

@adidahiya I like this idea, but it doesn't check if the type parameter matches kind. So you can accidentally write the following:
nodeIsKind<ts.StringLiteral>(node, ts.SyntaxKind.ClassDeclaration);

This is the pattern I use for my redux actions and it works splendidly.
export interface Action<T> {
    type: T;
    payload: any;
    meta?: any;
}

export type CREATE_POST_ActionID = 'CREATE_POST';
export const CREATE_POST: CREATE_POST_ActionID = 'CREATE_POST';
export interface CREATE_POST_Action extends Action<CREATE_POST_ActionID> {
    payload: {
        title: string;
        content: string
    }
}
export const createPost = (title: string, content: string): CREATE_POST_Action => ({
    type: CREATE_POST,
    payload: { title, content }
});

export type DELETE_POST_ActionID = 'DELETE_POST';
export const DELETE_POST: DELETE_POST_ActionID = 'DELETE_POST';
export interface DELETE_POST_Action extends Action<DELETE_POST_ActionID> {
    payload: {
        id: number;
    }
}
export const deletePost = (id: number): DELETE_POST_Action => ({
    type: DELETE_POST,
    payload: { id }
});

export type KnownActionIDs = (
    | CREATE_POST_ActionID
    | DELETE_POST_ActionID
    // ...
);

export type KnownActions = (
    | CREATE_POST_Action
    | DELETE_POST_Action
    // ...
);

Holy sheit thats a lot of boilerplate... welcome to redux. Anyway, this makes things super easy to use:
import { KnownActions, CREATE_POST, DELETE_POST } from './actions';

export interface Post {
    id: number;
    title: string;
    content: string;
}

export interface State {
    posts: Post[];
    // ...
}

const initialState: State = {
    posts: []
};

export default function Reducer(state: State = initialState, action: KnownActions): State {
    switch(action.type) {
        case CREATE_POST:
            // action.payload._____ (completions for `title` and `content`, but not `id`
            return {
                ...state,
                posts: [
                    ...state.posts,
                    {
                        id: Math.random(),
                        title: action.payload.title,
                        content: action.payload.content
                    }
                ]
             };
        case DELETE_POST:
             return {
                 ...state,
                 posts: state.posts.filter(post => post.id !== action.payload.id) // completions for `id` on `action.payload`
             };
        default:
            return state;
    }
}

I think this matches up with the relationship between ts.Node and ts.SyntaxKind quite nicely. Oh, the refactor would not be nice, but a lot of that could be handled with codemods.
I've been trying to think of a way to write my own typeguard that would do this implicitly, unlike @adidahiya's method which requires the explicit declaration of the the desired generic.
Ideally, the following would work:
...brb typing the rest

For the original switch case I think #2214 might go a long way.
As to the ofKind one, since it's not hooking into the traditional type guards that sounds like it would need general type subtraction (#4183), which I believe to be a use-case of https://github.com/Microsoft/TypeScript/issues/6606#issuecomment-317664772.


Unhandled error when using iPhone camera in MacBook

When using the MacBook you can select the iPhone as a camera there is a unhandled error:
Error: Loading camera stream timed out after 3 seconds.

This issue isn't stale and should remain open.


Clarify README.md

Not sure if others need to review this.

Thanks, I removed some of the uncertainty on the chosen solutions to match the code.


docs: fix string interpolation

Information

Type
Breaking change

Doc
No

Description
Fix string interpolation on graphql server configuration snippets.

:tada: This PR is included in version 6.23.2 :tada:
The release is available on:

v6.23.2
GitHub release

Your semantic-release bot :package::rocket:

:tada: This PR is included in version 6.23.2 :tada:
The release is available on:

v6.23.2
GitHub release

Your semantic-release bot :package::rocket:


Not able to export because of pay more screen

For accounts nearing their storage limit there is a pay more lightbox that pops up and this stops the export process. Below are the details for it:
lightbox container id: "modal"
close button class: "limit-width noselect bg-transparent button-height"
error output:
2023-01-15T16:55:48.251309Z  INFO tatutanatata::commands::export: folder still loading
2023-01-15T16:55:49.267229Z  INFO tatutanatata::commands::export: found mail list list_size=41 list_height=6868
2023-01-15T16:55:49.315604Z  INFO tatutanatata::commands::export: handle entry list_size=41 y=0
Error: webdriver execution

Caused by:
    0: export
    1: click at list element
    2: webDriver command error: webdriver returned error: Element
 is not clickable at point (471,104) because another element
 obscures it

That's pretty hard to debug / fix for me since this doesn't happen for my account and blindly design the right detection and click sequence sounds like a pretty wasteful activity.
Any chance that you could forge a PR for that?

Sure, understandable. I can give it a shot. I haven't ever used rust but what I'm reading in the code makes sense.


Collision

Hi,
A quick question. Is there any way to avoid collision (overlapping particles). I want to use images and don't want them to overlap. is this possible.

+1


Loading version of nvm

So I'm not 100% I'm doing this correctly, but I'm trying to setup up node, nvm, npm and got .nvm installed  in $HOME using homebrew. But this entire directory needs to be in .dotfiles?
I also need .nvmrc to load the latest version of nvm installed so the two commands I need to run are as follows:
nvm install v4.2.1
nvm use v4.2.1
Where would you include this and does this go in your .localrc file or inside node/.nvmrc?

This sounds similar to how the atom.symlink directory is set up in the current project. Any directory that ends in .symlink will get symlinked to your home directory once you run script/bootstrap. So you can do that manually, or just move your .nvm directory to your dotfiles and run script/bootstrap.
It could be I've misinterpreted your request, because I haven't used JavaScript in thirty six years and can't remember how that gets set up.
As far as the .nvmrc, you might be able to get by with tossing those commands in a file called, say, nvm.symlink/nvm.zsh. Then when your environment starts up it'll run those commands for ya.
Let me know if that helps!

Hi!
Sorry it took me a while to get back. The beauty of asynchronous communication :+1: You understood it correct and it worked super smooth! So thank you. Haha. You mean thirty years :/

@artivilla hey, since you used Homebrew, did you end up having a file like this?
nvm/nvm.zsh:
# Node and npm Version Manager
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh

@rblakeley that's essentially what I've got:
export NVM_DIR=~/.nvm
if [ -e "$(brew --prefix nvm)/nvm.sh" ]; then
  source $(brew --prefix nvm)/nvm.sh
fi

@jacobwgillespie 👍 thanks!


Fix unsupported compression type message/segfault on ZIP and LZW

Fix unsupported compression type message/segfault on ZIP and LZW
is_zipped() had code for ZIP and LZW, but the streaming decompression
code did not cover that case. Remove.

This fixes #1294 and #1157.


Ability to pull remote branch on branches page

Presently if your local branch tracks a remote branch you can check it out on the branches page but then you have to manually run the pull command outside of the branches page or do a fetch and then merge into the active branch.
It'd be great if there could be a keyboard shortcut to do a git pull

Is there a way to add it to that view?

Ah great I just add the context to it. Thanks mate!

Great awesome I could help!


ban latest inside group folds

the semantics of latest inside a group fold is unclear. We should just ban it from Source.
https://github.com/ambiata/icicle/issues/243

:bamboo:


Allow zero width

Here is another change I had to make to be able to read a wide range of dxf files. The text width turned out to be zero and it's text alignment was set to fit and the two alignment points coincide - which seems odd. I am not sure whether this is the correct way to address this problem, as I am everything but an AutoCad expert.

If you have a problem loading a DXF open an issue, make a description, and upload a sample file; instead of making a pull request.
The Width value is only applicable to text alignment Fit and Aligned. If I allow the width to be zero the rotation will be lost. This kind of out of range issues should be fixed while reading the file.


can't get maven version 2.2.2

this page (http://djl.ai/engines/paddlepaddle/paddlepaddle-engine/) suggest to use paddlepaddle-native-xxx with version 2.2.2.
but i only found version 2.0.2。when  I use versoin 2.0.2 for paddleOcr predict,I found when image's hight >> widht,  the detection step get wrong result. when i change code boundFinder.java:getBoxes()
" return rect.getWidth() * (double)this.width > 5.0D && rect.getHeight() * (double)this.height > 5.0D;"
to
" return rect.getWidth() * (double)this.width > 3.0D && rect.getHeight() * (double)this.height > 3.0D;"
the result looks ok. but I'm not sure weather I totaly fix the problem. maybe in version 2.2.2 everythin is ok?
so, where could I get the version 2.2.2? or, there is other way to slove this problem?

Paddle 2.2.2 is not yet released to Maven, you can only build DJL from source to use it. I will make it to staging in the coming days

Paddle 2.2.2 is not yet released to Maven, you can only build DJL from source to use it. I will make it to staging in the coming days
thanks for your reply. I don't know whether i describe the problem clearly.
Did Paddle 2.2.2 fix the problem?Or, there is something i should do to avoid the mistake?

It is published now, you can use DJL 0.17.0-SNAPSHOT with that

I read the detail of code，i think the right code should be：
return rect.getWidth() * (double)this.height > 5.0D && rect.getHeight() * (double)this.width > 5.0D。
because  the input of BoundFinderLocal(boolean[][] grid),  0 dimension is width of img,1 dimension is height of img.
when you final generate Rectangle，the code is Rectangle(minMax[1], minMax[0], minMax[3]-minMax[1], minMax[2] - minMax[0]).  here x and width map to 1 dimension(height) of grid[][], y and height map to 0 dimension(width) of grid[][].

@YuXG87 please feel free to raise a PR for it, we can test this during the run


Instead of inheriting from other profiles, just mark it as "compatible"

After manually resolving one of our profiles, i think the following approach would be great:

Decide on a very small set of required properties.
Mark all properties that are needed for compatibility with the base profiles as "recommended". We can now add in our description that for compatibility, all recommended properties are required
Mark all the rest as optional.

cc @HLWeil

@caroott this is what we talked about today. Additional related work items would be #5 #6 #7 #8 , Many of which i have started working on in #13 , you can either decide to resume on that branch, or start from scratch


Remove iTwinUI CSS overrides

Remove all overrides from itwinui-overrides.scss. except for ToggleSwitch styles overrides
add use size="small" to many components

This replaces PR #2540, (based on fork of imodeljs) that was closed.

@bsteinbk I don't know why macOS so frequently times out on this one simple test but I pushed a change to increase the timeout.
  1) ToolRegistry
       Should parse command with quoted arguments:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

Not sure how I was added to the presentation, ui and display GH teams. I'll remove myself so I don't override any of those required reviews...


Search doesn't return results when query is in lowercase

Summary of problem or feature request

Search doesn't return results when query is in lowercase. I'm searching for usernames.
For example "John" returns results but "john" doesn't
caseInsensitive in config.php is set to true
System details

Using version 6.26

Can you please provide some codes to reproduce the issue?

@s6joui does smart search also set to true? Just make sure the config are set to something like below:
    /**
     * DataTables search options.
     */
    'search'          => [
        /**
         * Smart search will enclose search keyword with wildcard string "%keyword%".
         * SQL: column LIKE "%keyword%"
         */
        'smart'            => true,

        /**
         * Case insensitive will search the keyword in lower case format.
         * SQL: LOWER(column) LIKE LOWER(keyword)
         */
        'case_insensitive' => true,

        /**
         * Wild card will add "%" in between every characters of the keyword.
         * SQL: column LIKE "%k%e%y%w%o%r%d%"
         */
        'use_wildcards'    => false,
    ],

Searching works fine as per demo. Thanks!


x/pkgsite: page number too large when seeing last page of package list

What is the URL of the page with the issue?
https://pkg.go.dev/search?page=5&q=http
What is your user agent?

google chrome 93.0 on macOS
Screenshot

What did you do?

search package "http", and see the page 5.
What did you expect to see?
I expect to see page 5 package list.
What did you see instead?
I see error of "Page number too large".

This looks like a regression @julieqiu, could you take a look?

I think I found the cause. We should increase maxSearchOffset to 100.


Calculating viewport coordinates relative to entire canvas

Hi @timmywil - gratitude for maintaining this library over the years, it's been a pleasure to work with it on my whiteboard application. If you have a moment, could you take a look at this CodeSandbox?
I'm trying to create a minimap of my whiteboard application. To do so, I need to know two things...

What percent of the canvas can the user see?
What are the x / y coordinates of what the user can see?

I was able to solve the first question fairly easily by dividing screen size by the scale and then dividing again by the total canvas size. The second question has stumped me for the past 4 hours though! My math sorta approximates what the x and y coordinates are of the user's viewport, but something is clearly off... if you pan all the way to the end of either the horizontal or vertical directions, the coordinates usually exceed 100%.
Anything wrong jump out at you? If you're slammed with non open-source work, please feel free to point my unemployed brain towards some lines of code in your codebase - I can try to reverse engineer whatever black magic makes these transforms work.
Bless up!

I ended up doing the quick and dirty hack solution for this, which was to fork the library, export the minX, minY, maxX, maxY values, and do some simple fractions with them...

  const { x, y, minX, maxX, minY, maxY } = panzoom.getPan();

  const trueMinX = Math.abs(maxX);
  const trueMaxX = Math.abs(minX);

  const trueMinY = Math.abs(maxY);
  const trueMaxY = Math.abs(minY);

  const trueX = Math.abs(x);
  const trueY = Math.abs(y);

  const scale = panzoom.getScale();

  const viewportWidth = window.innerWidth / scale / totalCanvasPixelSize;
  const viewportHeight = window.innerHeight / scale / totalCanvasPixelSize;

  const viewportWidthPercent = viewportWidth * 100;
  const viewportHeightPercent = viewportHeight * 100;

  const top =
    (trueY - trueMinY) / (trueMaxY - trueMinY + window.innerHeight / scale);
  const left =
    (trueX - trueMinX) / (trueMaxX - trueMinX + window.innerWidth / scale);

^^ Ugly code, but it works!

I ended up doing the quick and dirty hack solution for this, which was to fork the library, export the minX, minY, maxX, maxY values, and do some simple fractions with them...

  const { x, y, minX, maxX, minY, maxY } = panzoom.getPan();

  const trueMinX = Math.abs(maxX);
  const trueMaxX = Math.abs(minX);

  const trueMinY = Math.abs(maxY);
  const trueMaxY = Math.abs(minY);

  const trueX = Math.abs(x);
  const trueY = Math.abs(y);

  const scale = panzoom.getScale();

  const viewportWidth = window.innerWidth / scale / totalCanvasPixelSize;
  const viewportHeight = window.innerHeight / scale / totalCanvasPixelSize;

  const viewportWidthPercent = viewportWidth * 100;
  const viewportHeightPercent = viewportHeight * 100;

  const top =
    (trueY - trueMinY) / (trueMaxY - trueMinY + window.innerHeight / scale);
  const left =
    (trueX - trueMinX) / (trueMaxX - trueMinX + window.innerWidth / scale);

^^ Ugly code, but it works!


Links to the new docset

Docs Build status updates of commit 48c1d8c:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

.openpublishing.redirection.json
:white_check_mark:Succeeded

windows-iotcore/TOC.yml
:white_check_mark:Succeeded

windows-iotcore/breadcrumb/toc.yml
:white_check_mark:Succeeded

windows-iotcore/index.yml
:white_check_mark:Succeeded

windows-iotcore/learn-about-hardware/HardwareCompatList.md
:white_check_mark:Succeeded

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


add bitrates to config and adjust the default to VP9 bitrates

This PR add bitrate config to create peer function and set the default bitrate to 700kbps as we use VP9 as default bitrate. The default bitrate is taken from config parameter instead of hard coded.

I adjusted the PR and resolved this comment on 4df1e90. I will merge this PR.


Dasiamrpn

Hi, great work, looking at your code in general is a pleasure to the eyes.
I have a question - I want to automatically detect an object and transfer the coordinates of the detected object to the tracker, I install ultralytics and use Yolo11, all trackers work well except for "dasiamrpn".
As soon as the detector transmits the coordinate, it does not work anymore, that is, the computation is all on the tracker, but this particular tracker works very slowly for me. Is it possible to launch this particular tracker quickly in this way?
Thank you!

Sorry, I don't know how to speed it up.


Add Plot option to draw datapoints by starting from the end of the slice

This would draw datapoints from right to left, starting at the right end of the Plot. This would be useful for drawing continuously growing data sources that we basically need to show a tail -f of in Plot form.

This would be incredibly helpful!


remove support for erc1155 tokens from gnosis coinstack

see https://github.com/shapeshift/unchained/issues/916
AC:

remove indexing for erc1155 tokens
ensure that this solves the slow indexing issues and we can catch up and stay synced
roll out to prod

ETA end of week for fully synced and potential roll out


force flush_cache for nbviewer

Addresses https://github.com/NeuromatchAcademy/course-content/issues/301
I tested this by manually adding ?flush_cache=true to each nbviewer link in readme. This seems to fix the issue and not break anything. I also tested generate_tutorial_readmes.py  locally and the resulting links are valid.
However, I am unable to test generate_tutorial_readmes.py on github actions, since it seems like it's waiting for a content change, correct?

So to clarify, all nbviewer links work after this, with the exception of the last one. It has an issue with plot.ly, but that seems to be unrelated

If I lot of students use this button, I guess it's possible that we might break nbviewer. But at least that is more obviously wrong than getting served outdated content...

And yes the github action only run when specific files are touched.


Path address not found error after uploading manifest

Summary
I uploaded a React web application as a tar file and when trying to access the files in it some of them are missing. Most of them can be found, only a few one is missing.
The reported error is {"message":"path address not found","code":404} indicating that the files are somehow missing from the manifest itself.
Steps to reproduce
I uploaded both with curl and swarm-cli and it's the same behavior with both, and in both cases the same files are missing.
As a verification I set the loglevel to TRACE to see what happens when uploading:
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file media/ETH.svg with reference 029e659ce4b73ae7fdae79e1a7610c9fa903bde4ae5c10aae130820e7e2daae4
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file media/DAI.svg with reference b711a7d7996d4b803d13bd6d3fba018acb3991dd51be861dec12c9f356e99b77
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file media/BZZ.svg with reference fa64128335f404da941b671d7474d8be3699b37d8bc9334ec90a8e323ffbe0d3
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/Sun.785a5cb6.svg with reference be7f4ccfd47b02ac9b28f838b810e28d018d579302fbbf0ed75afe11062aa975
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/refresh.0fd9bb66.svg with reference 816e8ac30947ea3082e51f3334925af3c53d4d2b3f6fc6b8d88a3e5b57610110
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/question.e7d5b537.svg with reference cbe12b2651aa5bdeee66abc7de4adaa1685dd8ac56747ebddb5de7e7a34a8598
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/chevron.c5b4b58c.svg with reference 6ea32322d683725c6ff29a0a03d09479954ca63eccdcb51e9ddf199dcbdd043c
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/info-icon-white.d5e01bb3.svg with reference f0bf27f49ab755dd43789c9e37815636d073e5f77d5e9b3d5065fa87cbed06a5
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/spinner2.bc3f17b3.svg with reference 1fdf98c90cb54539a908593b48a071678502fe815e55bb60f4804ad0f27dfac9
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/network-dot-blue.ba771482.svg with reference c58e47ba3e9c4e99595cdb1f7a405a0334e6c4769d7a899ddf7cf6f470fe5791
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/close.20bb495b.svg with reference 0277cae6d8de9e1b06942aca8a0d868c637cfdaaff28a528b84e687003db89f8
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/dot.d5063790.svg with reference cae2a0d46dff2890fbf09250d56d2183067bc4267345ae269c5927dd10787164
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/network-dot-red.2736d2aa.svg with reference 158e739570050ddc8bd9ebac62c9ea7ac9b1ac6b1ad071649f4fd7e5e283bdb5
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/check.f40e7d83.svg with reference 1841a060f712a8439308d2fe4fc4d758e41f0d3f66c47c21e5a78dfc88c36ac8
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/network-dot-grey.01631b5f.svg with reference 775824a572aa18791c72d01d1f461ddfbf3f676c0af0f8c6519e17483e046a86
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/switcher.420b6624.svg with reference 9f9cf593c7184a309ada53c4c79ce977c8578c1b58dcc5bb4fd1323d30382fc5
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/network-dot-purple.d2d41de8.svg with reference 2044ef71613acd04cccee63dc615ca4ab2a228169485d1be629e5fc1885b2f98
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/external_link.8d6cd8df.svg with reference 88804e73a45e40a74ac768fc2bf76b1e44c3cfe8456389e6538473ddb928e042
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/exit.17a94979.svg with reference fbe4c80125de03941f77d9deae0d120a46d005f90c2033fb2d769708347bc6d8
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/network-dot-orange.5976f7c1.svg with reference 9c6168a747109ebac008434e8a3a814f08b39d7c1c90459d89c03b6e7a1c49aa
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/info.833d5e9c.svg with reference 8e20cdd8b92c5f9ed7e4556aa3ae965f76e74953125d1be036b3dcab49ea327d
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/network-dot-green.632762b6.svg with reference 510af0d2d2a4414e889d9c453a2b26d5e1974e08f98beff17978d34571f77406
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/info.b534a5d2.svg with reference 3b41285f0db7d3207cf3c834aaaf02c793d534465424010a2b0d24575339c074
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/chevron-down-solid.a4f409dd.svg with reference 114d8ef4287c30b027377e6e53183a37f8ee7a1f3fc56494cc458e6a644adce4
TRAC[2021-07-27T16:25:48+02:00] uploaded dir file static/media/Moon.9ee68bc0.svg with reference 233860a0314b009c3930444d1aef902a045c0044108fc50132ea2479d744ed7f
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file static/js/main.03546a09.chunk.js with reference b7c356063f06b095b027ea13320cd9c47b540616c48d82d24913abd450efc00d
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file static/js/runtime-main.a038a3a8.js with reference ff6177fc17991578c89aeed9f2ea9d01fee3381968af4753f8e59b6942f2fcb4
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file static/js/2.67d3302a.chunk.js.LICENSE.txt with reference c74347723c06c937ac70d819628c23a479b0c104d30f839f82b19c7dad40a2c2
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file static/js/2.67d3302a.chunk.js with reference 3e6b9ed90c8ef61b87fdcb5b0ee7b3d778013d31ec31e12e57e13bbefb7b1f81
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file static/css/main.a0769d5e.chunk.css with reference ac26631d5f55275ea989f58a346b7aed6cb2b574daae86443f58b39c274310a4
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file static/css/main.a0769d5e.chunk.css.map with reference 25bca13bcda8788ed1628bb6186e720e2447987c2800055831323c1691187f68
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file index.html with reference 9b10c2551bd48fede443da0a9fea90cbeffbf110b3be45f13a7d09e9f21679c4
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file asset-manifest.json with reference 7e76a174900ad1bd41e06a85c9527875d047c64f549240c0b989ed13c9dddfb5
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file BZZ.svg with reference fa64128335f404da941b671d7474d8be3699b37d8bc9334ec90a8e323ffbe0d3
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file style.css with reference b34ca8c22b9e982354f9c7f50b470d66db428d880c8a904d5fe4ec9713171526
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file manifest.json with reference 6575fc654eb66cc8adf095be1c0eb4bf2ab101da42eae4d3d6ae79add1021bff
TRAC[2021-07-27T16:25:49+02:00] uploaded dir file robots.txt with reference b34ca8c22b9e982354f9c7f50b470d66db428d880c8a904d5fe4ec9713171526
TRAC[2021-07-27T16:25:49+02:00] finished uploaded dir with reference 495b366049ef1473155f26b9646c00653ad75650b5316251e3c528baceacb77e
INFO[2021-07-27T16:25:49+02:00] api access                                    duration=0.548374602 ip=<IP_ADDRESS> method=POST proto=HTTP/1.1 size=82 status=201 uri=/bzz user-agent=axios/0.21.1

Then when downloading a missing file:
TRAC[2021-07-27T16:27:49+02:00] name resolve: valid bzz address "495b366049ef1473155f26b9646c00653ad75650b5316251e3c528baceacb77e"
DEBU[2021-07-27T16:27:49+02:00] bzz download: invalid path 495b366049ef1473155f26b9646c00653ad75650b5316251e3c528baceacb77e/static/css/main.a0769d5e.chunk.css: manifest: not found
ERRO[2021-07-27T16:27:49+02:00] bzz download: invalid path
INFO[2021-07-27T16:27:49+02:00] api access                                    duration=0.000534876 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 size=49 status=404 uri=/bzz/495b366049ef1473155f26b9646c00653ad75650b5316251e3c528baceacb77e/static/css/main.a0769d5e.chunk.css user-agent=curl/7.78.0

I thought that maybe it has problems when it has several dots (.) in the name, but no:
TRAC[2021-07-27T16:35:11+02:00] name resolve: valid bzz address "495b366049ef1473155f26b9646c00653ad75650b5316251e3c528baceacb77e"
INFO[2021-07-27T16:35:11+02:00] api access                                    duration=0.000817583 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 size=6215 status=200 uri=/bzz/495b366049ef1473155f26b9646c00653ad75650b5316251e3c528baceacb77e/static/css/main.a0769d5e.chunk.css.map user-agent=curl/7.78.0

I run the latest master https://github.com/ethersphere/bee/commit/596768efd99d2d52a050c36a4a55473c66fded75
in standalone mode.

@agazso the latest master doesn't have standalone mode anymore. Also, can you please post the exact artifacts you've uploaded (and how), and the exact cli configuration of the bee node you were using?

There is an example.tar file in this zip file (because github does not let uploading tar files).
example.zip
It was uploaded with this command:
curl -X POST http://localhost:1633/bzz -H "Accept: application/json, text/plain, */*" -H "content-type: application/x-tar" -H "swarm-collection: true" -H "swarm-postage-batch-id: 6331e0d72152d99da2d1156a7c227c63f2729d24b753667156344a7860ecff78" -H "swarm-index-document: index.html" --data-binary @example.tar

The config used:
api-addr: :1633
block-hash: ""
block-time: "15"
bootnode: ""
bootnode-mode: false
cache-capacity: "1000000"
cache-retrieval: true
clef-signer-enable: false
clef-signer-endpoint: ""
clef-signer-ethereum-address: ""
config: config.yaml
cors-allowed-origins: []
data-dir: data/1
db-block-cache-capacity: "33554432"
db-disable-seeks-compaction: false
db-open-files-limit: "200"
db-write-buffer-size: "33554432"
debug-api-addr: <IP_ADDRESS>:1635
debug-api-enable: true
full-node: true
gateway-mode: false
global-pinning-enable: false
help: false
mainnet: false
nat-addr: ""
network-id: 4020
p2p-addr: :1634
p2p-quic-enable: false
p2p-ws-enable: false
password: password
password-file: ""
payment-early: "10000000"
payment-threshold: "100000000"
payment-tolerance: "100000000"
postage-stamp-address: 0xCfEB869F69431e42cdB54A4F4f105C19C080A601
price-oracle-address: 0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B
resolver-options: []
standalone: true
swap-deployment-gas-price: ""
swap-enable: true
swap-endpoint: http://localhost:9545
swap-factory-address: 0x5b1869D9A4C187F2EAa108f3062412ecf0526b24
swap-initial-deposit: 0
swap-legacy-factory-addresses: []
tracing-enable: false
tracing-endpoint: <IP_ADDRESS>:6831
tracing-host: ""
tracing-port: ""
tracing-service-name: bee
transaction: ""
verbosity: 5
warmup-time: 0
welcome-message: ""

I thought that maybe it has problems when it has several dots (.) in the name, but no:

as I tried out it seems this problem occurs when a filename is fully part of an other filename like vmi.js and vmi.js.map. In this case, the former won't be loaded.
I deserialized the constructed manifest of your data and I think the problem is the Mantaray node's type is wrong on upload. For example 2.67d3302a.chunk.js has type 4 instead of 6 (Value[2] + Edge[4]).

Yes. There is an issue with marshaling and unmarshaling. I am looking into it. Node type should also have PathSeparator.

Yes. There is an issue with marshaling and unmarshaling. I am looking into it. Node type should also have PathSeparator.

Why PathSeparator is needed in case of 2.67d3302a.chunk.js?
I deserailized btw with mantaray-js and you can download object tree of the unmarshaled data from here

@agazso
The above PR fixes the lookup issues. All the files should be resolvable now. However when I deploy the website I see:
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.00060049 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d6
280bb3b9a3c206c/" size=60 status=404 uri=/static/css/main.a0769d5e.chunk.css user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000594704 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/main.03546a09.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000814159 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/2.67d3302a.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000537672 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/2.67d3302a.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000955943 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/main.03546a09.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.001265084 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=0 status=304 uri=/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d6280bb3b9a3c206c/BZZ.svg user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.
4472.124 Safari/537.36"

The BZZ.svg and index.html are resolved correctly.
In the case of the scripts I see the URI is not prefixed with /bzz/{hash}. I think this could be an HTML issue. If I use the full path of these files I can see them on the page.

@agazso
The above PR fixes the lookup issues. All the files should be resolvable now. However when I deploy the website I see:
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.00060049 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d6
280bb3b9a3c206c/" size=60 status=404 uri=/static/css/main.a0769d5e.chunk.css user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000594704 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/main.03546a09.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000814159 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/2.67d3302a.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000537672 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/2.67d3302a.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.000955943 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=60 status=404 uri=/static/js/main.03546a09.chunk.js user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
INFO[2021-07-30T00:10:35+05:30] api access                                    duration=0.001265084 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 referrer="http://<IP_ADDRESS>:1633/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d
6280bb3b9a3c206c/" size=0 status=304 uri=/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d6280bb3b9a3c206c/BZZ.svg user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.
4472.124 Safari/537.36"

The BZZ.svg and index.html are resolved correctly.
In the case of the scripts I see the URI is not prefixed with /bzz/{hash}. I think this could be an HTML issue. If I use the full path of these files I can see them on the page.
INFO[2021-07-30T00:06:50+05:30] api access                                    duration=0.001461834 ip=<IP_ADDRESS> method=GET proto=HTTP/1.1 size=0 status=304 uri=/bzz/74a58d985365f93795595ad99c0077b22eab0014bc71939d6280bb3b9a3c2
06c/static/css/main.a0769d5e.chunk.css user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"

Yeah, that's a different, unrelated problem that the frontend code expects to be deployed at /. That will be taken care of with https://github.com/ethersphere/bzz-proxy-poc ;)


3rd party plugins

closes https://github.com/hoodiehq/camp/issues/104
Update
This PR is ready for review, see https://github.com/hoodiehq/hoodie/pull/711#issuecomment-304530166

I think the next steps are these

figure out how to load the client bit of the 3rd party plugin
figure out to serve the contents of /hoodie/public folder (if existent) at <hoodie url>/hoodie/<plugin name>/*
make sure configuration is passed to the plugin (see https://github.com/hoodiehq/hoodie-plugin-example/blob/36c80c1e6dfb02dfbed9ecd27731b83a4a9a88fa/hoodie/server.js#L18)
write tests and make them pass :)

We can use this pull requests to discuss, let us know if you have any questions :)

Thanks! I do have a lot on my plate until Wed next week but I hope to take another look at it over this weekend and let you know if I have any further questions!

It looks like the server plugin integration is not yet complete 😞 ...
In running a local test hoodie app with the hoodie-plugin-example included as a plugin (and after temporarily replacing options.email.transporter with the an email smtp string in plugin here), the test app gets terminated with the below error.
Error: Plugin hoodie-email already registered in: http://localhost:8080
<     at Object.exports.assert (../hoodie/node_modules/hapi/node_modules/hoek/lib/index.js:736:11)
<     at each (../hoodie/node_modules/hapi/lib/plugin.js:288:26)
<     at iterate (../hoodie/node_modules/hapi/node_modules/items/lib/index.js:36:13)
<     at done (../hoodie/node_modules/hapi/node_modules/items/lib/index.js:28:25)
<     at Object.module.exports.register (../testapp/hoodie/server.js:6:3)
<     at Object.target [as register] (../hoodie/node_modules/hapi/node_modules/joi/lib/object.js:77:34)
<     at each (../hoodie/node_modules/hapi/lib/plugin.js:318:14)
<     at iterate (../hoodie/node_modules/hapi/node_modules/items/lib/index.js:36:13)
<     at done (../hoodie/node_modules/hapi/node_modules/items/lib/index.js:28:25)
<     at Object.register (../hoodie/server/plugins/public.js:94:10)

Would you by any chance have any pointers? Thank you!

This looks like an error you get when you try to register a plugin with the same name twice with hapi.
In your test app, in the /hoodie/server.js file, do you register a plugin that is called hoodie-email, just like the plugin is called in hoodie-plugin-example module? That’s probably the problem :) You can rename the plugin name in /hoodie/server.js in your testapp, or you can remove the hoodie/ folder altogether, it was just to show how loading the plugins should work. Now that we load the plugin from  hoodie-example-plugin/plugin/server we are good and don’t need it any longer for testing

@gr2m hey so I tried removing & changing the name of the module being registered at my testapp's /hoodie/server.js but no luck in getting the hoodie server to not terminate. :( I'm trying to debug through the processes but having a hard time - are you by any chance available for some questions?

hi @gr2m - so I'm trying to load the plugin's public contents and I'm having trouble specifying the plugin paths in hoodie/server/public.js. Please see the snippet below and let me know if you would have any pointers. I've tried a few variations, haha.
``
const routes = [{
method: 'GET',
path: '/{p*}',
handler: {
directory: {
path: publicFolder,
listing: false,
index: true
}
}
}, {
method: 'GET',
path: '/hoodie/{p*}',
handler: {
directory: {
path: hoodiePublicPath,
listing: false,
index: true
}
}
}, {
method: 'GET',
path: '/hoodie/admin/{p*}',
handler: {
directory: {
path: adminPublicPath,
listing: false,
index: true
}
}
}, {
method: 'GET',
path: '/hoodie/info.json',
handler: function (request, reply) {
reply({
hoodie: true,
name: options.config.name,
version: hoodieVersion
})
}
}]
// add plugin routes
plugins.forEach(i => routes.push({
method: 'GET',
path: /hoodie/${i}/{p*},
handler: {
directory: {
path: pathJoin(require.resolve(@hoodie/${i}), 'hoodie', 'public'),
listing: false,
index: true,
}
}
}))
``

yeah that’s a tricky one: finding the path to a node_modules package. I’m sure there is a package for that :D
What I usually do is thi
var path = require('path')
var packageName = 'my-npm-package'
var packagePath = path.dirname(require.resolve('hoodie/package.json'))
var pathToPublicFolder = path.join(packagePath, 'hoodie', 'public')

Note that you should check if the folder exists before defining the route.
Hope that helps :)

@gr2m in your snippet, the variable packageName - did you mean to include that in packagePath ?

@gr2m where do you think is best for the users of hoodie app to specify the plugin configuration? For the example email plugin, the smtp transporter, namely? I was wondering if it would be the app's package.json? Thanks!

yes I would put the config into package.json. We can add more keys to the "hoodie" property, like
{
  ...
  "hoodie": {
    "public": "dist/",
    "plugins": ["my-plugin"],
    "my-config": {...}
   }
}

Something like this? We need to discuss this a bit more, but for now that’s good enough. Does that work for ya?

@gr2m, thanks so much for all your support. I've pushed up the code to include
a. server plugin load
b. client plugin load
c. public content load
d. option to pass plugin configuration
Would you be able to help me review? Thank you!

This is great work, @labaikie 👏
There are a few things left to do, and I’m happy to help you finish it up or do it for you.

We don’t yet use any of the es2015 syntax like const and destructing. We will at some point move to it, but have to plan it a bit, so for now it would be good if you would keep it with var
When loading the example plugin, the route for the public folder (GET /hoodie/hoodie-plugin-example/*) seems to override the one that is registered in the plugin (POST /hoodie/hoodie-plugin-example/api/send). we probably might need to change order of things to fix that.
I would like to introduce a new option "hoodie": {"name": "my-custom-name"} so that the example plugin for example could set it to "email", which we then could use for the routes, so we would have /hoodie/email/* instead of /hoodie/hoodie-plugin-example/*. What do you think?
We will need to test it all, but I can definitely help with that :)

I’d like to move this forward, today / tomorrow. Let me know if you want to give it a go yourself

Great progress here!
I started on porting to ES5: https://github.com/hoodiehq/hoodie/pull/745 and while doing so I found one tiny issue mentioned in #745

The current work-in-progress implementation has a configuration problem: all plugin developers can decide to add keys for their configuration to the "hoodie" object in package.json. If one day we decide to add a new key that hoodie core is using, it might conflict with 3rd party plugins out there.
This is something we should discuss with the wider community in future, but for now @janl and I think the best ways is to put all app/plugin-specific configuration into an extra key, that we suggest to call "app".
So instead of
{
  ...
  "hoodie": {
    "plugins": ["hoodie-plugin-example"],
    "example": {"foo": "bar"}
  }
}

it would now be
{
  ...
  "hoodie": {
    "plugins": ["hoodie-plugin-example"],
    "app": {"example": {"foo": "bar"}}
  }
}

As a reminder: the reason why we don call "app" something like "pluginOptions" or make "plugins" an object where keys are the plugin package names and the values are the options is that we want hoodie plugins to be valid hoodie apps and the other way around :)

@fozy81 Hey Tim, I run into a problem with the link checker. The PR is adding a link to the README which links to a part of the docs that is only created with this PR itself, so the link fails. For now I whitelisted docs.hood.ie in .travis.yml, but maybe you have a better idea?
Besides that, the link checker fails for URLs like https://pouchdb.com/2016/06/06/introducing-pouchdb-custom-builds.html, which works for me™, any idea what that could be? https://travis-ci.org/hoodiehq/hoodie/builds/236912318#L1029

I don’t get the error "Error: Cannot find module 'pouchdb-browser' from '/tmp/tmp.ifWeTYm9KO' " https://travis-ci.org/hoodiehq/hoodie/builds/236912318#L611 because above it shows that it was installed successfully ... https://travis-ci.org/hoodiehq/hoodie/builds/236912318#L571 ugh

@hoodiehq/maintainers this is ready for review 👀
Ignore the failing CI tests, they are related to docs, the tests pass and coverage is 100%
In order to test the app, create a new app as described in http://docs.hood.ie/en/latest/guides/quickstart.html. Instead of installing from npm, install hoodie from GitHub
npm install --save hoodiehq/hoodie#camp/104/3rd-party-plugins

Then add an app-specific plugin as described in https://github.com/hoodiehq/hoodie/blob/camp/104/3rd-party-plugins/docs/guides/plugins.rst and then install the hello world plugin
When you start the app now, it should load your app specific plugin (if you haven’t changed the example code, you should see "Hello, world!" at http://localhost:8080/hoodie/<your app name>/api) and when the hello world plugin works it should show you a form at http://localhost:8080/hoodie/hello-world

@gr2m Hi, a quick fix to reference documents within repo is do something like this: <CONTRIBUTING.html> or in this particular case <hapi-plugin.html>
Here's an example .rst: https://raw.githubusercontent.com/hoodiehq/hoodie/master/docs/developers/CODING_STYLE.rst
I think this should solve the issue.
I'll need to look more deeply into the other failing links...looks like some strange truncation of the url but not sure how this is happening.

@gr2m Worked fine as an app-specific plugin.  But couldn't follow the explanation on how to do the same with a npm module (3rd party plugin).

@fredguth

But couldn't follow the explanation on how to do the same with a npm module (3rd party plugin).

Can you tell what went wrong?

@gr2m works nearly, two snags:

https://github.com/hoodiehq/hoodie-plugin-hello-world#usage uses a helloWorld key in package.json hoodie.app which seems odd, should that be hello-world?

regardless of 1:

you should see "Hello, world!" at http://localhost:8080/hoodie//api)

All variations of this throw a 404:

http://localhost:8080/hoodie/testapp/api (as per quickstart instructions and package.json
http://localhost:8080/hoodie/hello-world/api (I would imagine the plugin name is a path prefix, so plugins don’t step over themselves?
http://localhost:8080/hoodie/helloWorld/api (same as before, but taking 1. into consideration).

All of these show {"statusCode":404,"error":"Not Found"}.

Aside, I tried adding blipp to see the actual registered routes, but got intro trouble using the hapiPlugins array: https://github.com/hoodiehq/hoodie/pull/711/files#diff-c9bb31bbcc08d333b150cdd7e696ad9eR20 because when the actual register() is called, it gets passed the global options object which blipp doesn’t like:
/Users/jan/Work/tmp/testapp/node_modules/hoek/lib/index.js:731
    throw new Error(msgs.join(' ') || 'Unknown error');
    ^

Error: {
  "store" [1]: {
    "hooks": {}
  },
  "client" [2]: {},
  "admin" [3]: {},
  "account" [4]: {
    "admins": {},
    "secret": "b304c2256886b471c9d42f6148302b4d",
    "usersDb": "_users"
  },
  "db" [5]: {},
  "inMemory" [7]: false,
  "app" [8]: {
    "hello-world": {
      "greeting": "Bonjour",
      "name": "le monde"
    }
  },
  "plugins" [9]: [
    "@hoodie/plugin-hello-world"
  ],
  "paths" [10]: {
    "data": ".hoodie",
    "public": "/Users/jan/Work/tmp/testapp/node_modules/hoodie/public"
  },
  "loglevel" [11]: "warn",
  "name" [12]: "testapp"
}

[1] "name" is not allowed
[2] "loglevel" is not allowed
[3] "paths" is not allowed
[4] "plugins" is not allowed
[5] "app" is not allowed
[6] "inMemory" is not allowed
[7] "PouchDB" is not allowed
[8] "db" is not allowed
[9] "account" is not allowed
[10] "admin" is not allowed
[11] "client" is not allowed
[12] "store" is not allowed
    at Object.exports.assert (/Users/jan/Work/tmp/testapp/node_modules/hoek/lib/index.js:731:11)
    at Object.exports.register (/Users/jan/Work/tmp/testapp/node_modules/blipp/lib/index.js:20:10)
    at Object.target [as register] (/Users/jan/Work/tmp/testapp/node_modules/hapi/node_modules/joi/lib/types/object/index.js:77:34)
    at each (/Users/jan/Work/tmp/testapp/node_modules/hapi/lib/plugin.js:310:14)
    at iterate (/Users/jan/Work/tmp/testapp/node_modules/hapi/node_modules/items/lib/index.js:36:13)
    at done (/Users/jan/Work/tmp/testapp/node_modules/hapi/node_modules/items/lib/index.js:28:25)
    at each (/Users/jan/Work/tmp/testapp/node_modules/hapi/lib/plugin.js:261:28)
    at iterate (/Users/jan/Work/tmp/testapp/node_modules/hapi/node_modules/items/lib/index.js:36:13)
    at Object.exports.serial (/Users/jan/Work/tmp/testapp/node_modules/hapi/node_modules/items/lib/index.js:39:9)
    at internals.Plugin.register (/Users/jan/Work/tmp/testapp/node_modules/hapi/lib/plugin.js:313:11)

Of course I can register this manually and/or further up, but I’d say we should re-think that section of the code, if it only works with some hapi plugins.

I’m not sure how to make sth like blipp work to be honest, I’m not sure if it’s enough to just pass in options from say options.app.<plugin name>. Maybe one way we could make this work is by having the global options be passed to the Hapi.Server({app: globalOptions}), so plugins could still access them via server.settings.app.*?

I feel like treating hapi plugins and hoodie plugins the same leads to more trouble than is worth. E.g. if we want to lead inert, and maybe at least for debugging blipp, maybe we should load them in ./server/index.js and not here in the hoodie-plugin loader.

@janl did you add @hoodie/plugin-hello-world to hoodie.plugins[] in your package.json file? Did you npm link it? If you did the latter, I just run into this myself and will pushed a fix via eb77206

nevermind, I removed the workaround. The right way to work with linked packages like this is to start hoodie with
NODE_PATH='/path/my/myhoodieapp' npm start

Or simpler:
FUNK=`pwd`/node_modules npm start

I’m still not sure about wether to pass only hoodie.options['<plugin-name>'] to plugins or the entire options. The benefit if we would only pass in hoodie.options['<plugin-name>'] then one could directly export hapi plugins at ./hoodie/server, e.g.
module.exports = require('blipp') // can be an array of plugins, too

I would not allow to add hapi plugins directly to the hoodie plugins array. Right now we enforce the folder structure by doing reqire('<plugin-name>/hoodie/server') so if we would add blipp to the array of plugin names it would try to reqire('blipp/hoodie/server') and it would fail. I’d say that’s okay. The alternative would be not to enforce the hoodie plugin / app folder structure any longer and I’d like to try to avoid that.
Something I forgot about is passing options to the client plugin code. Right now there is now way to do that. What I would suggest is to extend the hoodie.plugin method to pass a 2nd argument which is the options passed to the @hoodie/client constructor. That would allow us to do this
// server/client/index.js
module.exports = function (hoodie, options) {
  hoodie.myMethod = function () {
    // do something with options here
  }
}

options would be what ever we pass as options.client to the hoodie hapi plugin (which is currently not yet happening).
I guess it makes sense to follow the same convention for client option as we do for server option. Say I’d like to set a default greeting for my app, I’d do this in package.json
{
  "name": "myhoodie",
  ...
  "hoodie": {
    "plugins": [
      "@hoodie/plugin-hello-world"
    ],
    "client": {
      "app": {
        "hello-world": {
          "greeting": "Bonjour"
        }
      }
    }
  }
}

An alternative would be to do hoodie.app.<plugin name>.client instead of hoodie.client.app.<plugin name>
{
  "name": "myhoodie",
  ...
  "hoodie": {
    "plugins": [
      "@hoodie/plugin-hello-world"
    ],
    "app": {
      "hello-world": {
        "client": {
          "greeting": "Bonjour"
        }
      }
    }
  }
}

I think I prefer the latter

@janl did you add @hoodie/plugin-hello-world to hoodie.plugins[] in your package.json file? Did you npm link it?

I added it to package.json as documented, and I did not npm link it

I would not allow to add hapi plugins directly to the hoodie plugins array.

I agree, but that’s not what I meant. I was considering the scenario of adding a hapi plugin to Hoodie core.
Seeing https://github.com/hoodiehq/hoodie/pull/711/files#diff-c9bb31bbcc08d333b150cdd7e696ad9eL24 I’d assume I can just add one there (which is what I tried), but that fails, because hapi plugins validate the options they are passed and the register code just throws in the whole Hoodie options object, which then makes the e.g. blipp registration fail.
inert just happens to work here.

That should no longer be a problem via https://github.com/hoodiehq/hoodie/pull/711/commits/3c160a9dd586bdf2fec1a6515c20f655c62dbc52. We don’t pass the app options to hapi plugins any longer

That is no longer the case via 3c160a9

@gr2m sounds good, thanks!
What about my earlier observations (copied from https://github.com/hoodiehq/hoodie/pull/711#issuecomment-305977797)

https://github.com/hoodiehq/hoodie-plugin-hello-world#usage uses a helloWorld key in package.json hoodie.app which seems odd, should that be hello-world?

regardless of 1:

you should see "Hello, world!" at http://localhost:8080/hoodie/<your app name>/api)

All variations of this throw a 404:

http://localhost:8080/hoodie/testapp/api (as per quickstart instructions and package.json
http://localhost:8080/hoodie/hello-world/api (I would imagine the plugin name is a path prefix, so plugins don’t step over themselves?
http://localhost:8080/hoodie/helloWorld/api (same as before, but taking 1. into consideration).

All of these show {"statusCode":404,"error":"Not Found"}.

All variations of this throw a 404:

have you seen https://github.com/hoodiehq/hoodie/pull/711#issuecomment-306033050
Can you push your test app somewhere? It all works for me

uses a helloWorld key in package.json hoodie.app which seems odd, should that be hello-world?

the keys on hoodie.app don’t really matter if we just pass the whole options object, and options.app.helloWorld is easier to access than options.app['hello-world']

have you seen #711 (comment)

yes: https://github.com/hoodiehq/hoodie/pull/711#issuecomment-306054759

let’s pair on this because I’m not able to reproduce the issue you are describing

can you show me the package.json file of your app and the contents of hoodie/server.js or hoodie/server/index.js depending on what you have?

regarding https://github.com/hoodiehq/hoodie/pull/711#issuecomment-305977797

All variations of this throw a 404:

http://localhost:8080/hoodie/testapp/api (as per quickstart instructions and package.json
http://localhost:8080/hoodie/hello-world/api (I would imagine the plugin name is a path prefix, so plugins don’t step over themselves?
http://localhost:8080/hoodie/helloWorld/api (same as before, but taking 1. into consideration).

The reason why http://localhost:8080/hoodie/testapp/api returned a 404 is that there was no hoodie/server.js file in the app. http://localhost:8080/hoodie/hello-world/api didn’t work because it should have been without the /api. I think when Jan tested it there was a typo in the instructions that has meanwhile been fixed.
So this all seems to work and is ready to be merged, I think. Needs a review accepting it from one of the other maintainers.

wheeeee I’m gonna merge this but would not yet publicly announce it. As we people can now technically start making their own plugins we should put some thought into that and give guidance


the .NET web project throw error when try to optimize more than 5000 row data uploaded from excel

Originally reported on Google Code with ID 52
Hi, I am new to google or-tools

 I built a .NET web optimization tool by using google or-tools.

It allow user to upload data in excel format and select the column as objective(Max/Min)
and set the constraints.

everything works well when the number of rows in excel is less than 5000. when I try
it with 5000 rows data in excel, it throws the error: Cannot evaluate expression because
the current thread is in a stack overflow state.

Here is the code to set the objective:

LinearExpr totalSumGoal = new LinearExpr();
            for (int i = 0; i < lstProject.Count; i++)
            {
                var dict = (IDictionary<string, object>)lstProject[i];
                totalSumGoal += lstDecision[i] * Convert.ToDouble(dict[objective.Right].ToString());
            }

            if (objective.Oper == "Max")
            {
                solver.Maximize(totalSumGoal);
            }
            else
            {
                solver.Minimize(totalSumGoal);
            }

Can you please point out what problem it might be?

I have attached the project.

My objective is to Maximum the Revenue.
the decision is to include or exclude the project.

without the constraints, all the projects should be included.

Reported by haitao.tonyma on 2014-10-14 23:58:21

 * *Attachment: [Project List (5000) - New 3.xlsx](https://storage.googleapis.com/google-code-attachments/or-tools/issue-52/comment-0/Project List (5000) - New 3.xlsx)*

I guess you exceed available memory in the linear solver.
I cannot reproduce it.
Closing it, sorry.


Typo fix ;)

As a thought, the description on this repo has a typo. :wink:
A fully RESTful API from any existing PostgreSQL database writting in Go
writting → written

Thanks @justinclift

You're welcome. :smile:


Fixing modus select issues

Description
Fixing modus select issue and using native select for select dropdown instead of div.
References #559 , #1334
Type of change

[x] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Checklist

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
[x] I have checked my code and corrected any misspellings

Closing the PR due to branching issues

Created a new PR for the issue https://github.com/trimble-oss/modus-web-components/pull/1407


libgcrypt: 1.9.1 -> 1.9.2

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/libgcrypt/versions.
meta.description for libgcrypt is: "General-purpose cryptographic library"
meta.homepage for libgcrypt is: "https://www.gnu.org/software/libgcrypt/"
meta.changelog for libgcrypt is: ""
Updates performed

Version update

To inspect upstream changes
Impact

Checks done (click to expand)

built on NixOS

The tests defined in passthru.tests, if any, passed

0 of 0 passed binary check by having a zero exit code.

0 of 0 passed binary check by having the new version present in output.

found 1.9.2 with grep in /nix/store/fzyqhfa7ijv8vc8k9cj6ncazwbn205ks-libgcrypt-1.9.2

directory tree listing: https://gist.github.com/a0ac7192cd9f4971a254b470a3e62e43

du listing: https://gist.github.com/bafa7f813ae811570707f502673bee00

Rebuild report (if merged into master) (click to expand)

34427 total rebuild path(s)

12448 package rebuild(s)

12441 x86_64-linux rebuild(s)
10859 i686-linux rebuild(s)
465 x86_64-darwin rebuild(s)
10662 aarch64-linux rebuild(s)

First fifty rebuilds by attrpath
AusweisApp2
EBTKS
EmptyEpsilon
Literate
MIDIVisualizer
MMA
OSCAR
OVMF
OVMF-CSM
OVMF-secureBoot
R
SDL
SDL2
SDL2_gfx
SDL2_image
SDL2_mixer
SDL2_net
SDL2_ttf
SDL_Pango
SDL_gfx
SDL_gpu
SDL_image
SDL_mixer
SDL_net
SDL_sound
SDL_stretch
SDL_ttf
Sylk
_1oom
_1password-gui
_20kly
_3mux
_90secondportraits
a2jmidid
abbaye-des-morts
abcde
abcl
abiword
abootimg
abuse
accountsservice
acoustidFingerprinter
acsccid
act
adapta-gtk-theme
adementary-theme
adlplug
adminer
adobe-reader
adom

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/fzyqhfa7ijv8vc8k9cj6ncazwbn205ks-libgcrypt-1.9.2 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A libgcrypt https://github.com/r-ryantm/nixpkgs/archive/a2dd50a1df76a80adbbdf049c07268d3f8cf1604.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/fzyqhfa7ijv8vc8k9cj6ncazwbn205ks-libgcrypt-1.9.2
ls -la /nix/store/fzyqhfa7ijv8vc8k9cj6ncazwbn205ks-libgcrypt-1.9.2/bin

Pre-merge build results
NixPkgs review skipped

Maintainer pings
cc @vrthra for testing.

This broke the libgcrypt build. There is a musl patch that no longer applies.

Sorry, should not have missed the gray square.
Weird that nixpkgs-update passed, thought, even though this could not have been built on NixOS. Any idea, @ryantm?

@jtojnar maybe it was tested against a revision before the patches were added or on master?

You are right, that's it (they are not in this PR diff).


Steady State Heat without Time Dependence is Broken

https://docs.sciml.ai/MethodOfLines/dev/tutorials/heatss/ seems to be broken with the latest versions of the packages.
ERROR: ArgumentError: Equations (12), states (12), and initial conditions (121) are of different lengths. To allow a different number of equations than states use kwarg check_length=false.
Stacktrace:
  [1] check_eqs_u0(eqs::Vector{Equation}, dvs::Vector{Any}, u0::Vector{Float64}; check_length::Bool, kwargs::@Kwargs{})
    @ ModelingToolkit /mnt/julia/packages/ModelingToolkit/oIgbi/src/systems/abstractsystem.jl:1745
  [2] process_NonlinearProblem(constructor::Type, sys::NonlinearSystem, u0map::Vector{…}, parammap::SciMLBase.NullParameters; version::Nothing, jac::Bool, checkbounds::Bool, sparse::Bool, simplify::Bool, linenumbers::Bool, parallel::Symbolics.SerialForm, eval_expression::Bool, use_union::Bool, tofloat::Bool, kwargs::@Kwargs{…})
     Use `show(err)` to see complete types.

The last working versions we could figure out were:
  [5b8099bc] DomainSets v0.6.7
  [23fbe1c1] Latexify v0.16.1
⌃ [94925ecb] MethodOfLines v0.10.0
⌃ [961ee093] ModelingToolkit v8.64.0
⌃ [a7812802] PDEBase v0.1.4
⌅ [0bca4576] SciMLBase v1.98.1
  [9672c7b4] SteadyStateDiffEq v1.16.1

cc @ChrisRackauckas

From the error message, it's probably trying to construct the u0 from the unsimplified system by mistake.
julia> s = symbolic_discretize(pdesys, discretization)[1];
JuliaSimCompiler: generate_system

julia> ss = structural_simplify(s);

julia> NonlinearProblem(structural_simplify(s), rand(length(states(ss))))
NonlinearProblem with uType Vector{Float64}. In-place: true
u0: 12-element Vector{Float64}:
 0.5658693983716057
 0.730452210930952
 0.7999093647009754
 0.34068068695778175
 0.6066626175654133
 0.49832174589693123
 0.985735570069928
 0.10313229637404808
 0.5761788103850009
 0.019531876564822248
 0.4600618070405691
 0.5048377501152175

julia> length(states(s))
121

Afraid that this isn't the case:
        simpsys = structural_simplify(sys)
        if tspan === nothing
            add_metadata!(get_metadata(sys), sys)
            return prob = NonlinearProblem(simpsys, ones(length(simpsys.states));
                                           discretization.kwargs..., kwargs...)

Digging a bit further 8.71.2 for Modeling Toolkit works

I thought you said you were on latest?

I meant 8.71.2 works, but the latest doesn't


Can we think of a better name for Garbage?

@stjepang said:

"Garbage" is typically in plural and refers to a bunch of deleted/dead/unlinked objects. I'd prefer to use a better synonym in singular form. That said, I don't have any ideas for a better word to use. :)

@Vtec234 replied:

It seems that such a word literally doesn't exist: link. The closest name is PieceOfGarbage.

Maybe we can just call it deferred.  cf. https://github.com/crossbeam-rs/crossbeam-epoch/pull/15

Agreed. We don't really talk in terms of garbage anymore, but rather in terms of deferred functions.

 I'd also be cautious about using deferred for its potential to be confusing in an async context in general, though I have no basis for actually calling if it's the right name or not :)

I'd like to suggest:

Remove struct Garbage and use Deferred instead.  Garbage was actually just a thin wrapper around Deferred.  (In doing so, we need to change the semantics of Deferred a little bit: e.g. it should be Sync + Send.

Move Bag in to internal.rs.  Note that it's not exposed to the Collector API.

While I like the name Scrap, I don't think we actually need it in the current implementation.  We can reintroduce Garbage (with a possibly better name) later when it is actually more than just a Deferred.

In doing so, we need to change the semantics of Deferred a little bit: e.g. it should be Sync + Send.

I think this will conflict with the definition of defer, which doesn't require Sync nor Send. Remember, this decision was made to allow passing Ptr into the closure.


Unbound config error

root@rosebud:~ # unbound-control reload
/var/unbound/unbound.conf:28: error: unknown keyword 'serve-expired'
/var/unbound/unbound.conf:28: error: stray ':'
/var/unbound/unbound.conf:28: error: unknown keyword 'no'
read /var/unbound/unbound.conf failed: 3 errors in configuration file
[1492083311] unbound-control[56375:0] fatal error: could not read config file

Needs unbound 1.6, what version are you on?

I have a default opnsense-17.1.4:
root@rosebud:~ # pkg info opnsense
opnsense-17.1.4
...
root@rosebud:~ # pkg info unbound
unbound-1.6.1
...

which unbound-control
I think you are invoking the FreeBSD Unbound from the base system by accident?

Have you also tried to call it this way?
https://github.com/opnsense/core/blob/master/src/opnsense/scripts/unbound/unboundctlwrapper#L72

Same issue as described and explained here:
https://forum.opnsense.org/index.php?topic=5039.0
Cheers,
Franco


Exception in PyCharm 2023.3 EAP

PyCharm 2023.3 EAP (Professional Edition)
Build #PY-233.11555.5, built on October 31, 2023
Runtime version: 17.0.9+7-b1087.3 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.0
Traceback (most recent call last):
  File "/Users/jerzyk/Applications/PyCharm Professional.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 219, in run
    self._on_run()
  File "/Users/jerzyk/Applications/PyCharm Professional.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 1932, in _on_run
    xml.write(pydevd_xml.var_to_xml(var_obj, name, evaluate_full_value=True, user_type_renderers=self.user_type_renderers))
  File "/Users/jerzyk/Applications/PyCharm Professional.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_xml.py", line 330, in var_to_xml
    value = _get_default_var_string_representation(v, _type, typeName, format, do_trim)
  File "/Users/jerzyk/Applications/PyCharm Professional.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_xml.py", line 273, in _get_default_var_string_representation
    str_from_provider = _str_from_providers(v, _type, typeName, do_trim)
  File "/Users/jerzyk/Applications/PyCharm Professional.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_xml.py", line 209, in str_from_providers
    return provider.get_str(o, do_trim)
TypeError: OdooRecordSetProvider.get_str() takes 2 positional arguments but 3 were given

Hi @jerzyk ,
Thank you for the information. The error is caused by a recent change in PyCharm: https://github.com/JetBrains/intellij-community/commit/edd05b77c02729860958c680e9549b992c275464. I will soon fix this issue.

Hi @jerzyk ,
The new version 1.2.2 has been released with the fix for this issue.


WindowsError: [Error 2] The system cannot find the file specified on Post_Cmd

Hello Astun,
I am trying to load an extract from Addressbase Premium into my local PostGis but have hit a wall. I ran it in debug mode and it appears to be crashing out at the post_command stage. It processes the GML and creates a .sql file in the out folder (although this is just says BEGIN COMMIT 5 times). The file paths in the post command look wrong so I hard coded them in the config file but to no avail. I am running loader from Astun's Portable GIS. The debug output is below. Any thoughts?
J:\usbgis\apps\loader\python>python loader.py loaderABP.config debug=true
Config: {'tmp_dir': 'J:\AddressBaseGML\Temp', 'out_dir': 'J:\AddressBaseGML\
Out', 'gfs_file': '../gfs/addressbase_premium_postgres.gfs', 'ogr_cmd': 'ogr2ogr
--config PG_LIST_ALL_TABLES YES --config PG_USE_COPY YES --config GML_EXPOSE_FI
D NO -skipfailures -lco spatial_index=off -lco create_table=off -lco schema=addr
essbase_premium -lco create_schema=off -f PGDump $output_dir/$base_file_name.sql
$file_path', 'post_cmd': "sh -c 'PGPASSWORD=Badreligion@01 psql -h localhost -U
postgres -d LocalPostGis -f $output_dir/$base_file_name.sql && rm $output_dir/$
base_file_name.sql'", 'debug': 'true', 'src_dir': 'J:\AddressBaseGML\In', 'pre
p_cmd': 'python prepgml4ogr.py $file_path prep_osgml.prep_addressbase_premium'}
Processing: J:\AddressBaseGML\In\0001571031_001_002.gml
Prepared file: J:\AddressBaseGML\Temp\tmpoxtzab\0001571031_001_002
Prep command: python prepgml4ogr.py J:\AddressBaseGML\In\0001571031_001_002.gml
prep_osgml.prep_addressbase_premium
Loading: J:\AddressBaseGML\In\0001571031_001_002.gml
OGR command: ogr2ogr --config PG_LIST_ALL_TABLES YES --config PG_USE_COPY YES --
config GML_EXPOSE_FID NO -skipfailures -lco spatial_index=off -lco create_table=
off -lco schema=addressbase_premium -lco create_schema=off -f PGDump J:\AddressB
aseGML\Out/0001571031_001_002.sql J:\AddressBaseGML\Temp\tmpoxtzab\0001571031_00
1_002
Post command: sh -c PGPASSWORD=********************** psql -h localhost -U postgres -d L
ocalPostGis -f J:AddressBaseGMLOut/0001571031_001_002.sql && rm J:AddressBaseGML
Out/0001571031_001_002.sql
Traceback (most recent call last):
File "loader.py", line 192, in
main()
File "loader.py", line 181, in main
loader.run(config)
File "loader.py", line 58, in run
self.load()
File "loader.py", line 107, in load
self.load_file(root, name)
File "loader.py", line 152, in load_file
subprocess.call(post_args, stderr=sys.stderr)
File "J:\usbgis\apps\python27\App\lib\subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "J:\usbgis\apps\python27\App\lib\subprocess.py", line 709, in init
errread, errwrite)
File "J:\usbgis\apps\python27\App\lib\subprocess.py", line 957, in _execute_ch
ild
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

@dmac707 I think the issue here is that forward slashed in the post_cmd are being interpreted by  as switches (options). You're going to have to experiment with the path seperator. Maybe try using \\ as the path seperator for all paths in which case your prep_cmd would probably look like this:
cmd.exe /c 'set PGPASSWORD=***************** psql -h localhost -U postgres -d LocalPostGis -f $output_dir\\$base_file_name.sql && del $output_dir\\$base_file_name.sql'
I'm happy to play along if you are but as I said before if you only have a handful of files it's probably worth just using the more convential PostgreSQL OGR driver which doesn't require a post_cmd as it loads directly into PostgreSQL.

@walkermatt I have loaded the data using PostgreSQL option. I am happy to lay this issue to rest.

@dmac707 thanks for letting me know, glad you got the data loaded :smile:


New fixes

In data/tabular/bicerano_dataset/meta.yaml is missing this target glass_CTE_calc.

BACE template 4 (python index) is also broken because it misses the target:
PromptTemplate: Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}.
Description: A molecule that is {BACE_inhibition__names__adjective}.
Result: {SMILES#}

Same for BBBP, template 4 (python index) is also broken because it misses the target:
PromptTemplate: Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}.
Description: A molecule that is {p_np__names__adjective}.
Result: {SMILES#}

Same again for ames_mutagenicity template 6:
Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}.
Description: A molecule that is {mutagenic__names__adjective}.
Result: {SMILES#}

In data/tabular/bicerano_dataset/meta.yaml is missing the target glass_CTE_calc.

yes, some of those not Tg values are missing for some materials.