Replacing gym's Mujoco envs with brax envs

Had a conversation with @jkterry1 on https://github.com/openai/gym/issues/2366, and it appears brax would also be a great alternative for the mujoco envs replacement.
To help with this transition. I made an attempt to try out brax with pytorch. Here is a basic report: https://wandb.ai/costa-huang/brax/reports/Brax-as-Pybullet-replacement--Vmlldzo5ODI4MDk. The source code is here: https://github.com/vwxyzjn/cleanrl/blob/mybranch/cleanrl/brax/readme.md
One of the biggest issue with the brax adoption is the env normalization:

gym doesn't have a normalization wrapper
sb3 has a normalization wrapper but brax does not have a sb3 vector env api
brax's normalization is implemented in the training side (https://github.com/google/brax/blob/main/brax/training/normalization.py)

I think going forward, probably the best way to fix this is to refactor the brax training side's normalization to the environment side. This in the future will also help throughput with the JaxToTorchWrapper. Otherwise, the observation will go from GPU to CPU for gym or sb3's normalization wrapper, then GPU again for torch, which just doesn't make sense.
One small thing is that given the brax environment directly produces the vector env, there is also no way to inject a ClipActionsWrapper(env), which may or may not have a performance impact. That said, this can be implemented in the training side with ease.

To recap the to do list:

Add suitable rendering
Further tune observation/action spaces to make them as close as possible
Make sure we are not reproducing the list of bugs in MuJuCo environments from Antonin Raffin that I sent you

I feel like there may have been a 4th issue, but I don't sleep very much and can no longer recall it. @erwincoumans @benelot do you remember?

One note on the suitable rendering is I feel implementing env.render(“rgb_array”) might be too expensive and counterproductive. Maybe implementing env.render(“html”) at the end of training is more preferable.

They're planning to add a new rendering engine such that "rgb_array" will be suitable

I don't know if this is the 4th feature I can't remember, but another thing we'll need to deal with that I briefly discussed is action/observation space documentation for the new Gym website we're working on, in the flavor of https://www.pettingzoo.ml/classic/chess

I would like to help with this, what can I do to help?

@joaogui1 Probably nothing, at least at the moment. Right I'm waiting on the Brax team to do some work and for the guy who created the pybullet replacement envs to get back from vacation, this will take 4-6 weeks. If you'd like to help with gym maintenance problems in general though, please email me and we can coordinate some things<EMAIL_ADDRESS>

Got it, will wait a little then, thanks!

I'm also happy to help on this, I've spent a lot of time with the mujoco/pybullet environments at this point. Can certainly help with points 2/3 that @jkterry1 posted in this thread.

We have started working on 1) the renderer.  We're looking at porting a simple technique like https://github.com/rougier/tiny-renderer to JAX as a new module in brax.io
Tuning observation/action space could start in parallel if anyone is interested.  I think the steps would involve:

reset a Gym Mujoco env (say Ant) to default state and inspect the observation space and its description
compare to Brax Ant env and make adjustments
step both and compare dynamic observations (e.g. contact forces)

I think the envs are already ~80% comparable, and the last 20% is just sleuthing to read the mujoco docs, and confirm the format matches.  I think we can get to the point where the meaning of each observation dimension is the same in both envs, even if the dynamics are still different.

I can get that going next week. I will use Mujoco 1.5 due to this  issue. It looks like the Brax environments are based off the v2 version of the Mujoco environments, so I'll start by comparing to those. Based on https://github.com/openai/gym/pull/1304 I think the v3 versions are supposed to be identical if using default args, not 100% sure that's true though.

This is so great to hear! I also have a quick update. Gym now has a normalization wrapper: https://github.com/openai/gym/pull/2387. The usage is roughly
env = gym.make("HalfCheetahBulletEnv-v0")
env = gym.wrappers.RecordEpisodeStatistics(env)
env = gym.wrappers.ClipAction(env)
env = gym.wrappers.NormalizeObservation(env)
env = gym.wrappers.TransformObservation(env, lambda obs: np.clip(obs, -10, 10))
env = gym.wrappers.NormalizeReward(env)
env = gym.wrappers.TransformReward(env, lambda reward: np.clip(reward, -10, 10))

However as I suggested earlier, this might be not as fast as implementing the normalization on brax's side. Another thing is directly applying these wrappers to brax environment won't work because some issues with jax's device array overriding numpy arrays in the wrappers.
A typical example is  gym.wrappers.RecordEpisodeStatistics, and its episode_returns array will be casted to a jax array, which causes problems because jax array is not mutable.

Ok, I was a bit busier than I expected this week, but as promised I did start comparing the ant environments this evening.
Here is a notebook I was using that may be useful to anyone else who wants to compare and tweak the envs.
With regards to the observations:

I believe all the state position and velocity information match up. For Mujoco it seems to be: z + quaternion for the torso (5), 8 joint angles, dxyz/drot (6) for torso, 8 more joint velocities, which matches exactly what brax has.
The contact information is where big differences appear. Brax ignores the contact forces for some internal bodies that present in the Mujoco model, this accounts for the difference in observation size (The brax team was already aware of this).
I'm not sure what the ordering for the contact forces is in brax. It doesn't match what mujoco does (see the notebook linked above) and it also doesn't seem to match up with the bodies in env.sys.body_idx.keys().
No matter the ordering , the magnitude of the force and and moment are substantially different, but that may be because of the difference in mass mentioned below.

