Always include Cargo.toml as input for Rust compilation

This is a somewhat minor hack to fix compilation in the distributed scenario, where a package needs to read its own manifest file.
For more context, Cargo already packs the manifest and other [package.include]d files in the .crate archive and in respective the .cargo/registry/src/<registry>/<package-id> directory, however sccache relies only on the explicit dep-info created by rustc for a regular crate compilation. While technically correct for a "barebones" Rust crate, the packages compiled and distributed by Cargo may also implicitly depend on the additional, aforementioned packed files.
This unconditionally marks Cargo.toml as the input for the Rust compilation, since
a) every Cargo package is known to have that file present in its crate archive/build environment
b) the manifest file is a relatively small text file so the overhead of packing it and transmitting it over the wire should be negligible
c) we don't use non-Cargo Rust crates (:warning: I need to test if it hard errors if there's not a Cargo.toml present for some crate)
d) this is 99% enough to get Substrate compiling
Alternatives
a) Use the include_bytes! with unnamed const trick:
  const _: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/Cargo.toml"));

This works on stable but includes a file in the compilation output which may or may not be stripped; This would have to be   repeated for every crate that uses parity-scale-codec (...that's too many)
b) Wait for https://github.com/rust-lang/rust/pull/84029 to land and use it in the nightly toolchain setting. That's the most straightforward solution but we'd only support the nightly toolchain and the time-to-stabilise might prove to be too long if we want to use sccache using a Rust stable toolchain.
c) Remove the rename-detection feature in parity-scale-codec-derive (breaking change but not sure if include that in stability guarantees) and migrate every crate that uses parity-scale-codec to import it directly, without renaming to codec via Cargo.toml (or other names). This imposes a churn and there's not a reliable/elegant way to prevent someone from breaking the build as this issue only pops up when using sccache
I'm 50-50 whether we should upstream this patch; ideally the crate developers should use https://github.com/rust-lang/rust/pull/84029 directly when it lands on stable but always including the Cargo.toml manifest seems like it gives some degree of out-of-box support for Cargo packages without that big of a runtime cost.

This is a somewhat minor hack to fix compilation in the distributed scenario, where a package needs to read its own manifest file.
For more context, Cargo already packs the manifest and other [package.include]d files in the .crate archive and in respective the .cargo/registry/src/<registry>/<package-id> directory, however sccache relies only on the explicit dep-info created by rustc for a regular crate compilation. While technically correct for a "barebones" Rust crate, the packages compiled and distributed by Cargo may also implicitly depend on the additional, aforementioned packed files.
This unconditionally marks Cargo.toml as the input for the Rust compilation, since
a) every Cargo package is known to have that file present in its crate archive/build environment
b) the manifest file is a relatively small text file so the overhead of packing it and transmitting it over the wire should be negligible
c) we don't use non-Cargo Rust crates (warning I need to test if it hard errors if there's not a Cargo.toml present for some crate)
d) this is 99% enough to get Substrate compiling
Alternatives
a) Use the include_bytes! with unnamed const trick:
  const _: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/Cargo.toml"));

This works on stable but includes a file in the compilation output which may or may not be stripped; This would have to be repeated for every crate that uses parity-scale-codec (...that's too many)

Not entirly sure we'd have to repeat it, or if that hack would have to be part of the scale codec created code? Either way, this is a hack and I can see non-parity crates refusing to do such treachery.

b) Wait for rust-lang/rust#84029 to land and use it in the nightly toolchain setting. That's the most straightforward solution but we'd only support the nightly toolchain and the time-to-stabilise might prove to be too long if we want to use sccache using a Rust stable toolchain.

For stable we have to do something in the meantime, :100:

c) Remove the rename-detection feature in parity-scale-codec-derive (breaking change but not sure if include that in stability guarantees) and migrate every crate that uses parity-scale-codec to import it directly, without renaming to codec via Cargo.toml (or other names). This imposes a churn and there's not a reliable/elegant way to prevent someone from breaking the build as this issue only pops up when using sccache

The issue really is limited to renames combined with proc macro crates, right? So it should be rather limited I would assume (this is not a proof, prove me wrong!)?
Not a fan of changing source for the sake of a tool. So for me that's a nay

I'm 50-50 whether we should upstream this patch; ideally the crate developers should use rust-lang/rust#84029 directly when it lands on stable but always including the Cargo.toml manifest seems like it gives some degree of out-of-box support for Cargo packages without that big of a runtime cost.

I tried this before which seems quite similar https://github.com/mozilla/sccache/pull/719 and it was closed, so I would not bother to do so.

Not entirely sure we'd have to repeat it, or if that hack would have to be part of the scale codec created code? Either way, this is a hack and I can see non-parity crates refusing to do such treachery.

Hm, that's a fair point, I guess you could technically quote! that into the consumer crate which uses the derive macros... That sounds like a good workaround and I guess it's technically correct in general to mark Cargo.toml as required file as it directly affects the compilation.
Unfortunately, I verified that using the unnamed const trick, the included file ends up in the .rlibs - whether it's in release or debug.

The issue really is limited to renames combined with proc macro crates, right?

Yes, the only reason in the first place for requiring Cargo.toml in our case is to detect renames via proc-macro-crate (which is used by parity-scale-codec-derive). Interestingly enough, this problem is not yet "solved" in Rust proper, see https://github.com/rust-lang/rust/issues/54363. For example serde uses a special #[serde(crate = "...")] attribute to work around that.

I wonder, taking a brief look, title says, about Cargo.toml, what about Cargo.lock ?

That's a fair question - in general, dependencies' lockfiles are ignored and only the lockfile of the primary package or the workspace is used. The lockfile is used as part of the dependency resolution, which happens on the client side - with dependencies resolved, the corresponding crate compilation requests are sent from the client to the build servers, so there's no need to transfer Cargo.lock anywhere for the build to happen/succeed.

thread 'compiler::rust::test::test_generate_hash_key' panicked at 'called `Result::unwrap()` on an `Err` value: Failed to open
file for hashing: "/tmp/sccache_testvclnIp/Cargo.toml"

I guess this needs a sanity check beforehand if the file exists at all

@Xanewok all my comments can be addressed in a followup as needed, this is good for now and remedies a roadblock :+1:

Awesome, thank you for your review! 🙏


Improve code readability for Authentication.Google

Hi @troydai, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.
TTYL, DNFBOT;

:shipit:


HmIP-MOD-HO lacks state "unknown"

DONT'T DELETE THIS.
This is for issues only
If you have a feature request, add it as a new discussion, or add your point of view to an existing discussion.
Please answer all questions as good as possible.
Language: as you like -> english/DEUTSCH: FYI, both is fine for your reply. Deutsch is my native language.
Make sure you have read the documentation at https://github.com/danielperna84/custom_homematic#custom_homematic.
Make sure you have read the release notes at https://github.com/danielperna84/custom_homematic/releases.
Make sure you are running the latest version of the custom_component (and Home Assistant) before reporting an issue.
ENSURE that your Backend (CCU/Homegear/...) is working as expected and connected devices are controllable.
custom_component version (if applicable):
1.25.1
known last working custom_component version (if applicable):
not applicable
Home Assistant:

Version: 2022.12.8
Installation method (HAOS, supervised, core, venv, Docker): HAOS

CCU:

Model (CCU2/3, Raspi3/4, NUC, ProxmoxVE, HA-Addon ...): CCU3
OS (Original, RaspberryMatic, debmatic ...): Original
Version: 3.65.11

