Backend Reorganization

There's a "Code Reorganization" milestone that Alvin made yesterday, and in it, there's a bullet point called "backend cleanup". I just want to be sure that everyone is on the same page about what a "clean backend" means since I'm a little confused myself.
The main point of confusion for me is what goes in the models and what goes in the API. I think originally, for the models, we had a view of a model is an object, so if we have a User object, we can ask it for things and it should know how to do them. For those calls, the API just calls the corresponding User object and things happen. However, there are other calls, such as downloading a CSV, which is in the api.py file.
Now, I think there are three approaches that we can take here:

Dumb down the models. The model just contains the fields and the API has all of the intelligence.

Make some clear boundary between the models and the API.

Put everything in the models- the API should just be calling the corresponding models.

I think the way that the code is designed right now, doing (2) or (3) would be the least amount of change to the codebase. What does everyone else think?

(2) sounds best. All logic that manipulates data should live in models.
All logic that parses input or formats output should live in api. Before
anyone embarks on significant reorganization, let's discuss what's moving
where.
On Wed, Jul 8, 2015 at 12:23 PM, soumyabasu<EMAIL_ADDRESS>wrote:

There's a "Code Reorganization" milestone that Alvin made yesterday, and
in it, there's a bullet point called "backend cleanup". I just want to be
sure that everyone is on the same page about what a "clean backend" means
since I'm a little confused myself.
The main point of confusion for me is what goes in the models and what
goes in the API. I think originally, for the models, we had a view of a
model is an object, so if we have a User object, we can ask it for things
and it should know how to do them. For those calls, the API just calls the
corresponding User object and things happen. However, there are other
calls, such as downloading a CSV, which is in the api.py file.
Now, I think there are three approaches that we can take here:

Dumb down the models. The model just contains the fields and the API
has all of the intelligence.

Make some clear boundary between the models and the API.

Put everything in the models- the API should just be calling the
corresponding models.

I think the way that the code is designed right now, doing (2) or (3)
would be the least amount of change to the codebase. What does everyone
else think?
—
Reply to this email directly or view it on GitHub
https://github.com/Cal-CS-61A-Staff/ok/issues/526.

Yeah, I think the first step is to get our test coverage up so that we're fairly certain that our changes don't break anything.

Sounds good. PR #527 created.
So building off of (2), and Professor DeNero's distinctions:
Models

Need permissions checks
all basic operations and queries - as a general rule of thumb, api.py should never need to instantiate a model object or use the query method?

API

define args
setup file formats (.zip, .csv .etc)
error handling

What do you guys think? Also, where do you guys think something like the SearchAPI should be placed? It doesn't have an associated model (kind of), but it's definitely logic.

Added conclusions to api.py and models.py. Feel free to modify them. I'll be working on tests in the meanwhile.


Regression for issue #423 in version 4.2.0 (unsupported API version on route constraint failure)

It appears that version 4.2.0 has reintroduced the previously resolved issue #423 as a regression, possibly in commit de9bc84e587cbd3914c923833d7d580747261c81 - although I haven't looked into this in great detail.
When a route constraint on a path using endpoint routing does not match, instead of returning a 404 status the error -
"error": {
"code": "UnsupportedApiVersion",
"message": "The HTTP resource that matches the request URI [URL of the endpoint] does not support the API version '[supported version]'.",
"innerError": null
}
Is returned with a Bad Request HTTP 400 response status code.
I have attached a reproduction project based on the ASP.NET Core 3.1 template API project.
Affected package Microsoft.AspNetCore.Mvc.Versioning - version 4.2.0
.NET Core version 3.1
SDK Microsoft.NET.Sdk.Web
In the attached solution change the URL from an arbitrary GUID like https://localhost:44350/weatherforecast/v1/location/3f43133b-9f36-492e-a32a-720d5bd6f033/ to a non-GUID string like https://localhost:44350/weatherforecast/v1/location/Test/ to replicate the problem.
Expected status code 404
Actual status code 400
VersionedRouteConstraintTest.zip

I'll have to go back and research this. I found at least one edge case where the logic was wrong and fixed it. That might have caused some expected behavioral regression - maybe. Thanks for the repo, I'll take look. It's possible this is fixed, but is in the 5.0 set.
Things can get hairy when the route template changes between versions. For example, consider:

1.0 = weatherforecast/v{version:apiVersion}/location/{id:guid}
2.0 = weatherforecast/v{version:apiVersion}/location/{id}

If you request weatherforecast/v1/location/Test, this will produce 400. API Versioning doesn't change routing, it just helps the routing system disambiguate duplicates. When at least one template could match, you'll get 400 over 404. The only other exception is 405, when reason they don't match is due to the HTTP method.
I'm not saying that is the issue, but I just wanted to highlight a scenario where it can happen. This isn't really something that API Versioning can solve. Ensuring the route templates don't introduce this behavior between versions will help.

Circling back around to this issue. I can confirm that this is indeed a regression in 4.2.0. It appears to have been fixed in 5.0.0. I updated your repro to use 5.0.0 and the behavior seems correct and as expected.
Is there any specific reason you cannot update to 5.0.0, which contains the fix? The 5.0.0 release still multi-targets to .NET Core 3.1. I do occasionally patch older packages when necessary, but honestly it's a lot of extra work for me as a one-man show. I'm also a little worried about the time it will take to track down the difference or change that caused the regression. If you really, really need it, then I'll see what I can do; otherwise, you should be good to go in 5.0.0.
Thanks

Hello @commonsensesoftware, unfortunately I seem to still be getting this issue in my current project.
My dependencies are:
Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0"
Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0"
Microsoft.AspNetCore.OData" Version="7.5.7"
This issue as described by @pwdst and in issue #423 is still present for me, and I am not using any route template changes between versions.

@pwdst , @jocf
6.0 is now available in preview and changes some internal routing mechanics, which I believe will address the routing issues. 404, 405, and 415 should be reported in expected ways. There are still a few scenarios for 400 (ex: API versioned, but not provided), but it's far fewer now. This is a bit of a departure from the past, but is simpler, more performant, and likely more closely aligns to expectations.
You can find all the updated examples here.
@pwdst it appears you want the new Asp.Versioning.Mvc package
@jocf  it appears you want the new Asp.Versioning.OData.ApiExplorer package

6.0 is officially released. If that resolves the issue for you, then I'd like to close this out. I'm still fighting publishing issues with code signing 5.1, which also contains the fix you're looking for. If you really need 5.1, then I'll circle back around once I'm finally able to publish it.

This issue has been fixed in 6.0 so I'm going to close this out. I'm still waiting on MS to unblock me on publishing the 5.1 packages and, at this point, it may never happen 😞. I should also mention that .NET Core 3.1 support ends in December so I do not plan to support it in the 7.0 release (to coincide with the .NET 7.0 release). I'm close to having 6.1 available. It's unfortunate that you'd have to go through the migration process, but any of the 6.x releases will support .NET Core 3.1.
If there's more guidance or questions I can answer, I'm happy to do so. This includes, but is not limited to, reopening the issue. Thanks.


The logout icon feels more like login

The current logout icons looks like this:

Would it be possible to modify the logout icon for the arrow to point outward of the door? (and maybe rename the current logout icon to login)

To me it looks more like a logout than a login. This impression seems confirmed by a google search:

PS: thank you so much for all you great work (refactoringui, tailwindcss...)

Hey,
I've made some using the current logout outline icon as a base. Previewable here: https://codepen.io/charltonsantana/pen/bGEmvEY
<svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor"><path d="M17 16l4-4m0 0l-4-4 m4 4h-14m5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h3a3 3 0 013 3v1"></path></svg>

<svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor"><path d="M17 16l4-4m0 0l-4-4 m4 4h-14m5 8 H6a3 3 0 01-3-3V7a3 3 0 013-3h7"></path></svg>

<svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor"><path d="M14 16l4-4m0 0l-4-4 m4 4h-11m11 5v1a2 2 0 01-2 2H6a3 3 0 01-3-3V7a3 3 0 013-3h10a2 2 0 0 12 2v1"></path></svg>

If either @adamwathan / @sschoger approve any of them, I'll go ahead and make a pull request.

Hey @CharltonSantana I don't know if you saw but I think this is being fixed in an update soon? See https://twitter.com/steveschoger/status/1283113613650284545

@jsmith Ahh, my bad :)

Haha I like your designs though :) The second is almost identical to the new design!


Changed cache to use seconds instead of minutes.

I have changed the cache plugin to use seconds instead of minutes for the expiration.
The problem with using minutes is that an uninformed user, it can appear that the cache simple does not work right and expires too soon. The plugin uses the client's local clock in order to determine if the cache is expired or not. The problem is that, the plugin simply checks if the clock has reached the expiration minute or not and doesn't consider the seconds until the next minute when setting the expiration. Example:
Your systems clock is 1:00:55. You set a value to expire in 1 minute: store.set('hello','world',1); You expect the value to be expired in 1 minute (60 seconds) from the time you set the value. But the value actually expires in 5 seconds, when the system clock hits 1:01:00. This can be very misleading and confusing if you are using store.js in a client side app with lots of short term (sub-minute) local storage caching.
So this PR changes the plugin to require the user to specify seconds of expiration instead of minutes. So if the user wanted to expire something in 1 minute, he would simply do store.set('hello','world',60);. It's more straightforward and I think more what the user would be expecting regarding setting a cache and obviously it allows for sub-minute expiration times.

You make a compelling case. I'll take it. :)

Thanks! Keep up the good work on this script. It's the best local storage wrapper I've worked with. It's simple and solid. And the expiration plugin is extra-awesome!

Glad you like it. :)


Implementation of MP sections not done in PI4

Feature Benefit
(What is this feature's benefit hypothisis? Proposed measurable benefit to the end-user or business)
Context
(User journeys, design mockups, architectural diagrams, business rules, data element definitions)

no longer needed


ModifyWalkSpeed does not see variables and attributes

When setting speed field for ModifyWalkSpeed it does not recognize neither variables nor attributes. For variables it gives the warning, that variable is unknown and for attributes (I've used movement_speed attribute) it just disables movement.

It looks like this action was not reading its parameters in the right place.
I've pushed a fix, can you please try the latest dev build and let me know if it's better?
https://jenkins.elmakers.com/job/MagicPlugin/4243/

Yeah, everything is working now!

Great, thank you for letting me know!


Document Enumerations

README says:
All .proto enumeration types convert to the Rust i32 type. Additionally, each enumeration type gets a corresponding Rust enum type, with helper methods to convert i32 values to the enum type. The enum type isn't used directly as a field, because the Protobuf spec mandates that enumerations values are 'open', and decoding unrecognized enumeration values must be possible.
It took me some (rather cheerless) time to discover that I can convert an enumeration like the one in the README example
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Enumeration)]
    pub enum PhoneType {
        Mobile = 0,
        Home = 1,
        Work = 2,
    }