If the goal is to make as faithful representation of mujoco envs as possible (which IMO it shouldn't necessarily be) then we will at least need to address the following:

The mj ant starts life suspended .75m in the air, the brax ant at .5
mj adds a relatively large amount random noise to its initial state on reset.
Inertial parameters for the two envs are different. Does brax have a way to infer an inertia from geometry? This is what mj does.
Torque limits appear different 300 in brax vs 150 in mj (units? That would be a lot of N*m)
Will need to find out what brax integrator settings are closest to an rk4 with dt = .01.
May also need to tune friction parameters, which will probably need to be done empirically.

TLDR: For the ant the difference in observations is in the ordering and number of contact forces. To make them match exactly we would need to re order the existing forces, and insert some dummy, zeroed elements into the observation. Should also probably adjust the mass, inertia, and torque limits.

@vwxyzjn good to hear about the normalization wrapper, I agree that the normalization and clipping should all be done on the brax side. This makes things awkward with respect to saving and loading environments / agents, since it will make brax a special case for gym, sb3 etc. Related, I also think that if the brax envs aren't going to be extremely fast that it would be to use pybullet.

@vwxyzjn we recently started using a similar Wrapper concept for wrapping envs in Brax, inspired by Gym.  e.g. EpisodeWrapper collects episode statistics and sets done at the episode boundary, and so on:
https://github.com/google/brax/blob/main/brax/envs/wrappers.py#L43
I don't think it would be too hard to make the brax API mirror what gym is doing, and still keep it all on device.

@sgillen this is super helpful - thanks for putting together this thorough comparison.  I hear you that our envs don't need to be exactly 1:1 to MuJoCo's - that said, we'd be happy to prioritize any fixes to the differences you brought up, according to whether they:

impact training curves significantly (e.g. we noticed that adding noise to initial states does sometimes impact training)
produce a more pleasing gate (e.g. perhaps re-adding the contact force reward penalty)
... some other reason?

Of the differences you found, do you have a suggestion for which might be the most important to address?

I agree with @sgillen on the tasks, but would reorder to:

add back in the contact force reward/penalty
adjust the mass, inertia, and torque limit
add the wider distribution to initial state

On 1: If we want to copy the previous env, we need it, whether it helps with training or not, otherwise we diverge.
On 2: Is there any reason these were set in the brax ant env the way they are? Torque limit looks like the result of f(mass, inertia, mujoco_engine_details), so we should be able to set similar ones to mujoco. If they can not be adjusted exactly, I would suggest to fall back to the metric of "similar learning curve". In pybullet I once looked at the metric of "similar observation distribution shape" which says something about in which observational manifold the ant moves.
On 3: This is certainly important for higher robustness of the learned policy. Especially in the humanoids, adding some noise during testing but not training easily messes them up.
On my side I started to play a bit with brax and built some initial version of the humanoid standup but ,being on vacation, I am not done yet. I plan to begin building a first version of all required mujoco envs next week in brax just to see how they perform. Then we can do the same for every env as @sgillen did for ant.

Just to confirm, does the list of inconsistencies include the list of bugs in MuJuCo that we want to make sure that we aren't reproducing that I sent?

@erikfrey I agree with @benelot list on what to prioritize. They will probably impact training, making the environment slightly harder if anything, but also closer to the original. The contact reward might lead to more pleasing gaits but it's hard to say.

@jkterry1 possibly means those:
(according to Antonin Raffin)

the broken halfcheetah is well known (blog post from 2018): https://www.alexirpan.com/2018/02/14/rl-hard.html
and was even more broken recently: https://twitter.com/natolambert/status/1369139391130607625

for the walker, I thought I saw a comment from Erwin saying it was heavier to actually avoid having it run but I cannot find it again, I can probably find a video of the Mujoco walker running (the envs where inspired by roboschool: https://github.com/openai/roboschool)
found it!
it's in the OpenAI blog post: https://openai.com/blog/roboschool/

according to OpenAI blog post, there was also the ant and the humanoid (but the humanoid is still quite un-realistic anyway)

otherwise, there is the Swimmer that changed behavior (but this can be solved by using a high discount factor): https://github.com/hill-a/stable-baselines/issues/500

@benelot that's the list, thanks a ton

Can confirm that our HalfCheetah is at least not broken in the ways discussed in those blogs.  In fact this is something we had to address in our paper comparing our envs to Mujoco's.  See section E1 in the appendix for a brief discussion about this problem.
That said, I am quite prepared for folks to find new and interesting bugs as these envs get more attention!  We'll be happy to address them when they come up    :-)
We are 90% done on hopper.  If someone would like to take a pass at Walker2d or Swimmer, please let me know.  Otherwise we'll get to them soon.

Quick update - we now have the Hopper env, and tomorrow we will land Walker2d.  We'll also add them soon to the colab with good default hparams.  Other things in flight:

We've added back the contact force penalty and shown it works well for Ant, confirming for others and then will push
@erwincoumans is making great progress on a simple, small software renderer that we will use for env.render
Wider distributions to initial state is also in progress

Per the meeting, we still need the following things before merging into Gym:
Adding missing environments:
Swimmer (Benjamin Ellenberger)
Standup (Brax team)
Inverted pendulum (Daniel Freeman)
Inverted double pendulum (Daniel Freeman)
Remove 0s where applicable (Brax team)

OK more updates:

Wider distributions to initial state is in!  We jitter qpos and qvel with the exact same amounts as the current gym mujoco envs
We now have a colab that demonstrates image rendering: https://colab.sandbox.google.com/github/google/brax/blob/main/notebooks/environments.ipynb
image rendering is now hooked up to the gym env render function for mode='rgb_array'
humanoid standup is in progress!

As a sidenote, rendering images does significantly slow down the throughput.

Yes, the CPU pytinyrenderer is not intended to use during training, only afterwards to see the rollout.
2 things to make it much faster:
half the resolution (width and height), and disable anti-aliasing
Image(image.render(env.sys, [s.qp for s in rollout], width=160, height=120, ssaa=1))

@erikfrey  What is needed to make those efficiency changes when using a Gym environment wrapper?

Yes, the CPU pytinyrenderer is not intended to use during training, only afterwards to see the rollout.

@erwincoumans That makes sense!
I think the desired solution also depends on if rendering the whole episode is faster. If the episode has 100 frames. Is it more expensive to (1) render the image at each frame, or (2) render the images for all the 100 frames as a batch?
gym.wrappers.RecordVideo takes approach (1), which takes an rgb_array from brax at every step. So if there are 1000 sub environments running, approach (1) could considerably slow things down since all the other 999 envs are basically blocked.
Maybe approach (2) is more preferable because you can have a wrapper that caches the states for the episode, when that episode ends, the wrapper spits out a video or an HTML. This way the other 999 sub environments are not blocked at all during the rollouts.  #

Here is a quick example.
Imagine we have 10 envs, 10 steps (unrolls), and record 1 frame takes 1 second, and each step takes 1 second.
Then approach (1) would take num_envs * (t_record + t_step) * num_steps = 10 * (1+1) * 10) = 120s
Whereas approach (2) would take num_envs * t_step * num_steps + t_record * num_steps = 10 * 1 * 10  + 1 * 10 = 110s.

Because I forgot to post it earlier, here's my list of remaining needed features in Brax per the last group call we had:
-Swimmer
-Remove unnecessary inheritance regarding hopper
-Joint dislocation
--Adjust joint stiffness
--Generalized constraint system
-Proof of concept with fast training in PyTorch
-Brax compatible wrappers

Just as a little mini-update on joint dislocation: Currently, Brax handles joint constraints using springy forces, but you can also rephrase these kinds of equality constraints as velocity-level updates which directly update the velocities of a system to satisfy constraints (instead of relying on strong springs to enforce the constraints).  There's a bit of a duality to these approaches, but it turns out it's much easier to reduce jitter in the joints with velocity-level methods.  As a proof of concept, here's Ant running around with its joints being governed by this new method:

OK!  I have uploaded an example of PPO in pure torch, running at 150,000 steps/sec on a Colab GPU.  It can train Ant in a few minutes.  We are far from Torch experts - I suspect there is an easy doubling in performance for someone who knows PyTorch better than we do:
Brax Training with PyTorch on GPU
I think is a good enough demonstration of using Brax from PyTorch via Gym, but if anyone out there would like to speed it up further, please have a go.  @vwxyzjn - your CleanRL was a helpful reference, thank you!  We tried a few things in that Colab (including using torch.jit) that may help bridge the perf gap in CleanRL.

For those following this thread, the remaining items are:
-Swimmer (Benjamin is working on this)
-Generalized constraint system
-Brax compatible wrappers (this is waiting on me)
-PR to Gym
-Phys2D environments to replace Box2D (future work)

We implemented a first version that is going to be in the repo soon.

Looks pretty decent!

Awesome!

The remaining action items from when we last met are:
-Grid line missing in rendering problem (Erik Frey)
-See if shadow jigging can be fixed (Erik Frey)
-Generalized constraint system
-Jumpy release
-PR to Gym
-Phys2D environments to replace Box2D
-Tensorflow conversion snippet so we can create a gym wrapper for it

OK Swimmer is live in 4f1e15a6594c4f0e797071abbb32c9c9bb3fc755
Grid lines fixed in cb59468d95c664f3fd2b3a6b92536e5cd3d5918b
Texture jiggling I was able to repro in Ubuntu Cinnamon / Chrome, but not a problem on other platforms.  Poking around in three.js issues the consensus seemed to be "it's a driver issue" but if I find a better answer, I'll be sure to address it.
Jumpy release underway!

That's awesome!
A minor update to the Box2D environments on my end:
-PRs are up for the needed refactoring of lunar lander and bipedal walker
-People are ostensibly currently working on the needed pygame rendering rewrite
-It turns out that the car racing environment has been used in a bunch of important work that I didn't know of by David Ha and others, so that would need to be ported instead of deleted like I'd planned

There's now a PR fixing the (large) outstanding bug in car racing though

Updated notes before I forget:
-Generalized constraint system
-Separate Jumpy repo
-Documentation files for the new website
-PR to Gym
-Phys2D environments to replace Box2D
-Tensorflow conversion snippet so we can create a gym wrapper for it

Hey, I had a discussion with a few people. The current to-do AFAIK is:
-Generalized constraint system
-Separate Jumpy repo
-Documentation files for the new website
-PR to Gym
-Phys2D environments to replace Box2D
-Tensorflow conversion snippet so we can create a gym wrapper for it
-https://github.com/openai/gym/issues/2456#issuecomment-999653317
-Supporting the non-vector API
-Upstreaming environments
-Pusher environment (Benjamin is working on this)
-https://github.com/google/brax/issues/164

Plumbing fixes:
-Final merge of generalized constraint system
-Pusher environment (Benjamin is working on this)
-PR to Jumpy repo
-Fix default camera view for reacher (briefly check the others)
-PR to Gym
--Documentation files for the new website
--Adapt MuJoCo md files (https://github.com/Farama-Foundation/gym-docs/tree/main/docs/pages/environments/mujoco)
--https://github.com/google/brax/issues/164
Future:
-Phys2D environments to replace Box2D

OK, we have a fix for the default camera view in 748229c02813dd151acecc4c0a1c1741b503be55.  Next time we do a version bump, it'll land in everyone's viewers.

PR to Jumpy repo is here: https://github.com/Farama-Foundation/Jumpy/pull/1

Apologies if this is the wrong place to comment, feel free to redirect.
Presumably porting of environments hasn't been started yet, but what's the status of 2d simulation with Brax ("Phys2d")? How would physics compare to box2d physics?


unsatisfiable class: lymph node marginal reticular cell is part_of an immaterial entity

This came up in a GO issue (there is an explanation there): https://github.com/geneontology/go-ontology/issues/23510#issuecomment-1158056090
The Ubergraph pre-release coherency check missed this because it turns out there are a few CARO-to-BFO bridge axioms found only in an RO import. I've since added this import to the check: https://github.com/INCATools/ubergraph/runs/6926464224?check_suite_focus=true

lymph node marginal reticular cell SubClassOf part of some subcapsular sinus of lymph node
subcapsular sinus of lymph node EquivalentTo anatomical space and (part of some lymph node) and (adjacent to some cortex of lymph node) and (adjacent to some capsule of lymph node)
This is the issue I think - instead of part_of sinus, perhaps adjacent_to?

@shawntanzk can we hotfix this now in whatever way, I can run a new release and we make a new issue to figure out the correct modelling? All worries should be dwarfed by unsats.
Since you define the sinus of lymph node as immaterial, it does not make sense to say its part of something material. It could be contained in it, or adjacent to it, or located in probably?

I'll change it to adjacent to for now -> located in wont work due to range that is imported into CL
'independent continuant'
 and (not ('spatial region'))

The correct relation is located_in (we need to add this here https://github.com/obophenotype/cell-ontology/blob/master/docs/relations_guide.md#recording-location).  We use this in multiple places for cells --> spaces especially sinuses.   The range is a confusing legacy of obsolete BFO concepts and should be fixed in RO.   It has no logical consequences under ELK reasoning.
Please change from adjacent_to ASAP, as this will cause fails for HubMap and scAtlas.


Entry with DependOn array not loading

Bug report

What is the current behavior?
If there are multiple items in the DependOn the module never runs.
If the current behavior is a bug, please provide the steps to reproduce.
I have an example repository here: https://github.com/neoGeneva/webpack-dependon-bug
I have a config with three entry points, and four modules.

Entry1 loads module1.js, which in turn loads module2.js
Entry2 loads module3.js, which in turn loads module2.js and module4.js. Entry2 has DependsOn: [Entry1, Entry3]
Entry3 loads module4.js

In my example each module logs its name, and the name of the modules its loaded. At the moment Entry2 never runs and its output is never logged to the console, and the output is the following
loaded module2
loaded module1
module1 loaded module2
loaded module4

What is the expected behavior?
The module should load, in my example I'd expect the output to be:
loaded module2
loaded module1
module1 loaded module2
loaded module4
loaded module3
module3 loaded module2
module3 loaded module4

Other relevant information:
webpack version: 5.0.0-rc.0
Node.js version: v12.18.3
Operating System: Windows 10 Version 20H2 (OS Build 19042.541)
Additional tools:

It's not allowed to have more then one runtime on a single html page. You have to use optimization.runtimeChunk: "single" for this case. That should also fix this issue.

Hey @sokra, that solved my problem, thanks!


Update container image versions

Coverage remained the same at 0.0% when pulling 5a85b3d3f838bac6ac4c495679732247e82f8249 on heuermh:container-updates into 111c645ff0fb9b021a0efec16078d46596481be0 on bigdatagenomics:master.

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/cannoli-prb/257/


Issue when clicking on titlebar when in background

I was looking into using this in a project of mine and noticed and issue when you click the titlebar of the window while it is in the background and try to drag. If you click high enough where the normal title bar is it allows you to drag, if you click lower it does not drag, it just activates the window.

I had fix this.  @mattshepherd @indragiek @jakepetroules @tonyarnold @robin
- (void)becomeKeyWindow
{
    // repost the first NSLeftMouseDown event filter by NSWindow
    [self postEvent:[self currentEvent] atStart:true];
	[super becomeKeyWindow];
	[self _updateTitlebarView];
	[self _updateBottomBarView];
	[self _layoutTrafficLightsAndContent];
	[self _setupTrafficLightsTrackingArea];
}

refer by Cocoa Event Handling Guide，so repost the event fix the problem.

Some events, many of which are defined by the Application Kit (type NSAppKitDefined), have to do with actions controlled by a window or the application object itself. Examples of these events are those related to activating, deactivating, hiding, and showing the application. NSApp filters out these events early in its dispatch routine and handles them itself.

or you can repost the event in NSWindowDelegate's notification
- (void)windowDidBecomeKey:(NSNotification *)notification {
    NSEvent *theEvent = [self.window currentEvent];
    if (theEvent != nil) {
        if(theEvent.type == NSLeftMouseDown){
            [self.window postEvent:theEvent atStart:true];
            NSLog(@"repost LeftMouseDown event");
        }
    }
}


Get an SSL (or Lwt_unix?) error on concurrent connection

I get an SSL error under the below settings:

running 6-echo server with ~https:true

run ab command with 2 or more concurrency level
$ ab -n 2 -c 2 -f TLS1.3 -T 'application/text' -p <(echo hi) https://localhost:8080/echo

error log:
15.04.21 00:55:12.132       dream.log  INFO REQ 1109 POST /echo <IP_ADDRESS>:35012 ApacheBench/2.3
15.04.21 00:55:12.132       dream.log  INFO REQ 1109 200 in 40 μs
15.04.21 00:55:12.137       dream.log  INFO REQ 1110 POST /echo <IP_ADDRESS>:35014 ApacheBench/2.3
15.04.21 00:55:12.137       dream.log  INFO REQ 1110 200 in 41 μs
15.04.21 00:55:12.138      dream.http ERROR HTTP (<IP_ADDRESS>:35016): SSL read() error: error:00000000:lib(0):func(0):reason(0)
15.04.21 00:55:12.138      dream.http ERROR Raised by primitive operation at Lwt_unix.shutdown in file "src/unix/lwt_unix.cppo.ml", line 1677, characters 2-38
15.04.21 00:55:12.138      dream.http ERROR Called from Lwt.Miscellaneous.wrap2 in file "src/core/lwt.ml", line 3087, characters 15-24

Thanks for the report, I was able to reproduce it, and I'm looking into it. Intially, I can say that this looks like a low-level/upstream error.

The error appears to occur after the last request for me. Can you confirm? For example, if I do
$ ab -n 100 -c 2 -f TLS1.3 -T 'application/text' -p <(echo hi) https://localhost:8080/echo

the error is triggered after request 100 has been finished, presumably when the TLS session (or one of them) is closed.

However, this doesn't explain the client port number, which appears to be fresh. Is it possible that this is a bug in ab?

I think this might be a bug in ab, too. Sorry ;)
I confirm no error with below script:
function post() {
  for ((i=0;i<100;i++)) {
    curl -s -k --http2 -XPOST https://<IP_ADDRESS>:8080/echo -d 'hello' &
  }
}

I confirm no error with below script:

Thanks!
As for the issue, I did not know about ab before, so it's useful :) Apart from the spurious error, it's a nice tool, and I will use it.


Hook removes blank lines not related to imports at all

Fantastic tool, however below is probably a bug.
Hook removes blank lines, that are not related to imports at all.
Example python script (notice blank lines around docstring):
$ cat test.py
#!/usr/bin/env python3

"""
Here goes synopsis
"""

import os
import random
import time

print("asdf")

Here is my pre-commit config:
$ cat .pre-commit-config.yaml
repos:
-   repo: https://github.com/asottile/reorder_python_imports
    rev: v1.3.5
    hooks:
    -   id: reorder-python-imports
        language_version: python3

Here is the run of the hook:
$ pre-commit run reorder-python-imports
Reorder python imports...................................................Failed
hookid: reorder-python-imports

Files were modified by this hook. Additional output:

Reordering imports in test.py

And the result:
$ cat test.py
#!/usr/bin/env python3
"""
Here goes synopsis
"""
import os
import random
import time

print("asdf")

This is ~kinda intentional.  the hook manages all newlines from the beginning of the file to the first "non-import / non-docstring code" portion.  Is this a problem?

Well, it ±kinda is :)
I love having a blank line after shebang at least.
I'm fairly new to Python, so not sure if this is against any PEP8 or other conventions \ style rules.
Even if it is, it still feels that blank lines before all the imports or after them - should not be the concern of the reorder-python-imports check.

pep8 doesn't really care either way.
Part of reordering is separating the imports into sections -- in order to do that accurately reorder-python-imports needs control of all the whitespace.  It would be possible to maintain it, but a lot more complicated.  Plus you'd lose out on this fix:
 """docstring"""
-
-
-
 import os

Another design principle at play here is "consistency > configuration" -- along the same lines of "only one way to do it".  reorder-python-imports does this by always normalizing the section it formats to the same output.
Note that after any imports, the whitespace isn't modified, so if you wanted to do something like this (violates pep8):
import os
import sys
x = 1

or this:
import os
import sys

x = 1

you're more than welcome to

Plus you'd lose out on this fix ...

Well, in my view it's not a fix - I'd rather have a blank line before the very first import, and I don't treat it as part of the imports block.

always normalizing the section it formats to the same output

I think idempotence here is orthogonal to removing (or not) blank lines before the import block.

anyway, I've explained how it is, and why it is, and what it could be, and why it probably won't be.  I don't think there's anything left to discuss here.  If you can make a tested patch which isn't terribly complicated I'd consider it -- but I'm not going to work on it myself because I prefer what happens right now.

@asottile would you consider a pull request for this (as stated in Feb 2019), or did you change your mind (as implied in the Aug 2019 comment)?
I would like reorder_python_imports to preserve all lines before the first import, just like it preserves all lines after the imports. I was about to log a duplicate issue until GitHub pointed me here.
Example input (with import sys before import os):
#!/usr/bin/env python
# Copyright 2020 Peter Cock.
# Released under the MIT Licence

"""This is a short example Python script.

This multiline string defined inside triple quotes is considered
to be the module's docstring.
"""

import sys
import os

sys.stderr.write(f"This is {os.uname().sysname}, aka {sys.platform}\n")

Example output from v1.5.1 (import order fixed, but also less blank lines):
#!/usr/bin/env python
# Copyright 2020 Peter Cock.
# Released under the MIT Licence
"""This is a short example Python script.

This multiline string defined inside triple quotes is considered
to be the module's docstring.
"""
import os
import sys

sys.stderr.write(f"This is {os.uname().sysname}, aka {sys.platform}\n")

I've seen enough real world Python code from other people to want to leave any blank lines before the first import alone. They can be purely cosmetic as in this example, but I have often seen loads of script documentation done as comment lines where blank lines were deliberate aids to readability.

I mean, I have my doubts that a simple patch can accomplish that -- and I don't want an option -- and in your example the copyright / mit license lines aren't necessary (that's what the LICENSE file is for, MIT does not require a header -- but sure you'd do that for apache2)
there has to be "one correct way" and currently that's to remove it all


Expose the current_user.userid at the navbar__user-name

This pull request is designed to make QE's life easier by exposing the userid as a parameter of the paragraph that shows the user's name. Because for login, QE's codebase only requires the login and a password, it will make a great simplification for us to check it.
You can try this PR out in browser by passing a command like this one in the dev console:
$$('#username_display')[0].getAttribute('data-userid')

Looks good.

If this could get to Euwe, that would make my day :)