Problem-relevant configuration:
Do you use tls? default setting
Do you use callback? default setting
Do you use username and password? yes
Which interfaces do you use (hmip/bidcos/wired)? hmip (wired and Funk)
Describe the bug
HmIP-MOD-HO is used for the Hörmann Garagentor. The functionality is mapped to the cover functionality.
Instead of the cover position as with other covers (e.g. for "Jalousien" or "Markisen"), CCU3 reports 3 different states: open, closed, unknown. Hörmann supports humidity control with a so calls "Lüftungsposition". This position is mapped to "unknown" by the CCU (I hope that at some point in time this will be mapped to the right wording if possible, but that's not related to this integration).
With the official integration, those 3 states get reported correctly. With this new custom integration (wich is much better otherwise, thank you!), any other state that closed gets reported to open state, also this unknown state.
With this new integration, it is thus not possible to separate between an open door and the "Lüftungsposition", which is relevant (as with the Lüftungsposition, the door is actually closed, except the small opening for the "Lüftung".
Is it possible to use both integration at the same time on the same home assistant installation? If yes, I probably would do this as a work-around until this is available also with the new integration.
(FYI: I currently have the official homematic integration with my running home assistant system and I'm currently testing this custom integration on a test Home Assistant installation to decide whether I'll migrate on my running system to the custom integration. Especially as the cover functionality has otherwise some issues in the official integration.)
To Reproduce
Steps to reproduce the behavior:

HmIP-MOD-HO integrated and Hörmann garage door in "Lüftungsposition".

Screenshots (if applicable)

CCU firewall in CCU
device config in CCU
integrations view in HA
device view in HA
enity view in HA

Relevant HA log entries (press full log) VERY IMPORTANT

Diagnostic Information (available on every device)

Expected behavior
"Lüftungsposition" reported separately (as also the information is separate in the CCU3 with unkown state and as this unkown state is also reported in the official integration).
Additional context
Add any other context about the problem here.

If the position is between 10% and 50% Lüftungsposition should be displayed.

That would be great. But I also don't see any % position in the CCU (only open, closed or unknown) and the unkown state is mapped to open with this custom integration.
Maybe this also depends on the Hörmann garage door version. I have a series 4 and thus, also require the HAP1 HCP Adapter in between. Maybe the position information is available in % with series 3 garage doors?
WIth this adapter and my series 4 Hörmann garage door, I only get these 3 states. And unknown mapped to open.

Please post a screenshot of the entity attributes (Developertools -> States)

I'll lean out the window and claim that the entity you complained about comes from the old integration.
According to the source code, this does not support position and should always return unknown as status.

This is quite sure not from the old integration. I can most likely exclude this is I have two separate installations currently:
One system as test system wit the custom integration (where I don't have the old integration configured) and the productive system with the old integration (where I don't have the custom installation, not even HACS, installed).
Screenshots:
In the CCU3:

From the custom integration:

From my productive system with the official integration (where unkown is reported correctly):

We use the GARAGE_DOOR_STATE to report the position/state in HA:
        if self._e_door_state.value == GARAGE_DOOR_STATE_OPEN:
            return 100
        if self._e_door_state.value == GARAGE_DOOR_STATE_VENTILATION_POSITION:
            return 10
        if self._e_door_state.value == GARAGE_DOOR_STATE_CLOSED:
            return 0

To the state, from an HA perspective is OK. Why should we not use it?

I don't know why I get "unkown" in the CCU when the position is actually in the ventilation position. I assume (but just a guess) that the HmIP-MOD-HO is maybe not yet fully compatible with the newer series 4 from Hörmann and thus, reports "unknown" when the garage door is in the ventilation position.
Would be great if unknown  could be mapped as well. Thank you!

I just see that there is a hidden entity door state which I can activate with the custom integration.
Yes, this one I can use as a work around. That's currently sufficient for me as I mainly hope that the CCU will display the states correctly as well (ventilation position instead of unknown) and this then also would solve this issue here correctly.
Thank you again! And thus, fine for me to close this issue. Should I click on close? I think this information is still helpful for someone else having this issue that activating this hidden entity is a good temporary solution.

Cover entities don't support textual states, so, As already mentioned above, the VENTILATION_POSITION will be displayed as position 10%.
There will be now further action from my side.


GamePad 'wasPressed' doesn't work.

When using this type of code
this.app.gamepads.wasPressed();
It doesn't work properly. Here is the thread where we went into detail, towards the end. >> https://forum.playcanvas.com/t/gamepad-help-please/4225/12
But here is what one of the users said in one of the responses.
So I found a gamepad, and it looks like this might be a bug in PlayCanvas.
What update is doing is it always update the current value, and sets the previous value to whatever was in current before it updated, so it's always lagging one frame behind.
Now wasPressed returns true only if current says it's pressed, and previous says it is not pressed. The problem seems to be that both current and previous always have the same value. If you print them out, they're synced together, so the condition for wasPressed is never true.
My guess is that this is because previous and current are set to objects, and so they might both be pointing to the same object as opposed to making a copy.
I implemented my own version of update and wasPressed here as a proof of concept:

var Test = pc.createScript('test');

Test.prototype.initialize = function() {
    this.previousUpPressed = false;
    this.currentUpPressed = false;
};

Test.prototype.wasUpPressed = function(){
    if(!this.currentUpPressed) return false;

    return this.currentUpPressed && !this.previousUpPressed;
};

Test.prototype.update = function(dt) {
    this.previousUpPressed = this.currentUpPressed;
    this.currentUpPressed = this.app.gamepads.isPressed(pc.PAD_1, pc.PAD_UP);

    if(this.wasUpPressed()){
        console.log("Pressing Up");
    }
};

Thanks for posting the issue up @Robotpencil ! I just opened a PR #985 as a potential fix.

Fixed in #985. Waiting for release.


Empire Launcher no longer works

Describe the bug
When attempting to launch the empire_exec module the following error is issued:
[-] Unable to connect to Empire's RESTful API: HTTPSConnectionPool(host='<IP_ADDRESS>', port=1337): Max retries exceeded with url: /api/admin/login (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:992)')))
The following error can be seen in the Empire Server log:
[WARNING]: Invalid HTTP request received.  Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/uvicorn/protocols/http/h11_impl.py", line 129, in handle_events     event = self.conn.next_event()             ^^^^^^^^^^^^^^^^^^^^^^   File "/usr/lib/python3/dist-packages/h11/_connection.py", line 487, in next_event     exc._reraise_as_remote_protocol_error()   File "/usr/lib/python3/dist-packages/h11/_util.py", line 77, in _reraise_as_remote_protocol_error     raise self   File "/usr/lib/python3/dist-packages/h11/_connection.py", line 469, in next_event     event = self._extract_next_receive_event()             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/lib/python3/dist-packages/h11/_connection.py", line 411, in _extract_next_receive_event     event = self._reader(self._receive_buffer)             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/lib/python3/dist-packages/h11/_readers.py", line 79, in maybe_read_from_IDLE_client     raise LocalProtocolError("illegal request line") h11._util.RemoteProtocolError: illegal request line
To Reproduce
Attemp to run the empire_exec module using the latest version of CME and Empire (BC Security) and observe the CME error and Empire server error present in the log.
Expected behavior
CME should connect to Empire and create a stager for the specified listener.
Screenshots
If applicable, add screenshots to help explain your problem.
Crackmapexec info

OS: Kali Rolling
Version of CME 5.4.0 Empire (BC) 5.0.0 (BETA 2)
Installed using latest release

Additional context
Add any other context about the problem here.

I can confirm this is broken. Empire changed their API in v5 and the module was not updated to match.
I have fixed this in my working branch, and once tested and approved it can be pushed to sponsors.

Thanks!.. Sponsored 👍


Pagerfanta and filtering not working

The issue is strange... On my development system, the same code works exactly like it should, but when I put it in the production environment, the pagerfanta element, sorting and filtering just doesn't work. The page reloads with no effect.
The only difference is that I'm developing on PHP5.4, and on the production system we have 5.6. Could this be the issue?

Ok, it looks like HAProxy breaks something on the way.


Add link to the docs

Add Link to the Docs in the market
It would make the market more beginner-friendly if we linked to the docs. We have quite a lot of helpful information and explanations in the docs so it makes sense to make it more accessible from the market. Most web3 apps will have a link to their docs or user guides to help out users who are new to web3.
See Uniswap for example:

There are a couple of options for how this could be done:
Simple solution
Just place a link to the docs in either the header menu or in the footer.
Dynamic solution
To avoid cluttering up the UI we could render them conditionally. For example:

If a user gets to the submit tab on the publish form without a wallet connected we could show an alert that says "You must connect your wallet to proceed" + a link to the docs on how to setup a wallet
If a user gets to the submit tab and they have 0 Eth their wallet we could show an alert that says "You must have ETH to pay the gas fees" + a link to the relevant docs

I think we could also add a couple more other links as well:

link to GitHub for contributors
link to discord for people who want to ask questions. Possibly also telegram.


Update Market Rules

Here are the updated rules to be used in Market creation, for both template and non template markets, as well is Reporting and disputing pgs as well
Market rules
A market is invalid if:
•	The market question, resolution details or its outcomes are ambiguous, subjective or unknown.
•	The result of the event was known at market creation time.
•	The outcome was not known at event expiration time.
•	It can resolve without at least one of the outcomes listed being the winner, unless it is explicitly stated how the market will otherwise resolve in the resolution details.
•	The title, details and outcomes are in direct conflict with each other.
•	The market can resolve with more than one winning outcome
•	Any of the outcomes don’t answer the market question ONLY. (outcomes cannot introduce a secondary question)
•	If using a resolution source (a source is a noun that reports on or decides the result of a market), the source's URL or full name is NOT in the Market Question, regardless of it being in the resolution details.
•	If using a resolution source, it is not referenced consistently between the Market Question and Resolution Details e.g. as either a URL or its full name
•	If it’s a stock, currency or cryptocurrency and its ticker is not used in the market question.
•	If it’s an index and the indexes full name is not in the market question.
•	For any sports markets that list a player or team not in the correct league, division or conference, at the time the market was created, the market should resolve as invalid.
•	A market only covers events that occur after market creation time and on or before reporting start time. If the event occurs outside of these bounds it has a high probability as resolving as invalid.

@bconfortin -- This would be a good one to knock out tomorrow.


Remove use of non-maybe version of TryCatch::StackTrace

looks good to me ... technically we need to check if we have a string I think if we do a to local checked, no?

I think we both check if the StackTrace is empty and then do a ToLocalChecked before getting the string so we should not have a crash.


Use selectrowsjs as a MySaaS extension.