to the value this way:
PhoneType::Mobile as i32

However, for the opposite direction, I'm lost for good. How do I convert an i32 code to PhoneType? Where do I find those "helper methods to convert i32 values to the enum type"? I'd really appreciate an example in the README. Thank you.
Furthermore, what is the #[derive(Enumeration)] ? Can't find the Enumeration trait anywhere..

How about From<i32> be implemented for enums?
So that this would work:
match phone_type.into() {
   PhoneType::Mobile => {},
  // etc.
  _ => {}
}

Can someone please provide an example on how to do do the rustdoc trick? I'm scouring documentation, and I can't seem to find the right combination of arguments :disappointed:
I was hoping that cargo doc --open --document-private-items would do the job, but seems like it's not the case.
(Although the comments above definitely helped!, so thank you for that!)


Provide write access to TensorDB through AggregationFunctionInterface

Recently, OpenFL has expanded the types of custom aggregation functions that can be computed on collaborator models. Some participants from the FeTS Challenge had complex aggregation strategies they wished to implement that were based on novel calculated metrics that could be used for a future round.

As a workaround, one can store calculated values in class properties and update them every round. I wouldn't recommend providing full access to TensorDB since we have internal entities dependant on its contents: we deal with certain tags on different stages of communication between aggregator and collaborator. Errors users may receive in case of inconsistent DB state may be confusing.

Closed via https://github.com/intel/openfl/pull/417


[question] working from root instead of exampleSite

First of all - thank you for this boilerplate!
I am still new to Hugo and a little confused about themes and working inside exampleSite dir.
Can I simply move the contents of exampleSite to the root directory and work there?
And if yes, I guess I will need to change the directory of themeDir inside postcss.config.js in order for it to work correctly when deploying to production?

You don’t dev your theme within the /exampleSite directory. This directory holds example content for your theme only. In an ideal case /exampleSite has just some .md files with dummy content and a minimal front matter setup (title, author, date). All your development work should be done in the /layout folder of your theme or directly within /layout of your project repo.
There are 3 use cases for this starter repo:

Develop a Hugo theme as a stand alone repo. This is the main use case for this starter repo.
For this you need the /exampleSite directory if you have custom content for your theme, e.g. a special front matter setup or a special folder structure for your content.
This /exampleSite directory is picked up by the gohugoio/hugoThemes repo to showcase the demo of your site on themes.gohugo.io. See adding a theme to the list for further instructions.

Develop a theme within the /themes folder of your Hugo project. For this you don’t need the /exampleSite directory, as you work directly from the content of your project and propably don’t distribute the theme to other projects. Though I think it is a good habit to have this folder to document the intended structure of your /content folder for later use.

Develop a Hugo site without using a theme, but instead work directly from the main /layout folder (content and theme as a mono-repo). For this you don’t need to change the setup of the postcss.config.js, but instead move the content of /themes/hugo-theme-tailwindcss-starter/assets to the /assets folder of you project and develop within /layout. The setup should work just fine.


Remove greenlet and add asyncio extra to sqlalchemy

closes #894
Checklist before merging

[x] I added an appropriate entry to CHANGELOG.md

This PR should solve the original Apple-M1 issue reported in https://github.com/fractal-analytics-platform/fractal-server/issues/747#issue-1754531516, while sticking to the solution recommended by sqlalchemy.
@jluethi would you mind re-trying the installation that triggered your original error? I don't have other Apple M1s available..
You would need to:

Download this wheel file: fractal_server-1.3.12-py3-none-any.txt;
Rename it to fractal_server-1.3.12-py3-none-any.whl;
Run pip install fractal_server-1.3.12-py3-none-any.whl;
Run fractalctl set-db and fractalctl start from a folder where you have the usual environment file.

If it all goes through, we can safely merge.
Thanks!

@tcompa I can confirm that this installs without error on an M1 mac and then starts the server.
I have not tested server functionality with it then, but I guess that shouldn't be necessary, right?

@tcompa I can confirm that this installs without error on an M1 mac and then starts the server.

Thanks!

I have not tested server functionality with it then, but I guess that shouldn't be necessary, right?

It isn't necessary, indeed.
If I remove greenlet from a working environment, even fractalctl set-db fails:
Run alembic.config, with argv=['-c', '/tmp/venv/lib/python3.10/site-packages/fractal_server/alembic.ini', 'upgrade', 'head']
fractal_server.app.db
Traceback (most recent call last):
  File "/tmp/venv/lib/python3.10/site-packages/fractal_server/app/db/__init__.py", line 32, in engine_async
    return cls._engine_async
AttributeError: type object 'DB' has no attribute '_engine_async'. Did you mean: 'engine_async'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/venv/bin/fractalctl", line 8, in <module>
    sys.exit(run())
  File "/tmp/venv/lib/python3.10/site-packages/fractal_server/__main__.py", line 83, in run
    set_db()
  File "/tmp/venv/lib/python3.10/site-packages/fractal_server/__main__.py", line 74, in set_db
    alembic.config.main(argv=alembic_args)
  File "/tmp/venv/lib/python3.10/site-packages/alembic/config.py", line 630, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/tmp/venv/lib/python3.10/site-packages/alembic/config.py", line 624, in main
    self.run_cmd(cfg, options)
  File "/tmp/venv/lib/python3.10/site-packages/alembic/config.py", line 601, in run_cmd
    fn(
  File "/tmp/venv/lib/python3.10/site-packages/alembic/command.py", line 399, in upgrade
    script.run_env()
  File "/tmp/venv/lib/python3.10/site-packages/alembic/script/base.py", line 578, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/tmp/venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
    module = load_module_py(module_id, path)
  File "/tmp/venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 109, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/tmp/venv/lib/python3.10/site-packages/fractal_server/migrations/env.py", line 98, in <module>
    asyncio.run(run_migrations_online())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/tmp/venv/lib/python3.10/site-packages/fractal_server/migrations/env.py", line 88, in run_migrations_online
    engine = DB.engine_async()
  File "/tmp/venv/lib/python3.10/site-packages/fractal_server/app/db/__init__.py", line 34, in engine_async
    cls.set_db()
  File "/tmp/venv/lib/python3.10/site-packages/fractal_server/app/db/__init__.py", line 68, in set_db
    cls._engine_async = create_async_engine(
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/engine.py", line 43, in create_async_engine
    sync_engine = _create_engine(*arg, **kw)
  File "<string>", line 2, in create_engine
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 309, in warned
    return fn(*args, **kwargs)
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 660, in create_engine
    event.listen(pool, "connect", on_connect)
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/event/api.py", line 115, in listen
    _event_key(target, identifier, fn).listen(*args, **kw)
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/event/registry.py", line 232, in listen
    self.dispatch_target.dispatch._listen(self, *args, **kw)
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/pool/events.py", line 69, in _listen
    event_key.base_listen(**kw)
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/event/registry.py", line 270, in base_listen
    for_modify._set_asyncio()
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/event/attr.py", line 265, in _set_asyncio
    self._exec_once_mutex = AsyncAdaptedLock()
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/util/concurrency.py", line 67, in AsyncAdaptedLock
    _not_implemented()
  File "/tmp/venv/lib/python3.10/site-packages/sqlalchemy/util/concurrency.py", line 47, in _not_implemented
    raise ValueError(
ValueError: the greenlet library is required to use this function. No module named 'greenlet'


Format code blocks and add keyboard shortcut for copying

In both the user's messages and the AI's replies, single backticks like this and triple backticks:
like this

Are visually formatted. This is what they look like:

In addition, when you press Cmd+Shift+C it will copy the very last response, or if the last response includes a code block instead of copying the full last response it will copy the last code block within the last response.
In addition, there is a copy icon within each code blocks which can be clicked to copy to clipboard.
Also, as part of this PR the keyboard-controller was refactored to support a target. If a target is specified, that's the item which the click() is executed on. And if multiple targets exist, then click() is executed on the last of the targets. This was my simple way of determining which element to trigger copy on when the keyboard shortcut is invoked.

@olimart This PR was a little tricky. If you have any feedback on the implementation, I welcome it. I got it all working, I just have a couple automated tests to add.

@krschacht will take a look (I had this one on my radar as well) 👍

@olimart Thanks for the feedback on this. I cleaned up the code a bit more, got all markdown parsing done, and am merging this in!


S145: ParserModel not implemented yet (kind:178)

I think I find a bug or missing feature
in my phero.ts file
I've got
import { createService } from '@phero/server';

type Id = number | string;

interface User {
  id: Id;
  email: string;
}

async function update(data: Partial<User>): Promise<User> {
  return { id: 1, email<EMAIL_ADDRESS>};
}

export const user = createService({ update });

but got an error
error TS-PheroError:
S145: ParserModel not implemented yet: `Id` (kind:178)

When I debug the code I find the problematic line
Partial<User> on async function update(data: Partial<User>): Promise<User> {
indeed if we change Partial<User>  to User  for example everything is ok
Is it an known bug ?

Just tested this, I can confirm this is a bug.
I'll try to fix this asap.

Fix is on its way @parweb
https://github.com/phero-hq/phero/pull/78

nice

@parweb Just released 0.9.11.
You should update both @phero/server and @phero/client and run Phero with the npx phero@latest command.
Can you please confirm if the issue is resolved for you? Thanks in advance :)

let's test this

It's working
I found an another bug will open a new issue

Thanks for reporting.
Sorry to hear you stumbled upon another bug. Lets see how fast we can fix that one :)

No worries it's for a hobby project love the phylosophy of your tool 👍
Happy to help stabalize it


fix: check for total challenge completion before donation pop up

This pr should fix the premature donation modal for blocks that are smaller than 10 challenges.
Checklist:

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the main branch of freeCodeCamp.
[x] I have tested these changes either locally on my machine, or GitPod.

Closes #XXXXX

@ahmaxed it's... interesting that the e2e tests passed in Firefox, but not any of the others. Any ideas?

firefox skips those tests

Oh, that's rather boring!
If the new behaviour is what we want for the existing curriculum as well as the new, could you adjust the tests?


Integration test for metadata updates following key revocations

Add an integration test that verifies how a top-level role like Root is updated after all of its keys have been revoked.  There are some unit tests that verify key and role revocation of specific roles, but these should be expanded to verify what should happen when key revocations happen over the span of multiple snapshots of the repository.

We now have an integration test for this here
We also have root-specific tests available here and here


git helper for 'https' rhel7

Issue:
git clone  https://github.com/AdoptOpenJDK/openjdk-tests.git
Cloning into 'openjdk-tests'...
fatal: Unable to find remote helper for 'https'

FYU: @sophieg @smlambert

solution to the current issues was to installed curl-devel and recompiled git
Pull request to fix it is required
FYI: @gdams

Isn't this resolved via #126 ?

Ahh, that was only for Ubuntu, I didn't add it for rhel as it appeared to already work there. Looks like the rhel playbook only installs it on ppcle
https://github.com/AdoptOpenJDK/openjdk-infrastructure/blob/7e5f884d7d519c4711410eb2b9275f93e7265e08/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/vars/RedHat.yml#L45

PR went through in #255


Capture deletes first line of previous buffer

Describe the bug
Doing a capture deletes the first line in the file from which I started the capture.
Steps to reproduce

Open nvim and load any file into, say, buffer a
<leader>oc
In the capture window: :wq
Observe that the first line of buffer a has been deleted.

Expected behavior
No deletion.
Emacs functionality
No response
Minimal init.lua
All I changed from the minimal_init.lua is that I added a capture template, capturing to ~/tmp/test.org.
(As an aside, I would suggest updating the minimal_init.lua such that a capture template and/or a default notes file is already set up).
vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]

local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'

local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {'nvim-treesitter/nvim-treesitter'},
      {'kristijanhusak/orgmode.nvim', branch = 'master' },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
    },
  }