Euwe Backport details:
$ git log -1
commit 303d9673b9d84f41e6202113b18e424ff7f81b46
Author: Martin Povolny<EMAIL_ADDRESS>Date:   Wed Oct 19 21:11:50 2016 +0200

    Merge pull request #12047 from mfalesni/username-userid

    Expose the current_user.userid at the navbar__user-name
    (cherry picked from commit 90040b47c673f4616c12b4e824944c5eb1fdb442)


Are min and max time supported?

I want to restrict time picker to show range like from 10:00 to 20:00. And I should be able to select a time from this range only. So does this library supports min and max time value to display on picker?

I also need; but see the time of this issue，I think I should do it myself

You can use disabledHours and disabledMinutes.  They are arrays that you can will to hide certain hours.  eg disabledHours=[1] will hide the 1 from hour selection

This is should be a basic functionality of date and time pickers. It's weird that this is missing from this library...

This is should be a basic functionality of date and time pickers. It's weird that this is missing from this library...


Change note type

Closes #834

FYI I had to run tox -e fix -- docs/start/hello-world.ipynb to fix the CI failure. I opened https://github.com/Qiskit/documentation/issues/838 to make the CI failure much more explicit and so that you can fix the problem without running things locally.


(Feature) Duplicate Promotion codes

Is your feature request related to a problem? Please describe.
It takes so long to make many promotion codes for a giveaway.
Describe the solution you'd like
it would be really nice with a duplicate function like on the payment method section.

Promo codes should be able to be reused x times if the users wants it...

I want to make it a one time coupon.
If you set it to x times the and click once per user, the user could make a new account and abuse it.

This is a nice feature request.


Record-defined chat functions are not recognized