Add the app.rb file.
Setup extension.rb to add a link to /developers/selectrowsjs/example.html in the footer of MySaaS, in the section Developers.
Setup extension.rb to call the file selectrows.min.js when load a page of MySaaS.
Remove the source code of SelectRows.Js from the screen /settings/users.
This code: https://github.com/leandrosardi/mysaas/blob/0.0.3/views/settings/users.erb#L276
Add the extension in the config.rb of your MySaaS project, and test it in the /settings/users screen.
Add a new section 2. Using SelectRows.Js as a [MySaaS](https://github.com/leandrosardi/mysaas) Extension in the README.md file of the selectrowsjs project. There, explain how to add filters.js as an extension of MySaaS.
Here is a good example that you can follow: https://github.com/leandrosardi/leads#1-getting-started.

Done.


nodejs file modules suggestion not working

Hello,
Im trying to get suggestion of file tree inside "require" modules, but i get not suggestions..
Im using vsc on mac, it works when i type the file name manually ,but i want it to suggest me automatically after i type "/"..
any idea how i can solve it ? it used to work before but not anymore..

Hm seems to work for me
What VS Code version are you using and does this happen if you disable all extensions?
Also did you disable the editor.suggestOnTriggerCharacters setting?

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.
Happy Coding!

What VS Code version are you using and does this happen if you disable all extensions?
using Version: 1.82.2 on mac,
even if i disable extensions its still won't work, i have to type manually to get the suggestion as in the image i provided,
and yes, i disabled editor.suggestOnTriggerCharacters,
in this setting other is on, comments is off and strings is on

Hm seems to work for me
What VS Code version are you using and does this happen if you disable all extensions?
Also did you disable the editor.suggestOnTriggerCharacters setting?

and yes, i disabled editor.suggestOnTriggerCharacters

That's why it doesn't work. The setting is what shows suggestions when you type a character such as /
If you don't want to turn trigger characters on, you can always manually trigger suggestions using ctrl+space

That's why it doesn't work. The setting is what shows suggestions when you type a character such as /

you're right, that's actually solve it, thanks


Sending to an integrated address asks to accept transfer to a unfamiliar address

I've just tried sending some XMR to an integrated address and when asked to confirm the amount to send to the receiving address, the address shown on the Ledger Nano isn't the integrated address, but the standard Monero address that makes up the integrated address + the Payment ID. I split the integrated address to check it here:
https://xmr.llcoins.net/addresstests.html
So whilst the XMR would end up at the right place if I had gone through with the transaction, this would be confusing for some users as the address they put into the CLI/GUI would be different to the one displayed on the Ledger Nano. I would suspect some would think this was broken. I think the Ledger Nano should display the Integrated address.
I suppose another concern would be that if the Ledger is appearing to strip the Payment ID from the Integrated address on the device, will the CLI/GUI send the Payment ID with the transaction? I suspect the CLI/GUI will send the payment ID, but I didn't test this due to the issue in the next paragraph.
I didn't actually go through with the transaction because of something else that I think this is related to issue #15. The transaction was creating a non-insignificant amount of change and was asking me to accept sending it to an address that was unfamiliar. This is perhaps a bigger issue, but there was no way I was going to test losing that amount of change into the abyss!

Ledger Nano should display the Integrated address as stated above. Very bad user experience for user, since the screen is supposed to be the last check before sweeping all your funds and you want to see the address you input appearing for confirmation.

Same here, when churning to primary address or to subaddress I get following:

I send all to primary address in gui wallet
ledger shows fee --> I accept fee
ledger shows amount 0 and shows different destination address, asks to accept TX --> at this point I just reject the tx, since churning is the total wallet amount I don't want to 'risk' sending it to another address.

thanks for looking into it


Wrong error message when auth failed on target registry

From https://github.com/GoogleContainerTools/jib/issues/712#issuecomment-409403379
The log clearly shows that it's failing on the target registry, but the same log says at the end
> Build image failed, perhaps you should set a credential helper name with the configuration 'from.credHelper' or from.auth
It should say 'to.credHelper' or to.auth. Bonus for being consistent with single quotes.

This actually confused the user to take a wrong action:
https://github.com/GoogleContainerTools/jib/issues/712#issuecomment-408647611

albeit I had to put my username/password to pull a public image from docker hub.

https://github.com/GoogleContainerTools/jib/issues/712#issuecomment-409403379

I did not have an auth field originally and got this error so I assumed I needed one and added it.

Oh jeepers, I meant to file this from #620.

Ah I think I found the issue.
      boolean isRegistryForBase =
          registryUnauthorizedException
              .getRegistry()
              .equals(buildConfiguration.getBaseImageConfiguration().getImageRegistry());
      boolean isRegistryForTarget =
          registryUnauthorizedException
              .getRegistry()
              .equals(buildConfiguration.getTargetImageConfiguration().getImageRegistry());
      boolean areBaseImageCredentialsConfigured =
          buildConfiguration.getBaseImageConfiguration().getCredentialHelper() != null
              || buildConfiguration.getBaseImageConfiguration().getKnownRegistryCredentials()
                  != null;
      boolean areTargetImageCredentialsConfigured =
          buildConfiguration.getTargetImageConfiguration().getCredentialHelper() != null
              || buildConfiguration.getTargetImageConfiguration().getKnownRegistryCredentials()
                  != null;

      if (isRegistryForBase && !areBaseImageCredentialsConfigured) {
        throw new BuildStepsExecutionException(
            helpfulSuggestions.forNoCredentialHelpersDefinedForBaseImage(
                registryUnauthorizedException.getRegistry()),
            registryUnauthorizedException);
      }
      if (isRegistryForTarget && !areTargetImageCredentialsConfigured) {
        throw new BuildStepsExecutionException(
            helpfulSuggestions.forNoCredentialHelpersDefinedForTargetImage(
                registryUnauthorizedException.getRegistry()),
            registryUnauthorizedException);
      }

If the base image registry and target image registry are the same, we assume the problem is with the base image credentials.


Fixed missing editor

In some cases, when editor is just mounted refresh must be called according to the author of CodeMirror: https://stackoverflow.com/a/8353537/125351
Otherwise it may end up not visible until first click.

On the second thought, this PR should probably be discarded.
It adds race condition, which I don't like. E.g. when beforeDestroy() is called before setTimeout()  handler.
I think it would probably be safer to let consumers do this refresh logic via $refs.editor.editor or something like that... What do you think?

I agree. Just let consumer do the refresh logic.


[Bug] Cannot run "php artisan backpack:crud bug" working with Bug.php model

ErrorException
Undefined offset: 1
at C:\wamp64\www\toplitz\vendor\backpack\generators\src\Console\Commands\CrudModelBackpackCommand.php:84
80▕                 if (Str::contains($line, $classDefinition)) {
81▕                     if (Str::endsWith($line, '{')) {
82▕                         // add the trait on the next
83▕                         $position = $key + 1;
➜  84▕                     } elseif ($file_array[$key + 1] == '{') {
85▕                         // add the trait on the next next line
86▕                         $position = $key + 2;
87▕                     }
88▕
1   C:\wamp64\www\toplitz\vendor\backpack\generators\src\Console\Commands\CrudModelBackpackCommand.php:84
Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Undefined offset: 1", "C:\wamp64\www\toplitz\vendor\backpack\generators\src\Console\Commands\CrudModelBackpackCommand.php")
2   C:\wamp64\www\toplitz\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:37
Backpack\Generators\Console\Commands\CrudModelBackpackCommand::handle()

Hello @IazLur
Thanks for the bug report.
I just transfered your issue to the correct repository.
Could you please provide some more info with: php artisan backpack:version and gives us info what version of generators you are loading in your composer.json ?
Thanks in advance,
Pedro

PHP VERSION:
PHP 7.3.12 (cli) (built: Nov 19 2019 13:58:02) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies
LARAVEL VERSION:
v8.6.0@a71952a6dba55de0bb11b5fbbd84874eda2a755c
BACKPACK VERSION:
4.1.25@23fb1ed5153d5465d49d2fe1ca265a5985c78877
"require-dev": {
"backpack/generators": "^3.1",
"facade/ignition": "^2.3.6",
"fzaninotto/faker": "^1.9.1",
"laracasts/generators": "^2.0",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3"
},
@pxpm

Hmm that's weird. It worked fine for me:

@IazLur by any chance did you already have a Bug.php model? If so, we're going to need the code inside Bug.php BEFORE Backpack made any changes to it, to detect what the problem was... What happens is the Backpack tries in this case to add use the CrudTrait inside your existing model. But, depending on how your model is coded, it might fail in some very particular cases. We just need to understand what that particular case is 😄

Hi, I tried to understand where was the bug but I didn't found.
Here id the Bug.php before I made the command.
`
belongsTo(BugGame::class);
    }

    /**
     * @return HasMany
     */
    protected function bugMedias()
    {
        return $this->hasMany(BugMedia::class);
    }

    /**
     * @return BelongsTo
     */
    protected function bugType()
    {
        return $this->belongsTo(BugType::class);
    }

    /**
     * @return BelongsTo
     */
    protected function gameVersion()
    {
        return $this->belongsTo(GameVersion::class);
    }
}
`

Your model already exists.
Remove it and try again the command.

On my side, the bug seems to be with the file being read as 1 big line.
Problem might be here :
$file_array = explode(PHP_EOL, $file);

@dividy could you check if #100 fixes it?
Best,
Pedro

I was about to submit this :
$file_array = preg_split('/\r\n|\r|\n/', $file);

Beat me to it 😄
Your PR works 👍

Model already exists! We just added CrudTrait on it.
Request already exists!
Route already exists!
Sidebar item already exists!

Thanks guys!
The PR was merged and tagged, a composer update should fix it (by getting backpack/generators 3.1.4). So let's close this.
Cheers!


inline_query.py:23: Перенести классы в отдельные файлы 22

The puzzle 899-0a0d2718 from #899 has to be resolved:
https://github.com/blablatdinov/tg-quranbot/blob/faf3d14afbd20f44e1eebc1b0ab150628e5ddda5/src/integrations/tg/inline_query.py#L23-L23
The puzzle was created by Ilaletdinov Almaz on 20-Jun-24.
role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

The puzzle 899-0a0d2718 has disappeared from the source code, that's why I closed this issue.


[WFLY-19176][Preview] Update elytron-oidc-client scope related tests to use optional client scopes for multipleClientScopes test

Issue: https://issues.redhat.com/browse/WFLY-19176

More information about the wildfly-bot[bot]

Thanks @PrarthonaPaul and @fjuma


[SPARK-20003] [ML] FPGrowthModel setMinConfidence should affect rules generation and transform

What changes were proposed in this pull request?
jira: https://issues.apache.org/jira/browse/SPARK-20003
I was doing some test and found the issue. FPGrowthModel setMinConfidence should always affect rules generation and transform.
Currently associationRules in FPGrowthModel is a lazy val and setMinConfidence in FPGrowthModel has no impact once associationRules got computed .
I try to cache the associationRules to avoid re-computation if minConfidence is not changed, but this makes FPGrowthModel somehow stateful. Let me know if there's any concern.
How was this patch tested?
new unit test and I strength the unit test for model save/load to ensure the cache mechanism.

ping @jkbradley and @srowen to be aware of the issue.

Test build #74752 has started for PR 17336 at commit 3398d62.

Test build #74752 has finished for PR 17336 at commit 3398d62.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74752/
Test PASSed.

Test build #74995 has started for PR 17336 at commit 9c046c3.

Test build #74995 has finished for PR 17336 at commit 9c046c3.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74995/
Test PASSed.

Merged build finished. Test PASSed.

ping @jkbradley as this is something we should fix before release.

Thanks for this PR!  Do you think it's worth adding the caching logic?  I'm now wondering if we should change associationRules into a method which recomputes the DataFrame every time it is called.  That will make it easier for the user to understand the semantics, and it would be easy for a user to define a val to hold onto the computed DataFrame if needed.
Would you mind updating this accordingly?  Thanks!

The major thing I'm concerned is that transform will have to recompute the association rules each time it's invoked. If that's not a problem,  changing association rules to method would be much simpler.

Test build #75448 has started for PR 17336 at commit a95a07a.

Test build #75448 has finished for PR 17336 at commit a95a07a.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/75448/
Test PASSed.

Test build #75517 has started for PR 17336 at commit 81bce96.

Test build #75517 has finished for PR 17336 at commit 81bce96.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/75517/
Test PASSed.

Merged build finished. Test PASSed.

Thanks a lot for the second update!  This LGTM
Merging with master


side tab for clue stash units

would be nice to be able to see all the stash units in a side tab
shows if stash unit has been built
shows the items that go into that unit
green tick item in the the stash
blue circle if items in the bank or inventory
Red Cross if do not have item
Notification in chat if you pick up an item that is needed for stash units
option to show stash units location on map

Duplicate of #1662


No error with Partial<Record<number, {}>> in object spreading

TypeScript Version:  3.8.3

Search Terms: [type inference], [partial], [record], [object spreading]
Code
type Point = {
  x: number
  y: number
}

type Space = Partial<Record<number, Point>>

function addPointReducer(point: Point, pointId: number, prevSpace: Space): Space {
  const prevPoint = prevSpace[pointId]

  return {
    ...prevPoint,
    [pointId]: point,
  }
}

Expected behavior:
Should throw an error on ...prevPoint because Point doesn't equal to Space.
Actual behavior:
No error.
Playground Link: https://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=17&pc=1#code/C4TwDgpgBACg9gSwHbCgXigbwFBSgDwC4okBXAWwCMIAnXKEYsq27AX221EigGUwAhgGNoGGAJrAEAgDYAeAEoQhcGgBM5zajQA0sRCgB8hztgBmpJEKlwkUAWrXxkwJWtIiaACjAHgxZxQ9XxcASTUmCm1gmggAN35hCGJEkQBKFMERLHoVJABnVDBYuMDUDGL41IgAbRCUcIBdTjxY4FIaOxw8PAA6fsrSvx16PDq-JuJ64BG8Dg4gA
Related Issues:

@ahejlsberg I've been looking at a few of these and don't feel like I have a good handle on our policy on computed property keys in these positions. Are they ever excess? How are they checked?

Too explained this issue on SO with spreading with number keys.
https://stackoverflow.com/questions/63037175/typescript-some-strange-spread-allowed-that-breaks-typings
Why this works without error:
interface S {
  chats: {
    [ChatId: number]: {
      name: string
      messages: []
    }
  }
}

const s1: S = {
  chats: {
    [1123]: {
      name: 'some',
      messages: [],
    },
  },
}

const s2: S = {
  chats: {
    ...s1,
  },
}

console.log('s2', s2)

Ts playground
This definilty gives illegal result: s2 { chats: { chats: { '1123': [Object] } } }

This is likely highly related to https://github.com/microsoft/TypeScript/issues/27273


Pretrained weights damaged. Winrar cant extract anything

Downloaded from the link given but it says its damaged. I have found somewhere inference .npz files. Could they be used?

Hi - these weights are not damaged. Simply point the code to the zipped file and the code will do it's job. You should not try and extract.

Hi - these weights are not damaged. Simply point the code to the zipped file and the code will do it's job. You should not try and extract.
Thankyou for the prompt response. Did as you said, got this runtime error :

Hi, I am also facing damaged pretrained weights issue. Have you resolved this problem or it still persists?

Hi, I am also facing damaged pretrained weights issue. Have you resolved this problem or it still persists?

Yes just like he mentioned above, you dont need to unzip them. Pass as an argument as is. check the image i have attached above.

Yes, I did the same but It's giving the same runtime error of missing keys. Can you please let me know how you managed to resolve that issue?

Like, Have you used the .npz file instead of .tar weights available in the original repo?

i had the error but didnt dig deeper into it. My main goal was the repo Nuc2Vec which has one component of hovernet so i skipped it.

There are 2 HoVerNet repositories, the one by Simon was for inference using Tensorflow checkpoints. This repository is solely for Pytorch now. Any pretrained weights that are included here should be used only you know well what you are doing.
Any checkpoints obtained by training the model using the code in this repos can be loaded and accessed via brief template here https://github.com/vqdang/hover_net/issues/213#issuecomment-1141128669 . Please make sure that you instantiate the model with correct number of types.


The "red" color prominence in base16 editor colourschemes for non-error code

I once showed a few base16 text editor colourschemes to someone and they said that they would not use it because they all use the colour “red” a lot and “red” indicates an error to them (which is a reasonable).
Since then I haven’t really been able to get that out my head. BASE_08 is often used as the standard text colour but it’s also used for errors and is often red. Errors don’t stand out because it’s the colour of text and you need to understand the context in which errors are shows to understand it’s an error. Syntax highlighting is meant to convey meaning (it’s nice if it looks good too) and meaning is lost when it comes to errors compared almost any other editor theme I've used before. The base16 styling page mentions:

base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted

I'm guessing it's used for errors due to the Diff Deleted colouring? Here is a side by side example of a sample piece of code from base16-builder-go with vscode using the top theme vscode extension for that specific theme:

Theme
Base16 version (vim)
VSCode extension version

Ayu dark

Gruvbox dark medium

Monokai

Nord

Solarized light

Below is an example of side by side typescript with errors in VSCode. I've included Gruvbox which is quite "red" heavy and nord which has basically no "red".

Theme
VSCode Base16-Theme-Generator
VSCode Nord extension

Gruvbox dark medium

Nord

I picked these themes because they're all very popular themes.
Conservatively, Base16 has at least double the amount of "red" in it's themes than the "official" or most popular VSCode equivalents when not displaying errors. I suspect this is a systemic problem, otherwise it wouldn't be so prevalent in basically ever theme (but I could be wrong).
@base16-project/base16-project-team what your thoughts are on this? Is there something we can do about it?

Base9 addressed it and is explained here
From a implementation stand point. It's achieved the following way:
Given list of colors specified by the theme, programmatically calculate the color that's closest to red. Assign it to a mustache variable called red or error. Then, the template can decide on whether to use BASE_08 (which can be any color) or red (color that's closest to red in the theme).
Reference:
Code that calculate what's closest to red
Example of use of red in template
Base16 could also do something similar.

For reference if someone would like to see a wider variety of Base16 themes and broader sample of languages/code samples you could check out the Highlight.js Demo site...
https://highlightjs.org/static/demo/
All the Base16 themes are grouped together...  so just find a few languages you'd like to click thru then just click the themes sequentially on the left to switch between themes...   How Highlight.js maps base08:
.hljs-bullet,
.hljs-variable,
.hljs-template-variable,
.hljs-selector-tag,
.hljs-name,
.hljs-deletion {
  color: #{{base08-hex}}; }

Personally I don't see a huge problem (with just a quick glance)... it's definitely way worse if you're handed variable heavy code... (as with the original examples posted in this issue)

semantic meaning of base-colors is good topic to raise, i'd also add what for using base-colors for theming GUI apps it'd be useful to also have an understanding of at least following colors:

background
foreground
accent/selection
error
success
warning

@lijiaqigreat I really like the idea of absolute colours. @actionless some of those are addressed in https://github.com/base16-project/base16/blob/main/styling.md but would definitely be good to have colours to use fo error/warning/success.

@JamyGolden thanks, i'll check if my adapters for base16 are following that guideline

regarding Success/Error/Warning, what about reusing these 3:
base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
base0B - Strings, Inherited Class, Markup Code, Diff Inserted
base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed

Are those differences in the template implementation it else for though or in the editors syntax highlighting engine?

I'm not sure yet but I just assumed template implementation, I just opened this up to compare a few minutes ago and didn't expect the big difference.

@joshgoebel in many css themes of apps or websites such approach is used but idk how close we could get there with our current situation:
--red: #00ff00;
--blue: #00ff00;
--green: #0000ff;

--error: var(--red);
--success: var(--green);

and element colors are assigned from named colors instead of absolute colors

I don't know how that helps if I want errors to be RED but variables to be GOLD and the standard says I only have a single color, Base08 to do that with... this isn't a naming problem AFAICT.

Wouldn't a better way to study this be to just analyze mathematically the base08 and base0B color of ALL schemes and see what that color distribution looks like?
-What I'd hope to see is a widely varied distribution across all the themes...

What is being surmised here is that many to most of the themes skew towardsred for base08 and green for base0B

If this can be shown concretely then I'd say we have a problem that styling needs to address.  When designing a theme I don't think one's hands should be tied in this matter - choosing between making diffs look "reasonable" and picking the colors you might otherwise want.
I'm not sure that 16 unnamed, numbered colors will continue to be sufficient... it may be that I want to specify:

variables: gold
removed lines: red

It seems that as long as I still have 16 total colors that I should be able to say:

use the red color (base02) for "Diff Deleted"

And if this were shown to be a problem I'd propose a minimal fix, the addition of a small number of named aliases that are allowed to point back into the existing palette.  Templates could use these by name and builders would default to the style guidelines when the named aliases were not present... if if diff_added was missing, then it would default to base08, as it has historically.
scheme: "Scheme Name"
...
base02: "222222"
base0F: "ffffff"
...
diff_added: base02
diff_removed: base06

yeah, the latter i think would be less painful considering it would have reasonable fallbacks

Yeah I think that’s a good idea. I’m going to be away from my computer for a few days; does anyone want to write a script for the analysis? If not, then I’ll do it when I’m back next week.

Made a chart for it:
https://docs.google.com/spreadsheets/d/1ejVo3o_CD9PtnC02kVhi9h3JyC2s0ZoewdTylorvF-E/edit#gid=286940616
Gave everyone edit access. Please don't abuse it...
It works in LAB color space.
For each scheme, it computes the average LAB for all 16 colors, then plots (BASE_08.A - average A) against (BASE_08.B - average B) as a dot on the chart for each scheme.
Here is a visualization of LAB color space:
https://www.fsw.cc/wp-content/uploads/2017/01/CIELAB-Full-Color-Graphic-e1485790949295.png
It shows that there is some skew toward red, but there is quite some variation. How much skew and variation is good amount is up to debate.

amazing job @lijiaqigreat
could you please share here the averaged #ff0000 hex values of the all themes?

I added a data dump for rgb values. Feel free to add a tab with your name or clone the sheet to do your own analysis. Made an error in excel, the skew is much worse and spread is much worse than the previous result.

If this can be shown concretely then I'd say we have a problem that styling needs to address.

I think it's fair to say it concretely shown that there is a systematic skew towards red for BASE08 and green for BASE0B.

Is the real problem just with red and green, or are too many themes only minor variants of the colors from the logo?  Do we need to have a filter function here to filter out that "noise"?  I've noticed this before in passing that a lot of themes follow that pattern... You might expect for a theme that prefers "more colors" to have a spread (a green, a red, a yellow, etc.)... but that a majority should all decide to use the same colors for the same things semantically - seems to be kind of weird.

@actionless Can you share your code for building the averages?

It's all in the sheet
https://docs.google.com/spreadsheets/d/1ejVo3o_CD9PtnC02kVhi9h3JyC2s0ZoewdTylorvF-E/edit?usp=drivesdk

Oh I was hoping for source that I could run against the actual schemes repository dataset...

I'll look into adding a hivemind generator to the go builder. That could be fun.


Fix UI anomalies

Before:

After:

Remove the scroll bar exception that in the a tag
Reduce the actual width of the a tag to the actual width of the content

As shown in the screenshot, the red box area should not be clickable

For current

For #25597

After reading the code again, I think the root problem is that the Fomantic List has some pre-defined "line-height"
ul.ui.list li,
ol.ui.list li,
.ui.list > .item,
.ui.list .list > .item {
  display: list-item;
  table-layout: fixed;
  list-style-type: none;
  list-style-position: outside;
  padding: 0.21428571em 0;
  line-height: 1.14285714em;
}

I believe the line-height fix should be applied to the "li / item" selector.

I guess we can just override the Fomantic UI variable itemLineHeight and build Fomantic again?

I guess we can just override the Fomantic UI variable itemLineHeight and build Fomantic again?
https://github.com/go-gitea/gitea/blob/main/web_src/fomantic/_site/globals/site.variables
Then maybe many patched styles could also be removed.

Personally, I don't think override the Fomantic UI variable is a better solution.

it requires separate compilation
it can affect some internal computational logic in Fomantic. For example, the itemLineHeight variable you mentioned has multiple references within Fomantic, making it difficult to maintain such modifications

So, I think it's easier to maintain it in gitea's own css as needed, but it's also possible that I'm not thinking enough.

I would prefer to change @itemLineHeight variable.
@silverwind what do you think?

I would prefer to change @itemLineHeight variable.
@silverwind what do you think?

In fact, I have tried, as I said, because of internal dependencies, resulting in changes will need to do all kinds of compatibility;
Here are some of the dependencies I analyzed:

https://github.com/fomantic/Fomantic-UI/blob/2.8.7/src/definitions/elements/list.less#L61

/* List Item */
ul.ui.list li,
ol.ui.list li,
.ui.list > .item,
.ui.list .list > .item {
    ...
    line-height: @itemLineHeight;
}

https://github.com/fomantic/Fomantic-UI/blob/2.8.7/src/themes/default/elements/list.variables#L20

@itemLineHeight: @relativeLarge;

https://github.com/fomantic/Fomantic-UI/blob/2.8.7/src/themes/default/elements/list.variables#L49

@contentLineHeight: @itemLineHeight;
@contentLineHeightOffset: ((@contentLineHeight - 1em) / 2);

https://github.com/fomantic/Fomantic-UI/blob/2.8.7/src/themes/default/globals/site.variables#L671

@relativeLarge: unit(@largeRaw, em);

This PR focuses on itemLineHeight, We can change itemLineHeight from elements/list.variables or relativeLarge from globals/site.variables, After I try to make only the above changes, the following exception occurs:
Potentially unhandled rejection [2] Error: Error in plugin "gulp-less"
Message:
    Operation on an invalid type in file /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/src/themes/default/elements/list.variables line no. 48
Details:
    type: Operation
    filename: /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/src/themes/default/elements/list.variables

    index: 1081
    line: 48
    column: 15
    callLine: NaN
    callExtract: undefined
,@contentLineHeight: @itemLineHeight;
    lineNumber: 48
    fileName: /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/src/themes/default/elements/list.variables
    at DestroyableTransform.errorHandler (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/tasks/config/tasks.js:124:19)
    at DestroyableTransform.emit (node:events:525:35)
    at DestroyableTransform.emit (node:domain:489:12)
    at onwriteError (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_writable.js:449:12)
    at onwrite (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_writable.js:470:11)
    at WritableState.onwrite (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_writable.js:180:5)
    at DestroyableTransform.afterTransform (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_transform.js:93:3)
    at /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/gulp-less/index.js:58:14
    at tryCatchReject (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/when/lib/makePromise.js:845:30)
    at runContinuation1 (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/when/lib/makePromise.js:804:4)
Potentially unhandled rejection [4] Error: Error in plugin "gulp-less"
Message:
    Operation on an invalid type in file /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/src/themes/default/elements/list.variables line no. 48
Details:
    type: Operation
    filename: /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/src/themes/default/elements/list.variables
    index: 1081
    line: 48
    column: 15
    callLine: NaN
    callExtract: undefined
,@contentLineHeight: @itemLineHeight;
    lineNumber: 48
    fileName: /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/src/themes/default/elements/list.variables

    at DestroyableTransform.errorHandler (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/fomantic-ui/tasks/config/tasks.js:124:19)
    at DestroyableTransform.emit (node:events:525:35)
    at DestroyableTransform.emit (node:domain:489:12)
    at onwriteError (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_writable.js:449:12)
    at onwrite (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_writable.js:470:11)
    at WritableState.onwrite (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_writable.js:180:5)
    at DestroyableTransform.afterTransform (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/readable-stream/lib/_stream_transform.js:93:3)
    at /kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/gulp-less/index.js:58:14
    at tryCatchReject (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/when/lib/makePromise.js:845:30)
    at runContinuation1 (/kerwin612/.linux/ws/gitea/web_src/fomantic/node_modules/when/lib/makePromise.js:804:4)
[09:02:56] The following tasks did not complete: build, build-css, <series>, <series>, Building uncompressed CSS, Building compressed CSS
[09:02:56] Did you forget to signal async completion?
make: *** [Makefile:947: fomantic] Error 1

Because I think this change may be more and more difficult to maintain, so I did not continue, as I replied earlier, I don't quite agree with this modification.

In fact, I have tried, as I said, because of internal dependencies, resulting in changes will need to do all kinds of compatibility;

Thank you for sharing your findings. Although I have read your comment carefully, my initial thought is "we can override the computed variables together". But it looks that it is more complex than it should be.
TBH, there is still another problem in this PR: the .ui.list .item styles don't seem good to mix with ui.input > input, which have other unrelated styles.

@kerwin612 changes looks good code viz but due to language barriers could you add some context about this Pr in the description or in PR title. Easy for others too look into.
Thanks for this change. Appreciate.
Let's roll this change.
🚀
Backport.

I would prefer to change @itemLineHeight variable.
@silverwind what do you think?

If it works, sure. My experience with Fomantic vars is that some work, some don't for unknown reason. I think this one doesn't.

I was unable to create a backport for 1.20. @kerwin612, please send one manually. :tea:
go run ./contrib/backport 26961
...  // fix git conflicts if any
go run ./contrib/backport --continue


VSC doesn't start hidden on Mac

I've put VS Code in my "Login Items" on my Mac, so that it starts when I login on my Mac. I also checkmarked the "Hide" option. But when I start my Mac, my other apps like Chrome are hidden on startup, but VS Code is not.

@garyking does it work with other Electron applications like Whatsapp for Desktop?

I tested with Insomnia. It doesn't start hidden too. So it seems to be an Electron problem. I figured it was likely to be the case.

Hello, so it seems like VS Code will need to implement Electron APIs to make this work for itself. Relevant comment here.

@garyking great findings, I was not aware of that API.

@garyking I wonder what the expectation is to support this setting (also @weinand as macOS expert on this topic). I tested with Safari and Chrome and when I configure these applications to start hidden on login I can see that the applications opens without any windows opened (as expected). As soon as I click the dock icon, a window opens.
What is unclear to me is if clicking the dock icon should perform the same as clicking on the dock when all windows are closed. For VS Code this means to open an empty window. However if we did that, this would mean that we would never restore the last session that was active, you would always end up with an empty window (unless maybe you right clicked on the dock icon and picked a folder from the previous session).
And there is another challenge: If you quit with some files dirty ("hot exit") we always forcefully restore these windows upon next start so that the work is not lost in these dirty files. I am not sure how this feature could work together with starting VS Code hidden upon login. I think if you leave with dirty files we need to make those windows visible that contain dirty files, anything else would be quite complicated for us to implement I fear.

I wonder if that could mean it would be OK for us to restore any windows from the previous session but simply not show the windows until the dock icon is clicked. This is a bit challenging though because a user could Alt+Tab into the application and start to use the application menu (e.g. File > New Window). In that case, I guess all other windows would need to become visible too?

Yes this is best.
When VSC is in Login Items and Hidden, I would prefer if it restored all windows like a normal startup, and just hides them. Then if they Alt+Tab into VSC, then just show all the windows.

I think Electrons APIs do not allow me to open a window without moving it to the foreground so it will  be hard to implement this properly.
I am open to help here if someone has ideas how to implement this best with Electron. Some API pointers how to create a BrowserWindow.


Visual telling the player to click in the window before starting

Maybe programatically tell if we have focus?

Just some text for now, should help.


Printing a web page in Firefox or IE doesn't show the calendar data currently in view

I have my calendar load with a particular date in view, showing items between the hours of 06:00 and 20:00. The calendar is scrollable, showing +/- 7 day's worth of data from the selected date.
Printing the webpage with either CTRL+P or using a window.print() method should print the page verbatim (I'm not using any media-based stylesheets). This works fine in Chrome, but appears to print data not currently in view, and roughly half a day in the past in Firefox and IE, and misses some of the visual information (such as the date in the top bar).
I'm unsure if this is likely to be related to my own code, the source code, or a "feature" of Firefox/IE.
The below screenshots are with the exact same data in view in the browser:
Chrome print output

Firefox print output

IE print output

Library Version: 0.23 (I'm conscious this is not the latest)
Desktop: Windows 7 (64 bit)
Browser(s):
Chrome 74.0.3729.169
Firefox 66.0.6
IE 11.0.9600.19356

@TomJones2822 please provide a codesandbox of your code so I can reproduce


Update MLOps Stacks to Use Databricks Asset Bundles

Do we want to tag the pre-bundles version with a release tag or something? In case users want to refer to it and use it for some reason.

Do we want to tag the pre-bundles version with a release tag or something? In case users want to refer to it and use it for some reason.

Yeah I was thinking about that but they can also just refer to the commit right before this release. But also release tags are free so I can just do it too 😛


draft: js bindings for deltalake

Description
The description of the main changes of your pull request
Related Issue(s)
closes https://github.com/delta-io/delta-rs/issues/2342
Documentation

Nice start @universalmind303 ! I would recommend we split this into a separate repository to evolve independently like @mightyshazam has started with delta-dotnet. That will allow iteration without needing to take on all the CI and other processes we have out of necessity in this project.
My recommendation would be to start a new repo with this work, and then we can suggest it for the inclusion in as an incubating project if you'd like

My recommendation would be to start a new repo with this work, and then we can suggest it for the inclusion in as an incubating project if you'd like

sure that sounds good. Ill close this PR, and continue work on the bindings in a separate repo.


Feature: Send metadata to creator in separate message

When creating a Laisee, some metadata could be sent to its creator in a separate message:

Date created
Amount
ID
Expiration date
Raw LNURL (ideally as a hyerlink with the lightning: prefix)

See commit:
https://github.com/bitkarrot/laiseebot/commit/b3322073d46c54f8799d530d96e6d02998b37860

Closing this issue


Allow disabling the product hunt search engine

Currently the chrome extensions defaults to product hunt search when I type "product" into the google search bar. I haven't found a way to disable. I type the word "product" very often in other context and it is quite frustrating that I want to uninstall the chrome extension all together!

Would you be able to add an option to disable the search engine feature?

+1 on this.
It's incredibly frustrating that this extension forces the enabling of such a short-sighted search keyword, which interferes with normal use of the URL bar. The only way to disable the feature is to completely disable the extension. The only thing I use the extension for is to have PH displayed in my new-tab view. If I had wanted PH as a search engine, I would have just added it myself, if only the PH search bar was recognizable as a search bar by Chrome (which it's not).
The extension options has one option titled "Disable product bar", for which there is no tool tip, and which seems to have no effect on the search engine feature.
The extension should provide both the ability to disable the search engine feature, as well as the keyword.

@rm-rf-etc @sidazhang, sadly the omnibox feature must be defined in the static manifest.json file and as far as I know, cannot be disabled dynamically (if you know a way, lmk!) https://github.com/producthunt/producthunt-chrome-extension/blob/master/src/manifest.json#L29
We've changed the keyword to ph which will hopefully result in less conflicts. We will push the new version on the Chrome Web Store soon-ish.
If you have any better suggestions, please feel free to let me know.

@vesln
ph sounds fine by me :+1:
Any idea when you might push an update?

We are working on a minor update of the extension and we will release a new version soonish. Thanks all for the feedback!

Deleting the app until this is fixed. Enabling the "disable product bar" option does nothing.

@TrevorColeman Also deleted the extension. It is too intrusive

Any news here? It would be great if this was solved. Changing the keyword to ph or something other than a commonly used word would do it!

I don't see the point. This ticket has been around for close to 2 years.
the product hunt extension honestly it not the useful anyway, you should
just delete it
On Wed, Jan 25, 2017 at 1:50 AM, DiogoAdaoeSilva<EMAIL_ADDRESS>wrote:

Any news here? It would be great if this was solved. Changing the keyword
to ph or something other than a commonly used word would do it!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/producthunt/producthunt-chrome-extension/issues/8#issuecomment-275064325,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADWyi1n8H2oWfKxrwb7ogrCZ65i11zb5ks5rVxrzgaJpZM4EKN54
.

--
Kind regards,
Sidney Zhang
Mobile: +1<PHONE_NUMBER>

We are working on update which would be available in February which would fix this issue.

@RStankov lol you guys also said the same thing on August 10th 2015 and May 12th 2016

@sidazhang true, but this time would be different :)

I love the extension but couldn't use it as I frequently search for terms beginning with "product". The above mentioned update with the changed omnibox keyword to "ph" was nowhere to be found (the extension I downloaded from the chrome webstore still uses "producthunt"), I ended up modifying the manifest.json file myself with a little help from a plugin called Chrome Extension Source Viewer.
If you're too lazy to do this yourself, you can find the modified extension to use on my github in the meantime before the authors fix the issue. @vesln @RStankov are you cool with this ?

@vesln, @RStankov, what is preventing a release to fix this issue? Is it not possible or reasonable to branch off the last release, apply the change, release, and then merge the hotfix release into develop (or whichever branch you're working off of)? I don't know anything about how the chrome web store works, but I would think small fixes would be allowed.

We are working on update which would be available in February which would fix this issue.

lol. @rm-rf-etc @sebosik I have already identified the correct fix to this problem about a year ago which is to delete the chrome extension.

Closing the issue because the correct fix is to delete this chrome extension

@sidazhang, I'm confused, I like having product hunt in the new tab view. I don't want to delete the extension. How is that a fix?

I was being sarcastic because It has been 2 years and 3 different promises.

+1

it's 2018, did anybody got the solution or we need to disable the extension. Because it was super annoying.


Poor calibration when using sample_weights

Description
I am using LightGBM to model an imbalanced binary classication problem (positive label rate is around 1:200). The data has been asymmetrically subsampled (90% of negative class observations are removed) to reduce data volume. I have accordingly set the sample weight for all negative class observations to 10.
The issue is that LightGBM exhibits very poor calibration on the holdout (test/validation) data when sample weights are used for this kind of imbalanced problem. In particular, for minority positive labels, LightGBM's predictions on the test data are consistently 10%-20% higher than for the train data (despite the fact that the data comes from the same distribution).
When the model is aggressively tuned to under-fit (e.g. by setting high values for min_data_in_leaf or min_sum_hessian_in_leaf), this problem disappears. For this reason, my interpretation is that this is a kind of overfitting. But the hyperparameters which minimise the objective (i.e. log loss) seem to consistently result in poor calibration.
Do you have any recommendations to mitigate this issue and ensure that predictions are well calibrated? I currently tune a large number of hyperparameters, including any that seem to be related to overfitting (max_depth, learning_rate, path_smooth, min_data_in_leaf, min_sum_hessian_in_leaf, min_split_gain, num_leaves, num_iterations, etc.)
Reproducible example
import random
import numpy as np
from lightgbm import LGBMClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.metrics import log_loss

random.seed(0)
np.random.seed(0)
X, y = make_classification(n_samples=10**6, n_informative=10, weights=[0.99, 0.01])

# Subsample negative class
subsample_rate = 0.1
keep_sample = np.logical_or.reduce([y == 1, np.random.rand(y.shape[0]) < subsample_rate])
X = X[keep_sample]
y = y[keep_sample]

w = np.ones_like(y) / subsample_rate
w[y == 1] = 1

X_train, X_test, y_train, y_test, w_train, w_test = train_test_split(X, y, w)

clf = LGBMClassifier(random_state=0)
clf.fit(X_train, y_train, sample_weight=w_train)

p_train = clf.predict_proba(X_train)[:, 1]
p_test = clf.predict_proba(X_test)[:, 1]

print(f'Train loss: {log_loss(y_train, p_train, sample_weight=w_train)}')
print(f'Test loss: {log_loss(y_test, p_test, sample_weight=w_test)}')

print(f'Mean pred train: {(p_train * w_train).sum() / w_train.sum()}')
print(f'Mean label train: {(y_train * w_train).sum() / w_train.sum()}')

print(f'Mean pred test: {(p_test * w_test).sum() / w_test.sum()}')
print(f'Mean label test: {(y_test * w_test).sum() / w_test.sum()}')

Output:
Train loss: 0.040031721581402745
Test loss: 0.0502729675920403
Mean pred train: 0.015120217715055714
Mean label train: 0.015096301218636456
Mean pred test: 0.017147299168392718
Mean label test: 0.014936516793044344

We observe that the average prediction on test data is significantly higher (~15%) than the average prediction on train data, even though the two distributions are the same. In this example there is no hyperparameter optimisation, but in other instances i have observed exactly the same over-prediction behaviour despite an extensive hyperparameter search (via Optuna). It seems that optimising the test/validation objective does not necessarily guarantee well-calibrated predictions when sample weights are used.
Environment info
LightGBM version or commit hash: 3.3.5
Command(s) you used to install LightGBM
poetry add lightgbm

Update: I wanted to justify this claim more thoroughly:

It seems that optimising the test/validation objective does not necessarily guarantee well-calibrated predictions when sample weights are used.

To this end, I extended the example above with a quick-and-dirty hyperparameter search:
...

grid = ParameterGrid(
    {
        'min_child_weight': np.logspace(-1, 2, num=4),
        'learning_rate': np.logspace(-2, 0, num=4),
        'num_iterations': np.logspace(2, 3, num=4)
    }
)
test_loss = []
test_calib = []
for params in grid:
    clf = LGBMClassifier(random_state=0, **params)

    ...

    test_loss.append(log_loss(y_test, p_test, sample_weight=w_test))
    test_calib.append(
        (p_test * w_test).sum() / w_test.sum()
        / ((y_test * w_test).sum() / w_test.sum())
    )

plt.scatter(test_loss, test_calib)
plt.xlim(0.04, 0.08)
plt.ylim(0.95, 1.5)
plt.xlabel('Log loss')
plt.ylabel('Calibration')

This gives:

This reinforces (I think) that there is a clear tendency for poorly calibrated estimations when optimizing for test log loss.

Let me know if further explanation is needed :)

Let me know if you need any further explanation :)


OpenAI-Compatible RESTful API 并不支持function_call吗？我用https://platform.openai.com/docs/guides/function-calling的例子测试了下，但发现始终返回的是function_call=None, tool_calls=None

# https://platform.openai.com/docs/guides/function-calling
from openai import OpenAI
import json

client = OpenAI(
    base_url="http://<IP_ADDRESS>:8000/v1",
    api_key="simple"
)

# Example dummy function hard coded to return the same weather
# In production, this could be your backend API or an external API
def get_current_weather(location, unit="fahrenheit"):
    """Get the current weather in a given location"""
    if "tokyo" in location.lower():
        return json.dumps({"location": "Tokyo", "temperature": "10", "unit": unit})
    elif "san francisco" in location.lower():
        return json.dumps({"location": "San Francisco", "temperature": "72", "unit": unit})
    elif "paris" in location.lower():
        return json.dumps({"location": "Paris", "temperature": "22", "unit": unit})
    else:
        return json.dumps({"location": location, "temperature": "unknown"})

def run_conversation():
    # Step 1: send the conversation and available functions to the model
    tools = [
        {
            "type": "function",
            "function": {
                "name": "get_current_weather",
                "description": "Get the current weather in a given location",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "The city and state, e.g. San Francisco, CA",
                        },
                        "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
                    },
                    "required": ["location"],
                },
            },
        }
    ]

    messages = [{
                "role": "system",
                "content": f"你是一个人工作智能助手，帮助回答用户的问题，必要时可以调用工具，回答用户问题。下面是你可以调用的工具:\n{tools}\n  请明确返回是否需要调用工具，并返回调用该工具所需的参数。"
            },
            {"role": "user",
             "content": "What's the weather like in San Francisco, Tokyo, and Paris?"}
            ]

    response = client.chat.completions.create(
        model="chat",
        messages=messages,
        tools=tools,
        tool_choice="auto",  # auto is default, but we'll be explicit
    )
    response_message = response.choices[0].message
    print(response_message)
    tool_calls = response_message.tool_calls
    # Step 2: check if the model wanted to call a function
    if tool_calls:
        # Step 3: call the function
        # Note: the JSON response may not always be valid; be sure to handle errors
        available_functions = {
            "get_current_weather": get_current_weather,
        }  # only one function in this example, but you can have multiple
        messages.append(response_message)  # extend conversation with assistant's reply
        # Step 4: send the info for each function call and function response to the model
        for tool_call in tool_calls:
            function_name = tool_call.function.name
            function_to_call = available_functions[function_name]
            function_args = json.loads(tool_call.function.arguments)
            function_response = function_to_call(
                location=function_args.get("location"),
                unit=function_args.get("unit"),
            )
            messages.append(
                {
                    "tool_call_id": tool_call.id,
                    "role": "tool",
                    "name": function_name,
                    "content": function_response,
                }
            )  # extend conversation with function response
        second_response = client.chat.completions.create(
            model="chat",
            messages=messages,
        )  # get a new response from the model where it can see the function response
        return second_response
