Error: StaticInjectorError[Injector]: when consuming library

Type of Issue
[?] Bug Report
[ ] Feature Request
[x] Help Rquest

Description
Relatively simple error, but i haven't found any solution that works in my case.
i try to package a component library that i created, and everything works fine until i try to include a service which uses Httpclient for get requests.
i've seen several dusin solutions, including --preserveSymlinks, a bunch of suggestions,
on where and what to import / DI (HttpModule --> HttpClientModule after 4.4)
Im fairly new to Angular 5, so it might be my inexperience but i could really use some help.
My App.module.ts in library app,
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { SpeedometerModule } from './modules/speedometer/speedometer.module';
import { SpeedometerService } from './modules/speedometer/speedometer.service';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
SpeedometerModule,
],
providers: [SpeedometerService],
bootstrap: [AppComponent]
})
export class AppModule { }
Speedometer.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SpeedometerComponent } from './speedometer.component';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { SpeedometerService } from './speedometer.service';
@NgModule({
imports: [
CommonModule,
HttpClientModule,
],
declarations:[SpeedometerComponent],
providers:[SpeedometerService],
exports:[SpeedometerComponent]
})
export class SpeedometerModule { }
speedometer.service.ts
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable()
export class SpeedometerService {
constructor(private http:HttpClient) { }
test(){
console.log("Hello World");
}
}
ng-package.json
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"whitelistedNonPeerDependencies": ["."],
"lib": {
"entryFile": "public_api.ts",
"externals": {
}
}
}
angular-cli.json
..
"defaults": {
"styleExt": "scss",
"component": {},
"build": {
"preserveSymlinks": true
}
}
Does anyone have any suggestions to what i be doing wrong?
Version Information
Library
ng-packagr: 2.4.1
@angular/*: 1.7.3
typescript: 2.5.3
rxjs: 5.5.6
node: 4.1.0
npm/yarn: 5.6.0

App consuming:
@angular/*: 1.7.4
typescript: 2.4.2
rxjs: 5.5.8
node: 3.2.0
npm/yarn: 5.6.0
_Please include all version numbers that might be relevant, e.g. third-party libraries_

am facing the same issue. any solutions ?

Well, yes i sort of did. But i still don't know what was wrong. i have an idea, but at this point i cant prove it.
So i build my own component library following this guide (https://medium.com/@nikolasleblanc/building-an-angular-4-component-library-with-the-angular-cli-and-ng-packagr-53b2ade0701e),
and it seemed to be "consumed" just fine, because as long as i didn't have any httpclient dependencies in my services. Note, that the consuming app, was a rather big application, which I've been developing for a few months, and i'm fairly new to angular, so there definitely a lot of things that could have gone wrong.
So i build a new library following dherges sample code, (https://github.com/dherges/ng-packagr/tree/master/integration/samples/core/src) and that resulted in a library with a bit different package hierarchy, i consumed the component library in a new fresh project, with no dependencies, and it worked just perfect.
so what i suspect went wrong was some dependencies in my old(bad) project, overlapping, or pointing differently, than the DI's i had in my component library.
If you're all out of suggestions, i would recommend build a small sample of your current library, following the structure of dherges, and consume the library by a fresh newly made app.
If you figure out the actual problem, i would love to hear from you. I've unfortunately gone to far, that it would require a lot of changes to find out more in detail what was wrong.
And im on a deadline with this project.
Good luck to you, and i hope you might find something here that will help you.

Fra: bdonchenko<EMAIL_ADDRESS>Sendt: 12. april 2018 16:24:08
Til: dherges/ng-packagr
Cc: Howisch92; State change
Emne: Re: [dherges/ng-packagr] Error: StaticInjectorError[Injector]: when consuming library (#764)
I have a similar issue. did you solve it?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHubhttps://github.com/dherges/ng-packagr/issues/764#issuecomment-380864251, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APES7UkXFu4-YaNHL2Lh-Sd1Fmb-7nEzks5tn3-ogaJpZM4TRnCG.

Thanks a lot!! I figured out the issue with mine. I had the shared module in my Main app which was published in npm and was consumed by the feature module which was again getting published in npm.
Main consumed the feature module from npm,  but main app included the shared module from the code base rather than the npm causing different dependency for services.
So once I figured this and made sure Main app consumes referes the shared services from the npm shared module rather than referencing from its code base, the issue got fixed.


Issues with reliability and usability of  built in Extension command line commands, and Question about metrics and guidance.

I have been working on a PowerShell Module for working with VSCode Extensions and Metrics. This project got started by looking for a better way to get metrics on Publishers and Extensions. I have a large number of published extension, roughly 300 or so which are mostly themes, and found it was almost impossible to really get any sort of idea on numbers.
My module can be found here VSCodeExtensions
When implementing my Install-VSCodeExtension and Uninstall-VSCodeExtension I first tried to use wrappers around the code --install-extension and code --uninstall-extension. I found it incredibly difficult to work with the built in commands.

The first issue I encountered, is the cmd returns before the JS does, so there is no way to capture the output to error handle. This also might potentially be the reason why PowerShell ISE gets zero output from --list-extensions. If you run the command to get installed extension in the ISE it does not show any output. I felt this issue was related enough for this issue, but if it is not I can open up a separate issue.

When I first started to write Pester tests for my wrappers, I had to stop because the internal wrapped commands weren't reliable enough to test. If you look in that repo will notice, I really don't have any Pester unit/integration tests for that project, and that is because I don't want to write them only to have to change my whole implementation because the internal commands are not reliable. So right now, I have everything written in PowerShell. Gtting installed extensions and versions is just parsing the package.jsons, finding packages I am using the cache url, uninstalling packages I am removing all versions of extension folders, and to install I am getting the asseturi, downloading vsix, unpacking vsix, moving to vscode folder and then renaming manifest and moving to vscode folder. Then I added an update command to find latest installed versions and then check to see if theres an update and updates if available. I like this one for my powershell profile.

Since the output comes from a separate process, I cannot catch the output in a variable for use in powershell.

My solution was to replicate the installation in pure powershell. I can actually control the errors and what causes them. I much prefer this method as I am not dependent on an external cmd file. One thing I did not replicate was the added metadata that is added into the package.json, and I could easily do this for 99% of the data, but there was one field I was uncertain about. The "X-Market-User-Id" I was seeing odd and different results. I look at some, and the value was a long randon string, and then others would be "someValue.machineID". The other issue was the amount of metadata has been inconsistent.
 I know the metadata is not required, but I am not quite sure what that impacts. The other reason is the built in commands are about as basic as they can get. Writing this native in powershell lets me build in pipeline support and ability to query by any property. This allows me to do things like this
Find-VSCodeExtension -ExtensionName * -category Snippets -Tag *type* -PublisherName 'gerane' | Install-VSCodeExtension

How does VSCode handle the metrics for extension installs? I am guessing having this external to the built in command lines is going to break the install metrics, but it just was not reliable enough to use for me. It would be nice if Code offered a native powershell module for Windows, but since I am not so sure that will happen, I was hoping I could get a little guidance on the direction I should go. If anything, maybe I can get some support or potentially work with the PowerShell extension in some way.
One thing I am worried about, is the apis or uris that are currently accessible, might be removed one day without warning.
There is another issue with --uninstall-extension that I will open a second ticket for. It is only uninstalling the latest version. So if you have 6 versions installed, you have to run the command 6 times to actually remove the extension.
cc @daviwil

VSCode Version: 1.3.0-insiders
OS Version: Windows 10

Steps to Reproduce:

Run large number of Install/uninstall extensions
Occasional unexplained failures with no way of knowing cause.

I feel your pain with the wrappers and I'm way out of my league as with trying to understand cmd, call and all their complicated ramifications... One idea you could do would be to mimic what code.cmd itself does: it launches Code.exe resources\app\out\cli.js ARGS with the ATOM_SHELL_INTERNAL_RUN_AS_NODE env variable set to 1. This would surely let you capture its output and wait for its end.
Code recently started cropping the metadata, so we only need the small 3 pairs you mentioned. The bigger snippet was needed in older versions only.
The metrics are fetched live with the Marketplace API. Yes, this API is not published and will change over time. Code doesn't own it, but the Visual Studio family, as it's a feature that runs across the whole family.

Closing this since it is a discussion issue. We can keep talking here.

@joaomoreno did you remove the ability to open files with the command recently? This stopped working in insiders for the last few days.

I don't understand what you mean by the ability to open files with the command, can you elaborate?

I opened this #8947
code-insiders C:\path\to\project or code-insiders.cmd C:\path\to\project would open the project in a new Code window.

or just code-insiders or code-insiders.cmd would open a new Code Window, but now it does now.

This only happens from inside of Code. Works properly from outside of code. This just started happening earlier this week.


Does hugo-prose support multiple level header menu？

I create a folder about and placed two markdown files: file1.md and file2.md in it. So is it possible to add a menu about with two subitem file1 and file2?
Where should I check to understand the underlying mechanism of menu integration in this theme?

It's possible but the CSS might be a little complicated. To define a menu item with children, the child items need to declare their parent. The documentation is here: https://gohugo.io/content-management/menus/ I don't have much experience here, so you may need to find the CSS by yourself.


[Bug]: Tooltip throwing error on SSR

Environment
Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager<EMAIL_ADDRESS>Radix Vue version: 1.0.0
Shadcn Vue version: 1.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework<EMAIL_ADDRESS>Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction
https://www.shadcn-vue.com/docs/components/tooltip.html
Steps to reproduce

Describe the bug
when i  use tooltip into my nuxt project

get this error.
if i use redix-tooltip directly there is no error
Expected behavior
No response
Conext & Screenshots (if applicable)
No response

Hey @zernonia , I noticed this error with a few of the triggers. Was it update for all of them or just for the Tooltip?

@BayBreezy could you point me to which triggers are causing similar issue? I updated a few.. and will look into the real problem today


[FLINK-12171][Network] Do not limit the network buffer memory by heap size on the TM side

What is the purpose of the change
This pull request fixes the bug that limits the network buffer size with the heap size on the TM side. In fact, network buffer occupies a part of direct memory and is independent with the heap.
To fix this problem, The limitation on the TM side is removed. Although we may want to compare the network memory size with the total memory size on the TM side, currently we can only compute the total memory with heap + computed network memory and the computed total memory should be always larger than the computed network memory.
To remove the limitation, the max allowed memory used to check the network memory size on TM side is changed to Long.MAX_VALUE. Another option is to move the checking to the caller function on the RM side. however, it is not easy to achieve since the checking relies on the configured values of MIN and MAX, and it is not accessible outside of the current function.
Brief change log

f32dde51c1183d22e8a192e19d037a4f0c48c9ae extracts common variables to simplify the tests.
17f93e19b39433dc5d93c24c5b8a85feb1c37b1f fixes the exception when network buffer fraction is larger than 0.5 on TM side, and adds new tests to cover the cases that the network buffer fraction is larger than 0.5
2762ce8f219b8b988d9824a8beab5c6117119403 optimizes the computation of the network memory on TM side to fix the numerical precision problem.
aa5c15913e411babe2bf5cc3067cdbb112d57fd0 unifies the terminology in NettyShuffleEnvironmentConfiguration

Verifying this change
This change added tests and can be verified as follows:

Add tests for network buffer computation with fraction > 0.5
Manually verified the change by running a cluster with two task managers for both standalone and YARN mode, and test the configuration with heap = 3G/network = 2G and heap = 5G/network = 2G.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): no
The public API, i.e., is any changed class annotated with @Public(Evolving): no
The serializers: no
The runtime per-record code paths (performance sensitive): no
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no
The S3 file system connector: no

Documentation

Does this pull request introduce a new feature? no
If yes, how is the feature documented? not applicable

Very thanks @NicoK for the review and sorry for missing the tests. I will address the comments and complement the tests right now.

Hi @NicoK , very thanks for the review ! I have updated the PR to address the issues.

Very thanks @NicoK review the codes! I have merged the two related commits, and fixed the indentation problem.


fr- Add information about population

Add information about a country's population

You once wrote a scraper for the data you're using currently. Swept through your repos, can't find it.
Could you show me where with link.

Alright. No problem
https://github.com/mrbazzan/populate_pynation


App serve with SSR ERROR m [Error]: NG04002: 'robots.txt'

Command
serve
Is this a regression?

[X] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was
16.2
Description
When I build an angular project with SSR (ng build), and then run it with the command npm run serve:ssr:angular-bug, each time when I open a link on the local host I get an error in node console:
ERROR m [Error]: NG04002: 'robots.txt'

This happens only when I open the link with Firefox Browser (Firefox Developer 123.0b2 (64-bit)). Opening localhost:4000 on Chrome or Safari doesn't trigger this error.
Minimal Reproduction

Create a new project with SSR using Angular CLI
Build it with ng build
Run serve command  serve:ssr:angular-bug.

Then open the server link http://localhost:4000. The error will be shown in the node console.
Minimal repo to reproduce: https://github.com/armingdev/angular-bug
Exception or Error
npm run serve:ssr:angular-bug

><EMAIL_ADDRESS>serve:ssr:angular-bug
> node dist/angular-bug/server/server.mjs

Node Express server listening on http://localhost:4000
ERROR m [Error]: NG04002: 'robots.txt'
    at pc.noMatchError (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:35:56595)
    at file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:35:57289
    at file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:16385
    at Ei._error (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:5478)
    at Ei.error (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:2583)
    at Ei._error (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:2823)
    at Ei.error (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:2583)
    at Ei._error (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:2823)
    at Ei.error (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:2583)
    at Ei._error (file:///Users/armingerina/Code/gamers.ba/angular-bug/dist/angular-bug/server/chunk-SNCOUTZD.mjs:4:2823) {
  code: 4002
}

Your Environment
MacOS:
Sonoma 14.3

Node Version:

node -v
v20.11.0

Angular Version:

ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 17.1.1
Node: 20.11.0
Package Manager: npm 10.2.4
OS: darwin arm64

Angular: 17.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.1
@angular-devkit/build-angular   17.1.1
@angular-devkit/core            17.1.1
@angular-devkit/schematics      17.1.1
@schematics/angular             17.1.1
rxjs                            7.8.1
typescript                      5.3.3
zone.js                         0.14.3

Anything else relevant?
package.json:
{
  "name": "angular-bug",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "serve:ssr:angular-bug": "node dist/angular-bug/server/server.mjs"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^17.1.1",
    "@angular/common": "^17.1.1",
    "@angular/compiler": "^17.1.1",
    "@angular/core": "^17.1.1",
    "@angular/forms": "^17.1.1",
    "@angular/platform-browser": "^17.1.1",
    "@angular/platform-browser-dynamic": "^17.1.1",
    "@angular/platform-server": "^17.1.1",
    "@angular/router": "^17.1.1",
    "@angular/ssr": "^17.1.1",
    "express": "^4.18.2",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^17.1.1",
    "@angular/cli": "^17.1.1",
    "@angular/compiler-cli": "^17.1.1",
    "@types/express": "^4.17.17",
    "@types/jasmine": "~5.1.0",
    "@types/node": "^18.18.0",
    "jasmine-core": "~5.1.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.3.2"
  }
}

Does your firefox request a robots.txt on everyweb site ?
Do you have any extension that might do that ?

Does your firefox request a robots.txt on everyweb site ? Do you have any extension that might do that ?

It's happening even if I open this link in a private window, without any extensions. Also, this is not happening when I run a project with ng serve.

There’s nothing in Angular that specifically requests robots.txt. Your application routes do not have a fallback or configured response to this request path. Closing as expected and an issue outside of Angular.

There’s nothing in Angular that specifically requests robots.txt. Your application routes do not have a fallback or configured response to this request path. Closing as expected and an issue outside of Angular.

fallback route fixed it. Maybe this should be in docs also. Thanks


KA-426 Support technical articles

Content types code_sample, code_samples, and instructions are now being properly indexed.
The task is ready for review.

I took the liberty to convert the internal marks to constants.


4.4.X minimum version iOS 17.0

Hello,
I recently updated the objectMapper, but I noticed that the minimum version requirement is set quite high. Could it be lowered?
Version 4.3.0 had iOS 13 as its minimum, but starting from 4.4.0, it's been raised to iOS 17. Is there a specific reason for this change?
ObjectMapper.podspec

#1146
I've confirmed that the changes have been made! I will close this issue now!


Should have stricter checking of symbol names

Current code checks only that symbol names cannot contain whitespace.
It seems to me that you should also exclude punctuation symbols used by the Lizzie language: (){} and comma.

Actually, in regards to the (){}, characters, finding one of these in the place where I suspect you're looking (SanityCheckSymbolName?) would be theoretically impossible, since at this point if the code contained such characters, the tokenizer would have create a new token - So adding a check for these characters would be a redundant check, and simply use additional CPU, for no purpose - Unless somebody have create their own Tokenizer, which is possible though, but highly unlikely, and if they do, they'll probably tokenize similarly according to these characters ...
Basically, checking for anything we're checking for here, is due to Lizzie's tokens definition redundant, since it would be logically impossible to encounter any of these characters as a part of a symbol name, since the tokenizer would then have stopped interpreting it as a single token, and declared it as three tokens (separated by the special character, e.g. {)
E.g.
foo{bar

Becomes 3 tokens ...

foo
{
bar

So a symbol could never, not even in theory, contain such characters ... :)


Error messages, I18N and Namespaces

Reform 2.0 does support lotus-validations and I will push towards making this the default implementation. Thanks for this. :heart:
As discussed with Luca, I'm currently designing the process of generating an (i18nized) message string from an Error object. I do this in Reform first, and will then extract it to this gem.
Consider the following object for a nested field band.label.name.
#<Lotus::Validations::Error:0x007fb6d5b48aa0 @attribute_name="name",
  @validation=:presence, @expected=true, @actual=nil,
  @namespace="band.label", @attribute="name">]}

In order to translate this, I propose the following I18N paths (please comment!).
form.band.label.name.blank
form.band.name.blank
form.name.blank

Don't worry about the prefix form., this could be anything and is just an example.
Another thing is: How to name the suffixes, e.g. blank? This has to be computed from Error by looking at @validation and @actual, so we need to specify translation suffixes for validation/result tuples.
Any input?

So, to make it a bit clearer: The API I'm dreaming of is as follows.
error #=> <Lotus::Validations::Error @attribute_name="name", ..., @namespace="band.label">

error.to_s
# invokes
error.to_i18n_s # or something like that
# will compute the aforementioned i18n paths, find the string, etc. and RETURN AN ERROR MESSAGE.

My point here is that Reform will be responsible to provide the @namespace, then calls Error#to_s and the rest happens in Lotus. Is that cool?

@apotonick Thanks for following up our discussion.
My idea for Lotus::Validations as a standalone lib, was something like this:
if defined?(I18n)
  def to_s
    I18n.translate(i18n_key, message)
  end
else
  def to_s
    message
  end
end

private

def i18n_key
  # ...
end

def message
  # ...
end

If I18n gem is present, try to find a translation for the given i18n_key (eg. "form.name.blank"), otherwise fallback to message. This last method is a default error message, such as "Name can't be blank".
I'd get rid of #to_i18n_s. Imagine you're iterating a collection of errors how to decide which method to use? By exposing only #to_s has the advantage of doing this error presentation always using the same method.
By overriding #to_s we can leverage the fact that template engines will call that method implicitly.
<% form.errors.each do |error| %>
  <%= error %> <!-- implicit #to_s call -->
<% end %>

To recap, L::V is able to compute default english error messages (#message), devs can customize a message via I18n or fallback to the standard message. All this logic is exposed via #to_s.
Sounds good? @apotonick @lotus/core-team

Oh yeah absolutely, @jodosha ! I as a Trb representant am only interested in the #to_s method, so I'm totally fine with a conditional to_s as long as I get a message back! :wink:
The to_i18n_s was more a conceptual thing...
Anyways, what about the namespace? Would that work for you the way I specified it? I don't really care about the details which paths get searched when, etc, but if you're fine I will implement a prototype and then we'll see? :sparkles:

@apotonick
Namespace
For the namespace there is a pending issues about composable validations.
If we have a module EmailValidations that is included into Signup. Which is the expected starting value for the namespace: email_validations.* or signup.*? What if I want to have two different messages for these two cases? If we exclude the class/module name from the first value of the namespace, we can do something clever with I18n scopes.
I18n.translate(i18n_key, scope: namespaces, default: message)

puts i18n_key       # => "email.presence"
puts namespaces # => ["signup", "email_validations"]
puts message       # => "Email can't be blank"

In this way if a translation for signup.email.presence is defined it will return it, otherwise it will try with email_validations.email.presence or eventually fall back to the default message.
Validation names
Regarding the validation names, I'd stick with the ones who are already implemented. For instance, instead of using blank, we should use presence. In this way developers can have a symmetry between the names that they use to define the validations and their counterpart error messages.
Eg.
class Signup
  include Lotus::Validations

  attribute :email, presence: true
end

It will correspond to the following custom message:
en:
  signup:
    email:
      presence: "Email can't be blank"

What do you think?

Reverse order:
Validation names
The less mapping, the better! Happy to use presence instead of blank, etc. Let's see where we go, I will play with it tomorrow.
Namespaces
I do not really understand how composable validations are related to namespaces? :confetti_ball: The :scope option of I18N is perfect, thanks for pointing that out.
Let me play with it a bit, we're on the same page and once we got some examples we can figure out details, e.g. where do class names go, etc. Thanks :beers:

I do not really understand how composable validations are related to namespaces?

I assume that the top level entry for a namespace is the name of the class. Eg. if you have Signup that includes L::V, the namespace will start with signup and the complete name will be signup.email.presence etc..
 As a dev, I want to have the freedom to define the message once, but be able to specify an exception. Let me put in code terms. If I have a module like this:
module EmailValidations
  include Lotus::Validations

  attribute :email, presence: true
end

Then I define I18n message for it.
en:
  email_validations:
    email:
      presence: "Please enter email"
  signup:
    email:
      presence: "Email address is missing"
    age:
      inclusion: "You must be at least 18"

So I can reuse it in a few places:
class UpdateUserDetails
  include EmailValidations
end

class ForgotPassword
  include EmailValidations
end

validator = UpdateUserDetails.new(email: nil)
validator.valid? # => false
validator.errors.first.to_s # => "Please enter email"

# ..and

validator = ForgotPassword.new(email: '   ')
validator.valid? # => false
validator.errors.first.to_s # => "Please enter email"

Now I have a Signup validator, but I want to specify a different message, because the key en.signup.email.presence is defined, I expect it to be used.
class Signup
  include Lotus::Validations
  include EmailValidations

  attribute :age, inclusion: 18..999
end

validator = Signup.new(email: nil, age: 1)
validator.valid?
validator.errors.first.to_s # => "Email address is missing"
validator.errors.last.to_s  # => "You must be at least 18"

If we're able to track both the module where it was defined (eg EmailValidations) and the current class (eg Signup) and use them as I18n scopes, we can make working the scenario described above.

Having error objects knowing how to dump themselves into a string message sounds cool but it's not gonna be so nice when you want a complex error message that needs more context than just the plain error object. I believe having a separate error obj => error msg mapping layer could be more powerful and simpler. Otherwise you're gonna add a lot of logic to errors making them too big and complex.

This is from a localization and translation planning document that I spent some time on:
Localization and Translation
The processing actions are represented through a Form object.
Each form object is associated with a processing entity.
At present processing entities represent one of three things:

Sipity::Models::Work
Sipity::Models::WorkArea
Sipity::Models::SubmissionWindow

Instead of managing all of localizations of the different form objects through separate translation keys,
I want to see these unified and predictable.
I am assessing the gnarly localization/translation needs:

Form Labels for input fields on "command pages"
Form Hints input fields on "command pages"
Show Labels for predicates on "query pages"
Form Error Messages on "command pages"

As I've looked through the implementation of ActiveModel::Name and SimpleForm
there are a few things:
Form Labels
SimpleForm uses the :object_name derived from the :as option or #param_key.
This is known as the form's object_name.
When posting a form, the object_name is the hash key for the posted attributes.

simple_form_for :user would be 'user'
simple_form_for @user would be 'user' (assuming User.model_name.param_key == 'user')
simple_form_for @user, as: :ketchup would be 'ketchup'

If there is no hit on the object_name and attribute name SimpleForm will try
the defaults and attribute name.
If that fails, SimpleForm will pass the responsibility up to the object class's human_attibute_name method.
(Yes, the Law of Dememeter is being violated with that concession).
For Hints
As the Labels, but there is no fallback on human_attribte_name of the object's class.
Show Labels
The logical method is to fallback on the human_attribute_name of the object's class.
Form Error Messages
Leverages errors from the underlying model, which in turn goes through the .lookup_ancestors of the object's class.
Plan
For each Form object, expose a #model_name object.
That #model_name object would return an ActiveModel::Naming instance that was built with an object that responds to:

#name (and returns the concept it was using: Work, SubmissionWindow, WorkArea)
#lookup_ancestors (and returns [], is that correct?)
#i18n_scope (and returns the correct scope)

This leverages the implementation details of ActiveModel::Name.
I am hesistant to choose this implementation, but I'd prefer this over implementing the ActiveModel::Name interface.
If I implemented the ActiveModel::Name interface I would miss out on the fallback of human_attribute_name; Which will
rescue me from insanity.
Going forward, I would want to push the :hint behavior to the form object:
<%= f.input :title, hint: f.object.hint(:title) %>

And here is the implementation.
I opted to take inspiration from RDF regarding nomenclature (http://www.w3.org/RDF/).

@solnic Really good point! What about a very very very basic #to_s implementation? You can still use the Error instances outside if you want to compile complex messages that need multiple errors.
We do that in Reform all the time: run custom validations that access errors and then add new, "custom-made" errors.
@jeremyf I would refrain from using the ActiveModel API - I find it incredibly convoluted and complex, especially the lookup_ancestors is simply not the right place in a validator object. Is that the right thread for this to talk about that? :grin:

@solnic @apotonick Which is the integration point for that? I remember you that the basic goal is to provide a simple usage like this:
<% validator.errors.each do |error| %>
  <%= error %>
<% end %>

This will give the power of get both standard or customized error messages.
Because Error has informations such as attribute name, nested namespace, violated validation, expected and current value. One solution could be that devs will present errors according to their custom logic: eg <%= print_error(validator, error) %>.
I'm open to code suggestions for advanced cases. But again keep in mind that we aim for trivial usage for developers. :wink:

I wouldn't make error responsible for coercing itself to string and I don't really care it'd be "idiomatic ruby". Generating error messages can be pretty complex and I'd prefer to have a separate object responsible for that. I would also prefer to have one way of serializing errors into string messages vs "oh, if it's simple you just to_s otherwise you do something else" because it would result in more complexity (you would have to make error responsible for simple string coercion and build something else for complex cases too, pointless IMO).
Regarding "trivial usage" - look how ActiveRecord ended, it's been always optimized for being (seemingly) simple. Pretty DSLs on top of tons of complexity, as somebody tweeted recently, is not the way to go :)
As far as code suggestions goes, if we're talking about generating HTML with error messages I believe a simple decorator would be an elegant solution:

# excuse that really horrible name, just showing the concept
<% ErrorHTMLPresenter.new(errors).each do |error| %>
  <% error %>
<% end %>

Notice that with a decorator approach you can add a lot of really nice and convenient functionality w/o cluttering the error object. IE you can configure error html templates, so that a list of messages is formatted properly etc. A lot can be done easily and error API would stay simple.

I like your point about not polluting the Error#to_s method, @solnic.
What about this?
class Error
  def to_s
    Renderer.new(self).()
  end

This delegation is minimalising the pollution of Error and, at the same time, allows other decorators to be used.

@apotonick this couples error to a specific renderer implementation :(

@solnic Yeah but somewhere the messages need to be compiled per default, and as I said, you could do as follows if you don't like my specific renderer.
Formtastic::Errors::Renderer.new(errors).()

@apotonick wdym that they need to be compiled per default? they need to be compiled whenever you need to display them, so I don't see any reason why you would want to couple to_s to a specific rendering implementation.

Haha I love this discussion! :laughing:  Lotus has to ship with one specific implementation, otherwise the validations are useless for most people - you can't tell people to write their own message compilation with I18N, etc. (is that what you mean or am I wrong here?).
I totally agree that this should not sit directly in Error#to_s but in a separate renderer class. Now, all we need to do is connect errors with renderer, and I don't see why this is problematic to do so in Error#to_s, given that you could easily change the default renderer???

If you do def to_s; Renderer.new; end then it doesn't feel like it's easy to swap with a different strategy. I'm also not sure why lotus has to ship with one specific implementation. To me it seems like an integration thing - lotus-validations can be integrated with a view rendering layer or a json api layer etc.

@solnic @apotonick I see in this case #to_s as a textual, human friendly representation of the internal state of the error object. For this I don't see nothing wrong to implement this strategy there.
Well, in an ideal world I would have chosen a presenter strategy like:
ErrorPresenter.new(error).to_s

But, this isn't possible because there isn't a hook mechanism to do this internally. The only solution that I see at the moment is to use a syntax like this:
<% validators.errors.each do |error| %>
  <%= ErrorPresenter.new(error) %> <--! #to_s is implicitly called by ERB -->
<% end %>

For me this syntax is a :-1: because too verbose. However, devs are free to implement their own presentation strategy, by wrapping the error and not relying on #to_s.

If you do def to_s; Renderer.new; end then it doesn't feel like it's easy to swap with a different strategy.

Because Error is an object that is instantiated internally to a validator, there isn't an easy way to apply Dependency Injection. One way could be to accept a class that represent the error type that we want to use. Eg Signup.new(error: MyCustomErrorType). But this will make things complicated when the validator isn't explicitly instantiated by the dev. This is the case of Lotus::Action's params.

I'm also not sure why lotus has to ship with one specific implementation.

Well, if we don't ship one specific implementation means two things:

No error messages at all
Support for an error message presenter interface to be implemented by developers.

Because this is a common problem, it's up to a framework to solve it (like @apotonick suggested).
@solnic I'm still struggling to understand, what's your idea for error messages, from a syntax perspective. Again, I value a lot your opinion, that's why I'd love to hear more from you. Thanks.

lotus-validations could ship with integration for various use cases like rendering error messages in html templates, json responses, using I18n etc. There's absolutely no need for Error#to_s to exist except for debugging inspection maybe.
You can have an "error rendering plugin" for validators that could do something like validator.error_messages.each but keep errors pure.
Also remember that errors can be nested, messages may require data from other nodes and in general this is a pretty complicated problem. Trying to convince yourself that it can be solved as a simple to_s as a default behavior "because it's simple" doesn't feel right :) For me it's a rabbit hole right there. Hence I'm suggesting an external API to handle that and using error objects as simple pure data/information providers without much logic.

My two cents:
I don't think that to_s is the right way to get i18n aware error messages. Error objects should just contain the information that can be used to render a user friendly error message.
If the syntax for views is too verbose, then this can be solved by a helper.

So today, is there any way at all to specify a custom user-facing error message with lotus validations? I'd love to at least consider using it, but this would be a deal breaker if there isn't any way at all yet. At least until this gets solved.

@sockmonk not atm

I started working on it yesterday, here is my fork branch: https://github.com/trailblazer/lotus-validations/tree/error-messages

@apotonick I want to :kiss: you

@apotonick can you please create a PR so we could follow your progress? TIA

Once it's presentable! :kiss:

Hey, anything we can do to help ship this?

@fbernier I've started working on this. Please have a look at: https://github.com/lotus/validations/tree/error-messages

Closed by #100


Support for Intellij 2021.1

Hello
Today I updated my Intellij and lost support for the plugin.
Here is the build version

Any plans to some update?
:)

@tauba the release is pending approval, it should be available within a few days


Redis brain

So, I was getting the sparse hubot tests to run, when I thought "Why do I need redis for local dev?"
The basic Robot.Brain has no persistence.

@technoweenie I'd like something like the file persistence to be a user script, it should be pretty easy to implement.
I'm kinda tired and don't fully grok this, I'll bug you about it tomorrow.


Question: Google Analytics

Hi there,
Just noticed after each return from a locally served SD run, the addon is sending something to google analytics? , Can you tell me what's being sent here please? - Thanks!

Yes, I added google analytics last week, so I can watch for errors and have a general sense of usage. It's sending meta/usage info only - never the prompt or image!
You can see exactly what it's sending here: https://github.com/benrugg/AI-Render/blob/e81ad4976d339ba585c379ac85152ed914d483e1/analytics.py#L126

Hi, Thank you for the clarification!


Reorder <For /> apply_diff steps

This PR fixes more edge cases with apply_diff by reordering steps and simplifying unpack_moves.

My only request — could you let me know the edge cases, or add them to test-bench, so we continue to have a good set of cases to make sure there are no regressions? Obviously with the additional PRs we hadn't thought up all the possible issues, so adding them as we discover them is good for regression testing in the future.

Excellent! This is exactly what I wanted.

I'll go ahead and change ` to take an iterator of vecs so we can test all the cases more thoroughly.


Drop Prebuild

It is time.  It took me a lot of work to make the result actually compile* under Ubuntu 16.04 with the FlatPak install of MonoDevelop 7.3.3.
Note I specifically did not attempt to add NuGet dependency management: that's a totally separate project with its own complexities.
I've also not added a bunch of rules to the solution/project files that I think could be added, I just took the output of prebuild and made the edits I needed to make it work.

Although I had to also remove the __MonoCS__ compiler checks too, not committed here as they cause other problems.  As such they'll be a separate PR.

Looks like I need to fix something though: the AppVeyor build failed because it was unable to find LMV for some reason. Though that should be right there in the bin.

AppVeyor is still failing, but on something that should exist under Windows/.NET builds.  Odd.

I'll pull the branch anew and see if I have a similar build problem.

Looks great. Built without trouble, everything starts and runs and login successful.
Time to clean up the runprebuild stuff after this. Woot! \o/


Add the frame rotation cost + improve description of cost classes - [merged]

In GitLab by @cmastalli on Apr 22, 2019, 15:51
Merges topic/frame-rotation-cost -> devel
This PR includes the cost model for frame rotation. Despite that this kind of cost can be implemented through CostModelFramePlacement, it's very inefficient.
I have some unmerged code that uses this type of cost functions.

In GitLab by @cmastalli on Apr 22, 2019, 22:55
changed the description

In GitLab by @cmastalli on Apr 22, 2019, 22:55
assigned to @proyan

In GitLab by @proyan on Apr 25, 2019, 14:34
Could you also please add a unitttest?

In GitLab by @proyan on Apr 25, 2019, 14:42
How about this:
It defines a template of cost model whose residual and derivatives can be retrieved from Pinocchio data, by the calc and calcDiff functions respectively. Pinocchio data is not updated by calc, or calcdiff, and should have been updated beforehand.

In GitLab by @nmansard on May 3, 2019, 11:18
could we conclude on this MR?

In GitLab by @cmastalli on May 3, 2019, 12:30
changed this line in version 2 of the diff

In GitLab by @cmastalli on May 3, 2019, 12:30
added 2 commits
7b3afbb2 - [unittest] Added CostModelFrameRotation unit-testfa83124f - [cost] Improved the documentation of CostModelPinocchio + fixed few common grammar mistakes
Compare with previous version

In GitLab by @cmastalli on May 3, 2019, 12:30
Done!

In GitLab by @cmastalli on May 3, 2019, 12:30
resolved all discussions

In GitLab by @cmastalli on May 3, 2019, 12:32
added 9 commits
fa83124f...62d3d0cd - 5 commits from branch loco-3d:devel27c58668 - [cost] Added a cost for frame rotations9006f283 - [doc][cost] Improved a little the comment inside cost functionsbae81546 - [unittest] Added CostModelFrameRotation unit-testd0f7199a - [cost] Improved the documentation of CostModelPinocchio + fixed few common grammar mistakes
Compare with previous version

In GitLab by @cmastalli on May 3, 2019, 12:35
added 1 commit
ea3db862 - [format] Fixing error in the unit-test format
Compare with previous version

In GitLab by @cmastalli on May 3, 2019, 12:36
added 1 commit
02bdeef8 - [format] This is boring, really!
Compare with previous version

In GitLab by @cmastalli on May 3, 2019, 12:57
added 1 commit
1d56471d - [format] Fixed unit-test format
Compare with previous version

In GitLab by @cmastalli on May 3, 2019, 12:58
@nmansard I have added the unit-test. You can merge it

In GitLab by @cmastalli on May 3, 2019, 12:58
assigned to @nmansard

In GitLab by @cmastalli on May 15, 2019, 18:04
I will merge this PR since there is not any extra remark to be fixed.

In GitLab by @cmastalli on May 15, 2019, 18:04
merged

In GitLab by @cmastalli on May 15, 2019, 18:04
mentioned in commit 918a8929bc9fcb605d177a9bd2bf5233dbfaf35f


Improve BLE_LEDBlinker example.

Change the criteria used to identify the PEER. Instead of using the mac
address, the example now use the complete local name.
Update the documentation.

@rgrover  Could you review this ?

Thanks, for your comments, I have updated my PR.
i should be incremented by record_length at the end of the loop. Then, the loop statement will increment it by 1.

@rgrover Could you review my changes ?

thanks. looks good.


[FEATURE] Java client compatible with OpenSearch 3.0.0

Is your feature request related to a problem?
We are building OpenSearch 3.0.0 at this point. Java client is not available for the same.

This is needed because of the high level REST client being used. Let's ensure a  2.x branch with backport workflows.

3.0.0-SNAPSHOT for the java client is now available. Resolving this issue.


glBindVertexBuffers(0, 1, NULL, NULL, NULL); crashes

According to the OpenGL wiki the array buffer can be decoupled from the VAO if I call glBindVertexBuffers(0, 1, NULL, NULL, NULL) when creating it.
RenderDoc tries to read these NULL pointers and crashes.

The spec does indeed allow for that, but I'm not entirely clear where the crash lies. A fix for this was submitted in PR #351 and as far as I can tell it's still protected. There are checks here and here where the pointers would otherwise be dereferenced, so on the face of it I can't see where the read of NULL would be.
If you have a repro of this crash can you give more information about where exactly the NULL read happens, and if possible share a program that exhibits the crash?

Oh! I'm blind - the check for offsets/strides is backwards. It should be buffers ? (uint64_t)offsets[i] : 0 and similarly for strides. I'll fix this, thanks for the report.

I believe that should fix the crash on v0.x and v1.x branches. Can you let me know if you still have trouble with the next nightly build? Or if you're able to build locally and test all the better :).

The fix you suggested actually solved the problem, so I'm pretty sure it will be fine.


feat(generate): add guard generation

@hansl, could I get a re-review? Thanks!

@hansl could I get a rebuild on travis and appveyor? Please and thank you!

@delasteve there seems to be some broken tests with your latest changes.


How to validate object graph as an automated test outside of Unity

I am creating an external library (that will be later used in Unity) using Extenject. I would like to check if I can successfully resolve bind objects using an automated test. Eg. I have the following:
container.Bind<TBind>().To<TTo>().AsSingle();
To test this simple graph I can just call
container.Resolve<TBind>()
and see if there is any exception thrown.
However this is getting much more complicated once using constructs like WhenInjectedInto.
Is there any out-of-the-box solution for this? Or has someone wrote their own working solution and would like to share?
I realize, that there is a Validator when using Extenject withing Unity. But I want to validate the graph without Unity.

As far as I can see, you'd need to construct the DiContainer with isValidating = true, and then call ResolveRoots() once your bindings are in place. I've never used Extenject outside of Unity, so I'm not exactly sure how this would work, or if I'm missing some other details.

Yes, what @sbergen said.  Also, make sure you set the validation error response to 'throw' instead of logging, if executing inside unity tests.  Also note the RootResolveMethods field.
For example:
var container = new DiContainer(true);
container.Settings = new ZenjectSettings(
    ValidationErrorResponses.Throw, RootResolveMethods.All);

// Add bindings

// This will throw if validation fails
container.ResolveRoots()

The RootResolveMethods will determine whether it only validates the actual object graph (constructed based on the NonLazy root bindings) or whether it will attempt to resolve all bindings regardless of whether they are inside the object graph or not.


[GROOVY-9109] GroovyShell: don't override classloader if parent is al…

…ready GroovyClassLoader

@paulk-asert Would it be possible merge this for the upcoming release of 3.0.0-beta-2?

@paulk-asert @danielsun1106 can we get this into upcoming 2.5.8 release, please?

We will merge PRs into branches, so just submit PRs to master ;-)

Okay, understood. Closing this.


[improvement](disk balance) Impr disk rebalancer sched when be load r…

…ebalancer idle
Proposed changes
When use be load rebalancer, even after balanced, some backends load scores may be low or high. It will stop disk rebalancer working. Impr: when use be load rebalancer, if its cache empty for 10 min, then all the backends will try to do disk balance.

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall

run buildall

run buildall

run buildall

run buildall

run buildall


"--use_strict" does not work because of .dasherize call

It currently isn't possible to set the node/io.js use_strict flag.
Is it an option to modify this composition or would that break something else?

What about it breaks strict mode?

Oh nvm. Sorry about that. I thought that the plugin would explicitly create a node instance instead of calling the compiled mocha binary and that I could simply use node flags.
Should've read the readme more thoroughly before. :sweat:


Vue 2.7 SFC

<template>

    <form>
      <input v-model="form.foo" />
    </form>

</template>

If we change the name of the form reactive property to something else (e.g myForm) the <form> will be rendered as expected.
// HelloWorld.vue

<template>

    <form>
      <input v-model="myForm.foo" />
    </form>

</template>

冲突了这是。


1.1.0 Release

Release Notes draft

Python 3.5 support dropped. 3.9, 3.8 Added.
Raise IndexError instead of assertion ( #136 )
Introduce physical size limit to file cache ( #143 )
In FileCache, index file and data file are merged to one ( #145 )
Change behaviour of size limit exceed, and allow cache file overwrite (#138)

This release came into real definitely by @belltailjp . Thanks a lot!


Add evening to tasks

One feature I really loved about Thingsapp was the ability to separate tasks into day and evening tasks. I found this helpful for organizing work & home responsibilities and tasks.

Codecov Report

Merging #5 (6f9485a) into master (5071193) will increase coverage by 0.07%.
The diff coverage is 93.33%.

@@             Coverage Diff              @@
##             master       #5      +/-   ##
============================================
+ Coverage     86.69%   86.76%   +0.07%
- Complexity      253      258       +5
============================================
  Files            26       26
  Lines          1022     1035      +13
============================================
+ Hits            886      898      +12
- Misses          136      137       +1

Impacted Files
Coverage Δ
Complexity Δ

src/Model/Entity/Task.php
0.00% <ø> (ø)
2.00 <0.00> (ø)

src/Model/Table/TasksTable.php
89.86% <92.85%> (+0.15%)
32.00 <0.00> (+5.00)

src/Controller/TasksController.php
72.52% <100.00%> (+0.30%)
22.00 <0.00> (ø)

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 5071193...8bfb29d. Read the comment docs.


Incorrect tooltip styling

Title line template: [Title]:
In the latest carbon-components, the .bx--tooltip div has align-items: flex-end; . This is making the tooltip content to be displayed right aligned.  It should be align-items: flex-start;.
Detailed description
In the latest carbon-components, the .bx--tooltip div has align-items: flex-end; . This is making the tooltip content to be displayed right aligned.  It should be align-items: flex-start;.

Is this issue related to a specific component?
Tooltip
"carbon-components": "^9.61.1",
"carbon-components-react": "^6.59.0",

<EMAIL_ADDRESS>cc @jnm2377

Tagging @aledavila since you worked on this, but I think the fix would be to specifically set styles on .bx--tooltip__footer instead of .bx--tooltip div which is what we are currently doing. So its causing any div to align to the bottom. 🤔

@Dr-KiranJogu as @asudoh mentioned, the align-items: flex-end is making the items all align at the bottom as opposed to the top. I just want to clarify your issue, though. When you said all the content was justified to the end of the div, did you mean "end" as in right-aligned or "end" as in bottom-aligned? I just wasn't sure from your image if the problem was that you wanted to have the bold content on the left side, or you wanted the content at the top.
Pasting this image from slack for reference on what his issue was @alisonjoseph @aledavila @asudoh

the issue with this styling is … all the tooltip content is justified to the end of the div

Thanks @alisonjoseph.
@Dr-KiranJogu Just to clarify flex-end is applying to the footer div and needs it, but I've changed styles so it directly applies to only footer and not other divs.

Hi @aledavila ,
Thanks for fixing the issue.
The flex-end is getting applied to all the div s in the .bx--tooltip. The following figure clarifies that.
Your fix (above pull request) will solve this issue as it directly applies to only footer and not other divs.
Please let me know in which version the fix will be available, once the fix is merged.  Thanks

@Dr-KiranJogu bug fix has been merged. should expect to see it shortly.


feat(headers): impl Eq for ContentType

#1071

Thanks! I think the issue in #1071 was instead that the user was comparing &ContentType == ContentType... Still, this code is correct, so merged!


remove right margin from default layout header

removes the margin on the right side of the kebab

@ItsMeBrianD linter is failing on query store? 🤔

Checking this now, not sure why it's just now popping an issue up


Option to run with float32 precision on CPU

I borrowed the code from predict.py, to write a langchain PDF loader using Nougat.

Full nougat_loader.py
from functools import partial
from typing import Optional, Iterator
import re

import torch
from tqdm import tqdm
from torch.utils.data import DataLoader
from langchain.docstore.document import Document
from langchain.document_loaders.pdf import BasePDFLoader

from chatdocs.logger import logger

class NougatPDFLoader(BasePDFLoader):
    """Load `PDF` files using Nougat (https://facebookresearch.github.io/nougat/)."""

    def __init__(self, file_path: str, *, headers: Optional[dict] = None) -> None:
        """Initialize with file path."""
        super().__init__(file_path, headers=headers)

        try:
            from nougat import NougatModel
            from nougat.utils.checkpoint import get_checkpoint
            from nougat.utils.device import move_to_device
        except ImportError:
            raise ImportError(
                "`nougat` package not found, please install it with "
                "`pip install nougat-ocr`"
            )
        checkpoint = get_checkpoint("nougat", download=True)
        self.model = NougatModel.from_pretrained(checkpoint)

        if torch.cuda.is_available():
            self.batch_size = int(
                torch.cuda.get_device_properties(0).total_memory
                / 1024
                / 1024
                / 1000
                * 0.3
            )
            if self.batch_size == 0:
                self.batch_size = 1
                logger.warning("GPU VRAM is too small. Computing on CPU.")
        elif torch.backends.mps.is_available():
            self.batch_size = 4
        else:
            self.batch_size = 1
            logger.warning("No GPU found. Conversion on CPU is very slow.")

        self.model = move_to_device(self.model)
        self.model.eval()

    def load(self) -> list[Document]:
        """Eagerly load the content."""
        return list(self.lazy_load())

    def lazy_load(
        self,
    ) -> Iterator[Document]:
        """Lazily load documents."""
        import pypdf
        from nougat.utils.dataset import LazyDataset
        from nougat.postprocessing import markdown_compatible

        try:
            dataset = LazyDataset(
                pdf=self.file_path,
                prepare=partial(self.model.encoder.prepare_input, random_padding=False),
            )
        except pypdf.errors.PdfStreamError:
            logger.info(f"Could not load file {str(self.file_path)}.")
            return

        dataloader = DataLoader(
            dataset,
            num_workers=0,
            batch_size=self.batch_size,
            shuffle=False,
            collate_fn=LazyDataset.ignore_none_collate,
        )

        predictions = []
        page_num = 0
        for sample, is_last_page in tqdm(dataloader):
            model_output = self.model.inference(
                image_tensors=sample, early_stopping=True
            )
            # check if model output is faulty
            for j, output in enumerate(model_output["predictions"]):
                if page_num == 0:
                    logger.info(
                        "Processing file %s with %i pages"
                        % (dataset.name, dataset.size)
                    )
                page_num += 1
                if output.strip() == "[MISSING_PAGE_POST]":
                    # uncaught repetitions -- most likely empty page
                    predictions.append(f"\n\n[MISSING_PAGE_EMPTY:{page_num}]\n\n")
                elif model_output["repeats"][j] is not None:
                    if model_output["repeats"][j] > 0:
                        # If we end up here, it means the output is most likely not complete and was truncated.
                        logger.warning(f"Skipping page {page_num} due to repetitions.")
                        predictions.append(f"\n\n[MISSING_PAGE_FAIL:{page_num}]\n\n")
                    else:
                        # If we end up here, it means the document page is too different from the training domain.
                        # This can happen e.g. for cover pages.
                        predictions.append(f"\n\n[MISSING_PAGE_EMPTY:{j+1}]\n\n")
                else:
                    output = markdown_compatible(output)
                    output = re.sub(r"\n{3,}", "\n\n", output).strip()
                    predictions.append(output)
                    metadata = {"source": self.file_path, "page": page_num}
                    yield Document(page_content=output, metadata=metadata)

I'm running this on a CPU-only machine on Windows 10. By default, the model parameters and inputs are converted to torch.bfloat16 tensors. Experimentally, it takes about 8 minutes to process 1 PDF page (the message "No GPU found. Conversion on CPU is very slow." is not kidding!)
However, I found that if I run everything without converting to torch.bfloat16 (leaving at the default torch.float32 precision), it runs much faster -- ~30 seconds per PDF page. To do this, I commented out the line self.model = move_to_device(self.model) in my PDF loader and the line image_tensors = image_tensors.to(torch.bfloat16) (plus its if condition) in  nougat\model.py, class NougatModel, inference method:
if self.device.type != "mps":
    image_tensors = image_tensors.to(torch.bfloat16)
image_tensors = image_tensors.to(self.device)

last_hidden_state = self.encoder(image_tensors)

(which gets called by model_output = self.model.inference(image_tensors=sample, early_stopping=True).
It might be useful to add a parameter to model.inference to allow selecting the desired precision, and perhaps a cli flag for it too. What do you think?

To back this up, I ran a full test loading the same PDF from https://www.workerinfoexchange.org/uber-guidance-document
This is the result using torch.bfloat16:
100%███████████████████████████████████████████████████████████████████████| 57/57 [4:38:22<00:00, 293.03s/it]
And without moving weights or inputs (default torch.float32):
100%███████████████████████████████████████████████████████████████████████| 57/57 [22:39<00:00, 23.85s/it]
So more than a 12x speed-up.
System information:
OS Name: Microsoft Windows 10 Pro
Version: 10.0.19045 Build 19045
Processor: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz, 2904 Mhz, 2 Core(s), 4 Logical Processor(s)
Total Physical Memory: 15.9 GB
Python: Python 3.11.4 | packaged by Anaconda, Inc. | (main, Jul  5 2023, 13:38:37) [MSC v.1916 64 bit (AMD64)] on win32

I don't know if this a general rule for CPU inference or just an edge case. But being able to set precision to use would allow handling this, whether it is an edge case or not.

Oh wow. Thanks! Let me have a look

That didn't work for me. It actually got slower by 20s/it (from 43.58 to 59.26) using 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz.

I've added the option to use full precision


Correct usage of http.nonProxyHosts system property

The current implementation in io.smallrye.restclient.RestClientBuilderImpl does not correctly use the http.nonProxyHosts system property. It does not parse it like usual implementations do (see https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html), even if it suggests it by having the default value "localhost|127.*|[::1]".
This is the line of Code that causes the problem: https://github.com/smallrye/smallrye-rest-client/blob/737876ec42853eb966d29228334c7c91f04128ed/implementation/src/main/java/io/smallrye/restclient/RestClientBuilderImpl.java#L158
I suggest using the ProxySelector to read the standard system properties for proxy configuration and resolving the nonProxyHosts. I could provide a PR with this change if welcomed.

We'd love a PR! Thanks


Is this project still active?

I'd really love a keybase Ruby API. Is this project still active / in progress?

Great, thanks!


da14531 use case Central, Add uart1 to this routine. uart1 crashes while receiving data

I am using the routine https://github.com/dialog-semiconductor/BLE_SDK6_examples/tree/main/connectivity/central and added uart1 to the routine to send and receive custom data to and from the test pc. But when I send data from pc to da14531, da14531 crashes. da14531 sends data to pc and it's fine again! Running the uart routines in the sdk alone. Sending and receiving is fine

Please clone the latest version.


Fix syntax of test in chip_xcode_build_connector.sh.

There was a stray ']' that was being treated as part of the string, so we never set target_arch or target_cpu.
Fixing that ended up with us setting target_arch/cpu to arm64 if it came before
x84_64 in ARCHS, which breaks CI.  So make sure we use the host arch as the
target_arch if it's in ARCHS at all.

Fast-tracking platform-specific change with platform owner review.


Stencil to Angular component: chef-input

An ongoing effort to convert Stencil components over to Angular components.
User Story
As a Developer, I will use this work when I want to build out any html template that uses an <input> input.  This will allow us to re-use a component with minimal effort and consistent styling across automate, while at the same time increasing performance.
Definition of Done

[ ] Angular component built that returns a native <input> input
[ ] Chef specific styles applied
[ ] current chef-input stencil is replaced where used across the site

This will address the touched/untouched issues we've seen for displaying error messages https://github.com/chef/automate/pull/2033


[turbopack] Stuck in infinite GET request loop when using Next-Auth middleware.

What version of Turborepo are you using?
--turbo
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Windows
Describe the Bug
Problem
Using NextAuth in nextjs and writing a simple middleware file (as shown in my stackoverflow issue), causes the app to be stuck in an infinite status 200 get request loop. I suggest it is a turbopack issue, whenever I remove --turbo from my package.json the middleware works as expected and route protection with nextjs's middleware works.
Middleware.ts
export { default } from 'next-auth/middleware'

export const config = {
    matcher: "/settings"
}

Link to stackoverflow question
Link
Image

Expected Behavior
No GET loop is happening after loggin in and accessing a protected route.
To Reproduce

Create a simple next.js application and enable turbopack and implement next-auth.
In my case I am using prisma for a connection to a local MySQL database and a credentialsprovider.
Add a middleware.ts in the root folder of the project with the basic middleware as shown above.
Access a protected route, while logged in and check the network tab in the dev tools of your browser.
Enjoy the frozen site and GET loop as shown in the picture above.

Reproduction Repo
No response

Thanks for the report, I have reassigned it to the turbopack team.

Having the same issue, with a simple redirect middleware.

Looks like middlewares not working well with Turbopack. I also have this problem with my authenticated app.

Having the same issue, with a simple redirect middleware.

Just disable turbopack until the issue is resolved or try and move to another authentication service like clerk.

i experience the issue here, while using clerk

Is there another ticket tracking this issue somewhere? Experiencing this exact issue as well.

I am using Clerk Auth and I have an infinite loop, inside the middleware I have the condition if I am already in the path with req.nextUrl.pathname but I still get the error.
if (!user.privateMetadata.role && req.nextUrl.pathname !== '/started') {
    const started = new URL('/started', req.url)
    return NextResponse.redirect(started)
}

The issue with Clerk has been fixed some time ago. Can you try again?

Works for me🙏👏
On Fri, Feb 9, 2024, 11:07 Tim Neutkens @.***> wrote:

The issue with Clerk has been fixed some time ago. Can you try again?
—
Reply to this email directly, view it on GitHub
https://github.com/vercel/turbo/issues/5408#issuecomment-1935563446, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAN2TMFJACTYFV4VSOW3BXDYSXROBAVCNFSM6AAAAAAZW7O7EOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVGU3DGNBUGY
.
You are receiving this because you commented.Message ID:
@.***>

Thanks for checking!

Asked @balazsorban44 to check the next-auth case as well and that one works too 🙌


[WFCORE-831] Revert the changes to the AD super constructor calls

https://github.com/wildfly/wildfly-core/pull/1011 introduced some changes to the AttributeDefinition super calls which should be reverted

Core - Full Integration - Windows Build 95 is now running using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca

Windows Build 2058 is now running using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca

Core - Full Integration Build 1674 is now running using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca

Linux Build 2549 is now running using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca

Windows Build 2058 outcome was SUCCESS using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca
Summary: Tests passed: 3409, ignored: 64 Build time: 00:36:22

Linux Build 2549 outcome was SUCCESS using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca
Summary: Tests passed: 3409, ignored: 64 Build time: 00:37:19

Core - Full Integration Build 1674 outcome was SUCCESS using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca
Summary: Tests passed: 3060, ignored: 359 Build time: 00:49:34

Core - Full Integration - Windows Build 95 outcome was SUCCESS using a merge of 53361db5d63ee634681ffbffd33f779125a7c3ca
Summary: Tests passed: 3060, ignored: 359 Build time: 00:52:48


Page watch later

This PR will add code for the Design and Functionality of Watch Later
In this PR, 658 additions and 130 deletions lines of code

some files contain only 5 to 6 lines of code
if you don't like you can avoid reviewing Backend related files

Please review this PR and give your feedback

Watch Later is for Logged In user, so you can use the following credentials
email<EMAIL_ADDRESS>password: johnDoe123

OR, you can check its signup functionality, and create a new account.

Live URL

The code looks good to me! UI is also great.
Tried adding to the Watch later list from home page. But did not work. Check that

Had you logged in? as the watch later feature is only for logged-in users. I will add toast to notify the user, till then please bear with me.
p.s. I tried and it is working for me. Please you try once more too.

Code looks pretty good and The thing is you manage it properly but my small suggestion for you is that sometimes I feel you divide code too much Which I didn't feel right as Sometimes it hinders the dev experience in reading the code. Though else everything was pretty good

Thanks for your suggestion, Akshat. Actually, how I divide the code is if something is getting repeated in two or three files, then I extract that thing in a separate file, as the same lines of code are unnecessary increasing the codebase and also file length.
And also, if I will not extract things out then the file length will become too long, and it would be hard to review that file too. I also think it increase the code reusability a lot, as many things I just copied from the last project and it worked perfectly fine without breaking any functionality.

Had you logged in? as the watch later feature is only for logged-in users. I will add toast to notify the user, till then please bear with me.
p.s. I tried and it is working for me. Please you try once more too.

Yes, I had logged in as the watch later page says to login first.
I tried it once again and seems to be working now. Not sure why it did not work previously.

Had you logged in? as the watch later feature is only for logged-in users. I will add toast to notify the user, till then please bear with me.
p.s. I tried and it is working for me. Please you try once more too.

Yes, I had logged in as the watch later page says to login first.
I tried it once again and seems to be working now. Not sure why it did not work previously.

oh! Okay, thanks for checking it again.

Thank you for reviewing,


Config per component

Description
This adds the config prop that allows per-component configuration
Example:
<CldImage
  width="987"
  height="1481"
  src="images/woman-headphones"
  alt="Original image of images/woman with headphones"
  config={{
    cloud: {
      cloudName: 'next-cloudinary'
    },
    url: { secureDistribution: 'spacejelly.dev' }
  }}
/>

Note: this is currently not working properly, see comments
Issue Ticket Number
Fixes #25

Type of change

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Fix or improve the documentation
[ ] This change requires a documentation update

Checklist

[ ] I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
[ ] I have created an issue ticket for this PR
[ ] I have checked to ensure there aren't other open Pull Requests for the same update/change?
[ ] I have performed a self-review of my own code
[ ] I have run tests locally to ensure they all pass
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes needed to the documentation

@matiasfha can you help me take a look at this?
i'm running into an issue where without javascript, the first rendering from the server is correctly applying this config, however with JavaScript in the browser, it's not applying the config
With JavaScript

Without JavaScript
It's correctly not supposed to render, as im just testing via the URL

I've been testing.
What I noticed is that without Javascript, the URL passed to the DOM is the one returned by getCldImageUrl that doesn't include the secureDistribution config
With javascript, I can see the correct src.
My guess:
The srcset is generated by unpic here
and here
The unpic svelte component use reactivity to generate the transformed props, so I guess that the unpic component does two different passes.


Optimization of JS visualization code

Since imageData is a typed array, it supports the set method that reduces the number of write ops as we write to a contiguous block of memory.

excellent, thank you!


Synchronous XMLHttpRequest warning in console

The viewer.js code does exactly what I need it to do and I would like to keep using it; however I am getting the following warning in the console that I have linked to the viewer.js code:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
Is there a plan for updating the XMLHttpRequests used in the code to asynchronous to ensure the usability beyond when the synchronous requests are no longer supported?

Thanks for the hint. This is a known warning, we see it as well :)
No immediate plans to do something about it, but in the longterm surely will be handled.


Remove dependency to Blender

I forked your project to have a look and possibly provide some comments for you to meditate on. However, I am unable to play the game because it requires Blender. This means there are no meshes for rendering and no meshes for collision.
It would be really, really nice if you exported your .blend files as .fbx files instead, because that doesn't require Blender to be installed on the machine. As an interesting side note, Unity Cloud Build also doesn't support .blend files so it could be something keeping in mind.
Upon starting Unity, I get this error three times:
Blender could not be found.
Make sure that Blender is installed and the .blend file has Blender as its 'Open with' application!

[ ] asteroid1_model
[ ] asteroid2_model
[ ] ship_model

Hey there. Nice to see somebody following the project!
As for the issue you mention:
Exporting to .fbx was how I originally added the model assets, but later found out Unity could do it automatically, so I just saved the .blend file to the folder instead of just exporting the fbx file for convenience. I will change this asap.
While the manual mentions:

This works under the hood by using the Blender FBX exporter

I took it to mean they implemented Blender's FBX exporting source into Unity. I didn't know that Unity actually requires and executes Blender. Interesting.
See:
http://docs.unity3d.com/Manual/HOWTO-ImportObjectBlender.html

Dependency removed:
Added seperate .fbx model exports to Assets\Models\FBX.

Note: Each model's Import Settings Scale Factor is set to 100 to have correct scale.

Blender .blend files moved to Assets\Models\Blender.
The .fbx models are now the default models used/referenced in each prefab's MeshFilter component.

I didn't know that Unity actually requires and executes Blender. Interesting.

Yeah, there's some things you won't expect at first glance.
Art Asset Best Practice Guide

Import/Export
Unity can use two types of files: Saved 3D application files and Exported 3D formats. Which you decide to use can be quite important:
...
Disadvantages:

A licensed copy of that software must be installed on all machines using the Unity project


Create CONTRIBUTING.md

Add contributing guide.
TODO:

[ ] Code of Conduct link

I've merged this branch into readme-badges and updated the guide, so I'm going to close this one. #95


Higher order auto-diff issues

For some reason, float values marked as no_diff are not treated as no_diff in higher order derivatives (i.e. no_diff float in a forward is also no_diff float in bwd_diff(func)(...) call, but is DifferentialPair<float> in bwd_diff(bwd_diff(func))(...) call). uint values are working as expected.

Usage of built-in cos() ,sin() and exp() functions in higher order diff causes slang compiler to crash with<PHONE_NUMBER> (0xc00000fd) (Recursion Error). As a workaround the Taylor expansions of these functions can be used.

Recursion happens in:
https://github.com/shader-slang/slang/blob/56928794d0800824dc91e150cb345b5fec24d930/source/slang/slang-ir-autodiff-transcriber-base.cpp#L152
Slang source to reproduce the issue:
[Differentiable]
float3 test(float3 val)
{
    return float3(cos(val.x), sin(val.y), exp(val.z));
}

[shader("compute")]
[numthreads(16, 16, 1)]
void test_main(uint3 tid: SV_DispatchThreadID)
{
    float3 a = float3(tid);
    float3 b = float3(0);
    DifferentialPair<DifferentialPair<float3>> dp_dp_a = diffPair(diffPair(a));
    DifferentialPair<float3> dp_b = diffPair(b);
    bwd_diff(bwd_diff(test))(dp_dp_a, dp_b);
}

Thank you for providing a minimal reproducer! This will make it much simpler to figure out what's wrong. Will provide more updates soon.

I've done some digging into this issue. It appears that there's several unhandled cases when generics and multiple reverse-mode passes interact.
The specific issue is that reverse-mode auto-diff produces function dependent types (the intermediate context data structure depends on the function contents). These types are not handled correctly when they appear within generic containers (all stdlib methods like cos & sin are generics).
This doesn't matter for a single reverse-mode pass or reverse-mode over forward-mode. However, it becomes an issue with multiple layered bwd_diff calls.
Implementing the fixes is slightly involved so I'll continue to work on it & provide updates (I'm moving it to Q2 2024)
In the meantime, this can be worked around by using fwd_diff for the inner call instead of bwd_diff (i.e. bwd_diff(fwd_diff(fn))) to compute Hessians more efficiently.
Note that multiple reverse-mode passes (as shown in your snippet) leads to extremely inefficient code, and is usually not the recommended approach to compute Hessians.

@aroidzap Are you currently blocked by this issue? Does changing to bwd_diff(fwd_diff(f)) work for you?


Opinions about Foxx application export feature

IMO current ad hoc implementation/API of Foxx application export is quite dangerous due to lack of dependency management.
We encourage developers to share reusable application portions. But when more people adopt it, the current api (that only requires an app to specify a target app's mount point) may cause complexity.
Let's say some situations:

A sys admin whose job is to maintain the DB. He/she has no idea what the apps have in their source code. Or maybe he/she is able to read code, but there are simply too many of them. How can he/she know whether unmounting an app may cause some other apps to stop working?
App A depends on app B. B's mount point must be hard coded in A's source code. If B needs to change its mount point then A 's source code has to be modified. That's insane!
App B comes to a new version and there's no clear way for app A to know if B's API may no longer work in app A. Because there's no version.

Any ideas?

This has been implemented in devel.


In the To-do list:

https://50-days-50-web-project.vercel.app/TO_DO_LIST/todolist.html
Once a task marked done can't be undo , if made by mistake then user will have to create a new task all over again
I suggest to add an undo option that helps the user to unmark or undo the action.
You can also use checkboxes for the purpose and I can do that.
Will you assign me I'll make the task of checkboxes and will design accordance to your page .

find some different issue start with easy one
#80 duplicate issue


Enable editing/read-only modes for player colours and names

Added feature to enable editing/read-only modes for player colours and names as per #19
I opted to use a button with text to toggle between the modes, but don't know what they're meant to be in the other languages - I didn't want to use Google Translate in case it was severely incorrect.

Going to check this out locally and review the UI changes

@leeeennyy for the button placement, instead of absolute positioning, the way I would approach it is to make the reset players and lock palyers button siblings, and put them in a container similar to the buttons in the controls panel (settings / about /changelog). this way they nicely sit next to each other, 1rem from the last PlayerSection, and the reset player button disappears on desktop as it has before.

Mobile:
Desktop:

perfecto 👌

@chilblane Sweet as. I've rebased with master so merge should be okay now.
Do you know how we get the translations for other languages as well? The other languages still have lock/unlock in english.

We know that we need to review what we have to fix for translations; my UI update added/changed a few as well. I will let the maintainers figure out how they want to organize that and pass this PR off to them @Kedyn @francistse23


libsvm: 3.20 -> 3.22

Semi-automatic update. These checks were done:

built on NixOS
ran /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/bin/svm-scale help got 0 exit code
ran /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/bin/svm-train help got 0 exit code
found 3.22 in filename of file in /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22

cc @spwhitt

Success on aarch64-linux (full log)
Partial log (click to expand)
shrinking RPATHs of ELF executables and libraries in /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22
shrinking /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22/bin/svm-predict
shrinking /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22/bin/svm-train
shrinking /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22/bin/svm-scale
shrinking /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22/lib/libsvm.2.so
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22/lib  /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22/bin
patching script interpreter paths in /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22
checking for references to /build in /nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22...
/nix/store/dkgbd7ryqyfl69l0wflqrpjwd85incgm-libsvm-3.22

Success on x86_64-linux (full log)
Partial log (click to expand)
shrinking RPATHs of ELF executables and libraries in /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22
shrinking /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/bin/svm-predict
shrinking /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/bin/svm-train
shrinking /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/bin/svm-scale
shrinking /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/lib/libsvm.2.so
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/lib  /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22/bin
patching script interpreter paths in /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22
checking for references to /tmp/nix-build-libsvm-3.22.drv-0 in /nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22...
/nix/store/97a1nnpdah29fs3v274lnzk0hcyhncg3-libsvm-3.22

Success on x86_64-darwin (full log)
Partial log (click to expand)
	SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.2"; \
else \
	SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.2"; \
fi; \
clang++ ${SHARED_LIB_FLAG} svm.o -o libsvm.so.2
installing
post-installation fixup
strip is /nix/store/4sdh09gmvl15cy0zb6i7mbvxh5syz206-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/k9bmmangbnrm5iyi4mr42jmyddi4lrik-libsvm-3.22/lib  /nix/store/k9bmmangbnrm5iyi4mr42jmyddi4lrik-libsvm-3.22/bin
patching script interpreter paths in /nix/store/k9bmmangbnrm5iyi4mr42jmyddi4lrik-libsvm-3.22


Implement "capsules"

Michael is on this right now.

These are basically functioning, but when the capsules scale out, they go beneath other nearby capsules. Right now this is solved by jumping the z-index on the expanded page, but the animation should actually happen "above".
This custom behavior looks as though it might provide a hook at the animation start where one could possibly make that kind of adjustment. There are probably other routes as well.
For now going to leave this open until we get the animation tighter, but work may shift to other elements which aren't as far along.


hidden config with brackets in it - telescope

I have several commands that start require('telescope.builtin'), and the rest gets cut off. I want to hide all of that (or perhaps just keep "telescope") so I add "require('telescope.builtin')" to the hidden list - and that doesn't work.
Just "require(" doesn't work either. Okay, looks like it's regex, so...

"require" - works, but still leaves "('telescope.builtin')" that I want to remove
"require("? lua: invalid escape sequence
"require\("? now require isn't even hidden
"require\("? escape sequence again...
what the heck... "require\\("? now require isn't even hidden

So this seems impossible?
To be clear, this is the line hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ ", "require\(" } in require("which-key").setup {

Here's an example of how it's done.  https://github.com/ChristianChiarulli/LunarVim/blob/master/lua/lv-which-key/init.lua
The whole project is worth a look to see how you might configure neovim

That config doesn't do what I'm asking: there's no brackets on this line: https://github.com/ChristianChiarulli/LunarVim/blob/master/lua/lv-which-key/init.lua#L41

Sorry, I misunderstood.

Did you try require%(? It's a Lua regex.

Aha! Thanks, I didn't know Lua had unutual regex. Yes, this string works: "require%('telescope.builtin'%)."


ScopedContext time increases significantly when loading system using boom

Hello,
Thank you for this great solution, it is very convenient and useful.
We have started to use this solution on our trained network and it seems to work fine. But when we test load stress using the offered boom action, we start to get very low responses (after a few calls).
When checking closely it seems like the action time of 'ScopedContext' seems to increase significantly (up to ~600ms).
When we use a single 'curl' call, this action takes less than 1ms.
We use K80 GPU which reaches a maximum of 89% during the boom load.
Do you maybe know of any reason that might affect the system in such case?

By the way - this is for example what we get for boom -n 20000:
Summary:
  Total:	169.0645 secs
  Slowest:	0.7978 secs
  Fastest:	0.0370 secs
  Average:	0.4214 secs
  Requests/sec:	118.2981

Status code distribution:
  [200]	20000 responses

Response time histogram:
  0.037 [1]	|
  0.113 [83]	|
  0.189 [14]	|
  0.265 [16]	|
  0.341 [39]	|
  0.417 [4588]	|∎∎∎∎∎∎∎∎∎∎∎∎
  0.493 [15146]	|∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.570 [25]	|
  0.646 [8]	|
  0.722 [2]	|
  0.798 [78]	|

Hello @avishayzanbar,
Maybe boom is sending way too many requests and they start queuing, hence the high overall latency.
Could you try with boom -c 4 -n 20000 to limit the number of concurrent requests?

Hi @flx42
Thank you very much for the response.
You are probably right - after limiting the concurrent requests (4 or even 8) the average time reduced to ~50ms


patch: check environment variable existence

Description of change
Please write a summary of your changes and why you made them.
Links to any relevant issues
Be sure to reference any related issues by adding fixes #issue_number.
Type of change
Choose a type of change, and delete any options that are not relevant.

Bug fix (a non-breaking change which fixes an issue)
Enhancement (a non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Documentation Fix

How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.
Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.

[ ] I have followed the contribution guidelines for this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have checked that new and existing unit tests pass locally with my changes

Hi @raprocks, thanks for the PR! Just checking in, do you have any question regarding the issue?

Hi @raprocks, let us know if you don't have time to finish and we'll do it

hey @thibault-martinez , i got a little busy but i am back now. The PR was not for hacktoberfest haha, i will complete in this week sometime and make this ready for submission. I have the task clear. Thanks

@thibault-martinez Please Review and let me know if any other changes are necessary

sorry missed that!


SPM support and multi-platform

This PR make BezierKit available trough SPM and buildable on non-Apple platforms (Linux, Windows). Very little changes were made to source files.
Things that don't work on non-Apple platforms:

CGPath (requires CoreGraphics);
Draw (requires CoreGraphics);
Tests  (requires CGPath, so CoreGraphics);

P.S. I think that making BezierKit multi-platform is very cool, because it brings power of bezier curves to Swift in Linux world.

Codecov Report

Merging #71 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #71   +/-   ##
=======================================
  Coverage   96.66%   96.66%
=======================================
  Files          37       37
  Lines        6000     6000
=======================================
  Hits         5800     5800
  Misses        200      200

Impacted Files
Coverage Δ

BezierKit/Library/AugmentedGraph.swift
100.00% <ø> (ø)

BezierKit/Library/BezierCurve+Intersection.swift
96.26% <ø> (ø)

BezierKit/Library/BezierCurve.swift
100.00% <ø> (ø)

BezierKit/Library/BoundingBoxHierarchy.swift
100.00% <ø> (ø)

BezierKit/Library/CGPoint+Overloads.swift
100.00% <ø> (ø)

BezierKit/Library/CubicCurve.swift
100.00% <ø> (ø)

BezierKit/Library/Draw.swift
18.49% <ø> (ø)

BezierKit/Library/LineSegment.swift
100.00% <ø> (ø)

BezierKit/Library/Lock.swift
100.00% <ø> (ø)

BezierKit/Library/Path+Data.swift
100.00% <ø> (ø)

... and 8 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 ca4c97b...9125747. Read the comment docs.

@ky1vstar thank you for your contribution!
I'm going to get the continuous integration (Travis-CI) up and running with Swift Package Manager and a Linux environment, and then merge this into the latest release.
I don't use Linux or SPM so the continuous integration will make sure that I don't break this support with future development.

@ky1vstar ok so the Travis-CI is taking a bit longer than I thought. If you are familiar with Travis-CI I could use help modifying the .travis.yml to spin up a linux instance and run swift test --enable-test-discovery to execute the tests. I do have the tests running on an Ubuntu install locally.

@hfutrell thanks for approving!
Unfortunately I'm not familiar with Travis, but I found a working reference here

thank you for looking into it. Ultimately I used a lot of trial and error to get things working! I am not good at DevOps ...
So the good news is that continuous integration is working with Linux! I have merged the Swift Package Manager work into the latest release branch.

I've just seen SPM support in today's release. Just wanted to say this PR is much welcome! I had already moved away from CocoaPods and had manually integrated BezierKit as subproject as it was my last dependency without SPM support. Now I've everything managed through SPM and I'm happy, thank you!

@hfutrell I appreciate work you've put into this PR to make it life.
@Ceylo Thank you for kind words, I hope this PR will add more flexibility to evolve this project in future.


test: add integration test for sync with delta

Add an integration test to show off sync with deltas in PSQLFaissSearcher

@tadejsv I can't reply to your comments.
The reason these tests are more complex

They also act like showcases for how to full usage of these features.
test_psql_import needs to be the same as test_dump_reload, in order to compare them in the benchmark

You are testing the case 'use_delta': True in this test. Testing normal sync without it should be done as a separate test

The use_delta only has meaning if you have already imported from a snapshot, since it will only give you the data from that last timestamp.

Ok, so if I understand things correctly, the issue is that this unit test is trying to be 3 things at once: a unit test, a showcase, and a benchmark. Why not separate this out?

Showcase -> readme
benchmark -> perhaps the benchmarks repo? Not sure in what way you are using this benchmark

The use_delta only has meaning if you have already imported from a snapshot, since it will only give you the data from that last timestamp.

My comment referred to the call to /serach endpoint after a normal sync, which is not really needed in that unit test. There can/should be another unit test testing normal sync.
P.S. For these comments you can reply under the original comments

Ok, so if I understand things correctly, the issue is that this unit test is trying to be 3 things at once: a unit test, a showcase, and a benchmark. Why not separate this out?

Showcase -> readme

It won't be tested and thus will end up broken.

benchmark -> perhaps the benchmarks repo? Not sure in what way you are using this benchmark

That would create too much coupling. We want it as both an integration test here, but, as you can see, it can also be called to run in benchmark mode with a larger nr of docs and larger emebddings.

My comment referred to the call to /serach endpoint after a normal sync, which is not really needed in that unit test. There can/should be another unit test testing normal sync.

There is another unit test, in the PSQLFaissIndexer folder's tests. Yes, it can be removed. It's more like a gradual test, making sure that every step is ok before proceeding. So it can catch error early instead of waiting until the last assert.

That would create too much coupling. We want it as both an integration test here, but, as you can see, it can also be called to run in benchmark mode with a larger nr of docs and larger emebddings.

Well, fair point on coupling. But in general - a piece of code should do one thing and do that well. This tries to do too many things.

There is another unit test, in the PSQLFaissIndexer folder's tests. Yes, the assert on the search could be removed. It's more like a gradual test, making sure that every step is ok before proceeding. So it can catch error early instead of waiting until the last assert.

Not just assert on the search, the whole search. There's no need to catch an error early - there should be other tests for that, so when something breaks, you just look at which tests fail and deduce the root cause from there. A test should focus on testing one thing - this makes them readable and easy to understand

Not just assert on the search, the whole search. There's no need to catch an error early - there should be other tests for that, so when something breaks, you just look at which tests fail and deduce the root cause from there. A test should focus on testing one thing - this makes them readable and easy to understand

Ok, I'll remove that assert.

Well, fair point on coupling. But in general - a piece of code should do one thing and do that well. This tries to do too many things.

Could be refactored later. Right now it would mean also changing the other benchmark tests (which would be a bit too much for this PR)