JsonSchemaUtil generates schemas only for classes with fields. When passing a record it generates an empty schema because records have no fields.
This is the check that controls the fate of the class/record
    public static JsonNode classToJsonSchema(Class<?> clazz) {
        JsonNode jsonSchema = null;
        if (clazz.getFields().length > 0 {

So, records fail this check and get the empty class schema.
Actual empty classes end up as {"type":"object"}
But, the goal is to return the EMPTY_JSON_CLASS for such class: {"type":"object", "properties:: {}}
A simple fix is to just to just get the schema for any class without checking for fields or anything. If the resulting schema
is has no properties - {"type":"object"} - then return the EMPTY_JSON_CLASS {"type":"object", "properties:: {}}.
The code will be simpler and it will support records too.
Here is the original code:
public class JsonSchemaUtil {

    public static final String JSON_EMPTY_CLASS = "{\"type\":\"object\",\"properties\":{}}";
    private static ObjectMapper objectMapper = new ObjectMapper();

    private JsonSchemaUtil() {
    }

    public static JsonNode classToJsonSchema(Class<?> clazz) {
        JsonNode jsonSchema = null;
        if (clazz.getFields().length > 0) {
            try {
                var jacksonModule = new JacksonModule(JacksonOption.RESPECT_JSONPROPERTY_REQUIRED);
                var configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2020_12,
                        OptionPreset.PLAIN_JSON)
                        .with(jacksonModule)
                        .without(Option.SCHEMA_VERSION_INDICATOR);
                var config = configBuilder.build();
                var generator = new SchemaGenerator(config);
                jsonSchema = generator.generateSchema(clazz);

            } catch (Exception e) {
                throw new SimpleUncheckedException("Cannot generate the Json Schema for the class {0}.",
                        clazz.getName(), e);
            }
        } else {
            try {
                jsonSchema = objectMapper.readTree(JSON_EMPTY_CLASS);
            } catch (JsonProcessingException e) {
                throw new SimpleUncheckedException("Cannot generate the Json Schema for the class {0}.",
                        clazz.getName(), e);
            }
        }
        return jsonSchema;
    }
}

The new code is:
    public static JsonNode classToJsonSchema(Class<?> clazz) {
        JsonNode jsonSchema = null;
        try {
            var jacksonModule = new JacksonModule(JacksonOption.RESPECT_JSONPROPERTY_REQUIRED);
            var configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2020_12,
                    OptionPreset.PLAIN_JSON)
                    .with(jacksonModule)
                    .without(Option.SCHEMA_VERSION_INDICATOR);
            var config = configBuilder.build();
            var generator = new SchemaGenerator(config);
            jsonSchema = generator.generateSchema(clazz);
            if (jsonSchema.get("properties") == null) {
                jsonSchema = objectMapper.readTree(JSON_EMPTY_CLASS);
            }
        } catch (Exception e) {
            throw new SimpleUncheckedException("Cannot generate the Json Schema for the class {0}.",
                    clazz.getName(), e);
        }
        return jsonSchema;
    }

I added a test for a record that passes with this change along with the previous tests:
package io.github.sashirestela.openai.support;

import static io.github.sashirestela.openai.support.JsonSchemaUtil.JSON_EMPTY_CLASS;
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.junit.jupiter.api.Test;

class JsonSchemaUtilTest {

    @Test
    void shouldGenerateFullJsonSchemaWhenClassHasSomeFields() {
        var actualJsonSchema = JsonSchemaUtil.classToJsonSchema(TestClass.class).toString();
        var expectedJsonSchema = "{\"type\":\"object\",\"properties\":{\"first\":{\"type\":\"string\"}," +
                "\"second\":{\"type\":\"integer\"}},\"required\":[\"first\"]}";
        assertEquals(expectedJsonSchema, actualJsonSchema);
    }

    @Test
    void shouldGenerateEmptyJsonSchemaWhenClassHasNoFields() {
        var actualJsonSchema = JsonSchemaUtil.classToJsonSchema(EmptyClass.class).toString();
        var expectedJsonSchema = JSON_EMPTY_CLASS;
        assertEquals(expectedJsonSchema, actualJsonSchema);
    }

    @Test
    void shouldGenerateFullJsonSchemaForRecord() {
        var actualJsonSchema = JsonSchemaUtil.classToJsonSchema(TestRecord.class).toString();
        var expectedJsonSchema = "{\"type\":\"object\",\"properties\":{\"first\":{\"type\":\"string\"}," +
            "\"second\":{\"type\":\"integer\"}},\"required\":[\"first\"]}";
        assertEquals(expectedJsonSchema, actualJsonSchema);
    }

    @NoArgsConstructor
    @AllArgsConstructor
    @Getter
    static class TestClass {

        @JsonProperty(required = true)
        public String first;

        public Integer second;
    }

    static class EmptyClass {
    }

    static record TestRecord(@JsonProperty(required = true) String first, Integer second){}
}

Note that simple-openai is currenly pinned to Java 11 in the pom.xml file:
  <properties>
    <!-- General -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>11</maven.compiler.release>

Since records were introduced in Java 16, I had to bump the version in order to add the test with the record.
I assume that staying at Java 11 is to be compatible with projects that are stuck on an older version.
If this the case then simple-openai can remain on Java 11. The code change that allows using records from consumers with more modern versions of Java will still work. Just the test case with the record will have to be removed. Or add a special test project that is using Java >= 16 and include simple-openai as a dependency.
An alternative solution is to  just replace JsonSchemaUtil with an existing package like com.kjetland.jackson.jsonSchema
Here is a comparison that my colleague conducted  between the schema generated by JsoSchemaUtil and com.kjetland.jackson.jsonSchema:
package com.invisible.bundle.invisible.guice;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.kjetland.jackson.jsonSchema.JsonSchemaConfig;
import com.kjetland.jackson.jsonSchema.JsonSchemaGenerator;
import io.github.sashirestela.openai.support.JsonSchemaUtil;
import org.junit.jupiter.api.Test;

public class FooTest {
  private final ObjectMapper mapper = new ObjectMapper();
  private final JsonSchemaConfig config = JsonSchemaConfig.vanillaJsonSchemaDraft4();

  private final JsonSchemaGenerator jsonSchemaGenerator = new JsonSchemaGenerator(mapper, config);
  @Test
  public void test() {
    System.out.println("Person class using kjetland.jackson.jsonSchema.JsonSchemaGenerator");
    System.out.println(jsonSchemaGenerator.generateJsonSchema(Person.class));
    System.out.println();

    System.out.println("Person class using io.github.sashirestela.openai.support.JsonSchemaUtil");
    System.out.println(JsonSchemaUtil.classToJsonSchema(Person.class));
    System.out.println();

    System.out.println("Shape record using kjetland.jackson.jsonSchema.JsonSchemaGenerator");
    System.out.println(jsonSchemaGenerator.generateJsonSchema(Shape.class));
    System.out.println();

    System.out.println("Shape record using io.github.sashirestela.openai.support.JsonSchemaUtil");
    System.out.println(JsonSchemaUtil.classToJsonSchema(Shape.class));
    System.out.println();
  }

  class Person {
    public String name;
    public int age;
  }

  record Shape(String type) {}
}

Here is the output:
Person class using kjetland.jackson.jsonSchema.JsonSchemaGenerator
{"$schema":"http://json-schema.org/draft-04/schema#","title":"Person","type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"age":{"type":"integer"}},"required":["age"]}

Person class using io.github.sashirestela.openai.support.JsonSchemaUtil
{"type":"object","properties":{"age":{"type":"integer"},"name":{"type":"string"}}}

Shape record using kjetland.jackson.jsonSchema.JsonSchemaGenerator
{"$schema":"http://json-schema.org/draft-04/schema#","title":"Shape","type":"object","additionalProperties":false,"properties":{"type":{"type":"string"}}}

Shape record using io.github.sashirestela.openai.support.JsonSchemaUtil
{"type":"object","properties":{}}

We already know why JsonSchemaUtil generated an empty schema for the record, but even for the Person class kjetland.jackson.jsonSchema generated richer schema.

Great. Looks like you got a straight-forward answer for your question on how to configure the schema generator , so empty class/record don't need special case treatment. The code can be even simpler.
Thanks for the warning about that library. We don't actually use it. My colleauge used it just for testing alternative Jaon Schema generation. but, given it's state definitely doesn't sound like a good option.

Is it possible to have just a test with record compiled with Java 17? maven testCompile or local .sdkmanrc?

Great. Looks like you got a straight-forward answer for your question on how to configure the schema generator , so empty class/record don't need special case treatment. The code can be even simpler.

OpenAI is requesting an empty properties element when the function described by a class does not have parameters:
https://community.openai.com/t/parameters-property-isnt-optional-as-theyve-mentioned-in-doc/265256
So, we do need to introduce the change as I was thinking.

Is it possible to have just a test with record compiled with Java 17? maven testCompile or local .sdkmanrc?

It might be possible, I suppose, but simple-openai is providing explicit support just for Java 11. In the future we could evaluate a Java version change, perhaps to 17 or 21.


Issues compiling with LLVM

Compiling with LLVM reveals a number of (minor) problems which should be fixed at some point. I just pushed a fix for the most severe issues, but some nuisances remain.
I also note that the LLVM linker fails when compiling in Release mode, complaining that the file format of libdream.a is unrecognized. Using CMAKE_BUILD_TYPE=Debug works around this issue.

(We should probably try to compile with LLVM now and then, just to try to catch all possible warnings. LLVM is rather famous for emitting warnings and catching more errors than GCC)


Getting IntegrityError when trying to hit an endpoint for the first time

http://dpaste.com/537543/ is the traceback

Are you missing the django.contrib.sites app?


BUG: check information in README.md and other docs should be programmatically generated from checks.md

An internal team complained that the description in https://github.com/ossf/scorecard#scorecard-checks is different from those in checks.md (Packaging check)
We should pull all the doc for checks from checks.yaml and generate the section of the README programatically. We now have a short field in the checks.md that we may be able to re-use (does not support clickable links, though).
More generally, anywhere we refer to checks, we should generate that programatically.

note that in checks/* (registerCheck()) we could also retrieve the check names from the yaml file

the run examples should also be generated programatically.

the run examples should also be generated programatically.

Can you please explain further on run examples?

oops, sorry.. that was vague. Ideally https://github.com/ossf/scorecard#using-repository-url would be generated from a scorecard run to generate the output example. I don't know how feasible this is in practice.

another thing we need to fix: We tend to update checks' source code but forget to update the checks' documentation in the same PR. We need to catch this. One idea would be to:

Create a tool that we run during PR validation in a workflow
The tool would check if anything changes under checks/.
2.1 If something changed under checks/ and the doc was updated, PASS.
2.1 If something changed under checks/ but the doc was not updated, FAIL, unless the PR is tagged with a label, say no-doc-change-needed. Reviewers can add the label after reviewing the PR.

In addition to the above, we could also add Need doc update in the PR template.
WDUT?

we can do the same for keep the cron section of the readme up-to-date, by monitoring changes under cron/


boltzcli: rephrase using "remote balance" for reverse swaps in autoswap setup

We expect most users of autoswap wanting to maintain a certain amount of "inbound liquidity" aka "remote balance" to be able to reliably receive payments. Current wording is a mind bender for this "keeping local balance below set threshold". I mean it's probably a use case too, but a niche one.
Let's invert wording and threshold numbers in the setup from:
? Which type of swaps should be executed?  [Use arrows to move, type to filter]
> reverse - keeps your local balance below set threshold

to:
? Which type of swaps should be executed?  [Use arrows to move, type to filter]
reverse - keeps your remote balance above set threshold

And invert these from:
? What is the maximum percentage of total capacity you want to keep in your channels? 75
? What is the maximum amount of sats you want to keep in your channels?

to:
? What is the minimum percentage of total capacity you want to keep as your remote balance? 25
? What is the minimum amount of sats you want to keep as your remote balance?

Decided to not do this now to keep setup in line with the generated config. We can apply inverted wording in UIs later which is the most important part anyways.


Create thumbnails and upload individual files

Create thumbnail for browse image
Upload individual files to S3
Rename some variables to make the code more similar to hyp3-gamma

Generally woks how I expected. I see a 2048 pixel wide browse image, and a 100 pixel wide thumbnail image. All these files were uploaded to S3 with the correct file_type S3 Tags:
_conncomp.tif
_corr.tif
_dem.tif
.json
_unw_phase.png
_unw_phase.png.aux.xml
_unw_phase_thumb.png
_unw_phase.tif
_unw_phase.tif.aux.xml
_wrapped_phase.tif

Possibly out of scope for this PR, but I think we should remove the two sidecar .aux.xml files. I believe _unw_phase.tif.aux.xml contains the stats we generate to produce the browse image, and _unw_phase.png.aux.xml has geolocation information for the browse image. We don't include either for INSAR_GAMMA products.

opened https://github.com/ASFHyP3/hyp3-isce2/pull/52 to address the .aux.xml files, but feel free to merge this and point that one at develop if you prefer


Add semicolon to end of file

Without a tailing semicolon, issues arise when combining this with other JavaScript libraries.

I've done a new release with semicolons everywhere again.


"A room with this name already exists" message appears on Create New Room page

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Login with account that has policyRooms beta enabled
Click FAB -> New Room
Don't input anything and just click "Create Room" button
"A room with this name already exists" message shows below Room Name input field
Type any letter on Room Name field and erase all
This time, "Please enter a room name" message shows below Room Name input field

Expected Result:
Error message should be consistent as "Please enter a room name"
Actual Result:
"A room with this name already exists" error shows first time
Workaround:
unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android / native
[ ] Android / Chrome
[ ] iOS / native
[ ] iOS / Safari
[ ] MacOS / Chrome / Safari
[ ] MacOS / Desktop

**Version Number:**v1.2.48-2
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/210688549-978b46b7-d921-4518-bc83-386ef55416f8.mov
https://user-images.githubusercontent.com/43996225/210688565-b85d0f8f-d7e0-48ae-b5b3-84cbda4072af.mp4
Expensify/Expensify Issue URL:
Issue reported by: @0xmiroslav
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1672852094448169
View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~01226a954977211217
Upwork Job ID:<PHONE_NUMBER>634461696
Last Price Increase: 2023-01-05

I can take a look at this one.

@yuwenmemon I have found root case of this issue during testing. If you want I can post here. I'm asking bcz this issue is Internal and not allowed for external contributors.

What I have found is
we have added ReportFooter with loading state view.
In this PR https://github.com/Expensify/App/pull/13523
/src/pages/home/ReportScreen.js
 <>
      <ReportActionsSkeletonView containerHeight={this.state.skeletonViewContainerHeight} />
      <ReportFooter shouldDisableCompose isOffline={this.props.network.isOffline} />
</>

We are not passing report in this case. Due to report not exist ReportFooter will use default prop
/src/pages/home/report/ReportFooter.js
LN: 52
report: {reportID: '0'},
and it will pass down to ReportActionCompose
<ReportActionCompose
    onSubmit={this.props.onSubmitComment}
    reportID={this.props.report.reportID.toString()}
    reportActions={this.props.reportActions}
    report={this.props.report}
    isComposerFullSize={this.props.isComposerFullSize}
    disabled={this.props.shouldDisableCompose}
/>

On component mount inside ReportActionCompose updateComponent function will trigger and it will call
   // The draft has been deleted.         if (newComment.length === 0) {             Report.setReportWithDraft(this.props.reportID, false);         }
Now in this case new incorrect report record will created with report_0: { hasDraft: false }
It will impact condition of check room name already exist or not
function isExistingRoomName(roomName, reports, policyID) {
  return _.some(
      reports,
      report => report && report.policyID === policyID
      && report.reportName === roomName,
  );
}

app has incorrect report record report_0: { hasDraft: false }
so it will check report exist true,
report.policyID === PolicyID will be true bcz both are undefined bcz we don't have default value of room name.
report.reportName === roomName will be true bcz both are undefined.

I think we should add validation as @0xmiroslav stated , we also have change this block to if else statement , the second validation is overwriting the first one
https://github.com/Expensify/App/blob/dee9ac5915ba6d50c6360ce6ed8602c7fd97bba0/src/pages/workspace/WorkspaceNewRoomPage.js#L84-L92
         // We error if the user doesn't enter a room name or left blank
+        // We error if the room name already exists.
         if (!values.roomName || values.roomName === CONST.POLICY.ROOM_PREFIX) {
             errors.roomName = this.props.translate('newRoomPage.pleaseEnterRoomName');
-        }
-
-        // We error if the room name already exists.
-        if (ValidationUtils.isExistingRoomName(values.roomName, this.props.reports, values.policyID)) {
+        } else if (ValidationUtils.isExistingRoomName(values.roomName, this.props.reports, values.policyID)) {
             errors.roomName = this.props.translate('newRoomPage.roomAlreadyExistsError');
         }

and for validation here I think this is enough
 function isExistingRoomName(roomName, reports, policyID) {
-    return _.some(
+    return roomName && _.some(
         reports,
         report => report && report.policyID === policyID
         && report.reportName === roomName,

Is this issue open for external? @yuwenmemon

This was fixed with: https://github.com/Expensify/App/pull/13994
Also yes FYI @dhairyasenjaliya @fedirjh @0xmiroslav @jatinsonijs I appreciate the input but do please understand that this issue was tagged Internal and not marked either External or Help Wanted.

I believe that's correct @0xmiroslav but I will defer to @NicMendonca on that point.

@yuwenmemon I think this has not been fixed yet , now with this #13994 It will always skip the first validation , I still think that validation to same input field should go through an if - else :

if (empty) shows empty error
else if (invalid name) shows invalid error
else if (used name) shows already used error
else if (reserved name) shows reserved error

I think we can also add this rule to FORMS docs.

@fedirjh that's a good observation. I'll make that change, and we can work with @NicMendonca to ensure you get a bug reporting bonus.

@fedirjh can you please apply to the job here?

@NicMendonca Thank you, accepted!

@fedirjh paid the reporting bonus - thanks!

@NicMendonca @0xmiroslav is correct :+1:

@0xmiroslav can you please accept the job offer?

Ah, Thank you, I've created a new milestone 😄 Paid for $250

bonuses have both been paid ✅

Hey @NicMendonca, C+ review compensation is due (sorry for the late comment).

Bump @NicMendonca

@thesahindia can you accept the job offer, please?

@thesahindia paid!

I think this can be closed now?


Fix typo

Coverage decreased (-1.8%) to 92.163% when pulling 4ea5895922871ec6975964272f0dc7b455d3f420 on cbeer-patch-1 into c3385cd1de2542d779ea7071ca75d8001d6de268 on develop.

Coverage decreased (-1.8%) to 92.163% when pulling 4ea5895922871ec6975964272f0dc7b455d3f420 on cbeer-patch-1 into c3385cd1de2542d779ea7071ca75d8001d6de268 on develop.

Thanks, Chris. Obviously needs another couple of tests!


Error on start

Hello guys!!
Help me!!
On execute application with doki, i have this error, can you help me?
This is bug on loading libraries .net sdks.

Can you please post the contents of the sdk8.csproj file here?

I will close this issue because of inactivity...


Fix windows compilability

In #2037 I've made some mistakes, this is an attempt to fix windows compilability. @volzhs, could you try to compile it?

here's my error logs.
platform/windows/godot_win.cpp: In function 'int widechar_main(int, wchar_t**)':
platform/windows/godot_win.cpp:128:13: error: cannot declare variable 'os' to be of abstract type 'OS_Windows'
  OS_Windows os(NULL);
             ^
In file included from platform/windows/godot_win.cpp:29:0:
platform/windows/os_windows.h:62:7: note:   because the following virtual functions are pure within 'OS_Windows':
 class OS_Windows : public OS {
       ^
In file included from platform/windows/os_windows.h:35:0,
                 from platform/windows/godot_win.cpp:29:
core/os/os.h:255:23: note: 	virtual OS::TimeZoneInfo OS::get_time_zone_info() const
  virtual TimeZoneInfo get_time_zone_info() const=0;
                       ^
x86_64-w64-mingw32-g++ -o main/main.windows.opt.tools.64.o -c -O2 -DDEBUG_ENABLED -DFREETYPE_ENABLED -DWINDOWS_ENABLED -mwindows -DGLES2_ENABLED -DGLEW_ENABLED -DRTAUDIO_ENABLED -DMINGW_ENABLED -DMUSEPACK_ENABLED -DOPENSSL_ENABLED -DSQUISH_ENABLED -DVORBIS_ENABLED -DPNG_ENABLED -DDDS_ENABLED -DPVR_ENABLED -DJPG_ENABLED -DWEBP_ENABLED -DSPEEX_ENABLED -DTOOLS_ENABLED -DGDSCRIPT_ENABLED -DMINIZIP_ENABLED -DXML_ENABLED -DETC1_ENABLED -DOPENSSL_NO_ASM -DOPENSSL_THREADS -DL_ENDIAN -Icore -Icore/math -Itools -Idrivers -I. -Iplatform/windows -Itools/freetype -Itools/freetype/freetype/include -Idrivers/builtin_openssl2 -Idrivers/builtin_zlib/zlib -Imain/vorbis -Idrivers/builtin_openssl2/crypto -Idrivers/builtin_openssl2/openssl -Idrivers/builtin_openssl2/crypto/evp -Idrivers/builtin_openssl2/crypto/asn1 -Idrivers/builtin_openssl2/crypto/modes main/main.cpp
scons: *** [platform/windows/godot_win.windows.opt.tools.64.o] Error 1
platform/windows/os_windows.cpp:1863:51: error: no 'OS::TimeZoneInfo OS_Windows::get_time_zone_info() const' member function declared in class 'OS_Windows'
 OS::TimeZoneInfo OS_Windows::get_time_zone_info() const {
                                                   ^
scons: *** [platform/windows/os_windows.windows.opt.tools.64.o] Error 1
scons: building terminated because of errors.

here's updated error logs.
platform/windows/os_windows.cpp: In member function 'virtual OS::TimeZoneInfo OS_Windows::get_time_zone_info() const':
platform/windows/os_windows.cpp:1866:33: error: cannot convert 'TIME_ZONE_INFORMATION {aka _TIME_ZONE_INFORMATION}' to 'LPTIME_ZONE_INFORMATION {aka _TIME_ZONE_INFORMATION*}' for argument '1' to 'DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION)'
  if (GetTimeZoneInformation(info) == TIME_ZONE_ID_DAYLIGHT)
                                 ^
platform/windows/os_windows.cpp:1870:3: error: 'ret' was not declared in this scope
   ret.name = info.DaylightName;
   ^
platform/windows/os_windows.cpp:1872:3: error: 'ret' was not declared in this scope
   ret.name = info.StandardName;
   ^
platform/windows/os_windows.cpp:1875:2: error: 'ret' was not declared in this scope
  ret.bias = info.Bias;
  ^
x86_64-w64-mingw32-g++ -o modules/gridmap/register_types.windows.opt.tools.64.o -c -O2 -DDEBUG_ENABLED -DFREETYPE_ENABLED -DWINDOWS_ENABLED -mwindows -DGLES2_ENABLED -DGLEW_ENABLED -DRTAUDIO_ENABLED -DMINGW_ENABLED -DMUSEPACK_ENABLED -DOPENSSL_ENABLED -DSQUISH_ENABLED -DVORBIS_ENABLED -DPNG_ENABLED -DDDS_ENABLED -DPVR_ENABLED -DJPG_ENABLED -DWEBP_ENABLED -DSPEEX_ENABLED -DTOOLS_ENABLED -DGDSCRIPT_ENABLED -DMINIZIP_ENABLED -DXML_ENABLED -DETC1_ENABLED -DOPENSSL_NO_ASM -DOPENSSL_THREADS -DL_ENDIAN -Icore -Icore/math -Itools -Idrivers -I. -Iplatform/windows -Itools/freetype -Itools/freetype/freetype/include -Idrivers/builtin_openssl2 -Idrivers/builtin_zlib/zlib -Imodules/gridmap/vorbis -Idrivers/builtin_openssl2/crypto -Idrivers/builtin_openssl2/openssl -Idrivers/builtin_openssl2/crypto/evp -Idrivers/builtin_openssl2/crypto/asn1 -Idrivers/builtin_openssl2/crypto/modes modules/gridmap/register_types.cpp
scons: *** [platform/windows/os_windows.windows.opt.tools.64.o] Error 1
scons: building terminated because of errors.

@volzhs can you try to add TimeZoneInfo ret; before line 1869 of platform/windows/os_windows.cpp?

here's error.
platform/windows/os_windows.cpp: In member function 'virtual OS::TimeZoneInfo OS_Windows::get_time_zone_info() const':
platform/windows/os_windows.cpp:1866:33: error: cannot convert 'TIME_ZONE_INFORMATION {aka _TIME_ZONE_INFORMATION}' to 'LPTIME_ZONE_INFORMATION {aka _TIME_ZONE_INFORMATION*}' for argument '1' to 'DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION)'
  if (GetTimeZoneInformation(info) == TIME_ZONE_ID_DAYLIGHT)

Ok, what when you replace the info with &info, as in if (GetTimeZoneInformation(&info) == TIME_ZONE_ID_DAYLIGHT), at the line 1866?

i can give it a try when i get back home tonight, as I'm currently in
ubuntu..
On Sun, Jun 7, 2015 at 10:53 AM, est31<EMAIL_ADDRESS>wrote:

Ok, what when you replace the info with &info, as in if
(GetTimeZoneInformation(&info) == TIME_ZONE_ID_DAYLIGHT), at the line 1866
?
—
Reply to this email directly or view it on GitHub
https://github.com/okamstudio/godot/pull/2042#issuecomment-109758509.

ok according to @volzhs those two changes made it compile.

please send me PR to merge, since i won't be able to do much until I come
back home at night
On Sun, Jun 7, 2015 at 11:01 AM, est31<EMAIL_ADDRESS>wrote:

ok according to @volzhs https://github.com/volzhs those two changes
made it compile.
—
Reply to this email directly or view it on GitHub
https://github.com/okamstudio/godot/pull/2042#issuecomment-109758852.


Lonh datascience

@longhan what would you mean by this commit?
I think, you should fork this repo for this changes.

@hmert sorry about my mistake. This should be a pull request to my own repo.


I initially lost $404000 in just three months from Crypto all day and a couple of others. I contacted the authorities and they referred me to money peace net who helped me recover all my funds within 2 days. I’m speaking up to improve awareness of these cryptocurrency thieves and help as much as i can to reduce victims to the berets minimum. If you have been a victim, Simply visit marketpeace net


TODO: Make sure we're up to date with 3.2

Make sure any new features in DRF 3.2 are considered

Nothing really breaking for the simple features the generators use.


All the example links are broken

For example the 'Typography' link at the bottom of this page.
It looks like we moved all the examples into an 'examples' folder but didn't update the links. Weirdly though, when I go to the URL I'd expect to work I still get an error.

It looks like #411 caused this. When I run the site locally, I get this error:
Template render error: (govuk_elements/app/views/examples/example_grid_layout.html)
Error: template not found: includes/service_manual_navigation.html.
I'll update these pages to use the new navigation include.

Oh!! Sorry! Not sure how I managed that.

No worries, I didn't spot it either... opening a PR to fix!


Azure subscription annotation

CAPZ clusters need to have the spec.subscriptionid field set in AzureCluster CRs.
Because of a limit in Kyverno, we are not able to read plain text secret data in our policies.
This PR ensures a new annotation subscriptionid is ensured in the organization crs to allow kyverno to read the subscription id a cluster belongs to and default the required field in AzureCluster.
For non azure MCs the changes in this PR do nothing.
See also: https://github.com/giantswarm/kyverno-policies/pull/125
Checklist

[x] Update changelog in CHANGELOG.md.

Shouldn't then spec.subscriptionid be set with azure-admission-controller?

Shouldn't then spec.subscriptionid be set with azure-admission-controller?

Azure admission controller knows nothing about organizations nor credential secrets.
Sure, we can add that stuff but it was much easier to just add this small feature to org operator.
Expecially considering this will eventually (soon?) go away, as soon as kyverno adds base64 decode support.


Support Edit/Upload API thumbnail from API Publisher

Supports thumbnail upload in Publisher UI
Supports adding an icon(font) based thumbnail design

Fixed by @chanaka3d


A error occurred when using controller in swiper in React 18

Check that this is really a bug

[X] I confirm

Reproduction link
https://codesandbox.io/s/hungry-margulis-7lpem8
Bug description
following the doc here to setup controller but got an Cannot read properties of undefined (reading '2') error
the error is from here, parameter c is undefined
It's working with React 17
Expected Behavior
No response
Actual Behavior
No response
Swiper version
8.4.4
Platform/Target and Browser Versions
OSX 12.5, Chrome 107
Validations

[X] Follow our Code of Conduct
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
[X] Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

[ ] I'm willing to open a PR

<Swiper> would mount twice(unmount and mount again), and maybe there is a race condition that the first unmount makes second mount destroyed?

managed to get it work and here is the reference
https://codesandbox.io/s/modern-hill-ec9pcu
need to make sure swiperInstance exists and it's not destroyed

I'm unsure if this should be closed, while you have found a workaround, this is definitely an issue.


Cmake should handle linear algebra dependencies better

Cmake requires both blaze and eigen, whereas, I think if either one is found the code should be able to compile.

@kazbekkm can this be closed now?

I think so.

Fixed in d1d7eef0d7969bf39b5d746cdb1818371318ded1


Time series legend count not displaying with '+' symbol

Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:

Go to '...'
Click on '....'
Scroll down to '....'
See error

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots

Duplicate of #973


Fixes bug in swapping weights when replacing with Transformer-Engine layers

What does this PR do?

When linear layers in the model are replaced with Transformer-Engine's linear layers, the weights of the latter should be replaced with the weights of the former (currently, it's the other way around).
Adding TE's TransformerLayer to has_transformer_engine_layers function to allow the case when larger chunks of modules could be replaced (TransformerLayer could replace LlamaDecoderLayer in this case)

@muellerzr, could you pls take a look? Thanks!

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.


Increase activerecord benchmark size

The Active Record benchmark doesn't do a whole lot. It load a single record without any association and just read a few fields. It also always fetch directly from the database.
Here we add a single extra association, enable the query cache to remove IOs entirely, and access a few more attributes to exercise the casting code more
Before:
interp: ruby 3.3.1 (2024-04-23 revision c56cd86388) [arm64-darwin23]
yjit: ruby 3.3.1 (2024-04-23 revision c56cd86388) +YJIT [arm64-darwin23]

------------  -----------  ----------  ---------  ----------  ------------  -----------
bench         interp (ms)  stddev (%)  yjit (ms)  stddev (%)  yjit 1st itr  interp/yjit
activerecord  29.4         2.8         13.2       2.7         1.55          2.23
------------  -----------  ----------  ---------  ----------  ------------  -----------

After:
interp: ruby 3.3.1 (2024-04-23 revision c56cd86388) [arm64-darwin23]
yjit: ruby 3.3.1 (2024-04-23 revision c56cd86388) +YJIT [arm64-darwin23]

------------  -----------  ----------  ---------  ----------  ------------  -----------
bench         interp (ms)  stddev (%)  yjit (ms)  stddev (%)  yjit 1st itr  interp/yjit
activerecord  165.8        2.6         71.2       2.6         1.93          2.33
------------  -----------  ----------  ---------  ----------  ------------  -----------

Profile before:

Profile after:

You can see that before the top leafs were mundane things such as allocating record, Sqlite3 and accessing various thread local state. After the change the top elements are more relevant things such as attribute access and casting, association mapping, etc.
NB: Given that activerecord is marked as headline, and this is quite a radical change, perhaps it can just be a new benchmark, called activerecord2 or activerecord-read-heavy or something?

Alternatively, since Rails 7.2 should go out soon, we could wait and do the upgrade at the same time.

The change looks good to me.
Two thoughts:

the new code doesn't generate a string anymore, but in most Rails apps one would need to generate a string from these attributes (even if it's JSON and not HTML). Notably Time formatting is not cheap, but something many Rails apps will do. I think that would be worth tweaking to be more representative and also avoid e.g. a JIT noticing title is called 3 times and just reading it once or zero times because it's unused.
Using the query cache here doesn't seem representative, a real app wouldn't do the same query (10 * iterations) times in a single request. I thought it was on purpose this benchmark measures SQlite since a real app would need to query the database (sqlite OTOH is not typically the DB used in production but is certainly more practical than mysql2/pg).

Those are fair points.
I think it would make sense to generate a string as Benoit suggests.
Wrt query cache, ideally we'd generate a lot of posts (time budget < 10s to generate), and then request random posts. Some of them would get cached, some not.

in most Rails apps one would need to generate a string from these attributes

This is generally true. But that's more the job of "rails-bench" or similar to simulate a full Rails request. If you simulate templating, you might as well also do the controller etc etc.
Here the focus is Active Record itself. I think it make sense to only exercise Active Record APIs.

Using the query cache here doesn't seem representative

Similarly, IMO the goal is to show what's left to optimize. We can totally do the SQLite query I don't mind, but that's just gonna add some overhead that JITs can't do anything about. I guess it somewhat exercise C bindings, so why not.

Some of them would get cached, some not.

I'd be concerned it would increase variance between runs.

I think in a well-behaved app the query cache gets only cache misses, or very few hits overall (compared to numbers of queries), and so it seems more representative to disable it, but correct me if I'm wrong.

Is the cache part of sqlite itself? If so, the cache hit rate should actually be fairly high in a real server. I agree that there are concerns with variance. 🤔
What's the performance like with the cache on vs off?
With respect to building a string to output, I do think it might make some sense to do that. If there is no output, a sufficiently advanced JIT may be able to eliminate the calls.


The issue with Thumbnail in TouchableHighlight

Hello,
There is an issue with Thumbnail wrapped by TouchableHighlight. I am using Exponent XDE v14.0.0 and running the project on Genymotion emulator for Google Nexus 5 4.4.4 API 19.
Versions used

node.js 7.6.0
exponent 14.0.0
react 15.4.0
react-native 0.41.0
native-base 2.0.10

Expected behaviour
I am able to tap Thumbnail wrapped by TouchableHighlight.
Actual behaviour
When I tap Thumbnail, I get "undefined is not an object (evaluating 'this.wrappedInstance.setNativeProps')".
The project code
import Exponent from 'exponent';
import React from 'react';
import {
  Platform,
  Alert,
  TouchableHighlight
} from 'react-native';
import {
  Container,
  Header,
  Body,
  Title,
  Content,
  Thumbnail
} from 'native-base';

class App extends React.Component {
  constructor (props) {
    super(props);

    this.state = {
      isReady: false
    };
  }

  async componentWillMount() {
    if (Platform.OS === 'android') {
      await Exponent.Font.loadAsync({
        'Roboto': require('native-base/Fonts/Roboto.ttf'),
        'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf')
      });

      this.setState({
        isReady: true
      });
    }
  }

  render() {
    if (!this.state.isReady) {
      return <Exponent.Components.AppLoading />;
    }

    return (
      <Container style={{ flex: 1 }}>
        <Header>
          <Body>
            <Title style={{ alignSelf: 'stretch' }}>Test</Title>
          </Body>
        </Header>
        <Content>
          <TouchableHighlight onPress={ () => Alert.alert('Info', 'Image tapped') }>
            <Thumbnail style={{ width: 50, height: 50 }} source={{ uri: 'http://www.apdconsumo.pt/person.png' }} />
          </TouchableHighlight>
        </Content>
      </Container>
    );
  }
}

Exponent.registerRootComponent(App);

The screenshots

The device
I have tested the project only on Android.
The additional information
I think, you do not define the setNativeProps method in the Thumbnail component. Please, check Composite components and setNativeProps.

+1

I just tested it on iOS and android both and it works. Maybe exponent is causing this?

I also get this error, when the conatiner is wrapped in a style provider

Strange!

This is the code in my case:
  render() {
    return (
      <View style={{...this.props.style.container, height: this.state.height}}>
        <View onLayout={this.setHeaderHeight}>
          <TouchableHighlight onPress={this.toggle}>
            <Text>click here</Text>
          </TouchableHighlight>
        </View>
        <View onLayout={this.setContentHeight}>
          {this.props.children}
        </View>
      </View>
    );
  }
}

export default connectStyle('zoraTheme.Accordion', styles)(Accordion);

And I'm getting the same error

I have just updated native-base to the latest version 2.0.11 and it started working. It did not work with native-base 2.0.10.

It worked with me as well after install 2.0.11

+1 to the 2.0.11 fix

Great! Closing it then.

I'm already using 2.0.12, but the issue still comes up. Is it related to react native 0.42? Exactly having the Thumbnail in TouchableHighlight. Anyone?

The issue is back again in native-base 2.0.12.

I get the same error even if I use native-base Text in react-native TouchableHighlight:
import {
  Alert,
  TouchableHighlight
} from 'react-native';
import {
  Text
} from 'native-base';

<TouchableHighlight onPress={ () => Alert.alert('Info', 'Text touched') }>
  <Text>Click here</Text>
</TouchableHighlight>

However, if I use react-native Text, it works without issues:
import {
  Alert,
  TouchableHighlight,
  Text
} from 'react-native';

<TouchableHighlight onPress={ () => Alert.alert('Info', 'Text touched') }>
  <Text>Click here</Text>
</TouchableHighlight>

@sankhadeeproy007 , can you reopen the issue? The error comes up again in 2.0.12.

Same as @stonecold123 , error comes up with Icon inside TouchableHighlight in 2.0.13.

@sankhadeeproy007 the issue was never resolved and it is breaking our projects. please reopen and fix it.

We are looking into the issue. As a workaround for now, you can wrap the child component of TouchableHighlight into a RN <View>.

To expand on @shivrajkumar 's workaround, you need to import the View component from React Native: using Native Base's View component still causes the error.

Fixed with 2.1.5

facing same issue


how to get stream response from langflow flow api？

It seem like impossible to fetch stream response from running the langflow flow API, so far. Is there any solution to figure it out? We found run ui page input could get the stream effect, but ui interaction was not a common way for our team. thanks.

Langflow does not yet support streaming through their API, but after reviewing the recent configuration of API v1, I noticed that a stream flag has been added to the API endpoint. It seems likely that support will be available soon.

Hi,
Do we have any update about this feature ?

Do we have a JavaScript example for this? Does the stream URL implement SSE (Server-Sent Events)?

At last, it has been implemented!

Hi @WestLi and @YamonBot
We hope you're doing well. Just a friendly reminder that if we do not hear back from you within the next 3 days, we will close this issue. If you need more time or further assistance, please let us know.
Thank you for your understanding!

Thank you for your contribution! This issue will be closed. If you have any questions or encounter another problem, please open a new issue and we will be ready to assist you.

Hi there : do you have a version of the code that includes the API key parameter ? Thanks !

@Arron-Clague
If you ask @dosu, you'll get the answer you want!

Yes : where is @dosu when you need them ? He always has the answer  !

Hi, how can I obtain stream_url with the basic flow using: ChatInput, Agent, ChatOutput.
I call the run API with parameter stream = true but can't find stream_url in the response.


feat: support swagger UI to viewing API

Detail descrition for this feature please check #1879
We can view swagger UI by /swagger-ui/index.html like:
http://<IP_ADDRESS>:8080/swagger-ui/index.html

@wangyao2016 could you please describe the diff since last review?

@javeme Thank you for reviewing in time.
To facilitate version maintenance, use the same variable to maintain the version.

rerun failed ci & rocksdb's ci failed frequently in each pr

@wangyao2016 could you run
mvn checkstyle:checkstyle

and deal with code to conform with the specifications
https://github.com/apache/incubator-hugegraph-doc/wiki/HugeGraph代码风格指南

@seagle-yuan  Sure. First of all, make sure you mean these unused imports?

@seagle-yuan Sure. First of all, make sure you mean these unused imports?

yeah,this is just a case, suggest you deal with all the code for this issue

yeah, this is just a case, suggest you deal with all the code that you coded

yeah, this is just a case, suggest you deal with all the code that you coded

I've done it. But just found these  unused imports. Can you give me a screenshot?
Thanks.

very nice feature

@wangyao2016 Excuse me, wonder to know the could html/js files related to swagger generated by building?
like use execute mvn package/install to generate them rather than include them as a source file?
Contact me directly when free, thanks a lot 😸


Does apply_force work when used outside a ForceGenerator?

As per https://github.com/rustsim/nphysics/commit/c52d6eb4dd8a740c7b4dc017bfc3143b276554ce, I thought applying a force directly on a body works in the current version of nphysics. Indeed, if the ForceType is specified as ForceType::VelocityChange, the body moves, However I wasn't able to make anything move when using ForceType::Force. Am I missing something?
I construct my body with the following code.
let polygon = ShapeHandle::new(
    ConvexPolygon::try_new(vec![
        Point::new(1.0, 2.0),
        Point::new(2.0, 2.0),
        Point::new(2.0, 3.0),
        Point::new(1.0, 3.0),
    ])
    .unwrap(),
);
let local_inertia = polygon.inertia(0.1);
let local_center_of_mass = polygon.center_of_mass();
RigidBodyDesc::new()
    .position(Isometry::new(Vector::new(2.0, 10.0), 3.0))
    .local_inertia(local_inertia)
    .local_center_of_mass(local_center_of_mass)
    .mass(100.0)
    .build(&mut world);

And I apply the force like this.
let force = Force::from_slice(&[5.00, 2.00, 0.5]);
body.apply_force(body.part_handle().1, &force, ForceType::Force, true);

Full code: https://github.com/jnferner/nphysics-playground/blob/master/src/bin/rigid_body.rs
I am using the following crate versions:

nalgebra: 0.17.0
ncollide2d: 0.18.1
nphysics2d: 0.10.1

Hi! Thank you for reporting this bug. This happens because the inertia of 2D rigid bodies is not correctly initialized when it it set manually (instead of automatically computed by the ColliderDesc).
This does not happen in 3D because the inertia of 3D rigid bodies are updated at each timestep.
This will be fixed by #180.

Thanks for the quick fix :)


replace paths with mydocs variable for how-to-enumerate-directories-and-files

Summary
Describe your changes here.
Making paths platform agnostic (so they will work on Linux)
Part of dotnet/docs https://mseng.visualstudio.com/TechnicalContent/_workitems/edit/1374049/?triage=true (.NET: Verify content freshness for System.IO task topics)

@rpetrusha - Thanks, I have made the changes.


Move i18n bundles to content directory that's cached by server

Move i18n bundles to content directory that's cached by server as static asset

Per my understanding, this path/url is not configurable from generated
application and thus its internal change. Going forward, I would like it to
be configurable along with other extensions. If you still think we
shouldn't change, I can close this and instead add new dir for caching.
~Vishal
On Fri 29 Jun, 2018, 11:14 PM Deepu K Sasidharan<EMAIL_ADDRESS>wrote:

@deepu105 commented on this pull request.
Wouldn't it be better to just add this directory also to caching.
Otherwise this will be a breaking change for some people
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/ng-jhipster/pull/74#pullrequestreview-133317876,
or mute the thread
https://github.com/notifications/unsubscribe-auth/APQa8dkH6l2lpSVYjQpG7Jw8gzh-OHVVks5uBmeFgaJpZM4U9JJc
.

Yes I still think we should just add tgis to caching as thats the simplest
solution
On Sat, 30 Jun 2018, 4:14 am vishal423<EMAIL_ADDRESS>wrote:

Per my understanding, this path/url is not configurable from generated
application and thus its internal change. Going forward, I would like it to
be configurable along with other extensions. If you still think we
shouldn't change, I can close this and instead add new dir for caching.
~Vishal
On Fri 29 Jun, 2018, 11:14 PM Deepu K Sasidharan, <
<EMAIL_ADDRESS>wrote:

@deepu105 commented on this pull request.
Wouldn't it be better to just add this directory also to caching.
Otherwise this will be a breaking change for some people
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<
https://github.com/jhipster/ng-jhipster/pull/74#pullrequestreview-133317876
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/APQa8dkH6l2lpSVYjQpG7Jw8gzh-OHVVks5uBmeFgaJpZM4U9JJc
.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/ng-jhipster/pull/74#issuecomment-401510644,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDlFwhwOmIE40i6ndFMZK92vvc35NjGks5uBt8DgaJpZM4U9JJc
.

closing this and will add i18n to cached directory path


Improve accuracy of RequestND description

RequestND doesn't actually verify the inclusion proofs; this is done later in GetSharesByNamespace:
https://github.com/celestiaorg/celestia-node/blob/main/share/getters/shrex.go#L237

Codecov Report

Merging #2418 (0cf1bf3) into main (44786bb) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2418      +/-   ##
==========================================
+ Coverage   52.96%   52.97%   +0.01%
==========================================
  Files         156      156
  Lines        9915     9915
==========================================
+ Hits         5251     5252       +1
+ Misses       4208     4207       -1
  Partials      456      456

Impacted Files
Coverage Δ

share/p2p/shrexnd/client.go
45.52% <ø> (ø)

... and 4 files with indirect coverage changes


Make google.cloud.credentials.get_credentials private

Alternatively, make the whole module private.

Yup

Moot by #3667 and #3668.


 It would be super sick if we could create a kilter "party" similar to how Spotify etc have such features.
Initially, that party mode could just show the current problem, and if people are logged in they could tick it.
But if #79 is possible, more options become available, like putting new problems in the queue etc.
Happy to contribute this too, since the backend looks pretty light, I'd probably have a stab at doing this with WebRTC

Worth reading through https://github.com/lemeryfertitta/Climbdex/issues/45 which already has some discussion about this feature - @gardaholm had some similar ideas.
Just a heads-up that I don't feel like I really finished a solid initial implementation of the Bluetooth feature. From my limited testing, I think it still needs some stability and UI work, especially around reconnection, indication of existing connection, etc. Might be worth playing around with it for a bit to see what you think, as improving the initial implementation to be at least as good as the official apps might be the first step on the road to more advanced functionality.
I'd also suggest we break this down into more specific issues as you mentioned. I agree that a nice first step would just be a sharable link that takes you to the current "session." Then the features from the "session" can be improved with things like ticking and adding climbs to the queue.

Yeah I think the desire for more advanced features already pushed me in the direction of needing to overhaul stuff. It's currently all DOM state and HTML without a library, which becomes really cumbersome when pushing state changes from other places.
So armed with ChatGPT, I spiked converting some of the UI to React this evening, and I got a proof of concept of editing a board and sharing between multiple browser sessions.
The cool bit about webrtc is that it doesn't involve any backend changes, and since nobody would argue their kilter board session is mission critical that should be plenty sufficient.

the desire for more advanced features already pushed me in the direction of needing to overhaul stuff. It's currently all DOM state and HTML without a library, which becomes really cumbersome when pushing state changes from other places.

Makes sense. The original intent of the app was just to provide search by hold functionality, so a heavy JS framework felt like overkill at the time. The scope has started to increase as it has become clear that Climbdex could fully replace and improve upon the functionality of the existing apps, and I can see an argument for the need of something more.

I spiked converting some of the UI to React this evening, and I got a proof of concept of editing a board and sharing between multiple browser sessions.

Nice! If you do end up with something that you'd like to contribute, I'd be happy to review and get it deployed. My only request is that we break the changes down into smaller components to avoid a massive PR that changes every file 😅. If there is a conversion of existing UI, let's keep that separate from new features, and ideally also separated by the different pages.

 It would be super sick if we could create a kilter "party" similar to how Spotify etc have such features.

this would be a real game-changer. we also have the same first world problem here, as we tend to use the tb2 in groups. a session mode would make things so much more comfortable – even if there is just one host (which can select climbs and light climbs) and all others in the session can only view (and log) the current climb. would be a great addition.

@lemeryfertitta Yeah sounds good, I've put it behind a /react endpoint, it's relatively close to complete now, just haven't had a lot of time lately to finish it

Uploading Screen Recording 2024-09-13 at 14.35.00-1.mov…

@lemeryfertitta @gardaholm  I have a proof of concept with basic session sharing up: https://www.boardsesh.com/climb/kilter/8/25
When session sharing, currently it works like a remote control, but it should work more like spotify jams. The top kilter board will be for searching a climb, the bottom floating bar for playlist control of what is currently on the board. This way it also avoids jarring accidentally climb switches when someones currently climbing, and will make it easy to undo such a mistake as the forward and back buttons will go through history not the current search.
The Jams feature uses WebRTC so doesnt have to go through the backend.
I'll have to clean the repo up some more and then I'll open source it. I also converted the backend to nextjs, so it's pretty much a rewrite at this point, but it still uses Boardlib to get all the data.

nice! would love to test it in a group session here, but I've only got the tension board here.
do you think its possible to add tension data, I guess it's only missing the bin/sync_db.sh?
but will also do some dry runs with the kilter setup

@gardaholm I'm on holiday atm, so havent implemented the bluetooth code yet since I have no way of testing it. But I should be able to get tension board in there.
I'll have a stab at the bluetooth code too, probably the climbdex module for it is completely portable.

@marcodejongh cool! The sharing feature is neat. If you wanted to contribute that back to Climbdex I'd certainly be happy to accept that PR, but I understand if you prefer working on your rewrite. If you do continue with the rewrite and end up reaching feature parity with Climbdex, as well as making the work open source, I'd be happy to redirect to your project at that point and potentially contribute as well.

I'll definitely make it open source, and I'm keen to get other people involved. The only reason why its closed right now is that it's using the pro tie of the Vercel deployment stuff and I cant figure out how that works for public repository.
this has been my fun holiday side project, but start of October I'm back to regular life so wont have as much time as I do now. I'll make sure to get alternative deployments sorted before then.

@lemeryfertitta @gardaholm it's open source now: https://github.com/marcodejongh/boardsesh, and I've added instructions on how to start up a developer environment. I've also added Tension: https://www.boardsesh.com/tension/10/6/12,13/40/list.
Currently I don't have a board selector so here's kilter HW: https://www.boardsesh.com/kilter/8/17/26,27/40/list and regular OG Kilterboard: https://www.boardsesh.com/kilter/1/10/1,20/40/list
Contributions more than welcome. Next week I'll record some architecture run throughs.

Nice! I'm going to continue accepting contributions on Climbdex for now, as it seems to still have functionality/usability that  boardsesh does not, but I'll keep an eye on the repo. If it gets to the point where all of the Climbdex functionality/usability is replicated and improved upon over there, I'll look into redirecting to that repo and website.
As an aside, I would advise you not to copy and re-host the board images. I'm not a lawyer, but I think that trends closer to copyright infringement, which is why I simply link to the images hosted by the board apps.


Need a way to check for broken links in notebooks

Description
We have link checking for markdown, but we still missed a broken link in an example notebook. We need a way to check for those in our CI:
e.g. https://github.com/whylabs/whylogs/issues/769
https://whylogs.readthedocs.io/en/stable/examples/integrations/Writing_Profiles.html

Checking to see if we can just hedge the current markdown, else modifying it. But there is this article that is an interesting lead as well https://colab.research.google.com/drive/1zeTZ3S1Z8RvpwRlp4mtJOfNvUwzkSf7W

Sadly there is an external problem with the link checker. It grabs the entire line at times which has " and other characters such as >.
There is a work around by 1. Ignoring or 2. adding a space between the end of the link and the ending ". Now, this unfortunately is most of the links so 1 would make it not very useful for automation. 2 does work, but is funky. The good news is it still works as a link just fine, and if we ever had to join the string which is rare in .ipynb a strip fixes it. This would take a while to add a space to the end of every string, and it would be difficult for the team to remember.
For now, we are closing the PR to watch the external bug and revisit.


Custom editor component sometimes not rendered correctly

Describe the bug
I have created two custom editor components and defined them inside my admin/index.html. When I use them in an empty page they are getting parsed correctly and don't throw any errors in the Javascript console.
But when I have an empty page and add one of each components sometimes one component won't be rendered correctly and the second component in the page throws a Javascript error.
To Reproduce

Create two components in your ´admin/index.html´:

CMS.registerEditorComponent({
  id: "b",
  label: "B",
  fields: [
    {name: 'content', label: 'Content', widget: 'string'}],
  pattern: /{{}}([\s\S]*?){{< \/b >}}/,
  fromBlock: function(match) {
    return {
      content: match[1] ? match[1].trim() : ''
    };
  },
  toBlock: function(obj) {
    return `{{< b >}}\n${obj.content}\n{{< /b >}}`;
  },
  toPreview: function(obj) {
    return (
      `

        ${obj.content}

`
    );
  }
});
CMS.registerEditorComponent({
  id: "a",
  label: "A",
  fields: [
    {name: 'content', label: 'Content', widget: 'string'}],
  pattern: /{{}}([\s\S]*?){{< \/a >}}/,
  fromBlock: function(match) {
    return {
      content: match[1] ? match[1].trim() : ''
    };
  },
  toBlock: function(obj) {
    return `{{< a >}}\n${obj.content}\n{{< /a >}}`;
  },
  toPreview: function(obj) {
    return (
      `

        ${obj.content}

`
    );
  }
});

Add the two components into an empty page:

{{}}TEST{{}}

{{}}TEST{{}}

The first component will not be rendered correctly inside the Netlify CMS markdown editor, the second one will (s. Screenshot):

The second component added to the page will create a Javascript error:

remarkShortcodes.js:53 Sent invalid data to remark. Plugin: b. Value: {{}}TEST{{}}. Data: {"content":"TEST"}
(anonymous) @ remarkShortcodes.js:53

Expected behavior
Both components should render correctly in the markdown editor and no error should be thrown.
Screenshots
See above.
Applicable Versions:

Netlify CMS version: 2.10.93
Git provider: GitLab
OS: Ubuntu 20.04
Browser version chrome 88.0.4324.150

CMS configuration
backend:
  name: git-gateway
  branch: master

publish_mode: editorial_workflow
media_folder: "static/img"
public_folder: "/img"

collections:
  - name: "pages"
    label: "Page"
    folder: "content"
    create: true
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Body", name: "body", widget: "markdown"}

Additional context
One thing that might be interesting is that it depends on both the sequence the editor components are defined in admin/index.html and the sequence in which they are added to the page:

Declaration Sequence
Content Sequence
Throws JS error
correctly rendered

A-B
A-B
no-yes
yes-yes

A-B
B-A
no-yes
no-yes

B-A
B-A
no-yes
yes-yes

B-A
A-B
no-yes
no-yes

So it seems as if the sequence of declaration in admin/index.html and the sequence in the page is the same, both will be rendered correctly by the markdown editor. If this sequence is different, only the second will be rendered correctly.
No matter the sequences it is always the second component in the page that causes the Javascript error.
I am at a loss but would like to know what I can do to avoid this error. At first it seemed to me that this was a random glitch, until I had it tracked down to the above minimal example.
If you need any more information, please don't hesitate to reach out to me. Thank you very much for your support!

Without digging into the issue I would say that it's probably not a very good idea to use html-like syntax in your custom components, because markdown parser might mistake it for html. Can you try to change syntax to use curly braces only? Like:
{{ a }}TEST{{ /a }}
{{ b }}TEST{{ /b }}

And tell if error still persists.

Thanks for your reply! The problem is that this is Hugo's shortcode syntax that I need to use in order for it to correctly render my content.
How do other Hugo users do this?

Hm... according to docs this should work https://www.netlifycms.org/docs/hugo/#using-hugo-shortcodes-in-the-markdown-editor

Thanks for checking the docs with me. I have based my editor components on the examples you mentioned in the documentation. To be on the safe side I have also tried your suggestion from yesterday and removed the '<' and '>' from my shortcodes. Obviously they won't work with Hugo, but I wanted to check what Netlify CMS does.
The bad news: the error is still there. So I guess it has nothing to do with the opening and closing tags themselves, but with something else. When I use the editor components and shortcodes in isolation or the 'right' sequence, they work as expected.
Do you have any other idea?

Hi @p-goetz this is where those patterns are used https://github.com/netlify/netlify-cms/blob/b0fcaec4c30e3e7028206de1d83ffdd4a6fdbba8/packages/netlify-cms-widget-markdown/src/serializers/remarkShortcodes.js#L14

Thanks, @erezrokah! I had briefly looked at this module when I first got these Javascript errors but don't really understand what they are trying to do. I think it is especially the function eat that I don't get. Who passes it into the function and what does it do?

Hi @p-goetz, there's actually a lot of stuff going into that.
To summarize - this is the place where strings from the markdown content are parsed into objects and serialized back to string using the pattern and toBlock values you provide.
See also https://github.com/netlify/netlify-cms/blob/b0fcaec4c30e3e7028206de1d83ffdd4a6fdbba8/packages/netlify-cms-widget-markdown/src/serializers/remarkShortcodes.js#L59

@p-goetz I can look into the issue if you create test repo where this issue can be reliably reproduced

Thanks for the explanation @erezrokah. I will have a look to get a better understanding.
@smashercosmo thank you very much for your offer! I have created a simple repository here: https://github.com/p-goetz/netlify-cms-sandbox
It contains one page test.md that currently shows the error. That file currently has shortcodes a and b in the sequence b-a, while the admin/index.htmldefines them in sequence a-b. If you change the sequence in the page to a-b, the markdown editor will correctly show the two shortcodes in the custom editor component. If you leave it as it is, it only shows the second (a) and shows the markup for b.
If you have any questions or if I can help you in any way, please reach out.

@p-goetz I thing I figured out the problem with your code. Try to change your regexes to these
/^{{}}([\s\S]*?){{< \/a >}}/

/^{{}}([\s\S]*?){{< \/b >}}/

and tell me if the error still persists.

I think this can also be solved by using lazy quantifiers, but I haven't tried it yet.

Oh, I've just noticed that your regexes are actually using lazy quantifiers :) Well, this probably answers the question.

Thanks for much for this help. The ^ indeed solves this specific problem. I remember having read about it in some related issue here on GitHub. It didn't work for my more complicated use case, though.
I will now step by step make the example more complicated and check if the wrong behavior reappears. If it won't that means I will have found an error in my initial example, otherwise I will have a new example that doesn't work. Not matter what, I will come back as soon as I have something relevant to add here. This will most probably be the day after tomorrow!
Thanks again for your support!

Well, I tested your custom components with changed regexes and it solved the issue for me

I guess this particular issue can be closed now