print(run_conversation())

打印返回结果如下:
ChatCompletionMessage(content="Yes, I need to call the tool to get the current weather for each location. Here are the parameters for each city:\n\n1. San Francisco, CA\n2. Tokyo, Japan\n3. Paris, France\n\nUnit will be assumed as 'celsius' for all cities unless specified otherwise.", role='assistant', function_call=None, tool_calls=None)

对 OpenAI-Compatible RESTful API 还不支持function_call


Feedback for: Introduction to Progressive Web App Architectures [en]

https://github.com/google/WebFundamentals/blob/master/src/content/en/ilt/pwa/introduction-to-progressive-web-app-architectures.md
In the Registering a Service Worker section, the numbering and indentation should match the source doc.

When the export happens, it sees these sections as a new block element, and thus it restarts the number. Fixing these is going to be a bit harder.

Merging to #4261


errors in starting example app due to issues with gulp 3.9.2 and node 12

As no specific version of node/gulp is noted in the guide, i have installed latest node and gulp 3.9.2 (by using npm install). It turns out that due to graceful-fs version mismatch, the app won't load. See this for the error + fix:
https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: d4ce9745-5765-dae3-2d5b-2a24cfd787bb
Version Independent ID: 8d21fd6b-15a4-dc2a-c8c2-fc0e04c15f7f
Content: Tutorial: Node.js app with MongoDB - Azure App Service
Content Source: articles/app-service/tutorial-nodejs-mongodb-app.md
Service: app-service
GitHub Login: @cephalin
Microsoft Alias: cephalin