end

_G.load_config = function()
  require('orgmode').setup_ts_grammar()
  require('nvim-treesitter.configs').setup({
    highlight = {
      enable = true,
      additional_vim_regex_highlighting = { 'org' },
    },
  })

  vim.cmd[[packadd nvim-treesitter]]
  vim.cmd[[runtime plugin/nvim-treesitter.lua]]
  vim.cmd[[TSUpdateSync org]]

  -- Close packer after install
  if vim.bo.filetype == 'packer' then
    vim.api.nvim_win_close(0, true)
  end

  require('orgmode').setup({
    org_capture_templates = {
      t = {description = 'Todo', template = '* TODO %?', target = '~/tmp/test.org'},
    },
  })

  -- Reload current file if it's org file to reload tree-sitter
  if vim.bo.filetype == 'org' then
    vim.cmd[[edit!]]
  end
end

if vim.fn.isdirectory(install_path) == 0 then
  vim.fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerCompileDone ++once lua load_config()]]

Screenshots and recordings
No response
OS / Distro
Fedora 36 with alacritty 0.10.1
Neovim version/commit
latest master
Additional context
No response

Confirmed. Will look into it.
Temporary workaround is to close the capture buffer with Ctrl + c.

Interesting. It deletes the first two lines for me, if they're top level headlines and a single headline if it has sub-headlines:

that's my full config mind you

These lines are causing the issue, but fix would be a bit hacky. I want to refactor this class

I managed to find a simple fix until this gets refactored. Let me know if it's still broken.


fluxengine write: is it verifying anymore?

I don't see any lines about verification anymore when I write a floppy. Here I'm using Adafruit's GW-compatible firmware.
The software used to print information during verification
$ git describe --dirty --tags --always
dev-197-g9e4d99f
$ ./fluxengine write ibm1440 --usb.greaseweazle.port /dev/ttyACM1  -i prodigy.img -c 0 -h 0
      IMG: read 80 tracks, 2 sides, 1440 kB total
      Using GreaseWeazle on serial port /dev/ttyACM1
Measuring rotational speed... 200.7ms (299.0rpm)
      Writing to: drive 0
 0.0: writing 199 ms in 76988 bytes
 0.0: verifying 240 ms in 92145 bytes

However, this stopped happening.
$ git describe --dirty --tags --always
dev-198-gba3f806
$ ./fluxengine write ibm1440 --usb.greaseweazle.port /dev/ttyACM1  -i prodigy.img -c 0 -h 0
      IMG: read 80 tracks, 2 sides, 1440 kB total
 0.0: Using GreaseWeazle on serial port /dev/ttyACM1
      199 ms in 76988 bytes

Note how the "Using GreaseWeazle" line is moved around as well.
I think the same change also broke fluxengine rpm and maybe everything else that uses config.flux_source().has_drive (or flux_sink?)
$ ./fluxengine rpm --usb.greaseweazle.port /dev/ttyACM1
Error: this only makes sense with a real disk drive

The commit in question is  ba3f8066167f5590d3f087481ecdbcc6f24940f6 ("Move a lot of drive parameters into a toplevel drive{} config rather than leaving them in the source/sink configs (which means they have to be set twice)"). Other than using git bisect to find this commit, I didn't do any further troubleshooting.

...wasn't just the Greaseweazle; turns out that it wouldn't verify unless you specified an explicit destination with -d.


PR checklist workflow

This code has been merged but the PR is broken due to GH issues yesterday so closing PR

Seems like closing it fixed the issue with the PR


Improve punctuation/grammar with header.

Contributor checklist

[x] Provided the tests for the changes.

There are outdated references in the README etc.

[x] Assure PR title is short, clear, and good to be included in the user-oriented changelog

Maintainer checklist

[x] Assure one of these labels is present: backwards incompatible, feature, enhancement, deprecation, bug, dependency, docs or skip-changelog as they determine changelog listing.
[x] Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

We might want to rephrase the whole "To update run:" line, see the details https://github.com/jazzband/pip-tools/issues/1636.

Perhaps we should address this issue together with #1636 to update the header in one shot?


install/migration issue

Good day
When running:
python manage.py makemigrations blog
I'm getting the following error:
ModuleNotFoundError: No module named 'taggit'
I have later then Django 1.8 installed:
(b) PS C:\dan_projects\django_by_example_blog\mysite> pip freeze
Django==1.8.6
django-taggit==0.22.1
pytz==2017.2
And 'taggit' has been added to my installed_apps:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog',
'taggit',
)
In my models.py file I've imported it:
from taggit.managers import TaggableManager
Apologies if I'm doing something silly, I am a novice and any help would be greatly appreciated!

What was the fix? I am having the same issue right now


Add ref property

React has a ref property for all components, that refers to the DOM element. Any plans to add this one on Preact?

Yup, actually working on this right now! Refs were supported in preact-compat, but in a hacky way (using the DOM). I'm adding them to Preact core similar to how contexts work.

Nice \o/ :sparkles: :shipit:

This also fixes https://github.com/developit/preact-compat-example/issues/2 :boom:

@developit that is great. Just today I was looking into into the sources of preact-compat and react-toolbox to better understand what could have gone wrong with that example.

@rsaccon ah, hopefully I can save you some trouble. I'm not likely to get a refs release out until tomorrow morning. For preact-compat, it was using an undocumented and now removed render hook. It should have been using componentDidMount and componentDidUpdate.

@developit great, thanks, no hurry

Yay for refs! Don't see another way of getting values of form fields when dynamically constructing it except via refs.

@idchlife I only use Controlled Forms, and have never had a use for refs. Personally I find that approach to be much more consistent with the unidirectional rendering model, but I know others may not find it that way.

@developit actually you have one nice approach! And even with dynamic forms you can solve this by adding fields values into object in state. This will be event better. Somehow forgot about this and did this task with looping through fields and getting them by e.target.querySelector([name="${field.name}"])
Thanks!

Ah yeah I was doing that for a bit too.  When you throw redux into the mix it makes you realize asking the DOM for state is scary/unpredictable. Checkboxes are the worst! Cheers.

Yay for refs! Don't see another way of getting values of form fields when dynamically constructing it except via refs.

There's an elegant way of doing this:
class UserRegister extends Component {

    constructor(props) {
        super(props);
        this.state = {}
    }

    handleChange(key){
        return {
            value: this.state[key],
            requestChange: (value) => this.setState({[key]: value})
        }
    }

    render(){
        return

            Username
            <input type="text" valueLink={this.handleChange("username")}/>

    }
}

@nightwolfz does that work in React?

There are legitimate uses of ref. Right now I need to call the native showModal method on a dialog element. Without a ref, I have to query the DOM...