@yoadfe Thanks for the feedback! We are currently investigating and will update you shortly.

@yoadfe Thanks for bringing this to our attention. Your feedback has been shared with the content owner for further review.

As no specific version of node/gulp is noted in the guide, i have installed latest node and gulp 3.9.2 (by using npm install). It turns out that due to graceful-fs version mismatch, the app won't load. See this for the error + fix:
https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: d4ce9745-5765-dae3-2d5b-2a24cfd787bb
Version Independent ID: 8d21fd6b-15a4-dc2a-c8c2-fc0e04c15f7f
Content: Tutorial: Node.js app with MongoDB - Azure App Service
Content Source: articles/app-service/tutorial-nodejs-mongodb-app.md
Service: app-service
GitHub Login: @cephalin
Microsoft Alias: cephalin

I had the same problem. I changed the package.json file and changed the gulp version using:  "gulp": "^4.0.2", But there are still other errors.

@yoadfe Thanks for bringing this to our attention. Your feedback has been shared with the content owner for further review.

Has this problem being fixed? I can't learn from this tutorial as is.

Sorry for the delay. I've discovered that MEAN.js has become out of support at some point. I've rewritten the tutorial based on a new sample.


[react-*]: Remove extended internal data attributes

What do we think of this approach? If we're happy, I'll apply it across all of the others as part of this PR.

@chaance We've come full circle here and added a prop like you originally suggested. However, it's not just a prop to solve our internal issues now as I had an idea to make it useful for consumers: https://github.com/radix-ui/primitives/pull/397#issuecomment-760242925
This feels much better, gives us the prop you wanted and makes me happy because we're not just exposing something to solve an internal problem. Consumers can customise selectors now 🎉

@chaance We've come full circle here and added a prop like you originally suggested. However, it's not just a prop to solve our internal issues now as I had an idea to make it useful for consumers: https://github.com/radix-ui/primitives/pull/397#issuecomment-760242925
This feels much better, gives us the prop you wanted and makes me happy because we're not just exposing something to solve an internal problem. Consumers can customise selectors now 🎉

♥ this new approach.
I think if we go for that we should rename that namespaced util, feels a bit general in global context like that. But otherwise it's awesome.

♥ this new approach.
I think if we go for that we should rename that namespaced util, feels a bit general in global context like that. But otherwise it's awesome.

@benoitgrelard sure, what naming do you think works better for that? Maybe just getSelector?

@benoitgrelard sure, what naming do you think works better for that? Maybe just getSelector?

Yeah probably something like that, although it is probably used for other stuff too. So either we find a more applicable generic name, or I don't mind if we just do const getSelector = val => namespaced(val); either.