@unindented good point, and that's not something that's particularly easy to achieve via JSX (other than wrapping <dialog> in a component and mapping a show boolean attribute, but that's rescoping the issue).

I was spying on this for a while now and I'd like to bring some thoughts about how to implement this properly. The difficulty is to know which component is generating the vdom, because it could be passed as children of another component. Thus, the common approach is to maintain a global stack of currently rendering components, and link the last component to the generated vdom. This works, but I find this quite ugly.
I had a simple idea to solve this in a clean way: what if the JSX pragma was something like createElement(this)?
 would be transformed to createElement(this)("div", null), thus the createElement function would know which component did generate the element. If this is not a component instance, it is probably rendered through a stateless functional component, and it couldn't have refs anyway.
Instead of returning a new function everytime, createElement could be implemented like the following, with a pragma configured to createElement(this)._h:
const defaultRenderer = { _h: h } // where h is the current hyperscript-like function
function createElement(component) {
  return component && component._h ? component : defaultRenderer;
}

// the base component class would have the _h method, using the hyperscript-like
// function and the vnode hook to handle ref attributes.

A pattern React and React-like libraries are failing to solve is when the vdom of a component is rendered by a foreign component. See this example: the Bar component is calling a callback from Foo to get some vdom to render. The fooElement is stored in the Bar refs, but in a developper point of view, vdom returned by Foo#renderInternal should be related to Foo. With the above solution, preact would handle this gracefully.
Anyway, this was my two cents, feel free to use it or not!

@BenoitZugmeyer very interesting. I agree that the example does sortof seem like the ref should belong to the parent, but I immediately thought of this counter-example:
let renderInternal = () => (
foo
);

class A extends Component {
  render() {
    return
{ renderInternal() }
;
  }
}

class B extends Component {
  render() {
    return
{ renderInternal() }
;
  }
}

... where each component should really be given a ref to the rendered div.
I'm not sure where to fall on this one, perhaps that is why I was timid about refs in the first place.
Side note: regarding your contextualized hyperscript reviver, you could also do this:
import { options } from 'preact';

// preact actually supports a vnode hook that is invoked at the end of `h()`:
let oldHook = options.vnode;
options.vnode = vnode => {
  oldHook(vnode);
  let ref = vnode.attributes && vnode.attributes.ref;
  if (ref && current) current[ref] = vnode;
};

let current;

let oldRender = Component.prototype.render;
Component.prototype.render = function(...args) {
  current = this.refs = {};
  let r = oldRender.call(this, ...args);
  if (current===this.refs) current = null;
  return r;
};

... obviously some logic would be needed post-mount to swap vnodes for their DOM counterparts. Perhaps that's the "internal" bit.

Ok it makes sense, I never used this pattern before and find it somewhat hazardous, but it would be the limit of my solution. Preact could warn the user about it though (if this is not a component).
In you example, render should be written like this:
Component.prototype.render = function(...args) {
  let previous = current;
  current = this.refs = {};
  let r = oldRender.call(this, ...args);
  if (current===this.refs) current = previous;
  return r;
};

but yes, it would work, this is the common approach. I love how the vnode hook is public, in my opinion this is a real advantage over other implementations!

Yup that's my hope. The hooks aren't really advertised much since they are obviously not available in React and that means scary lock-in (though overriding React.createElement() would be pretty close).  If the size stays down, I'm looking to add a bunch of new hooks in 4.0 for augmenting/tracking element and component recycling :)

@developit do you think this will make it into a 3.x release, or 4.0?

@unindented likely 4.x, because it's backwards-incompatible (previously a ref property would be applied to the DOM as an attribute).  That's not to say it won't be soon, I'm actually hoping to publish a beta this evening.

Woohoo!

@developit React also supports callbacks as refs (https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute), and talks about string refs being legacy in the docs (https://facebook.github.io/react/docs/more-about-refs.html#the-ref-string-attribute).
That'd mean that preact wouldn't need to store the reference to the component. Users would manage that themselves:
  render () {
    return (
      <Dialog ref={(dialog) => { this._dialog = dialog }} />
    );
  }

Do you think just supporting function refs would be preferable? I don't use refs so I had thought the string form was more common.
Interesting point though: if preact core only supported function refs, preact-compat could actually use them to implement string refs. Wouldn't work the other way around, so that's another point in favor of just doing function refs in core.

I think function refs is the way React is going. They seem to be trying to get rid of string refs, but I guess they face resistance because of backwards compatibility.
You don't have that problem here, so I'd go with only function refs in core, and string refs in compat.

Perfect. I can definitely see why they want to ditch string refs, they are not free even if you don't use them. Function refs are nearly free because no refs object needs to be allocated, it's more of a hook.

100% voted for function refs only, so that seals the deal.  4.0.1 now (only) supports function refs.  There are also now some decent tests :rainbow:

:heart_eyes:

Thank you! @developit

👍

So... did you guys implement the refs as functions or strings in 1,6.1?
Either I am doing something wrong or they are not there yet...
Thanks!

@cportela Preact only supports function refs. String refs are supported by preact-compat.
class Foo {
  render() {
    return (

        <OtherComponent ref={ c => this.otherComponent = c } />

    );
  }
}

Perfect @developit, thanks for the instant response!

@cportela No problem! :) I just created a little library you can use to get String refs working without using preact-compat, if you don't have any other need for it.  I might even use this myself:
https://gist.github.com/developit/63e7a81a507c368f7fc0898076f64d8d

Thanks @developit, u rock!

Hey
Is it possible to pass a ref to a prop in another component using Preact?
<One ref={c => this.one = c}/>
<Two one={this.one}/>

@PierBover what do you want to accomplish exactly? Pass parent dom element to child component as a prop?

Hey @idchlife
I'd like to pass the component instance to be able to call its methods.

@PierBover may I ask, you new to react/preact? Did you consider using flux for between components interaction or create methods in parent component and accomplish your task like:
class ParentComp extends Component {
  emitter = new EventEmitter();

  constructor() // Some config code for emitter

  render() {
    return (

                 <One addListenerOnChanges={(callback) => this.emitter.addListener(callback)} />
                 <Two onChangeCallback={() => this.emitter.emit(CHANGE_EVENT)} />

)
  }
}

So you will have Two component emit some event in parent EventEmitter and emitter then will pass event into One which will attach callback.
This is one solution. Actually I recommend flux for those purposes...

@idchlife the problem with that approach is that it needs a lot of boilerplate. The point of passing refs is the make the code as dynamic and generic as possible, instead of hand written boilerplate specific logic.
@developit can you post an example? How do you get a reference of the instance of the component in ref_?

@PierBover for sure. I misread your original question though, so I'm not sure this is what you want. Here's a simple example anyway:
class Outer extends Component {
  render() {
    // this.inner is the
 from Inner
    return <Middle ref_={ c => this.inner = c } />;
  }
}

class Middle extends Component {
  render(props) {
    return <Inner ref={props.ref_} />;
  }
}

class Inner extends Component {
  render() {
    return
;
  }
}

Now that I re-read your question though, I think it's worth knowing why you want to be able to directly invoke methods on a component.  While it's certainly possible, invoking methods on a component is an anti-pattern - it creates a tight coupling between two components that would otherwise be usable in isolation.  In my experience, I've found that exposing the same functionality as props & events ends up scaling better long-term.
class Outer {
  // using an event architecture means information shared between child components is
  // owned and managed by their parent, nicely matching the existing hierarchy ownership.
  handleThing = data => {
    this.setState({ thing: data.thing });
  };

  render(props, state) {
    return (

        <One onThing={this.handleThing}>
        <Two thing={state.thing}>

    );
  }
}

I wrote an article about this pattern called Props Down, Events Up that you might find interesting.

Thanks a lot @developit
So the component instance is passed on every prop that is a callback?
I thought this only happened with the ref prop.
I'm referring to <Middle ref_={ c => this.inner = c } />;

ref_ isn't special, the only reason that example works is because Middle is passing props.ref_ into Inner as a ref property. It's just ferrying the function reference down the tree in a non-special property until someone uses it as a ref.
render(props) {
  return <Inner ref={props.ref_} />;
}

Oh right!
Wow that's convoluted...
I've been reading more and it seems the best solution for me will be moving away from state/refs/props for this kinds of plumbings and use MobX instead with a mini RX implementation of Observable.
I despise Redux to be honest. It's solid but overly tedious for my use cases.

I wouldn't necessarily associate the shared state tree thing with this directly, but it might be a way to circumvent needing to associate two components directly.  We're using a simple Store implementation for shared access to an object, and passing it around via context (using a Provider/connect model).

Any update on this? It's been months since the last activity.

@JeromeDane not sure what you are looking for an update on... If you mean an update on support for the ref prop, it's already been supported for almost a year (~feb 2016). Support for String refs will never be included in Preact's core since they are deprecated and a poor design that impacts performance. They have always been available in preact-compat, however.

Gotcha. Thanks. Sorry for my ignorance.

no problem! just wasn't sure if I'd missed something 👍


Fast changes 2

Codecov Report
Base: 76.42% // Head: 76.42% // No change to project coverage :thumbsup:

Coverage data is based on head (d21b662) compared to base (33ab580).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #132   +/-   ##
=======================================
  Coverage   76.42%   76.42%
=======================================
  Files          36       36
  Lines        2583     2583
=======================================
  Hits         1974     1974
  Misses        609      609

Flag
Coverage Δ

unittests
76.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


Filter out redundant surface mesh vertices

Triangles in the surface mesh share vertices but the vertices are repeated for every triangle in the mesh. This change reduces the number of points for the surface by 4-6× and should in principle reduce the time for brute-force all-to-all calculations used by Feret max by 16-36×. In testing on small meshes there is a several-fold speed up but not as much as predicted.

Nice. Changes LGTM. Just as a comment because I don't know the PA code well: we're sure that no other part of the code relies on having those points more than once?

Surface Area calculation requires the triangles to be complete, so it doesn't call the filtering method. Only ellipsoid fitting and feret max, which don't care about triangles, use the filtering method.


[BUG] AttributeError: module 'interactions' has no attribute 'Option'

Library Version
discord-py-interactions      5.6.0
Describe the Bug
The provided code encounters an error when attempting to use the Option attribute from the interactions module. The error message suggests that the Option attribute is not found in the interactions module.
interactions.Option( <------ "Breakpoint"
name="text",
description="What you want to say",
type=interactions.OptionType.STRING,
required=True,
),
Steps to Reproduce
Update to latest version, or install, get error trying to- usually around here:
interactions.Option( <---------- "No" attribute named option.
name="text",
description="What you want to say",
type=interactions.OptionType.STRING,
required=True,
),
Expected Results
My expected results were that the bot should be running fine with the commands and producing the correct results, which, I followed the documents for. Previously before updating it was working perfectly fine and ran the bot but upon further inspection came to me with an error.
Minimal Reproducible Code
import interactions

interactions.Option <------- no attr of Option

Traceback
Traceback (most recent call last):
File ".../.py", line 3, in
interactions.Option(
AttributeError: module 'interactions' has no attribute 'Option'
Checklist

[X] I have searched the open issues for duplicates.
[X] I have shown the entire traceback, if possible.
[X] I have removed my token from display, if visible.
[X] I have attempted to debug this myself, and I believe this issue is with the library

Additional Information
No response

Hi, this is not a bug, you are probably looking at v4 docs that are outdated since you have installed the v5 version of the lib.
Please follow this guide for information on Command Options using v5.

Hi, this is not a bug, you are probably looking at v4 docs that are outdated since you have installed the v5 version of the lib. Please follow this guide for information on Command Options using v5.

Yup, you're right, confirmed so.


feat: Migrate to standardized build configs

Moves us to unified set of build configs for consistency (and hopefully improved tree-shaking)

Externalizes ALL dependencies so nothing is bundled by default

Need to re-run pnpm i with the new version (9)

Done and done. Also added pnpm to the engines so it errors if we are using the wrong one.


Cannot find module './cookie-consent-banner.entry.js'

Node/npm version(s):
v16.13.0
Package(s) version(s):
<EMAIL_ADDRESS><EMAIL_ADDRESS>
Browser(s) version(s):
Chrome 100.0.4896.127
Description of the issue/feature:
Component is not rendered and the stack trace shows:
Uncaught (in promise) Error: Cannot find module './cookie-consent-banner.entry.js'
    at newRequire (index.2d3ace14.js:61:19)
    at newRequire (index.2d3ace14.js:45:18)
    at localRequire (index.2d3ace14.js:84:35)
    at loadModule (index-6c3638be.js:1108:12)
    at initializeComponent (index-6c3638be.js:869:20)
    at connectedCallback (index-6c3638be.js:964:17)
    at index-6c3638be.js:1044:39
    at Object.jmp (index-6c3638be.js:12:17)
    at HostElement.connectedCallback (index-6c3638be.js:1044:29)
    at appendChildToContainer (react-dom.development.js:11040:16)

Hi @switchnollie!
Is it possible that you provide a Codesandbox to reproduce this issue?


id_holder of shopkeeper inventories invalid

The output of /version on my server is: git-Spigot-6de3d4b-fc24934 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
The output of /version denizen on my server is: 1.1.3-SNAPSHOT (build 1703-REL) (same with 1.1.3-SNAPSHOT (build 4639-DEV))
Other relevant plugins:

Citizens2 version 2.0.26-SNAPSHOT (build 1842)
Shopkeepers version 2.9.2
Depenizen version 2.0.0 (build 608)

(If relevant) A link to a paste of a script demonstrating the issue:  minimal example
inv_type:
    type: procedure
    definitions: inv
    script:
        - determine <[inv].inventory_type>
shopkeeper_test:
    type: world
    events:
        on player opens inventory:
            - narrate "inv type = <proc[inv_type].context[<context.inventory>]>"

The issue is:
The holder id of NPC shopkeeper inventories is 'MERCHANT',  which is apparently invalid. When passing such an inventory to a procedure script and accessing it as an inventory, an exception is thrown. In the above example:
[18:38:28] [Server thread/INFO]:  ERROR in script 'inv_type' in queue 'INV_TYPE_RpEarthLabour' while executing command 'DETERMINE' in file 'scripts/test.yml' on line '16' with player 'p@621707eb-5811-457f-a889-6ecca695b463 (EnigmaAntares)'!
     Error Message: Internal exception was thrown!
[Error Continued] java.lang.IllegalArgumentException: Cannot open an inventory of type MERCHANT
[Error Continued] org.apache.commons.lang.Validate.isTrue(Validate.java:71)
[Error Continued] org.bukkit.craftbukkit.v1_15_R1.CraftServer.createInventory(CraftServer.java:1574)
[Error Continued] com.denizenscript.denizen.objects.properties.inventory.InventoryHolder.setHolder(InventoryHolder.java:127)

(line 16 is - determine <[inv].inventory_type> and inv is set to in@generic[holder=MERCHANT;title=Chest;uniquifier=0]).
When using the script on a villager, inv is set to in@entity[holder=e@c6d4a52e-4a66-4897-a3b7-d71528d1ef4e] and the procedure returns 'CHEST' which imho is another bug (the inventory type of a shopkeeper NPC is 'MERCHANT' - which I would expect for villagers as well).
Expected value for holder id would be something like 'n@42'.
Due to this bug it also isn't possible to directly determine the npc of such an inventory.
I think this is a Denizen bug, but it might actually be a Depenizen issue?

Have you asked the Shopkeepers dev about this?

Nio I haven't yet. Sorry, I somehow completely forgot about this issue ;)
Please give me some time (days, I guess) to recreate he bug with minimal plugins in the current version and then file a shopkeepers bugreport. I'll link it here when I'm done.


Yarn install fails

I installed yarn and ran yarn install but it fails with the following error (the same thing happens with npm install)
Oops! Something went wrong! :(

ESLint 7.32.0

ESLint couldn't find the config "next" to extend from. Please check that the name of the config is correct.

The config "next" was referenced from the config file in "C:\Users\USER\next-translate-routes\example".

It should be fixed with 1.7.0.


Is it possible to run it in an RaspberryPi?

Arch in RPI is ARM64 so I guess this won't work. I don't know much about docker, but can it be done?

I guess I can build this image for a different arch. I just don't know if this PPA https://launchpad.net/~team-xbmc has aarch64 repo.

It seems Kodi PPA doesn't work on arm64 https://forum.kodi.tv/showthread.php?tid=362374&pid=3034106#pid3034106


TypeError: model.native is not a function

Node version: 12
Sails version (sails): -
ORM hook version (sails-hook-orm): -
Sockets hook version (sails-hook-sockets): -
Organics hook version (sails-hook-organics): -
Grunt hook version (sails-hook-grunt): -
Uploads hook version (sails-hook-uploads): -
DB adapter & version (e.g. sails-mysql@5.55.5): last
Skipper adapter & version (e.g. skipper-s3@5.55.5): -

Hi i am using express + waterline + mongodb
trying to call a native method on a model
but it gives me an error
I don't understand how to fix it
any ideas would be helpful
TypeError: model.native is not a function
      at D:\WebProjects\ides\back\services\NativeQuery.js:4:22
      at new Promise (<anonymous>)
      at Object.find (D:\WebProjects\ides\back\services\NativeQuery.js:3:12)
      at newConstructor.validateList (D:\WebProjects\ides\back\models\Accounts.js:581:41)
      at list (D:\WebProjects\ides\back\controllers\AccountsController.js:55:65)
      at Layer.handle [as handle_request] (D:\WebProjects\ides\back\node_modules\express\lib\router\layer.js:95:5)
      at next (D:\WebProjects\ides\back\node_modules\express\lib\router\route.js:137:13)
      at Route.dispatch (D:\WebProjects\ides\back\node_modules\express\lib\router\route.js:112:3)
      at Layer.handle [as handle_request] (D:\WebProjects\ides\back\node_modules\express\lib\router\layer.js:95:5)
      at D:\WebProjects\ides\back\node_modules\express\lib\router\index.js:281:22
      at param (D:\WebProjects\ides\back\node_modules\express\lib\router\index.js:354:14)
      at param (D:\WebProjects\ides\back\node_modules\express\lib\router\index.js:365:14)
      at Function.process_params (D:\WebProjects\ides\back\node_modules\express\lib\router\index.js:410:3)
      at next (D:\WebProjects\ides\back\node_modules\express\lib\router\index.js:275:10)
      at SendStream.error (D:\WebProjects\ides\back\node_modules\serve-static\index.js:121:7)
      at SendStream.emit (events.js:315:20)

Hi @coaperator, would you mind sharing an example of how you're trying to call the native method in your code?

Hi @coaperator, would you mind sharing an example of how you're trying to call the native method in your code?

I made middleware, a model instance is passed to it
module.exports = {
  find: (model, query) => {
    return new Promise((resolve, reject) => {
      return model.native((err, collection) => {
        if (err) return reject(err);

        return collection.find(query).toArray((err, result) => {
          if (err) return reject(err);
          return resolve(result);
        });
      });
    });
  }
};

Hi @coaperator, Would you be able to create a github repo of a minimal sails app that reproduces the issue you're having?


Design Patterns

https://refactoring.guru/design-patterns

Creational patterns provide object creation mechanisms that increase flexibility and reuse of existing code.
Structural patterns explain how to assemble objects and classes into larger structures, while keeping these structures flexible and efficient.
Behavioral patterns take care of effective communication and the assignment of responsibilities between objects.

https://refactoring.guru/design-patterns/criticism


Retry on connection refused

Curl fails immediately (skipping retries) when connection on the port is refused. Might make sense to add --retry-connrefused?

Hey @benmerckx, thanks for this suggestion! I can't remember why it wasn't added straight away, but I can't think of any reason not to do it now.
v1.4 is now available and should have this enabled by default.
It seems to have passed all the checks, but let me know if anything.


Return error from server when client sends match state with an invalid match id.

Description
Currently server doesn't return any error when client sends match state with an invalid match id.
This can happen when a client sends match state having match_id of match which no longer exists on server.
Steps to Reproduce

Send match state from client to server with an invalid match_id
Observe that client doesn't get any error
e.g.
->Send matchState having invalid match_id
 _Socket.SendMatchState("abcd", matchOpCode, newState);
->Server logs show -
{"level":"debug","ts":"2018-11-29T13:23:34.008+0530","msg":"Received *rtapi.Envelope_MatchDataSend message","uid":"c7fb8ee6-70be-41a1-b29c-1656002c02fb","sid":"96979f2c-549d-4742-860d-4e58fb5052bd","message":{"MatchDataSend":{"match_id":"abcd","op_code":311,"data":"e30="}}}

->No error on server side and client doesn't get any error.
Expected Result
Server should return an error.
Invalid match_id error if match_id is not following a common pattern.
Match not found error if no match is found with the provided match_id
Actual Result
Server doesn't return any error.
Context
Unity
Your Environment

Nakama: 2.2.1
Cockroach: 2.0.5

Done in 012c695a8026f9c7c4cd745bd2af14da49ceef0a and will be part of the next release.


Gas estimate is hardcoded

The estimated eth gas is currently hardcoded from data sampled from test runs.
This is suboptimal as it could differ based on the base tokens for different tranches, and the numbers need to be updated on contract changes.
The reason that ethers estimateGas is not being used is due to how slow it is. The simulation time for 1-8 compounds is more than an order of magnitude longer when estimateGas is used.

Suggested resolutions:

A sample of transactions with the smart contract are fetched from on chain, and are used to calculate an estimate.
Transactions are fetched from on chain by some sort of off chain aggregator. The aggregator itself is then queried for estimates.


JavaScript SDK Feedback

[ ] Callbacks Removed
[ ] Uses promises or RxJS
[ ] Add vehicle class

@aj-michael @robinsdm
My understanding of promises is that once they have been settled (fulfilled or rejected), they remain in that state. So, if you do something like:
cluster.cluterWasRouted().then(function(response) {}, function(err) {});

you are S.O.L. if you get rerouted again unless you create another promise. I think it still makes sense to use promises for things like clusterById, but for push notifications which the server may call multiple times, it still seems appropriate to use callbacks. Does this seem reasonable or am I not seeing something?

@grovecj after talking with mike, he agrees with you. We have removed all promises.


Support for kustomize in ko

kubectl supports deploying YAML manifests with kustomize overlays via the -k option, where kubectl apply -k <path> roughly corresponds to kustomize <path> | kubectl apply -f -.
It would be handy to have a similar support kustomize in the resolve and apply commands of ko. That would enable maintaining overlays for applications deployed with ko.
For instance, when developing Knative or Tekton, it may be necessary to add special secrets or rolebindings to service accounts, depending on the target development cluster. Local overlays can be maintained for this purpose, which make the development workflow easier.
This is possible today with kustomize <path> | ko apply -f -, so ko apply -k would be a nice to have.

What would this implementation look like?
My gut reaction is "no" because I'd prefer to keep ko simple, but if all you have to do is pass through some flags it wouldn't be a huge deal.
What does the kubernetes implementation look like? Do they import kustomize or just shell out to it?


Set channels for [SyncVar]

Is your feature request related to a problem? Please describe.
SyncVars don't use channels. I would like to be able to set them as unreliable for things that update quickly. A boss with 20 people wailing on it will be updating a health SyncVar like mad. Cases like this shouldn't care if a packet drops.
Describe the solution you'd like
[SyncVar (channel=1)] would be the cleanest thing.
Describe alternatives you've considered
Formerly with Unet you could set the whole script to a channel. I'm not for sure what that did exactly though. Else I'll probably rip out any remaining SyncVars and continue to only RPC.
Additional context
With the UDP transports rolling, channels are becoming more relevant. It also seems like one of the only things you can't set channels for.

My opinion: this is difficult to implement. Theres several things to take into account, serialization code would become a lot more complicated.
The only way I see this could happen is to have it be treated only as a suggestion to Mirror: if on a particular update tick, only SyncVars marked Unreliable are being sent, then send it as unreliable. If there is any mix of Unreliable and Reliable, upgrade to reliable.
Still this would be a lot of added complexity, i think.

SyncVars and OnSerialize/OnDeserialize and SyncLists are all serialized into one packet. Using different channels for only parts of those would be really difficult and cause a lot more processing.
at the moment, we are not bandwidth limited. we are CPU limited. so I am closing this, sorry.


"Restart with current session" seems to grab wrong session/window.

Also, when restarting from session it seems that closing vertical splits causes the cmdheight to be reset to 20, which is what we do at startup (but only for a brief moment).

It seems to grab the session belonging to the first window that was opened with the app, not the currently focused window.

It's probably the hacked together session menu I made. I'll replace it with the better xoxo one.


shouldEnable option in ion-infinite-scroll after upgrade to RC0

Short description of the problem:
When serve the application this error occured and after remove shouldEnable from infinite scroll it's work.
What behavior are you expecting?
Run the application
Steps to reproduce:

Upgrade to RC0
Serve application

<ion-infinite-scroll (ionInfinite)="doInfinite($event)" [shouldEnable]="showingSection != 'list'">
        <ion-infinite-scroll-content loadingText="{{'Loading more data...' | translate}}"></ion-infinite-scroll-content>
</ion-infinite-scroll>

Unhandled Promise rejection:

Template parse errors:
Can't bind to 'shouldEnable' since it isn't a known property of 'ion-infinite-scroll'.
1. If 'ion-infinite-scroll' is an Angular component and it has 'shouldEnable' input, then verify that it is part of this module.
2. If 'ion-infinite-scroll' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the<EMAIL_ADDRESS>of this component to suppress this message.
 ("h"></ion-icon></button>
    </ion-list>
    <ion-infinite-scroll (ionInfinite)="doInfinite($event)" [ERROR ->][shouldEnable]="showingSection != 'list'">
        <ion-infinite-scroll-content loadingText="{{'Loadi"): StoreIndexPage@39:60

; Zone: <root> ; Task: Promise.then ; Value:
Error: Template parse errors: Can't bind to 'shouldEnable' since it isn't a known property of 'ion-infinite-scroll'. 1. If 'ion-infinite-scroll' is an Angular component and it has 'shouldEnable' input, then verify that it is part of this module. 2. If 'ion-infinite-scroll' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the<EMAIL_ADDRESS>of this component to suppress this message. ("h"></ion-icon></button> </ion-list> <ion-infinite-scroll (ionInfinite)="doInfinite($event)" [ERROR ->][shouldEnable]="showingSection != 'list'"> <ion-infinite-scroll-content loadingText="{{'Loadi"): StoreIndexPage@39:60

Which Ionic Version? 1.x or 2.x
2.x RC0

@jafaripur shouldEnable was never a valid attribute for ion-infinite-scroll. are you sure it made any difference in previously releases?

I'm just upgrade application and try to fix error occurred after upgrade to RC0. shouldEnable  metioned in this doc http://ionicframework.com/docs/v2/api/components/infinite-scroll/InfiniteScroll/ and i'm used it with previous version Beta11

@jafaripur but It was never mentioned in the doc as a Input:
http://ionicframework.com/docs/v2/2.0.0-beta.11/api/components/infinite-scroll/InfiniteScroll/#input-properties
Previously, it just didn't crash. It silently did not work.

Thank you.

I submitted a PR to support it though: https://github.com/driftyco/ionic/pull/8385


Remove INI support

In v1.2 the support for INI files will be dropped in favour of the alternative simvue.toml file which has further configuration potential.

Closed by #570


fix: Safely and lazily initialize native RNSkia JSI Bindings

The current way RNSkia JSI Bindings are installed is unsafe and actually crashes in Release builds on Android, since it is not following JSI Runtimes Threading Guidelines.
A JSI Runtime has no Thread Safety, and RNSkia does not enforce initial JSI Runtime operations (install the SkiaApi global) to run on the JS Thread, and since they are called when the RN Skia Module initializes, they are actually ran on the Native Module (mqt_native/mqt_nm) Thread, which leads to crashes since the Runtime might not be available yet.
This PR changes this behavior to expose a install(...) function that uses React Native's "blocking synchronous" native module function API, which as I initially expected, executes on the JS Thread (it's blocking.). This function is then called in the top-level index.ts file.
Benefits

Doesn't randomly crash on iOS release builds anymore
Doesn't randomly crash on Android release builds anymore
Seems to be safer and more predictable because we install the API just before we use it
A bit more lazy since the JSI Bindings only get installed once the react-native-skia package is imported, as opposed to eagerly install on app launch

Cool - as discussed on Slack, it works for me on iOS. I unfortunately couldn't build Android, but I think the code is right. Feel free to DM me to troubleshoot if something isn't working there.

Fixed a missing import on Android (ReactMethod), and merged with main.

Fixed a missing import on Android (ReactMethod), and merged with main.

Woohoo! Thanks Marc!

Woohoo! Thanks Marc!

glad it works out so well, can't believe I didn't discover this sooner for MMKV 🙈


(feat) Simple python script to carry over ES indices from 5 to 7.

This script is by no means comprehensive, but seems to be working well for LI.
Checklist

[x] The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
[ ] Links to related issues (if applicable)
[ ] Tests for the changes have been added/updated (if applicable)
[ ] Docs related to the changes have been added/updated (if applicable)

Also note I'm not really experienced with Python, so any nits/comments about Python in general are more than welcome.


Default screen resolution

Hi,
I'm trying to change the default screen resolution from 2560x1700 to 1920x1280, but on every start it falls back to the original one. I tried to include setres script to startup apps, but for some reason it doesn't take effect. Also if I set this resolution in the display settings on startup I get this error:
Could not apply the stored configuration for monitors
none of the selected modes were compatible with the possible modes:
Trying modes for CRTC 63
CRTC 63: trying mode 2560x1700@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 2048x1536@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1920x1440@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1856x1392@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1792x1344@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1920x1200@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1920x1080@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1600x1200@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1680x1050@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1680x1050@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1600x1024@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1400x1050@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1280x1024@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1440x900@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1280x960@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1360x768@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1360x768@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1152x864@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 1024x768@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 800x600@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 800x600@56Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 640x480@60Hz with output at 1920x1280@60Hz (pass 0)
CRTC 63: trying mode 2560x1700@60Hz with output at 1920x1280@60Hz (pass 1)
CRTC 63: trying mode 2048x1536@60Hz with output at 1920x1280@60Hz (pass 1)
CRTC 63: trying mode 1920x1440@60Hz with output at 1920x1280@60Hz (pass 1)
CRTC 63: trying mode 1856x1392@60Hz with output at 1920x1280@60Hz (pass 1)
CRTC 63: trying mode 1792x1344@60Hz with output at 1920x1280@60Hz (pass 1)
CRTC 63: trying mode 1920x1200@60Hz with output at 1920x1280@60Hz (pass 1)
CRTC 63: trying mode 1920x1080@60Hz with output at 1920x1280@60Hz (pass 1)

I have latest crouton with ubuntu 13.04.
Thanks in advance!

I have been using Unity for a few days with no problem and I just started getting the Could not apply ... error like the one above when loading it.  I followed the instructions (Option 3: change resolution) at the pixel wiki page referred to above.  The only thing that seemed odd was that the 10-monitor.conf file didn't exist.  I created it with the contents from the wiki page.  My cvt 1920 1280 60 output was the same as shown.
After doing this and restarting Unity the message changed to the one below.  (I don't know the details from the old error message).  Note that the message sits there for about a minute then the desktop appears as usual.
My resolution has been fine since the unity install.  I'm only doing this stuff to get rid of the error message and not have to wait the minute.
Could not apply the stored configuration for monitors

none of the selected modes were compatible with the possible modes:
Trying modes for CRTC 63
CRTC 63: trying mode 1920x1280@60Hz with output at 1291x920@60Hz (pass 0)
CRTC 63: trying mode 1360x768@60Hz with output at 1291x920@60Hz (pass 0)
CRTC 63: trying mode 1152x864@60Hz with output at 1291x920@60Hz (pass 0)
CRTC 63: trying mode 1024x768@60Hz with output at 1291x920@60Hz (pass 0)
CRTC 63: trying mode 800x600@60Hz with output at 1291x920@60Hz (pass 0)
CRTC 63: trying mode 640x480@60Hz with output at 1291x920@60Hz (pass 0)
CRTC 63: trying mode 1440x956@60Hz with output at 1291x920@60Hz (pass 0)
CRTC 63: trying mode 1920x1280@60Hz with output at 1291x920@60Hz (pass 1)
CRTC 63: trying mode 1360x768@60Hz with output at 1291x920@60Hz (pass 1)
CRTC 63: trying mode 1152x864@60Hz with output at 1291x920@60Hz (pass 1)
CRTC 63: trying mode 1024x768@60Hz with output at 1291x920@60Hz (pass 1)
CRTC 63: trying mode 800x600@60Hz with output at 1291x920@60Hz (pass 1)
CRTC 63: trying mode 640x480@60Hz with output at 1291x920@60Hz (pass 1)
CRTC 63: trying mode 1440x956@60Hz with output at 1291x920@60Hz (pass 1)

Installed via
sudo sh -e ~/Downloads/crouton -t unity,xiwi,keyboard -r trusty -n mychroot

Chromebook Pixel 2015
Version 41.0.2272.102 (64-bit)
Platform 6680.78.0 (Official Build) stable-channel samus
Firmware Google_Samus.6300.102.0


Multiple auth tokens

We're looking into potentially changing (probably not right now), an ESC token. We assume a newly generated token will replace the currently active, is this correct? Is there a future world where we can have concurrent active tokens, with associated activation datetimes, and select which ones to deactivate?

The question was triggered by an ESC asking if they're required to change the token (I believe the answer is no), but I got thinking of the possibility of this. We cannot generate a new token for them without it overwriting their current one, naturally resulting in errors in PROd during the transition and token handover.

Yeah I understand that 1-to-many tokens requires good process for cleanup

There is only one token associated with the ESC right now. Let's consider having multiple tokens, if there's a need.
There's a workaround. You can have 2 ESCs: "mr blue" & "mr green" and assign them the same permissions (yes, it's laborious). After they switch, deactivate the old one.
In short, having multiple tokens would facilitate the process of switching to a new token.
However, there's a risk we'll end up with a ton of unused, obsolete tokens, so maybe tracking the date when the token was in-use last time would be insightful in the cleanup process.
(issue reported by Veronica)

So here we've landed on going 1-to-many on ESCs to auth tokens, and then giving the portfolio manager a way to scan for dead or unused tokens, right?


Unicode character in Json value seems to break foreign key relationships

Bug description
When I try to insert the unicode character \udf9f into a JSON column, Prisma throws an error about a foreign key relationship. It seems to get schizophrenic about how I am trying to connect the models. It seems really bizarre, but I haven't found a workaround and it's important we can capture all types of characters in the JSON, where we store user content. Let me know if I can help any further.
I have seen at least one other unicode character trigger this issue: \udd5d. And I'm not sure if the fact I called my JSON column "data" could be causing an issue. All I have to do is replace the string with regular characters and the update will work fine.
How to reproduce
Create two models in the example below and include the unicode character \udf9f somewhere in the value of the JSON column.
Expected behavior
I expect the insert to work and connect the page diff correctly to the page model.
Prisma information

model Page {
  id                  String            @id @default(uuid()) @db.Uuid
}

model PageDiff {
  data      Json
  pageId    String   @db.Uuid
  page      Page?    @relation(fields: [pageId], references: [id], onDelete: Cascade, onUpdate: Cascade)
  version   Int

  @@unique([pageId, version])
  @@index([pageId])
}

Either approach triggers an error:

const page = await prisma.page.create({ data: { version: 0 } });

// Throws error: Unknown argument `pageId`. Did you mean `page`? Available options are listed in green.
await prisma.pageDiff.create({
  data: {
    pageId: page.id,
    data: {
       text: '\udf9f'
    }
  }
});

// Throws error: Argument `pageId` is missing.
await prisma.pageDiff.create({
  data: {
    page: {
       connect: {
          id: page.id
       }
    },
    data: {
       text: '\udf9f'
    }
  }
});

Environment & setup

OS: macOS
Database: PostgreSQL
Node.js version: v20.1.0

Prisma Version
prisma                  : 4.13.0
@prisma/client          : 4.13.0
Current platform        : darwin
Query Engine (Node-API) : libquery-engine 1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a (at<EMAIL_ADDRESS>Migration Engine        : migration-engine-cli 1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a (at node_modules/@prisma/engines/migration-engine-darwin)
Format Wasm             : @prisma/prisma-fmt-wasm 4.13.0-50.1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a
Default Engines Hash    : 1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a
Studio                  : 0.484.0

I could reproduce without any relation in our latest dev version 5.3.0-dev.6
import { PrismaClient } from "@prisma/client";

async function main() {
  const prisma = new PrismaClient();

  await prisma.something.create({
    data: {
      jsonData: {
        something: "\udf9f",
      },
    },
  });

  prisma.$disconnect();
}

main();

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model Something {
  id       String @id @default(uuid()) @db.Uuid
  jsonData Json
}

Errors with
PrismaClientKnownRequestError:
Invalid `prisma.something.create()` invocation in
/Users/j42/Repros/19620/main.ts:6:26

  3 async function main() {
  4   const prisma = new PrismaClient();
  5
→ 6   await prisma.something.create(
lone leading surrogate in hex escape at line 1 column 107
    at vn.handleRequestError (/Users/j42/Repros/19620/node_modules/@prisma/client/runtime/library.js:123:6730)
    at vn.handleAndLogRequestError (/Users/j42/Repros/19620/node_modules/@prisma/client/runtime/library.js:123:6119)
    at vn.request (/Users/j42/Repros/19620/node_modules/@prisma/client/runtime/library.js:123:5839)
    at l (/Users/j42/Repros/19620/node_modules/@prisma/client/runtime/library.js:128:9763)
    at main (/Users/j42/Repros/19620/main.ts:6:3)

Debug logs
  prisma:tryLoadEnv  Environment variables not found at null +0ms
  prisma:tryLoadEnv  Environment variables loaded from /Users/j42/Repros/19620/prisma/.env +1ms
  prisma:client  checkPlatformCaching:postinstall undefined +0ms
  prisma:client  checkPlatformCaching:ciName undefined +0ms
  prisma:tryLoadEnv  Environment variables not found at null +1ms
  prisma:tryLoadEnv  Environment variables loaded from /Users/j42/Repros/19620/prisma/.env +0ms
  prisma:client  dirname /Users/j42/Repros/19620/node_modules/.prisma/client +0ms
  prisma:client  relativePath ../../../prisma +0ms
  prisma:client  cwd /Users/j42/Repros/19620/prisma +0ms
  prisma:client  clientVersion 5.3.0-dev.6 +0ms
  prisma:client:libraryEngine  internalSetup +0ms
  prisma:client  Prisma Client call: +2ms
  prisma:client  prisma.something.create({
  data: {
    jsonData: {
      something: "\udf9f"
    }
  }
}) +0ms
  prisma:client  Generated request: +0ms
  prisma:client  {
  "modelName": "Something",
  "action": "createOne",
  "query": {
    "arguments": {
      "data": {
        "jsonData": {
          "something": "\udf9f"
        }
      }
    },
    "selection": {
      "$composites": true,
      "$scalars": true
    }
  }
}
 +0ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: false +1ms
  prisma:client:engines:resolveEnginePath  enginePath /Users/j42/Repros/19620/node_modules/.prisma/client/libquery_engine-darwin-arm64.dylib.node +0ms
  prisma:client:libraryEngine  library starting +3ms
  prisma:client:libraryEngine  library started +24ms
  prisma:client:request_handler  [Error: lone leading surrogate in hex escape at line 1 column 107] {
  code: 'InvalidArg'
} +0ms


Fix regression in runbook

Description
Fixes EN-4895

Fixed regression in imagepullback runbook (re: white space changes)
Added new runbook for demoing Gen-AI stuff

Need a json file as well for the new runbook @abhishek-unskript


Implement faction-based cost reduction locations

Introduces a new class, FactionCostReduction, that reduces the cost of the next marshaled card for the faction specified in the constructor. FactionCostReduction replaces DragonstonePort, BloodOrangeGrove and HeartTreeGrove which were all identical minus the faction code used.
It also introduces a function factionCostReductionLocation which takes a faction code and returns a card implementation that uses FactionCostReduction for that faction code. This function is now used to generate both the replaced reducer locations as well as implement the remaining reducer locations.

:+1: This is exactly what I was going to do this evening, thank you :)


Save the schedules in database

The favorites schedules should be saved in database in case the user want to change device or or got new device.

https://firebase.google.com/docs/database/android/offline-capabilities


Add German translation for TAG Environmental Sustainability _index.md

This commit adds the German translation for the TAG Environmental Sustainability landing page (_index.md) to the 'de' folder.

Whats missing here for the Quality check to run?

Whats missing here for the Quality check to run?

I believe the quality check is awaiting approval from a maintainer, likely because this is my first pull request in this repository.

Thanks for opening the PR! A couple of minor comments

Appreciate your feedback! I've implemented all the suggested changes.

Thanks 🙌


Inquiry on IQL Performance with One-Leg Assembly Task

Dear Authors,
First and foremost, I would like to express my gratitude for the exceptional work on this repository, which serves as a valuable benchmark for long-horizon assembly tasks!
I am reaching out to seek your insight regarding an issue I encountered with the Implicit Q-Learning (IQL) algorithm's performance on the one-leg assembly task. Following the instructions provided in your tutorial, I executed the example evaluation code using the command:
python implicit_q_learning/test_offline.py --env_name=FurnitureSimImageFeature-v0/one_leg --config=implicit_q_learning/configs/furniture_config.py --ckpt_step=1000000 --run_name one_leg_full_iql_r3m_low_sim_1000 --randomness low

Subsequently, I downloaded the pre-trained model one_leg_full_iql_r3m_low_sim_1000.42. Apart from a single adjustment made to address a bug—modifying _, params = variables.pop('params') to params = variables.pop('params') at this line (modify it to solve a small bug) — I adhered strictly to the provided setup. However, I've observed that the model's performance is suboptimal. Specifically, it occasionally completes only the first two phases (Grasp tabletop and Place it to corner) or even fails to progress through the first phases.
Included below are two screenshots capturing the moments when the robot arm becomes stuck during the task execution:

Given these observations, I am eager to hear your suggestions and recommendations. Is the issue rooted in the model itself, or is there a possibility that I've overlooked a critical step?
Thank you once again for developing and sharing this invaluable resource. I look forward to your guidance and advice!
Best regards,
Pengzhi

Here is the output during execution:
Importing module 'gym_38' (/home/pengzhi/courses_delft/master_thesis/isaac_gym/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so)
Setting GYM_USD_PLUG_INFO_PATH to /home/pengzhi/courses_delft/master_thesis/isaac_gym/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
/home/pengzhi/anaconda3/envs/isaacgym/lib/python3.8/site-packages/jax/_src/api_util.py:229: SyntaxWarning: Jitted function has invalid argnames {'distribution'} in static_argnames. Function does not take these args.This warning will be replaced by an error after 2022-08-20 at the earliest.
  warnings.warn(f"Jitted function has invalid argnames {invalid_argnames} "
PyTorch version 2.2.2+cu121
Using /home/pengzhi/.cache/torch_extensions/py38_cu121 as PyTorch extensions root...
Device count 1
/home/pengzhi/courses_delft/master_thesis/isaac_gym/isaacgym/python/isaacgym/_bindings/src/gymtorch
Emitting ninja build file /home/pengzhi/.cache/torch_extensions/py38_cu121/gymtorch/build.ninja...
Building extension module gymtorch...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: no work to do.
Loading extension module gymtorch...
Not connected to PVD
+++ Using GPU PhysX
Physics Engine: PhysX
Physics Device: cuda:0
GPU Pipeline: enabled
Using SDF cache directory '/home/pengzhi/.isaacgym/sdf_V100'
~!~!~! Loaded/Cooked SDF triangle mesh 0 @ 0x531675a0, resolution=512, spacing=0.000317
  ~!~! Bounds:  (-0.081250, 0.081250) (-0.015685, 0.015565) (-0.081250, 0.081251)
  ~!~! Extents: (0.162500, 0.031250, 0.162501)
  ~!~! Resolution: (512, 99, 512)
~!~!~! Loaded/Cooked SDF triangle mesh 1 @ 0x53165eb0, resolution=512, spacing=0.000171
  ~!~! Bounds:  (-0.015000, 0.015000) (-0.056250, 0.031250) (-0.014383, 0.015618)
  ~!~! Extents: (0.030000, 0.087500, 0.030001)
  ~!~! Resolution: (176, 512, 176)
~!~!~! Loaded/Cooked SDF triangle mesh 2 @ 0x522de620, resolution=512, spacing=0.000172
  ~!~! Bounds:  (-0.015000, 0.015000) (-0.056562, 0.031376) (-0.015438, 0.014563)
  ~!~! Extents: (0.030000, 0.087938, 0.030001)
  ~!~! Resolution: (175, 512, 175)
~!~!~! Loaded/Cooked SDF triangle mesh 3 @ 0x52ae1f70, resolution=512, spacing=0.000171
  ~!~! Bounds:  (-0.015000, 0.015000) (-0.056250, 0.031250) (-0.014375, 0.015625)
  ~!~! Extents: (0.030000, 0.087500, 0.030000)
  ~!~! Resolution: (176, 512, 176)
~!~!~! Loaded/Cooked SDF triangle mesh 4 @ 0x52e74e60, resolution=512, spacing=0.000171
  ~!~! Bounds:  (-0.015000, 0.015000) (-0.056250, 0.031250) (-0.015618, 0.014383)
  ~!~! Extents: (0.030000, 0.087500, 0.030001)
  ~!~! Resolution: (176, 512, 176)
/home/pengzhi/anaconda3/envs/isaacgym/lib/python3.8/site-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.
  warnings.warn(warning.format(ret))
/home/pengzhi/anaconda3/envs/isaacgym/lib/python3.8/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
  warnings.warn(
/home/pengzhi/anaconda3/envs/isaacgym/lib/python3.8/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=None`.
  warnings.warn(msg)
Observation space Dict(image1:Box([-inf -inf -inf ... -inf -inf -inf], [inf inf inf ... inf inf inf], (2048,), float32), image2:Box([-inf -inf -inf ... -inf -inf -inf], [inf inf inf ... inf inf inf], (2048,), float32), robot_state:Box([-inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf], [inf inf inf inf inf inf inf inf inf inf inf inf inf inf], (14,), float32))
Action space Box([[-1. -1. -1. -1. -1. -1. -1. -1.]], [[1. 1. 1. 1. 1. 1. 1. 1.]], (1, 8), float32)
I0409 01:53:10.627077<PHONE_NUMBER>37184 xla_bridge.py:603] Unable to initialize backend 'cuda': module 'jaxlib.xla_extension' has no attribute 'GpuAllocatorConfig'
I0409 01:53:10.627183<PHONE_NUMBER>37184 xla_bridge.py:603] Unable to initialize backend 'rocm': module 'jaxlib.xla_extension' has no attribute 'GpuAllocatorConfig'
I0409 01:53:10.627608<PHONE_NUMBER>37184 xla_bridge.py:603] Unable to initialize backend 'tpu': INVALID_ARGUMENT: TpuPlatform is not available.
W0409 01:53:10.627674<PHONE_NUMBER>37184 xla_bridge.py:617] No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
INFO: Found collision-free init pose

Dear Authors,
First and foremost, I would like to express my gratitude for the exceptional work on this repository, which serves as a valuable benchmark for long-horizon assembly tasks!
I am reaching out to seek your insight regarding an issue I encountered with the Implicit Q-Learning (IQL) algorithm's performance on the one-leg assembly task. Following the instructions provided in your tutorial, I executed the example evaluation code using the command:
python implicit_q_learning/test_offline.py --env_name=FurnitureSimImageFeature-v0/one_leg --config=implicit_q_learning/configs/furniture_config.py --ckpt_step=1000000 --run_name one_leg_full_iql_r3m_low_sim_1000 --randomness low

Subsequently, I downloaded the pre-trained model one_leg_full_iql_r3m_low_sim_1000.42. Apart from a single adjustment made to address a bug—modifying _, params = variables.pop('params') to params = variables.pop('params') at this line (modify it to solve a small bug) — I adhered strictly to the provided setup. However, I've observed that the model's performance is suboptimal. Specifically, it occasionally completes only the first two phases (Grasp tabletop and Place it to corner) or even fails to progress through the first phases.
Included below are two screenshots capturing the moments when the robot arm becomes stuck during the task execution:
Given these observations, I am eager to hear your suggestions and recommendations. Is the issue rooted in the model itself, or is there a possibility that I've overlooked a critical step?
Thank you once again for developing and sharing this invaluable resource. I look forward to your guidance and advice!
Best regards, Pengzhi

Hi, I also have the same problem. I would like to know if this problem has been solved?


Render analysis docs

This is the final phase of the doc work: rendering output for readthedocs. Because we already have docs/pact-properties.html, I'm tentatively putting this auto-generated output into docs/pact-properties-api.html.
I'm trying a little bit of an experimental way to describe type information in a way that users can understand what is going on without having to learn a new notation. Here are some examples.
A simple authorization function:

A function with multiple overloaded usages:

A polymorphic function:

A more complicated example, where we are binding variables in the presence of polymorphism:

This is all automatically generated from information I am storing the Doc type in Pact.Analyze.Feature.
EDIT: RST output available here.

For anyone wondering about my rationale for this "literate" type signature style:

Pact doesn't have type signatures
We need to communicate a lot of complexity: (1) overloading, (2) polymorphism, (3) constraints, and (4) variable binding.
Any type signature notation I could have cooked-up here would have: (1) not corresponded to knowledge users already have about pact code, and (2) been ad-hoc for this single purpose of documentation.
It's probably not safe to assume that users of pact would be familiar with things like "forall" in a type signature notation.

So I figured that I would try bulletpointed english descriptions first, and see if that worked well enough.

Good call with the intro -- you can now see that here: https://github.com/kadena-io/pact/blob/render-analysis-docs/docs/pact-properties-api.rst


telepathy

when mining slabs it gives glitched texture item

Strange, I tested and it gave me the slab fine. Could be another plugin messing with it or the servers jar possible. What is your server jar. Do /version in console and paste it here.

git-Paper-1104 (MC: 1.11.2)
try with quartz slab

It works fine for me. I am using normal spigot 1.11.2. Maybe the version of paper spigot you have is messing it up or its another plugin doing it.


Predicting only for a single user sequence

Is there a way that predict method works in the following way : (This can be used for real time cases)
Given a new user sequence of items that the user interacted with in real time  and the model created based on the training data,  a set of recommended items with their scores returns.
P.S https://github.com/THUwangcy/ReChorus is also SASRec Pytorch implementation but it is not easy to use it for the single user.
Thanks,
Sara

@shanian Hi Sara, thx for your information, if I understand 'the following way' you presented correctly, are you looking for the stuff inside the 'evaluate' functions? The part is the same as in original tensorflow implementation and in this pytorch version, do inference for users one by one:
https://github.com/pmixer/SASRec.pytorch/blob/dc41b6238c1c4cc90fbd186e387111aab86173f2/main.py#L98
https://github.com/pmixer/SASRec.pytorch/blob/dc41b6238c1c4cc90fbd186e387111aab86173f2/utils.py#L140

@pmixer Thanks for your quick reply. Yes  I like to know how this can be leverage to implement a real life scenario. (When the model is trained and saved.) a new user with some sequences of actions  is given and the predict function returns a list of relevant items as the next items for a given user. I will check the part you mentioned.
Thanks again,
Sara

@shanian thx, I think that's what you need, its a simple trick to make batch_size=1 for online inference(just put what you wan to rank(item ids) to item_idx would help you implement it), I also included a flag to only load the trained model and do inference in the script:
https://github.com/pmixer/SASRec.pytorch/blob/dc41b6238c1c4cc90fbd186e387111aab86173f2/main.py#L62
BTW, this kind of approach is of low performance, pls check serving frameworks if you really hope to do it for online services:
https://github.com/pytorch/serve
https://github.com/triton-inference-server

@pmixer Thanks for your help :)

I also have a question about online inference. I notice that the evaluate() function in the training process randomly selects 100 items and then makes use of "argsort()" to rank the predictions. But how to recommend top10 items to a new user with his historic items sequence as input? For example, if there are 2000 items in total, should I use [1,2,...,2000] as the "item_idx"?  (I have encountered difficulties in using the trained model to predict a new sequence.)
Thanks

input

argsort is just a trick for computing NDCG, pls code your own methods for customized requirements, no need to reuse current evaluate function.

@laodanhuang I think for your case you need use  [1,2,...,2000] as the "item_idx" (all your item in your dataset) and then choose top 10 items.


Making the GCS upload path time/commit specific.

The tests flakiness seems to be unrelated to this PR, will address it separately.


add list functionality to CLI

Some functions require calling by name (for service or account).
This will support listing the possible objects before

List functions added to usage and cost commands


Update mpack_advisor code for configurations validation

What changes were proposed in this pull request?
Update mpack_advisor.py to generate configuration recommend json with modified schema so that Java module can corretly parse it.
How was this patch tested?
Manually test

@swapanshridhar @jayush Please review it when you have time. Thanks.

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/2385/
Test FAILed.
Test FAILured.

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/2451/
Test FAILed.
Test FAILured.

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/2450/
Test FAILed.
Test FAILured.

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/2469/
Test FAILed.
Test FAILured.

+1 for the request.