Yeah probably something like that, although it is probably used for other stuff too. So either we find a more applicable generic name, or I don't mind if we just do const getSelector = val => namespaced(val); either.

Applying this to all of our components really wore me down on Friday haha. Thoughts on me creating a Primitive component that all of our primitives re-compose?
I could do this then:
type PrimitiveOwnProps = {
	/**
	 * A string to use as the component selector for CSS purposes. It will be added as
	 * a data attribute. Pass `null` to remove selector.
	 *
	 * @defaultValue radix-{component-display-name} - For example, `AccordionItem`
	 * selector will be `radix-accordion-item`.
	 */
	selector?: string | null;
}

Applying this to all of our components really wore me down on Friday haha. Thoughts on me creating a Primitive component that all of our primitives re-compose?
I could do this then:
type PrimitiveOwnProps = {
	/**
	 * A string to use as the component selector for CSS purposes. It will be added as
	 * a data attribute. Pass `null` to remove selector.
	 *
	 * @defaultValue radix-{component-display-name} - For example, `AccordionItem`
	 * selector will be `radix-accordion-item`.
	 */
	selector?: string | null;
}

This PR is insanely big now, sorry! Hopefully easier to review each commit but if not I can try split it into individual PRs.
I've not bothered with allowing customisation of the CSS properties in this PR. I felt we can probably tackle that separately to avoid bloating this further.

This PR is insanely big now, sorry! Hopefully easier to review each commit but if not I can try split it into individual PRs.
I've not bothered with allowing customisation of the CSS properties in this PR. I felt we can probably tackle that separately to avoid bloating this further.

is it actually ready to review now?

is it actually ready to review now?

@benoitgrelard yep, think so 🙈  haha

@benoitgrelard yep, think so 🙈  haha

Whoooop 🎉

Whoooop 🎉


How to get the node itself html?

doc.Find("#test").Html()

result:

I want the result:

Hello,
That would be OuterHtml: https://godoc.org/github.com/PuerkitoBio/goquery#OuterHtml
This is not a method on the Selection because this is not a jQuery method (in JS-land this is automatically provided by the DOM).
Have fun!
Martin


Limit drone velocity

Hi ,
I am using Anafi parrot 4K with your Ros package, I tried to limit and change the maximum speed but changing the value in the setAnafi.cfg but didnt work.
Could you help ?
Thanks by advance

Hi,
If you are talking about max_horizontal_speed parameter, it affects only moveto and moveby commands. So, if you use rpyt command, there is no way to limit the horizontal velocity since you provide directly roll and pitch commands and not the velocity commands.
To limit (and also command) the horizontal velocity, you have to implement your own velocity controller or use our anafi_autonomy package.
Best,
Andriy


port names should match endpoint names

Assuming that devfile containers have following endpoints
      endpoints:
        - name: first
          targetPort: 3000
        - name: second
          targetPort: 4000

The k8s Service that gets generated for odo should have matching port names
Current situation:
  ports:
  - name: port-3000
    port: 3000
    protocol: TCP
    targetPort: 3000
  - name: port-4000
    port: 4000
    protocol: TCP
    targetPort: 4000

/priority high
/kind bug

The service port naming is done here https://github.com/devfile/library/blob/5d88bd3c1220097161ef07d78c9fe7605be24ab7/pkg/devfile/generator/utils.go#L229.

The service port naming is done here https://github.com/devfile/library/blob/5d88bd3c1220097161ef07d78c9fe7605be24ab7/pkg/devfile/generator/utils.go#L229.

We should coordinate with the Devfiles team to change this.

Currently we allow multiple URLs on the same port, but k8s doesn't allow services to have two ports with the same port number and protocol combination.

/reopen.

This problem was again raised by user on slack

I'm using odo 2.3.1 with OpenShift 4.9 and trying to set the Service port name in the devfile, but it wont stick. I always get a default value of name: "port-8080" in my Service when what I want is a port name of "http" (for Service  Mesh and Kiali usage). Here is my devfile snippet, any ideas what I need to set:
components:

container:
endpoints:

exposure: public
name: "http"
path: /
targetPort: 8080

The service port naming is done here https://github.com/devfile/library/blob/5d88bd3c1220097161ef07d78c9fe7605be24ab7/pkg/devfile/generator/utils.go#L229.

These changes were made to accommodate another issue that odo was facing, see #4060, https://github.com/devfile/api/issues/287, and https://github.com/devfile/library/pull/51.

Currently we allow multiple URLs on the same port, but k8s doesn't allow services to have two ports with the same port number and protocol combination.

This is also because another issue that tools will face. As devfile allows multiple endpoints within same component to use same port. but you can only expose a port number once in a K8s service. In other word, if it behavior as described in the main issue description, the K8s service spec generated will be invalid :
      endpoints:
        - name: first
          targetPort: 3000
        - name: second
          targetPort: 3000

The k8s Service that gets generated is valid:
  ports:
  - name: first
    port: 3000
    protocol: TCP
    targetPort: 3000
  - name: second
    port: 3000
    protocol: TCP
    targetPort: 3000

The service port naming is done here https://github.com/devfile/library/blob/5d88bd3c1220097161ef07d78c9fe7605be24ab7/pkg/devfile/generator/utils.go#L229.

These changes were made to accommodate another issue that odo was facing, see #4060, devfile/api#287, and devfile/library#51.

This is not the same issue with devfile/api#287, and devfile/library#51. those were pod container port name
The service port naming conversion was done in this PR: https://github.com/devfile/library/commit/ccd9d189c1885bf3e2ee69ab8cb57eb69917b9af#diff-9126bba4cbc803f4a34bfee5d830ed5af0ed5ebb1450bd7f2ebd4f554ea15a97
And IIRC, we were trying to resolve the issue mention in my last comment: https://github.com/redhat-developer/odo/issues/4737#issuecomment-983777050

To summarize the current issue:
The devfile Spec & Odo:

Endpoint has limitation of 63 chars length
allows multiple endpoints under the same component shares the same port number

K8s:

pod container port name has to be within 15 chars length
service cannot have duplicate port exposure
This was the reasons we decided to use our own naming conversion for pod container port name and service port name.

Now, a Odo user reports the service port name does not match the actual endpoint name.  And we are looking for a more appropriate solution for the container port name & service port name.

allows multiple endpoints under the same component shares the same port number

Can we make this invalid? I'm not sure if there is a case where it would be required to have endpoints exposing the same port on one container component

Need to check to make sure it doesn't causes problems on update/migration

Remove the duplicate endpoint support from odo
Check if limiting the endpoint char length from 63 to 15 has any side effect on update/migration.

Once https://github.com/devfile/api/pull/702 is merged, we should add validation check to odo url create to ensure that the name length does not exceed 15 before writing the information to devfile otherwise it will cause an error every time the devfile is parsed.
Scope of the issue:

[ ] Add validation check for duplicate endpoint to odo url create.

Once https://github.com/devfile/api/issues/700 adds changes to devfile to use the endpoint names as container and service port name,
1. - [ ] add tests to ensure this feature.
2. - [ ] Add 15 char length validation for url name  to odo url create .


MINOR: Mention that -1 disables retention by time

Just a doc clarification so no tests.
Committer Checklist (excluded from commit message)

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation (including upgrade notes)

LGTM (non-binding)


Higher contrast table hover stripe (light mode)

This pull request differs from the design system, but I think it looks better, plus it also meets AAA contrast requirements.
Note: this only affects .dataframe classes once #2059 is merged.
After screenshot

Before screenshot

@smeragoel, 👍 ? 👎 ?

I agree, this definitely looks better. No objections to this change, however, we should also make a symmetric change for dark mode as well to ensure consistency in light / dark mode color patterns.
light mode: 300 -> 200
dark mode: 600 -> 700

Thanks @smeragoel, I've updated the pull request with your suggestion and added screenshots to the description.


[New Project] Protocol Bridge for the Official and Non-Official Server

Description

Accept KCP and specified version of proto files
Convert to KCP and another specified version of proto files (for the official server)
Convert to WebSocket and another specified version of proto files (for non-official server)
Add as a sub-project named sorapointa-protocol-bridge (maybe written in Rust)

Also, it may be proxy-like and have some extensibility (such as creating a custom packet modifier or DPS stats).
See Also
#58

We still need more time to evaluate whether it is necessary to implement this complex protocol system.


Recognize json files with different extensions

Is there a way to have it recognize a file that doesn't end in .json or .jsonp. I would like it to recognize a file like metrics.conf

new to the plug in and would also like to know if there is any extensibility to this plugin.


[Bug]: Pipeline "towhee/image-embedding-convnext-base"crashed when embedding concurrent multi threads

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior
2022-02-21 19:26:20,808 -<PHONE_NUMBER>65696 - thread_pool_task_executor.py-thread_pool_task_executor:75 - ERROR: Traceback (most recent call last):
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/thread_pool_task_executor.py", line 68, in execute
    op = self._op_pool.acquire_op(runner.hub_op_id, runner.op_args, runner.tag)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_pool.py", line 102, in acquire_op
    op = self._op_loader.load_operator(hub_op_id, op_args, tag)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 142, in load_operator
    op = factory(function, args, tag)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 118, in load_operator_from_cache
    return self.load_operator_from_path(path, args)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 108, in load_operator_from_path
    return self.instance_operator(op, args) if op is not None else None
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 152, in instance_operator
    return op(**args) if args is not None else op()
  File "/Users/jingjing/.towhee/operators/towhee/timm_image_embedding/main/timm_image_embedding.py", line 25, in __init__
    self.model = create_model(model_name, pretrained=True, num_classes=0)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/timm/models/factory.py", line 78, in create_model
    raise RuntimeError('Unknown model (%s)' % model_name)
RuntimeError: Unknown model (convnext_base)

2022-02-21 19:26:20,810 -<PHONE_NUMBER>65696 - thread_pool_task_executor.py-thread_pool_task_executor:76 - ERROR: Unknown model (convnext_base)
Traceback (most recent call last):
  File "/Users/jingjing/Workspace/towhee/tests/testcases/test_main.py", line 268, in <module>
    test_caller()
  File "/Users/jingjing/Workspace/towhee/tests/testcases/test_main.py", line 259, in test_caller
    image_class_pipeline_runner()
  File "/Users/jingjing/Workspace/towhee/tests/testcases/test_main.py", line 156, in image_class_pipeline_runner
    res = methodcaller(func, pipeline_name, embedding_size_each)(valid_embedding_obj)
  File "/Users/jingjing/Workspace/towhee/tests/testcases/test_image_embedding.py", line 179, in test_embedding_concurrent_multi_threads
    t.start()
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/threading.py", line 875, in start
    self._started.wait()
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/threading.py", line 574, in wait
    signaled = self._cond.wait(timeout)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/threading.py", line 312, in wait
    waiter.acquire()
KeyboardInterrupt
2022-02-21 19:26:20,827 -<PHONE_NUMBER>86368 - thread_pool_task_executor.py-thread_pool_task_executor:75 - ERROR: Traceback (most recent call last):
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/thread_pool_task_executor.py", line 68, in execute
    op = self._op_pool.acquire_op(runner.hub_op_id, runner.op_args, runner.tag)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_pool.py", line 102, in acquire_op
    op = self._op_loader.load_operator(hub_op_id, op_args, tag)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 142, in load_operator
    op = factory(function, args, tag)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 118, in load_operator_from_cache
    return self.load_operator_from_path(path, args)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 108, in load_operator_from_path
    return self.instance_operator(op, args) if op is not None else None
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/towhee/engine/operator_loader.py", line 152, in instance_operator
    return op(**args) if args is not None else op()
  File "/Users/jingjing/.towhee/operators/towhee/timm_image_embedding/main/timm_image_embedding.py", line 25, in __init__
    self.model = create_model(model_name, pretrained=True, num_classes=0)
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/site-packages/timm/models/factory.py", line 78, in create_model
    raise RuntimeError('Unknown model (%s)' % model_name)
RuntimeError: Unknown model (convnext_base)

2022-02-21 19:26:20,828 -<PHONE_NUMBER>86368 - thread_pool_task_executor.py-thread_pool_task_executor:76 - ERROR: Unknown model (convnext_base)
Exception ignored in: <module 'threading' from '/Users/jingjing/miniconda3/envs/tw/lib/python3.9/threading.py'>
Traceback (most recent call last):
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/threading.py", line 1411, in _shutdown
    atexit_call()
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/concurrent/futures/thread.py", line 31, in _python_exit
    t.join()
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/threading.py", line 1029, in join
    self._wait_for_tstate_lock()
  File "/Users/jingjing/miniconda3/envs/tw/lib/python3.9/threading.py", line 1045, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt:

Expected Behavior
embedding succssfully
Steps To Reproduce
def test_embedding_concurrent_multi_threads(self, pipeline_name, embedding_size):
        """
        target: test embedding for normal case
        method:  embedding with concurrent multi-processes
        expected: return embeddings
        """
        threads_num = 10
        threads = []

        def embedding():
            embedding_pipeline = pipeline(pipeline_name)
            embedding = embedding_pipeline(data_path + "towhee_test_image2.jpg")
            print(embedding.size)
            assert embedding.size == embedding_size

        for i in range(threads_num):
            t = threading.Thread(target=embedding)
            threads.append(t)
            t.start()
            time.sleep(0.2)
        for t in threads:
            t.join()

        return True

Environment
- Towhee version(e.g. v0.1.3 or 8b23a93):0.4.1.dev75
- OS(Ubuntu or CentOS): macos
- CPU/Memory:
- GPU:
- Others:

Anything else?
No response

Which pipeline did you use?

Which pipeline did you use?

towhee/image-embedding-convnext-base

Which version of timm is in your env,  it should be >= 0.5.4

Which version of timm is in your env, it should be >= 0.5.4

ok，I test it successful with timm>=0.5.4

@jingkl
please verify this issue, and close it if it is fixed, thanks.